Horde_Imsp_Client_Base::authenticate PHP Method

authenticate() abstract public method

Attempts to login to IMSP server.
abstract public authenticate ( boolean $login = true ) : boolean
$login boolean Should we remain logged in after auth?
return boolean
    public abstract function authenticate($login = true);

Usage Example

コード例 #1
0
ファイル: Imsp.php プロジェクト: raz0rsdge/horde
 /**
  * Private authentication function.
  *
  * @param string $userID      Username for IMSP server.
  * @param array $credentials  Hash containing 'password' element.
  *
  * @return boolean  True on success / False on failure.
  */
 protected function _authenticate($userID, $credentials)
 {
     // Need to create the Imsp socket here since it requires a user/password
     // to create, and we don't have one until this method.
     $this->_params['username'] = $userID;
     $this->_params['password'] = $credentials['password'];
     $this->_imsp = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Imsp')->create(null, $this->_params);
     if (!$this->_imsp->authenticate(false)) {
         throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
     }
 }