Exemple #1
0
             $action = OA_UPGRADE_FINISH;
         } else {
             $action = OA_UPGRADE_ERROR;
         }
     }
 } else {
     if (array_key_exists('btn_upgrade', $_POST)) {
         if (!OA_Upgrade_Login::checkLogin()) {
             $message = $strUsernameOrPasswordWrong;
             $action = OA_UPGRADE_LOGIN;
         } elseif ($oUpgrader->canUpgrade()) {
             $installStatus = $oUpgrader->existing_installation_status;
             define('DISABLE_ALL_EMAILS', 1);
             OA_Permission::switchToSystemProcessUser('Installer');
             if ($installStatus == OA_STATUS_NOT_INSTALLED) {
                 if ($oUpgrader->install($_POST['aConfig'])) {
                     $message = $strDBCreatedSuccesful . ' ' . OA_VERSION;
                     $action = OA_UPGRADE_INSTALL;
                 }
             } else {
                 if (empty($_COOKIE['oat']) || $_COOKIE['oat'] != OA_UPGRADE_UPGRADE) {
                     // Hey, what's going on, we shouldn't be here, go back to login!
                     $action = OA_UPGRADE_LOGIN;
                 } elseif ($oUpgrader->upgrade($oUpgrader->package_file)) {
                     $message = $strUpgradeComplete;
                     $action = OA_UPGRADE_UPGRADE;
                     // Timezone support - hack
                     if ($oUpgrader->versionInitialSchema['tables_core'] < 538 && empty($_POST['noTzAlert'])) {
                         OA_Dal_ApplicationVariables::set('utc_update', OA::getNowUTC());
                     }
                     // Clear the menu cache to built a new one with the new settings