Exemplo n.º 1
0
 /**
  * Command handler
  * 
  * @param   string      The command name
  * @param   object      The command context
  * @return  boolean     Can return both true or false.  
  * @throws  KControllerException
  */
 public final function execute($name, KCommandContext $context)
 {
     $parts = explode('.', $name);
     if ($parts[0] == 'before') {
         if (!$this->_checkToken($context)) {
             $context->setError(new KControllerException('Invalid token or session time-out', KHttpResponse::FORBIDDEN));
             return false;
         }
     }
     return parent::execute($name, $context);
 }