original_string: protected function _loadCommandMessage(Zend_Amf_Value_Messaging_CommandMessage $message)
      {
          require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';
          switch($message->operation) {
              case Zend_Amf_Value_Messaging_CommandMessage::DISCONNECT_OPERATION :
              case Zend_Amf_Value_Messaging_CommandMessage::CLIENT_PING_OPERATION :
                  $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
                  break;
              case Zend_Amf_Value_Messaging_CommandMessage::LOGIN_OPERATION :
                  $data = explode(':', base64_decode($message->body));
                  $userid = $data[0];
                  $password = isset($data[1])?$data[1]:"";
                  if(empty($userid)) {
                      require_once 'Zend/Amf/Server/Exception.php';
                      throw new Zend_Amf_Server_Exception('Login failed: username not supplied');
                  }
                  if(!$this->_handleAuth($userid, $password)) {
                      require_once 'Zend/Amf/Server/Exception.php';
                      throw new Zend_Amf_Server_Exception('Authentication failed');
                  }
                  $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
                  break;
             case Zend_Amf_Value_Messaging_CommandMessage::LOGOUT_OPERATION :
                  if($this->_auth) {
                      Zend_Auth::getInstance()->clearIdentity();
                  }
                  $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
                  break;
              default :
                  require_once 'Zend/Amf/Server/Exception.php';
                  throw new Zend_Amf_Server_Exception('CommandMessage::' . $message->operation . ' not implemented');
                  break;
          }
          return $return;
      }
code: protected function _loadCommandMessage(Zend_Amf_Value_Messaging_CommandMessage $message)
      {
          require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';
          switch($message->operation) {
              case Zend_Amf_Value_Messaging_CommandMessage::DISCONNECT_OPERATION :
              case Zend_Amf_Value_Messaging_CommandMessage::CLIENT_PING_OPERATION :
                  $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
                  break;
              case Zend_Amf_Value_Messaging_CommandMessage::LOGIN_OPERATION :
                  $data = explode(':', base64_decode($message->body));
                  $userid = $data[0];
                  $password = isset($data[1])?$data[1]:"";
                  if(empty($userid)) {
                      require_once 'Zend/Amf/Server/Exception.php';
                      throw new Zend_Amf_Server_Exception('Login failed: username not supplied');
                  }
                  if(!$this->_handleAuth($userid, $password)) {
                      require_once 'Zend/Amf/Server/Exception.php';
                      throw new Zend_Amf_Server_Exception('Authentication failed');
                  }
                  $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
                  break;
             case Zend_Amf_Value_Messaging_CommandMessage::LOGOUT_OPERATION :
                  if($this->_auth) {
                      Zend_Auth::getInstance()->clearIdentity();
                  }
                  $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
                  break;
              default :
                  require_once 'Zend/Amf/Server/Exception.php';
                  throw new Zend_Amf_Server_Exception('CommandMessage::' . $message->operation . ' not implemented');
                  break;
          }
          return $return;
      }
code_tokens: protected function _loadCommandMessage ( Zend_Amf_Value_Messaging_CommandMessage $ message ) { require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php' ; switch ( $ message -> operation ) { case Zend_Amf_Value_Messaging_CommandMessage :: DISCONNECT_OPERATION : case Zend_Amf_Value_Messaging_CommandMessage :: CLIENT_PING_OPERATION : $ return = new Zend_Amf_Value_Messaging_AcknowledgeMessage ( $ message ) ; break ; case Zend_Amf_Value_Messaging_CommandMessage :: LOGIN_OPERATION : $ data = explode ( ':' , base64_decode ( $ message -> body ) ) ; $ userid = $ data [ 0 ] ; $ password = isset ( $ data [ 1 ] ) ? $ data [ 1 ] : "" ; if ( empty ( $ userid ) ) { require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( 'Login failed: username not supplied' ) ; } if ( ! $ this -> _handleAuth ( $ userid , $ password ) ) { require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( 'Authentication failed' ) ; } $ return = new Zend_Amf_Value_Messaging_AcknowledgeMessage ( $ message ) ; break ; case Zend_Amf_Value_Messaging_CommandMessage :: LOGOUT_OPERATION : if ( $ this -> _auth ) { Zend_Auth :: getInstance ( ) -> clearIdentity ( ) ; } $ return = new Zend_Amf_Value_Messaging_AcknowledgeMessage ( $ message ) ; break ; default : require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( 'CommandMessage::' . $ message -> operation . ' not implemented' ) ; break ; } return $ return ; }
docstring: Handles each of the 11 different command message types.
  
  A command message is a flex.messaging.messages.CommandMessage
  
  @see    Zend_Amf_Value_Messaging_CommandMessage
  @param  Zend_Amf_Value_Messaging_CommandMessage $message
  @return Zend_Amf_Value_Messaging_AcknowledgeMessage
docstring_tokens: Handles each of the 11 different command message types .