sets login tracking
The userid gets a md5() to fullfilll german datenschutzgesetz

@param string $sUserId user id
@param string $sResult login result
337529
public function addLogin($sUserId, $sResult)
    {
        $this->_loginUser = md5($sUserId);
        $this->_loginResult = $sResult;
    }
690297
public static function decrypt($sValue, $sSecretKey, $migration = false)
    {
        if (empty($sValue)) {
            return "";
        }

        if (true === $migration) {
            $sSecretKey = substr($sSecretKey, 0, 30) . "\0\0";
        } else {
            $sSecretKey = substr($sSecretKey, 0, 32);
        }

        return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $sSecretKey, base64_decode($sValue), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)), "\0");
    }
570522
public function setUserContext($userId = null, $email = null, array $data = null)
    {
        $this->raven->set_user_data($userId, $email, $data);
    }
580371
private function validateUrlPartialMatch($urlResult, Environment $environment)
    {
        return
            // only valid if there is no full match already
            !array_key_exists($urlResult, $this->portalInformations[$environment->getType()])
            // check if last character is no dot
            && '.' != substr($urlResult, -1);
    }
401242
@Nonnull
  public EChange undeleteUser (@Nullable final String sUserID)
  {
    final User aUser = getOfID (sUserID);
    if (aUser == null)
    {
      AuditHelper.onAuditUndeleteFailure (User.OT, sUserID, "no-such-user-id");
      return EChange.UNCHANGED;
    }

    m_aRWLock.writeLock ().lock ();
    try
    {
      if (BusinessObjectHelper.setUndeletionNow (aUser).isUnchanged ())
        return EChange.UNCHANGED;
      internalMarkItemUndeleted (aUser);
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }
    AuditHelper.onAuditUndeleteSuccess (User.OT, sUserID);

    // Execute callback as the very last action
    m_aCallbacks.forEach (aCB -> aCB.onUserUndeleted (aUser));

    return EChange.CHANGED;
  }
1090289
protected function RegisterGuestUser($sSuccessURL = null, $sFailureURL = null)
    {
        if (null === $sSuccessURL) {
            if ($this->global->UserDataExists('sSuccessURL')) {
                $sSuccessURL = $this->global->GetUserData('sSuccessURL', array(), TCMSUserInput::FILTER_URL);
            }
            if (empty($sSuccessURL)) {
                $sSuccessURL = null;
            }
        }
        if (null === $sFailureURL) {
            if ($this->global->UserDataExists('sFailureURL')) {
                $sFailureURL = $this->global->GetUserData('sFailureURL', array(), TCMSUserInput::FILTER_URL);
            }
            if (empty($sFailureURL)) {
                $sFailureURL = null;
            }
        }
        $oStep = TdbShopOrderStep::GetStep('thankyou');
        if (null !== $oStep) {
            $oTmpUser = $oStep->GetLastUserBoughtFromSession();
            $aData = $this->GetFilteredUserData('aUser');
            if (is_array($aData) && 2 == count($aData) && array_key_exists('password', $aData) && array_key_exists('password2', $aData)) {
                foreach ($aData as $key => $val) {
                    $oTmpUser->sqlData[$key] = trim($val);
                }
                $aData = $oTmpUser->sqlData;

                $extranetUserProvider = $this->getExtranetUserProvider();
                $extranetUserProvider->reset();
                $oUser = $extranetUserProvider->getActiveUser();
                $oUser->LoadFromRow($aData);
                $bDataValid = $this->ValidateUserLoginData();
                $bDataValid = $this->ValidateUserData() && $bDataValid;
                if ($bDataValid) {
                    $oUserOrder = &TShopBasket::GetLastCreatedOrder();
                    $sNewUserId = $oUser->Register();
                    $this->UpdateUserAddress(null, null, true);
                    $oUserOrder->AllowEditByAll(true);
                    $oUserOrder->SaveFieldsFast(array('data_extranet_user_id' => $sNewUserId));
                    $oUserOrder->AllowEditByAll(false);
                    if (!is_null($sSuccessURL)) {
                        $this->controller->HeaderURLRedirect($sSuccessURL, true);
                    } else {
                        $oExtranetConf = &TdbDataExtranet::GetInstance();
                        $this->controller->HeaderURLRedirect($oExtranetConf->GetLinkRegisterSuccessPage(), true);
                    }
                    $oStep->RemoveLastUserBoughtFromSession();
                }
            }
        }
        if (null !== $sFailureURL) {
            $this->controller->HeaderURLRedirect($sFailureURL, true);
        } else {
            $oUser = TdbDataExtranetUser::GetInstance();
            $this->controller->HeaderURLRedirect($oUser->GetLinkForRegistrationGuest(), true);
        }
    }
698876
protected function authenticateExternalMember($data, ValidationResult &$result = null, Member $member = null)
    {
        $result = $result ?: ValidationResult::create();

        $ssLoginUserName = Environment::getEnv('SS_DEFAULT_ADMIN_USERNAME');

        $email = !empty($data['Email']) ? $data['Email'] : null;

        if ($email != $ssLoginUserName) {
            return;
        }

        // Check for default admin user
        $member = Member::get()->find(
            Member::config()->get('unique_identifier_field'),
            $ssLoginUserName
        );

        if (!$member) {
            return;
        }

        $member->checkLoginPassword($data['Password'], $result);
        return $member;
    }
170480
public function setRegistrationDate(FilterUserResponseEvent $event)
    {
        /** @var \XM\SecurityBundle\Entity $user */
        $user = $event->getUser();

        $user->setRegistrationDate(new \DateTime());
        $this->userManager->updateUser($user);
    }
1023799
public function write($sessID, $sessData)
    {
        return $this->memcachedDriver->set($this->config['prefix'] . $sessID, $sessData, $this->config['expire']);
    }
1003649
public function getReviewUserHash($sUserId)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sReviewUserHash = $oDb->getOne('select md5(concat("oxid", oxpassword, oxusername )) from oxuser where oxid = ' . $oDb->quote($sUserId) . '');

        return $sReviewUserHash;
    }
954682
protected function _getDemoShopLoginQuery($sUser, $sPassword)
    {
        if ($sPassword == "admin" && $sUser == "admin") {
            $sSelect = "SELECT `oxid` FROM `oxuser` WHERE `oxrights` = 'malladmin' ";
        } else {
            /** @var UserException $oEx */
            $oEx = oxNew(UserException::class);
            $oEx->setMessage('ERROR_MESSAGE_USER_NOVALIDLOGIN');
            throw $oEx;
        }

        return $sSelect;
    }
354199
function sls($retrieveParametersFromServer = false)
    {
        $auth = $this->auth;

        // destroy the local session by firing the Logout event
        $keep_local_session = false;
        $session_callback = function () {
            event(new Saml2LogoutEvent());
        };

        $auth->processSLO($keep_local_session, null, $retrieveParametersFromServer, $session_callback);

        $errors = $auth->getErrors();

        return $errors;
    }
842782
public static function setSSLAuth($sslCert = null, $sslKey = null, $sslCACert = null)
	{
		self::$sslCert = $sslCert;
		self::$sslKey = $sslKey;
		self::$sslCACert = $sslCACert;
	}
148465
public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
    {
        // Common code for intializing a Reed-Solomon control block (char or int symbols)
        // Copyright 2004 Phil Karn, KA9Q
        // May be used under the terms of the GNU Lesser General Public License (LGPL)

        $rs = null;

        // Check parameter ranges
        if($symsize < 0 || $symsize > 8)                     return $rs;
        if($fcr < 0 || $fcr >= (1<<$symsize))                return $rs;
        if($prim <= 0 || $prim >= (1<<$symsize))             return $rs;
        if($nroots < 0 || $nroots >= (1<<$symsize))          return $rs; // Can't have more roots than symbol values!
        if($pad < 0 || $pad >= ((1<<$symsize) -1 - $nroots)) return $rs; // Too much padding

        $rs = new QRrsItem();
        $rs->mm = $symsize;
        $rs->nn = (1<<$symsize)-1;
        $rs->pad = $pad;

        $rs->alpha_to = array_fill(0, $rs->nn+1, 0);
        $rs->index_of = array_fill(0, $rs->nn+1, 0);

        // PHP style macro replacement ;)
        $NN =& $rs->nn;
        $A0 =& $NN;

        // Generate Galois field lookup tables
        $rs->index_of[0] = $A0; // log(zero) = -inf
        $rs->alpha_to[$A0] = 0; // alpha**-inf = 0
        $sr = 1;

        for($i=0; $i<$rs->nn; $i++) {
            $rs->index_of[$sr] = $i;
            $rs->alpha_to[$i] = $sr;
            $sr <<= 1;
            if($sr & (1<<$symsize)) {
                $sr ^= $gfpoly;
            }
            $sr &= $rs->nn;
        }

        if($sr != 1){
            // field generator polynomial is not primitive!
            $rs = NULL;
            return $rs;
        }

        /* Form RS code generator polynomial from its roots */
        $rs->genpoly = array_fill(0, $nroots+1, 0);

        $rs->fcr = $fcr;
        $rs->prim = $prim;
        $rs->nroots = $nroots;
        $rs->gfpoly = $gfpoly;

        /* Find prim-th root of 1, used in decoding */
        for($iprim=1;($iprim % $prim) != 0;$iprim += $rs->nn)
        ; // intentional empty-body loop!

        $rs->iprim = (int)($iprim / $prim);
        $rs->genpoly[0] = 1;

        for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) {
            $rs->genpoly[$i+1] = 1;

            // Multiply rs->genpoly[] by  @**(root + x)
            for ($j = $i; $j > 0; $j--) {
                if ($rs->genpoly[$j] != 0) {
                    $rs->genpoly[$j] = $rs->genpoly[$j-1] ^ $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[$j]] + $root)];
                } else {
                    $rs->genpoly[$j] = $rs->genpoly[$j-1];
                }
            }
            // rs->genpoly[0] can never be zero
            $rs->genpoly[0] = $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[0]] + $root)];
        }

        // convert rs->genpoly[] to index form for quicker encoding
        for ($i = 0; $i <= $nroots; $i++)
            $rs->genpoly[$i] = $rs->index_of[$rs->genpoly[$i]];

        return $rs;
    }
233221
protected function PreSaveHook($bIsInsert)
    {
        if ($bIsInsert) {
            $request = $this->getCurrentRequest();
            $sUserIp = null === $request ? '' : $request->getClientIp();
            if (CHAMELEON_PKG_SHOP_REVIEWS_ANONYMIZE_IP) {
                $sUserIp = md5($sUserIp);
            }
            $this->sqlData['user_ip'] = $sUserIp;
        }
    }
834420
public function markAsUsed($sOrderId, $sUserId, $dDiscount)
    {
        //saving oxreserved field
        if ($this->oxvouchers__oxid->value) {
            $this->oxvouchers__oxorderid->setValue($sOrderId);
            $this->oxvouchers__oxuserid->setValue($sUserId);
            $this->oxvouchers__oxdiscount->setValue($dDiscount);
            $this->oxvouchers__oxdateused->setValue(date("Y-m-d", \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
            $this->save();
        }
    }
13589
public function validateCookieToken($strCookieToken, $strSalt=false) {
		$t = Cryptastic::decrypt($strCookieToken, ($strSalt ? $strSalt : $this->salt));

		if (isset($t['username']) && isset($t['expiration']) && $t['expiration'] > time())
			return $t['username'];

		return false;
	}