src/EntityDescriptor/User/AbstractUser.php
public static function userLogin($data, $loginField='email') {
		if( empty($data[$loginField]) )  {
			static::throwException('invalidLoginID');
		}
		$name = $data[$loginField];
		if( empty($data['password']) )  {
			static::throwException('invalidPassword');
		}
		$password = hashString($data['password']);
		//self::checkForEntry() does not return password and id now.
		
		$user = static::get(array(
// 			'where' => 'name LIKE '.static::formatValue($name),
			'where'		=> static::formatValue($name).' IN ('.implode(',', static::listLoginFields()).')',
			'number'	=> 1,
			'output'	=> SQLAdapter::OBJECT
		));
		if( empty($user) )  {
			static::throwException("invalidLoginID");
		}
		if( isset($user->published) && !$user->published )  {
			static::throwException('forbiddenLogin');
		}
		if( $user->password != $password )  {
			static::throwException('wrongPassword');
		}
		$user->logout();
		$user->login();
		return $user;
	}
public static function userLogin($data, $loginField='email') {
		if( empty($data[$loginField]) )  {
			static::throwException('invalidLoginID');
		}
		$name = $data[$loginField];
		if( empty($data['password']) )  {
			static::throwException('invalidPassword');
		}
		$password = hashString($data['password']);
		//self::checkForEntry() does not return password and id now.
		
		$user = static::get(array(
// 			'where' => 'name LIKE '.static::formatValue($name),
			'where'		=> static::formatValue($name).' IN ('.implode(',', static::listLoginFields()).')',
			'number'	=> 1,
			'output'	=> SQLAdapter::OBJECT
		));
		if( empty($user) )  {
			static::throwException("invalidLoginID");
		}
		if( isset($user->published) && !$user->published )  {
			static::throwException('forbiddenLogin');
		}
		if( $user->password != $password )  {
			static::throwException('wrongPassword');
		}
		$user->logout();
		$user->login();
		return $user;
	}
public static function userLogin ( $ data , $ loginField = 'email' ) { if ( empty ( $ data [ $ loginField ] ) ) { static :: throwException ( 'invalidLoginID' ) ; } $ name = $ data [ $ loginField ] ; if ( empty ( $ data [ 'password' ] ) ) { static :: throwException ( 'invalidPassword' ) ; } $ password = hashString ( $ data [ 'password' ] ) ; //self::checkForEntry() does not return password and id now. $ user = static :: get ( array ( // 			'where' => 'name LIKE '.static::formatValue($name), 'where' => static :: formatValue ( $ name ) . ' IN (' . implode ( ',' , static :: listLoginFields ( ) ) . ')' , 'number' => 1 , 'output' => SQLAdapter :: OBJECT ) ) ; if ( empty ( $ user ) ) { static :: throwException ( "invalidLoginID" ) ; } if ( isset ( $ user -> published ) && ! $ user -> published ) { static :: throwException ( 'forbiddenLogin' ) ; } if ( $ user -> password != $ password ) { static :: throwException ( 'wrongPassword' ) ; } $ user -> logout ( ) ; $ user -> login ( ) ; return $ user ; }
Logs in an user using data

@param array $data
@param string $loginField
@return \Orpheus\SQLRequest\SQLSelectRequest|\Orpheus\EntityDescriptor\User\AbstractUser|\Orpheus\Publisher\PermanentObject\static[]
Logs in an user using data