Horde_Imap_Client_Socket::_authInitialResponse PHP Method

_authInitialResponse() protected method

Create the AUTHENTICATE command for the initial client response.
protected _authInitialResponse ( string $method, string $ir, string $username = null ) : Horde_Imap_Client_Interaction_Command
$method string AUTHENTICATE SASL method.
$ir string Initial client response.
$username string If set, log a username message in debug log instead of raw data.
return Horde_Imap_Client_Interaction_Command A command object.
    protected function _authInitialResponse($method, $ir, $username = null)
    {
        $cmd = $this->_command('AUTHENTICATE')->add($method);
        if ($this->_capability('SASL-IR')) {
            // IMAP Extension for SASL Initial Client Response (RFC 4959)
            $cmd->add($ir);
            if ($username) {
                $cmd->debug = array(sprintf('AUTHENTICATE %s [INITIAL CLIENT RESPONSE (username: %s)]', $method, $username));
            }
        } else {
            $cmd->add(new Horde_Imap_Client_Interaction_Command_Continuation(function ($ob) use($ir) {
                return new Horde_Imap_Client_Data_Format_List($ir);
            }));
            if ($username) {
                $cmd->debug = array(null, sprintf('[INITIAL CLIENT RESPONSE (username: %s)]', $username));
            }
        }
        return $cmd;
    }