src/Administration.php
private function logInAsUserByColumnValue($columnName, $columnValue) {
		try {
			$users = $this->db->select(
				'SELECT verified, id, email, username, status, roles_mask FROM ' . $this->makeTableName('users') . ' WHERE ' . $columnName . ' = ? LIMIT 2 OFFSET 0',
				[ $columnValue ]
			);
		}
		catch (Error $e) {
			throw new DatabaseError($e->getMessage());
		}

		$numberOfMatchingUsers = ($users !== null) ? \count($users) : 0;

		if ($numberOfMatchingUsers === 1) {
			$user = $users[0];

			if ((int) $user['verified'] === 1) {
				$this->onLoginSuccessful($user['id'], $user['email'], $user['username'], $user['status'], $user['roles_mask'], \PHP_INT_MAX, false);
			}
			else {
				throw new EmailNotVerifiedException();
			}
		}

		return $numberOfMatchingUsers;
	}
private function logInAsUserByColumnValue($columnName, $columnValue) {
		try {
			$users = $this->db->select(
				'SELECT verified, id, email, username, status, roles_mask FROM ' . $this->makeTableName('users') . ' WHERE ' . $columnName . ' = ? LIMIT 2 OFFSET 0',
				[ $columnValue ]
			);
		}
		catch (Error $e) {
			throw new DatabaseError($e->getMessage());
		}

		$numberOfMatchingUsers = ($users !== null) ? \count($users) : 0;

		if ($numberOfMatchingUsers === 1) {
			$user = $users[0];

			if ((int) $user['verified'] === 1) {
				$this->onLoginSuccessful($user['id'], $user['email'], $user['username'], $user['status'], $user['roles_mask'], \PHP_INT_MAX, false);
			}
			else {
				throw new EmailNotVerifiedException();
			}
		}

		return $numberOfMatchingUsers;
	}
private function logInAsUserByColumnValue ( $ columnName , $ columnValue ) { try { $ users = $ this -> db -> select ( 'SELECT verified, id, email, username, status, roles_mask FROM ' . $ this -> makeTableName ( 'users' ) . ' WHERE ' . $ columnName . ' = ? LIMIT 2 OFFSET 0' , [ $ columnValue ] ) ; } catch ( Error $ e ) { throw new DatabaseError ( $ e -> getMessage ( ) ) ; } $ numberOfMatchingUsers = ( $ users !== null ) ? \ count ( $ users ) : 0 ; if ( $ numberOfMatchingUsers === 1 ) { $ user = $ users [ 0 ] ; if ( ( int ) $ user [ 'verified' ] === 1 ) { $ this -> onLoginSuccessful ( $ user [ 'id' ] , $ user [ 'email' ] , $ user [ 'username' ] , $ user [ 'status' ] , $ user [ 'roles_mask' ] , \ PHP_INT_MAX , false ) ; } else { throw new EmailNotVerifiedException ( ) ; } } return $ numberOfMatchingUsers ; }
Signs in as the user for which the column with the specified name has the given value

You must never pass untrusted input to the parameter that takes the column name

@param string $columnName the name of the column to filter by
@param mixed $columnValue the value to look for in the selected column
@return int the number of matched users (where only a value of one means that the login may have been successful)
@throws EmailNotVerifiedException if the user has not verified their email address via a confirmation method yet
@throws AuthError if an internal problem occurred (do *not* catch)
Signs in as the user for which the column with the specified name has the given value