protected function authPlain($uid, $pwd, $authz = '')
    {
        if (PEAR::isError($error = $this->put('AUTH', 'PLAIN'))) {
            return $error;
        }
        /* 334: Continue authentication request */
        if (PEAR::isError($error = $this->parseResponse(334))) {
            /* 503: Error: already authenticated */
            if ($this->code === 503) {
                return true;
            }
            return $error;
        }

        $auth_str = base64_encode($authz . chr(0) . $uid . chr(0) . $pwd);

        if (PEAR::isError($error = $this->put($auth_str))) {
            return $error;
        }

        /* 235: Authentication successful */
        if (PEAR::isError($error = $this->parseResponse(235))) {
            return $error;
        }

        return true;
    }
protected function authPlain($uid, $pwd, $authz = '')
    {
        if (PEAR::isError($error = $this->put('AUTH', 'PLAIN'))) {
            return $error;
        }
        /* 334: Continue authentication request */
        if (PEAR::isError($error = $this->parseResponse(334))) {
            /* 503: Error: already authenticated */
            if ($this->code === 503) {
                return true;
            }
            return $error;
        }

        $auth_str = base64_encode($authz . chr(0) . $uid . chr(0) . $pwd);

        if (PEAR::isError($error = $this->put($auth_str))) {
            return $error;
        }

        /* 235: Authentication successful */
        if (PEAR::isError($error = $this->parseResponse(235))) {
            return $error;
        }

        return true;
    }
protected function authPlain ( $ uid , $ pwd , $ authz = '' ) { if ( PEAR :: isError ( $ error = $ this -> put ( 'AUTH' , 'PLAIN' ) ) ) { return $ error ; } /* 334: Continue authentication request */ if ( PEAR :: isError ( $ error = $ this -> parseResponse ( 334 ) ) ) { /* 503: Error: already authenticated */ if ( $ this -> code === 503 ) { return true ; } return $ error ; } $ auth_str = base64_encode ( $ authz . chr ( 0 ) . $ uid . chr ( 0 ) . $ pwd ) ; if ( PEAR :: isError ( $ error = $ this -> put ( $ auth_str ) ) ) { return $ error ; } /* 235: Authentication successful */ if ( PEAR :: isError ( $ error = $ this -> parseResponse ( 235 ) ) ) { return $ error ; } return true ; }
Authenticates the user using the PLAIN method.

@param string $uid   The userid to authenticate as.
@param string $pwd   The password to authenticate with.
@param string $authz The optional authorization proxy identifier.

@return mixed Returns a PEAR_Error with an error message on any
kind of failure, or true on success.
@since 1.1.0
Authenticates the user using the PLAIN method .