source/Application/Model/User.php
public function checkIfEmailExists($sEmail)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $iShopId = $myConfig->getShopId();
        $blExists = false;

        $sQ = 'select oxshopid, oxrights, oxpassword from oxuser where oxusername = ' . $masterDb->quote($sEmail);
        if (($sOxid = $this->getId())) {
            $sQ .= " and oxid <> " . $masterDb->quote($sOxid);
        }
        $oRs = $masterDb->select($sQ, false);
        if ($oRs != false && $oRs->count() > 0) {
            if ($this->_blMallUsers) {
                $blExists = true;
                if ($oRs->fields[1] == 'user' && !$oRs->fields[2]) {
                    // password is not set - allow to override
                    $blExists = false;
                }
            } else {
                $blExists = false;
                while (!$oRs->EOF) {
                    if ($oRs->fields[1] != 'user') {
                        // exists admin with same login - must not allow
                        $blExists = true;
                        break;
                    } elseif ($oRs->fields[0] == $iShopId && $oRs->fields[2]) {
                        // exists same login (with password) in same shop
                        $blExists = true;
                        break;
                    }

                    $oRs->fetchRow();
                }
            }
        }

        return $blExists;
    }
public function checkIfEmailExists($sEmail)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $iShopId = $myConfig->getShopId();
        $blExists = false;

        $sQ = 'select oxshopid, oxrights, oxpassword from oxuser where oxusername = ' . $masterDb->quote($sEmail);
        if (($sOxid = $this->getId())) {
            $sQ .= " and oxid <> " . $masterDb->quote($sOxid);
        }
        $oRs = $masterDb->select($sQ, false);
        if ($oRs != false && $oRs->count() > 0) {
            if ($this->_blMallUsers) {
                $blExists = true;
                if ($oRs->fields[1] == 'user' && !$oRs->fields[2]) {
                    // password is not set - allow to override
                    $blExists = false;
                }
            } else {
                $blExists = false;
                while (!$oRs->EOF) {
                    if ($oRs->fields[1] != 'user') {
                        // exists admin with same login - must not allow
                        $blExists = true;
                        break;
                    } elseif ($oRs->fields[0] == $iShopId && $oRs->fields[2]) {
                        // exists same login (with password) in same shop
                        $blExists = true;
                        break;
                    }

                    $oRs->fetchRow();
                }
            }
        }

        return $blExists;
    }
public function checkIfEmailExists ( $ sEmail ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $ masterDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) ; $ iShopId = $ myConfig -> getShopId ( ) ; $ blExists = false ; $ sQ = 'select oxshopid, oxrights, oxpassword from oxuser where oxusername = ' . $ masterDb -> quote ( $ sEmail ) ; if ( ( $ sOxid = $ this -> getId ( ) ) ) { $ sQ .= " and oxid <> " . $ masterDb -> quote ( $ sOxid ) ; } $ oRs = $ masterDb -> select ( $ sQ , false ) ; if ( $ oRs != false && $ oRs -> count ( ) > 0 ) { if ( $ this -> _blMallUsers ) { $ blExists = true ; if ( $ oRs -> fields [ 1 ] == 'user' && ! $ oRs -> fields [ 2 ] ) { // password is not set - allow to override $ blExists = false ; } } else { $ blExists = false ; while ( ! $ oRs -> EOF ) { if ( $ oRs -> fields [ 1 ] != 'user' ) { // exists admin with same login - must not allow $ blExists = true ; break ; } elseif ( $ oRs -> fields [ 0 ] == $ iShopId && $ oRs -> fields [ 2 ] ) { // exists same login (with password) in same shop $ blExists = true ; break ; } $ oRs -> fetchRow ( ) ; } } } return $ blExists ; }
Checks for already used email

@param string $sEmail user email/login

@return null
Checks for already used email