Fetches the journal user
@param array $cache User cache
@param String $email User's email
@param Journal $journal Journal
@return JournalUser Imported or retrieved JournalUser
359141
private function getJournalUser(&$cache, $email, $journal)
    {
        if (!empty($cache[$email]['journal_user'])) {
            return $cache[$email]['journal_user'];
        }

        $journalUser = $this->em
            ->getRepository('VipaJournalBundle:JournalUser')
            ->findOneBy(['journal' => $journal, 'user' => $cache[$email]['user']]);

        if ($journalUser === null) {
            $journalUser = new JournalUser();
            $journalUser->setUser($cache[$email]['user']);
            $journalUser->setJournal($journal);
            $this->em->persist($journalUser);
        }

        $cache[$email]['journal_user'] = $journalUser;
        return $cache[$email]['journal_user'];
    }
494420
protected function getSubscribedUserIdByEmail($email)
    {
        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sEmailAddressQuoted = $database->quote($email);
        $userOxid = $database->getOne("select oxid from oxnewssubscribed where oxemail = {$sEmailAddressQuoted} ");

        return $userOxid;
    }
443796
public function getCache($cache)
    {
        $cache = self::encodeCache($cache);
        $url = "projects/{$this->project_id}/caches/$cache";
        $this->setJsonHeaders();
        return self::json_decode($this->apiCall(self::GET, $url));
    }
1281818
public static function getByEmail(string $email) : Users
    {
        $user = self::findFirst([
            'conditions' => 'email = ?0',
            'bind' => [$email]
        ]);

        if (!$user) {
            throw new Exception('No User Found');
        }

        return $user;
    }
661862
public function resolveUserIdFromEmail(string $email, int $mode)
    {
        switch ($mode) {
            case self::MODE_RESOLVE_PRIMARY_ONLY:
                $gmailUser = $this->getGmailDomain()->findGmailUserByPrimaryEmail($email);

                break;

            case self::MODE_RESOLVE_ALIASES_ONLY:
                $gmailUser = $this->getGmailDomain()->findGmailUserByEmailAlias($email);

                break;

            case self::MODE_RESOLVE_PRIMARY_PLUS_ALIASES:
                $gmailUser = $this->getGmailDomain()->findGmailUserByEmail($email);

                break;

            default:
                throw new \InvalidArgumentException();
        }

        return $gmailUser ? $gmailUser->getUserId() : null;
    }
410709
public function findUserOrCreateByEmail($email)
    {
        $user = $this->getUserMapper()->findByEmail($email);
        if (empty($user)) {
            // Pas d'utilisateur playground : alors on en crée un
            $user = new UserEntity();
            $user->setEmail($email);
            $rand = \Zend\Math\Rand::getString(8);
            $bcrypt = new Bcrypt;
            $zfcUserOptions = $this->getServiceManager()->get('zfcuser_module_options');
            $bcrypt->setCost($zfcUserOptions->getPasswordCost());
            $pass = $bcrypt->create($rand);
            $user->setPassword($pass);
            $user = $this->getUserMapper()->insert($user);
        }

        return $user;
    }
245169
public static function email($email)
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
581512
@Programmatic
    public ApplicationUser findByEmailAddressCached(final String emailAddress) {
        return queryResultsCache.execute(new Callable<ApplicationUser>() {
            @Override public ApplicationUser call() throws Exception {
                return findByEmailAddress(emailAddress);
            }
        }, ApplicationUserRepository.class, "findByEmailAddressCached", emailAddress);
    }
1324486
public function get($object, $key, $cache=null)
    {
        if ($cache) {
            $schema = \Pheasant::instance()->schema($this->class);

            if ($cached = $cache->get($schema->hash($object, array(array($this->local, $this->foreign))))) {
                return $cached;
            }
        }

        if (($localValue = $object->{$this->local}) === null) {
            if($this->_allowEmpty) {
                return null;
            } else {
                throw new \Pheasant\Exception("Local value is null while not allowed");
            }
        }

        $result = $this->query("{$this->foreign}=?", $localValue)->execute();

        if(!count($result)) {
            if($this->_allowEmpty) {
                return null;
            } else {
                throw new \Pheasant\Exception("Failed to find a {$key} (via {$this->foreign}={$localValue})");
            }
        }

        return $this->hydrate($result->row());
    }
1085565
protected function retrieveUser($email, User $owner)
    {
        $user = $this->objectManager->getRepository('ClarolineCoreBundle:User')->findOneByEmail($email);

        if (null === $user) {
            $user = $owner;
        }

        return $user;
    }
1302718
public function get( $id_email_or_login ) {

		if ( is_numeric( $id_email_or_login ) ) {
			$user = get_user_by( 'id', $id_email_or_login );
		} elseif ( is_email( $id_email_or_login ) ) {
			$user = get_user_by( 'email', $id_email_or_login );
			// Logins can be emails
			if ( ! $user ) {
				$user = get_user_by( 'login', $id_email_or_login );
			}
		} else {
			$user = get_user_by( 'login', $id_email_or_login );
		}

		return $user;
	}
777213
static function fetchByEmail( $email, $sorts = null, $offset = null, $length = null, $status = false )
    {
        $cond = array();
        $cond['email'] = $email;
        if ( $status !== false )
        {
            $cond['status'] = $status;
        }
        $limit = null;
        if ( !is_null( $offset ) )
        {
           $limit = array();
           $limit = array( 'offset' => $offset, 'length' => $length );
        }
        $return = eZPersistentObject::fetchObjectList( self::definition(), null, $cond, $sorts, $limit );
        return $return;
    }
201792
public function getUserByEmail($email) {
		$list = $this->itemsFilter(['email' => $email, 'limit' => 1]);
		if (empty($list)) {
			return NULL;
		}
		$user = reset($list);
		return $user;
	}
1242301
public function loadUserByUsername($username)
    {
        /** @var User|UserInterface $user */
        $user = $this->getRepository()->findOneBy(['username' => $username]);
        if (!$user && $this->allowEmailAsUsername) {
            $user = $this->getRepository()->findOneBy(['email' => $username]);
        }
        if ($user) {
            return $user;
        }

        throw new UsernameNotFoundException($username);
    }
722672
function getCache($address) {
        if(!isset($this->dsn))
            return false;
        
        $_ret = array();
        
        // PEAR DB
        require_once('DB.php');          
        $_db =& DB::connect($this->dsn);
        if (PEAR::isError($_db)) {
            die($_db->getMessage());
        }
        $_res =& $_db->query("SELECT lon,lat FROM {$this->_db_cache_table} where address = ?", $address);
        if (PEAR::isError($_res)) {
            die($_res->getMessage());
        }
        if($_row = $_res->fetchRow()) {            
            $_ret['lon'] = $_row[0];
            $_ret['lat'] = $_row[1];
        }
        
        $_db->disconnect();
        
        return !empty($_ret) ? $_ret : false;
    }
207591
public function setEmail($email): User
    {
        if ($this->email !== $email) {
            $this->email = $email;

            DB::table('user')
                ->where('user_id', '=', $this->user_id)
                ->update([
                    'email' => $email,
                ]);
        }

        return $this;
    }
1173956
public static function _Login ($email, $password)
	{
		
		// Authenticate
		
		if (static::_Authenticate ($email, $password) !== TRUE)
		{
			return 'authentication_fail';
		}
		
		// Get user
		
		$user	= static::_readFromEmail ($email);
		
		if (!$user)
		{
			return 'invalid_user';
		}
		
		// Reset password
		
		$user->reset ('password');
		
		// Set timestamps
		
		$user->loginTimestamp	= time ();
		$user->lastAction		= $user->loginTimestamp;
		
		// Set session
		
		$user->setSessionData ();
		
		// Return user object
		
		return $user;
		
	}