public function mfaDeviceSecretGet($iUserId)
    {
        $oDb      = Factory::service('Database');
        $oEncrypt = Factory::service('Encrypt');

        $oDb->where('user_id', $iUserId);
        $oDb->limit(1);
        $aResult = $oDb->get(NAILS_DB_PREFIX . 'user_auth_two_factor_device_secret')->result();

        if (empty($aResult)) {
            return false;
        }

        $oReturn         = reset($aResult);
        $oReturn->secret = $oEncrypt->decode($oReturn->secret, APP_PRIVATE_KEY);

        return $oReturn;
    }
public function mfaDeviceSecretGet($iUserId)
    {
        $oDb      = Factory::service('Database');
        $oEncrypt = Factory::service('Encrypt');

        $oDb->where('user_id', $iUserId);
        $oDb->limit(1);
        $aResult = $oDb->get(NAILS_DB_PREFIX . 'user_auth_two_factor_device_secret')->result();

        if (empty($aResult)) {
            return false;
        }

        $oReturn         = reset($aResult);
        $oReturn->secret = $oEncrypt->decode($oReturn->secret, APP_PRIVATE_KEY);

        return $oReturn;
    }
public function mfaDeviceSecretGet ( $ iUserId ) { $ oDb = Factory :: service ( 'Database' ) ; $ oEncrypt = Factory :: service ( 'Encrypt' ) ; $ oDb -> where ( 'user_id' , $ iUserId ) ; $ oDb -> limit ( 1 ) ; $ aResult = $ oDb -> get ( NAILS_DB_PREFIX . 'user_auth_two_factor_device_secret' ) -> result ( ) ; if ( empty ( $ aResult ) ) { return false ; } $ oReturn = reset ( $ aResult ) ; $ oReturn -> secret = $ oEncrypt -> decode ( $ oReturn -> secret , APP_PRIVATE_KEY ) ; return $ oReturn ; }
Gets the user's MFA device if there is one

@param  int $iUserId The user's ID

@return mixed         \stdClass on success, false on failure
Gets the user s MFA device if there is one