예제 #1
0
 /**
  * @see	\wcf\action\IAction::execute()
  */
 public function execute()
 {
     parent::execute();
     // do logout
     WCF::getSession()->delete();
     $this->executed();
     // forward to index page
     // warning: if doLogout() writes a cookie this is buggy in MS IIS
     HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Login'));
     exit;
 }
예제 #2
0
	/**
	 * @see	wcf\action\Action::execute()
	 */
	public function execute() {
		AbstractSecureAction::execute();
		
		// execute clipboard action
		$this->executeAction();
		
		// get editor items
		$returnValues = $this->getEditorItems();
		// send JSON response
		header('Content-type: application/json');
		echo JSON::encode($returnValues);
		exit;
	}
 /**
  * @see	\wcf\action\IAction::execute()
  */
 public final function execute()
 {
     parent::execute();
     $methodName = 'step' . StringUtil::firstCharToUpperCase($this->step);
     if (!method_exists($this, $methodName)) {
         throw new AJAXException("Class '" . get_class($this) . "' does not implement the required method '" . $methodName . "'");
     }
     // execute step
     $this->{$methodName}();
     $this->executed();
     // send JSON-encoded response
     header('Content-type: application/json');
     echo JSON::encode($this->data);
     exit;
 }
예제 #4
0
 /**
  * @see wcf\action\IAction::execute()
  */
 public function execute()
 {
     parent::execute();
     // validate
     if (!WCF::getUser()->userID) {
         throw new IllegalLinkException();
     }
     // do logout
     WCF::getSession()->delete();
     $this->executed();
     // forward to index page
     // warning: if doLogout() writes a cookie this is buggy in MS IIS
     HeaderUtil::redirect('index.php' . SID_ARG_1ST);
     exit;
 }
예제 #5
0
 /**
  * @see	\wcf\action\IAction::execute()
  */
 public function execute()
 {
     AbstractSecureAction::execute();
     // do logout
     WCF::getSession()->delete();
     // remove cookies
     if (isset($_COOKIE[COOKIE_PREFIX . 'userID'])) {
         HeaderUtil::setCookie('userID', 0);
     }
     if (isset($_COOKIE[COOKIE_PREFIX . 'password'])) {
         HeaderUtil::setCookie('password', '');
     }
     $this->executed();
     // forward to index page
     HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->get('wcf.user.logout.redirect'));
     exit;
 }
예제 #6
0
 /**
  * @see	\wcf\action\IAction::execute()
  */
 public function execute()
 {
     AbstractSecureAction::execute();
     if ($this->loopCount == -1) {
         $this->sendResponse();
     }
     // init worker
     $this->worker = new $this->className($this->parameters);
     $this->worker->setLoopCount($this->loopCount);
     // validate worker parameters
     $this->worker->validate();
     // calculate progress, triggers countObjects()
     $progress = $this->worker->getProgress();
     // execute worker
     $this->worker->execute();
     $this->worker->finalize();
     // send current state
     $this->sendResponse($progress, $this->worker->getParameters(), $this->worker->getProceedURL());
 }
예제 #7
0
 /**
  * @see	wcf\action\IAction::execute()
  */
 public function execute()
 {
     parent::execute();
     // validate class name
     if (!class_exists($this->className)) {
         throw new SystemException("unknown class '" . $this->className . "'");
     }
     if (!ClassUtil::isInstanceOf($this->className, 'wcf\\data\\IDatabaseObjectAction')) {
         throw new SystemException("'" . $this->className . "' should implement wcf\\system\\IDatabaseObjectAction");
     }
     // create object action instance
     $this->objectAction = new $this->className($this->objectIDs, $this->actionName, $this->parameters);
     // validate action
     try {
         $this->objectAction->validateAction();
     } catch (UserInputException $e) {
         $this->throwException($e);
     } catch (ValidateActionException $e) {
         $this->throwException($e);
     }
     // execute action
     try {
         $this->response = $this->objectAction->executeAction();
     } catch (\Exception $e) {
         $this->throwException($e);
     }
     $this->executed();
     // send JSON-encoded response
     header('Content-type: application/json');
     echo JSON::encode($this->response);
     exit;
 }
예제 #8
0
	/**
	 * @see	wcf\action\IAction::execute()
	 */
	public function execute() {
		parent::execute();
		
		// execute action
		try {
			$this->invoke();
		}
		catch (\Exception $e) {
			$this->throwException($e);
		}
		$this->executed();
		
		// send JSON-encoded response
		if (!$this->inDebugMode) {
			$this->sendResponse();
		}
	}
예제 #9
0
 /**
  * @see	wcf\action\IAction::execute()
  */
 public function execute()
 {
     parent::execute();
     // get object ids
     $objectIDs = $this->getObjectIDs();
     // create object action instance
     $this->objectAction = new $this->parameters['className']($objectIDs, $this->parameters['actionName']);
     // validate action
     try {
         $this->objectAction->validateAction();
     } catch (ValidateActionException $e) {
         throw new AJAXException("validation failed: " . $e->getMessage());
     }
     // execute action
     try {
         $this->response = $this->objectAction->executeAction();
     } catch (\Exception $e) {
         throw new AJAXException('unknown exception caught: ' . $e->getMessage());
     }
     $this->executed();
     // send JSON-encoded response
     header('Content-type: application/json');
     echo JSON::encode($this->response);
     exit;
 }