state!=SASL_CRAM_MD5_STATE_START) { $client->error="CRAM-MD5 authentication state is not at the start"; return(SASL_FAIL); } $this->credentials=array( "user"=>"", "password"=>"" ); $defaults=array(); $status=$client->GetCredentials($this->credentials,$defaults,$interactions); if($status==SASL_CONTINUE) $this->state=SASL_CRAM_MD5_STATE_RESPOND_CHALLENGE; Unset($message); return($status); } Function Step(&$client, $response, &$message, &$interactions) { switch($this->state) { case SASL_CRAM_MD5_STATE_RESPOND_CHALLENGE: $message=$this->credentials["user"]." ".$this->HMACMD5($this->credentials["password"], $response); $this->state=SASL_CRAM_MD5_STATE_DONE; break; case SASL_CRAM_MD5_STATE_DONE: $client->error="CRAM-MD5 authentication was finished without success"; return(SASL_FAIL); default: $client->error="invalid CRAM-MD5 authentication step state"; return(SASL_FAIL); } return(SASL_CONTINUE); } }; ?>