original_string: protected function _handleAuth( $userid,  $password)
      {
          if (!$this->_auth) {
              return true;
          }
          $this->_auth->setCredentials($userid, $password);
          $auth = Zend_Auth::getInstance();
          $result = $auth->authenticate($this->_auth);
          if ($result->isValid()) {
              if (!$this->isSession()) {
                  $this->setSession();
              }
              return true;
          } else {
              // authentication failed, good bye
              require_once 'Zend/Amf/Server/Exception.php';
              throw new Zend_Amf_Server_Exception(
                  "Authentication failed: " . join("\n",
                      $result->getMessages()), $result->getCode());
          }
  
      }
code: protected function _handleAuth( $userid,  $password)
      {
          if (!$this->_auth) {
              return true;
          }
          $this->_auth->setCredentials($userid, $password);
          $auth = Zend_Auth::getInstance();
          $result = $auth->authenticate($this->_auth);
          if ($result->isValid()) {
              if (!$this->isSession()) {
                  $this->setSession();
              }
              return true;
          } else {
              // authentication failed, good bye
              require_once 'Zend/Amf/Server/Exception.php';
              throw new Zend_Amf_Server_Exception(
                  "Authentication failed: " . join("\n",
                      $result->getMessages()), $result->getCode());
          }
  
      }
code_tokens: protected function _handleAuth ( $ userid , $ password ) { if ( ! $ this -> _auth ) { return true ; } $ this -> _auth -> setCredentials ( $ userid , $ password ) ; $ auth = Zend_Auth :: getInstance ( ) ; $ result = $ auth -> authenticate ( $ this -> _auth ) ; if ( $ result -> isValid ( ) ) { if ( ! $ this -> isSession ( ) ) { $ this -> setSession ( ) ; } return true ; } else { // authentication failed, good bye require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( "Authentication failed: " . join ( "\n" , $ result -> getMessages ( ) ) , $ result -> getCode ( ) ) ; } }
docstring: Handle AMF authentication
  
  @param string $userid
  @param string $password
  @return boolean
docstring_tokens: Handle AMF authentication