function checkLogin() { require_once MAX_PATH . '/lib/OA/Permission.php'; require_once MAX_PATH . '/lib/OA/Upgrade/Login.php'; OA_Upgrade_Login::autoLogin(); return OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isUserLinkedToAdmin(); }
public function jobsAction() { $oWizard = new OX_Admin_UI_Install_Wizard($this->getInstallStatus()); if ($oWizard->isStep('configuration')) { //this will be visible under config wizard entry $current = 'configuration'; } else { $current = 'database'; } $this->setCurrentStepIfReachable($oWizard, $current); $oUpgrader = $this->getUpgrader(); $isUpgrade = $this->getInstallStatus()->isUpgrade(); $oRequest = $this->getRequest(); $oStorage = OX_Admin_UI_Install_InstallUtils::getSessionStorage(); if ($oRequest->isGet()) { $oStorage->set('aJobStatuses', null); } if ($oRequest->isPost()) { $aJobErrors = $oRequest->getParam('jobError'); //check if there were any PHP errors when executing jobs //these are kind of errros which task and plugin runners might be //unable to catch and report in session eg. fatal error, timeout etc. if (!empty($aJobErrors)) { //push any errors through session so they can be presented in next step $aJobStatuses = $oStorage->get('aJobStatuses'); foreach ($aJobErrors as $id => $errMessage) { $aJobStatuses[$id]['errors'][] = $errMessage; list($type, $name) = explode(':', $id); $aJobStatuses[$id]['name'] = $name; $aJobStatuses[$id]['type'] = $type; } $oStorage->set('aJobStatuses', $aJobStatuses); } $this->redirect($oWizard->getNextStep()); } // Perform auto-login at this stage, so that the install-plugin can verify if ($this->getInstallStatus()->isInstall()) { OA_Upgrade_Login::autoLogin(); } // Use current url as base path for calling install-plugin $baseInstallUrl = $this->getRequest()->getBaseUrl(); //collect tasks $aUrls = OX_Upgrade_InstallPlugin_Controller::getTasksUrls($baseInstallUrl); $aUrls = array_merge($aUrls, OX_Upgrade_PostUpgradeTask_Controller::getTasksUrls($baseInstallUrl, $oUpgrader)); $json = new Services_JSON(); $jsonJobs = $json->encode($aUrls); $this->setModelProperty('oWizard', $oWizard); $this->setModelProperty('isUpgrade', $isUpgrade); $this->setModelProperty('jobs', $jsonJobs); }
} } } } } } } } } } } } } } if ($action == OA_UPGRADE_FINISH) { OA_Upgrade_Login::autoLogin(); // Execute any components which have registered at the afterLogin hook $aPlugins = OX_Component::getListOfRegisteredComponentsForHook('afterLogin'); foreach ($aPlugins as $i => $id) { if ($obj = OX_Component::factoryByComponentIdentifier($id)) { $obj->afterLogin(); } } // Delete the cookie setcookie('oat', ''); $oUpgrader->setOpenadsInstalledOn(); if (!$oUpgrader->removeUpgradeTriggerFile()) { $message .= '. ' . $strRemoveUpgradeFile; $strInstallSuccess = '<div class="sysinfoerror">' . $strOaUpToDateCantRemove . '</div>' . $strInstallSuccess; } }