public function executeTask()
 {
     $quickTaskId = $_GET['quicktask'];
     if (!$this->existQuickTask($quickTaskId)) {
         $this->output($this->_('Task does not exist!'));
         return;
     }
     $quickTask = $this->getQuickTask($quickTaskId);
     if (!$quickTask->isValid()) {
         $this->output($this->_('Task is not valid!'));
         return;
     }
     $authUser = Gpf::newObj(Gpf_Application::getInstance()->getAuthClass());
     Gpf_Session::getInstance()->save($authUser->createPrivilegedUser());
     try {
         $method = new Gpf_Tasks_QuickTaskRunner_ServiceMethod($quickTask->getRequest());
         $response = $method->execute();
     } catch (Gpf_Exception $e) {
         $this->output($e->getMessage());
         return;
     }
     $this->output($response->toText());
     Gpf_Db_Table_QuickTasks::getInstance()->removeTasksAfterExecute($quickTask);
 }
示例#2
0
 public function init()
 {
     $this->setTable(Gpf_Db_Table_QuickTasks::getInstance());
     parent::init();
 }