示例#1
0
 /**
  * Builds step array. Uses information from InstallStatus (eg. if it's upgrade
  * or install) and also storage properties 'isMarketStepVisible', 'isLoginStepVisible'
  *
  * @param OX_Admin_UI_Install_InstallStatus $oStatus
  * @param OX_Admin_UI_Storage $oStorage
  * @return array array('steps' => $aSteps, 'meta' => $aMeta);
  */
 protected function initSteps($oStatus, $oStorage)
 {
     $aMeta = array();
     if ($oStatus->isRecovery()) {
         $aSteps = array('recovery' => 'Recovery', 'finish' => 'Finish');
     }
     if ($oStatus->isInstall()) {
         $aSteps = array('welcome' => 'Welcome', 'database' => 'Database', 'configuration' => 'Configuration', 'finish' => 'Finish');
         $aMeta = array('finish' => array('secured' => true));
     } else {
         if ($oStatus->isUpgrade()) {
             $aSteps = array('welcome' => 'Welcome', 'login' => 'Administrator Login', 'database' => 'Database', 'configuration' => 'Configuration', 'finish' => 'Finish');
             $aMeta = array('welcome' => array('secured' => false), 'login' => array('secured' => false), 'database' => array('secured' => true), 'configuration' => array('secured' => true), 'finish' => array('secured' => true));
             // Hide steps which are not required
             if (!$oStorage->get('isLoginStepVisible')) {
                 unset($aSteps['login']);
                 unset($aMeta['login']);
             }
             if (!$oStorage->get('isConfigStepVisible')) {
                 unset($aSteps['configuration']);
                 unset($aMeta['configuration']);
             }
         } else {
             if ($oStatus->isUpToDate()) {
                 $aSteps = array('uptodate' => 'Up To Date');
             }
         }
     }
     return array('steps' => $aSteps, 'meta' => $aMeta);
 }
 /**
  * Called before any action gets executed
  */
 protected function init()
 {
     // No upgrade file? No installer! Unless the user is in the last step
     if (!file_exists(MAX_PATH . '/var/UPGRADE') && 'finish' != $_REQUEST['action']) {
         header("Location: index.php");
         exit;
     }
     @set_time_limit(0);
     //  load translations for installer
     Language_Loader::load('installer');
     Language_Loader::load('default');
     Language_Loader::load('settings');
     Language_Loader::load('settings-help');
     // Setup oUpgrader
     $this->initUpgrader();
     $this->oTranslation = new OX_Translation();
     // clear the $session variable to prevent users pretending to be logged in.
     global $session;
     unset($session);
     $this->initInstallStatus();
     //check if market is required, if login is required (this will be used by wizard)
     $this->initStepConfig();
     //check if recovery required
     $oRequest = $this->getRequest();
     if ($this->oInstallStatus->isRecovery() && $oRequest->getParam('action') != 'recovery') {
         //if recovery required and not recovering already, force recovery to be started
         $oRequest->setParam('action', 'recovery');
     }
     parent::init();
 }