57 |
57 |
58 // Version check |
58 // Version check |
59 if ( enano_version() == installer_enano_version() ) |
59 if ( enano_version() == installer_enano_version() ) |
60 { |
60 { |
61 $ui->show_header(); |
61 $ui->show_header(); |
62 echo '<h3>Already upgraded</h3>' . '<p>You don\'t need to migrate, you\'re already on <del>crack</del> the 1.1 platform.</p>'; |
62 $link_home = makeUrl(getConfig('main_page'), false, true); |
|
63 echo '<h3>' . $lang->get('upgrade_err_current_title') . '</h3>' . |
|
64 '<p>' . $lang->get('upgrade_err_current_body', array('mainpage_link' => $link_home)) . '</p>' . |
|
65 '<p>' . $lang->get('upgrade_err_current_body_para2', array('mainpage_link' => $link_home)) . '</p>'; |
63 $ui->show_footer(); |
66 $ui->show_footer(); |
64 exit(); |
67 exit(); |
65 } |
68 } |
66 |
69 |
67 // Start session manager |
70 // Start session manager |
173 enano_perform_upgrade() will only do upgrades. Not migrations. The two as |
176 enano_perform_upgrade() will only do upgrades. Not migrations. The two as |
174 illustrated within this installer are very different. |
177 illustrated within this installer are very different. |
175 */ |
178 */ |
176 |
179 |
177 // Do we need to run the migration first? |
180 // Do we need to run the migration first? |
178 list($major_version, $minor_version) = explode('.', enano_version()); |
181 list($major_version, $minor_version) = explode('.', preg_replace('/^upg-/', '', enano_version())); |
179 $current_branch = "$major_version.$minor_version"; |
182 $current_branch = "$major_version.$minor_version"; |
180 |
183 |
181 list($major_version, $minor_version) = explode('.', installer_enano_version()); |
184 list($major_version, $minor_version) = explode('.', installer_enano_version()); |
182 $target_branch = "$major_version.$minor_version"; |
185 $target_branch = "$major_version.$minor_version"; |
183 |
186 |
211 <?php echo $lang->get('upgrade_msg_schema_complete_body'); ?> |
214 <?php echo $lang->get('upgrade_msg_schema_complete_body'); ?> |
212 </p> |
215 </p> |
213 <form action="upgrade.php" method="get" style="text-align: center;"> |
216 <form action="upgrade.php" method="get" style="text-align: center;"> |
214 <input type="hidden" name="auth" value="<?php echo $session->sid_super; ?>" /> |
217 <input type="hidden" name="auth" value="<?php echo $session->sid_super; ?>" /> |
215 <p style="text-align: center;"> |
218 <p style="text-align: center;"> |
216 <button name="stage" value="postpimp"> |
219 <button name="stage" value="postpimp" class="submit"> |
217 <?php echo $lang->get('etc_continue'); ?> |
220 <?php echo $lang->get('upgrade_btn_continue'); ?> |
218 </button> |
221 </button> |
219 </p> |
222 </p> |
220 </form> |
223 </form> |
221 <?php |
224 <?php |
222 } |
225 } |
246 run_installer_stage('load', $lang->get('install_stg_load_title'), 'stg_load_files', $lang->get('install_stg_load_body'), false); |
249 run_installer_stage('load', $lang->get('install_stg_load_title'), 'stg_load_files', $lang->get('install_stg_load_body'), false); |
247 run_installer_stage('importlang', $lang->get('install_stg_importlang_title'), 'stg_lang_import', $lang->get('install_stg_importlang_body')); |
250 run_installer_stage('importlang', $lang->get('install_stg_importlang_title'), 'stg_lang_import', $lang->get('install_stg_importlang_body')); |
248 run_installer_stage('flushcache', $lang->get('upgrade_stg_flushcache_title'), 'stg_flush_cache', $lang->get('upgrade_stg_flushcache_body')); |
251 run_installer_stage('flushcache', $lang->get('upgrade_stg_flushcache_title'), 'stg_flush_cache', $lang->get('upgrade_stg_flushcache_body')); |
249 run_installer_stage('setversion', $lang->get('upgrade_stg_setversion_title'), 'stg_set_version', $lang->get('upgrade_stg_setversion_body')); |
252 run_installer_stage('setversion', $lang->get('upgrade_stg_setversion_title'), 'stg_set_version', $lang->get('upgrade_stg_setversion_body')); |
250 close_install_table(); |
253 close_install_table(); |
|
254 |
|
255 // demote privileges |
|
256 $session->logout(USER_LEVEL_ADMIN); |
251 |
257 |
252 $link_home = makeUrl(getConfig('main_page'), false, true); |
258 $link_home = makeUrl(getConfig('main_page'), false, true); |
253 echo '<h3>' . $lang->get('upgrade_post_status_finish_title') . '</h3>'; |
259 echo '<h3>' . $lang->get('upgrade_post_status_finish_title') . '</h3>'; |
254 echo '<p>' . $lang->get('upgrade_post_status_finish_body', array('mainpage_link' => $link_home)) . '</p>'; |
260 echo '<p>' . $lang->get('upgrade_post_status_finish_body', array('mainpage_link' => $link_home)) . '</p>'; |
255 } |
261 } |