public function onActionRequest(MWP_Event_ActionRequest $event) { $this->saveWorkerConfiguration($event->getRequest()->getData()); // Prevent PHP Warning: set_time_limit() has been disabled for security reasons in __FILE__ @set_time_limit(1800); $this->setMemoryLimit(); $this->resetVersions(); $this->migration->migrate(); }
public function onActionRequest(MWP_Event_ActionRequest $event) { $nonce = $event->getRequest()->getNonce(); try { $this->nonceManager->useNonce($nonce); } catch (MWP_Security_Exception_NonceFormatInvalid $e) { throw new MWP_Worker_Exception(MWP_Worker_Exception::NONCE_FORMAT_INVALID, "Invalid nonce used. Please contact support.", array('nonce' => $nonce)); } catch (MWP_Security_Exception_NonceExpired $e) { throw new MWP_Worker_Exception(MWP_Worker_Exception::NONCE_EXPIRED, "Nonce expired. Please contact support.", array('nonce' => $nonce)); } catch (MWP_Security_Exception_NonceAlreadyUsed $e) { throw new MWP_Worker_Exception(MWP_Worker_Exception::NONCE_ALREADY_USED, "Nonce already used. Please contact support.", array('nonce' => $nonce)); } }
public function onActionRequest(MWP_Event_ActionRequest $event) { $user = null; $usernameUsed = $event->getRequest()->getUsername(); if ($usernameUsed) { $user = $this->context->getUserByUsername($usernameUsed); } if ($user === null) { // No user provided, find one instead. $users = $this->context->getUsers(array('role' => 'administrator', 'number' => 1, 'orderby' => 'ID')); if (count($users) === 0) { throw new MWP_Worker_Exception(MWP_Worker_Exception::AUTHENTICATION_NO_ADMIN_USER, "We could not find an administrator user to use. Please contact support."); } $user = $users[0]; } $this->context->setCurrentUser($user); }
public function onActionRequest(MWP_Event_ActionRequest $event) { $request = $event->getRequest(); $this->logger->debug('Master request: "{action}"', array('action' => $request->getAction(), 'params' => $request->getParams(), 'setting' => $request->getSetting())); }