Horde\ManageSieve::login PHP Method

login() public method

Defaults from the constructor are used for missing parameters.
public login ( string $user = null, string $password = null, string $authmethod = null, string $euser = null )
$user string Login username.
$password string Login password.
$authmethod string Type of login method to use.
$euser string Effective UID (perform on behalf of $euser).
    public function login($user = null, $password = null, $authmethod = null, $euser = null)
    {
        if (isset($user)) {
            $this->_params['user'] = $user;
        }
        if (isset($password)) {
            $this->_params['password'] = $password;
        }
        if (isset($authmethod)) {
            $this->_params['authmethod'] = $authmethod;
        }
        if (isset($euser)) {
            $this->_params['euser'] = $euser;
        }
        $this->_checkConnected();
        if (self::STATE_AUTHENTICATED == $this->_state) {
            throw new Exception('Already authenticated');
        }
        $this->_cmdAuthenticate($this->_params['user'], $this->_params['password'], $this->_params['authmethod'], $this->_params['euser']);
        $this->_state = self::STATE_AUTHENTICATED;
    }

Usage Example

Beispiel #1
0
 public function testDisconnect()
 {
     $this->fixture->connect($this->config['host'], $this->config['port']);
     $this->fixture->login($this->config['username'], $this->config['password']);
     $this->fixture->disconnect();
 }