| | |
| | | |
| | | const COMMAND_NORESPONSE = 1; |
| | | const COMMAND_CAPABILITY = 2; |
| | | const COMMAND_LASTLINE = 4; |
| | | |
| | | /** |
| | | * Object constructor |
| | |
| | | |
| | | // RFC 4959 (SASL-IR): save one round trip |
| | | if ($this->getCapability('SASL-IR')) { |
| | | $result = $this->execute("AUTHENTICATE PLAIN", array($reply), |
| | | self::COMMAND_NORESPONSE | self::COMMAND_CAPABILITY); |
| | | list($result, $line) = $this->execute("AUTHENTICATE PLAIN", array($reply), |
| | | self::COMMAND_LASTLINE | self::COMMAND_CAPABILITY); |
| | | } |
| | | else { |
| | | $this->putLine($this->nextTag() . " AUTHENTICATE PLAIN"); |
| | |
| | | $this->parseCapability($matches[1], true); |
| | | } |
| | | |
| | | // return last line only (without command tag and result) |
| | | if ($line && ($options & self::COMMAND_LASTLINE)) { |
| | | $response = preg_replace("/^$tag (OK|NO|BAD|BYE|PREAUTH)?\s*/i", '', trim($line)); |
| | | } |
| | | |
| | | return $noresp ? $code : array($code, $response); |
| | | } |
| | | |