| | |
| | | return $data; |
| | | } |
| | | |
| | | // don't use it in loops, until you exactly know what you're doing |
| | | function readReply(&$untagged=null) |
| | | { |
| | | do { |
| | |
| | | } |
| | | |
| | | $this->putLine($this->nextTag() . " AUTHENTICATE $type"); |
| | | $line = trim($this->readLine(1024)); |
| | | $line = trim($this->readReply()); |
| | | |
| | | if ($line[0] == '+') { |
| | | $challenge = substr($line, 2); |
| | |
| | | |
| | | // send result |
| | | $this->putLine($reply); |
| | | $line = $this->readLine(1024); |
| | | $line = trim($this->readReply()); |
| | | |
| | | if ($line[0] == '+') { |
| | | $challenge = substr($line, 2); |
| | |
| | | $this->putLine(''); |
| | | } |
| | | |
| | | $line = $this->readLine(1024); |
| | | $line = $this->readReply(); |
| | | $result = $this->parseResult($line); |
| | | } |
| | | else { // PLAIN |
| | |
| | | } |
| | | else { |
| | | $this->putLine($this->nextTag() . " AUTHENTICATE PLAIN"); |
| | | $line = trim($this->readLine(1024)); |
| | | $line = trim($this->readReply()); |
| | | |
| | | if ($line[0] != '+') { |
| | | return $this->parseResult($line); |
| | |
| | | |
| | | // send result, get reply and process it |
| | | $this->putLine($reply); |
| | | $line = $this->readLine(1024); |
| | | $line = $this->readReply(); |
| | | $result = $this->parseResult($line); |
| | | } |
| | | } |