File tree Expand file tree Collapse file tree 7 files changed +31
-15
lines changed
datamodels/2.x/itop-core-update
sources/Application/Helper Expand file tree Collapse file tree 7 files changed +31
-15
lines changed Original file line number Diff line number Diff line change 6363 }
6464 }
6565});
66- $ oKPI = new ExecutionKPI ();
67- Session::Start ();
68- $ oKPI ->ComputeAndReport ("Session Start " );
6966
7067$ sSwitchEnv = utils::ReadParam ('switch_env ' , null );
7168$ bAllowCache = true ;
Original file line number Diff line number Diff line change 3030 *
3131 * @since 3.0.0 N°2214
3232 */
33+
34+ use Combodo \iTop \Application \Helper \Session ;
35+
3336$ bIsValidPhpVersion = false ;
3437if (PHP_MAJOR_VERSION >= 7 ) {
3538 $ bIsValidPhpVersion = true ;
4750
4851if (!isset ($ GLOBALS ['bBypassAutoload ' ]) || $ GLOBALS ['bBypassAutoload ' ] == false ) {
4952 require_once APPROOT .'/lib/autoload.php ' ;
53+ $ oKPI = new ExecutionKPI ();
54+ Session::Start ();
55+ $ oKPI ->ComputeAndReport ('Session Start ' );
56+
57+ // Now bBypassMaintenance mode is set in the session rather than the request params
58+ $ bBypassMaintenance = Session::Get ('bBypassMaintenance ' , false );
5059}
5160
5261//
5362// Maintenance mode
5463//
55-
56- // Use 'maintenance' parameter to bypass maintenance mode
57- if (!isset ($ bBypassMaintenance )) {
58- $ bBypassMaintenance = isset ($ _REQUEST ['maintenance ' ]) ? boolval ($ _REQUEST ['maintenance ' ]) : false ;
59- }
60-
6164if (file_exists (MAINTENANCE_MODE_FILE ) && !$ bBypassMaintenance ) {
6265 $ sTitle = 'Maintenance ' ;
6366 $ sMessage = 'This application is currently under maintenance. ' ;
Original file line number Diff line number Diff line change 44 <menu id =" iTopUpdate" xsi : type =" WebPageMenuNode" _delta =" define" >
55 <rank >60</rank >
66 <parent >SystemTools</parent >
7- <url >$pages/UI.php?route=core_update.select_update_file& maintenance=true </url >
7+ <url >$pages/UI.php?route=core_update.select_update_file</url >
88 <enable_admin_only >1</enable_admin_only >
99 </menu >
1010 </menus >
Original file line number Diff line number Diff line change @@ -15,8 +15,7 @@ var oGetCurrentVersion = {
1515 method: "POST",
1616 url: "{{ sAjaxURL | raw }}",
1717 data: {
18- route: "core_update_ajax.get_current_version",
19- maintenance: true
18+ route: "core_update_ajax.get_current_version"
2019 },
2120 dataType: "json",
2221 success: function(data)
@@ -36,8 +35,7 @@ function GetAjaxRequest(sOperation)
3635 url: "{{ sAjaxURL | raw }}",
3736 data: {
3837 route: sOperation,
39- authent: "{{ sSetupToken }}",
40- maintenance: true
38+ authent: "{{ sSetupToken }}"
4139 },
4240 dataType: "json"
4341 };
Original file line number Diff line number Diff line change 2626 * @since 3.0.0 N°3253
2727 */
2828
29+ use Combodo \iTop \Application \Helper \Session ;
30+
2931require_once ('../lib/autoload.php ' );
3032
33+ // Hack for setup, we need these constants in the session
34+ define ('APPROOT ' , dirname (__DIR__ ).'/ ' );
35+ define ('APPCONF ' , APPROOT .'conf/ ' );
36+ define ('ITOP_DEFAULT_ENV ' , 'production ' );
37+
38+ Session::Start ();
39+ if (!Session::Get ('bBypassMaintenance ' , false )) {
40+ // Allow setup in maintenance mode
41+ Session::Set ('bBypassMaintenance ' , true );
42+ }
43+
3144echo <<<HTML
3245<!DOCTYPE html>
3346<html>
Original file line number Diff line number Diff line change @@ -1940,6 +1940,7 @@ public static function EnterMaintenanceMode($oConfig): bool
19401940 {
19411941 $ bPreviousMode = self ::IsInMaintenanceMode ();
19421942 @touch (MAINTENANCE_MODE_FILE );
1943+ Session::Set ('bBypassMaintenance ' , true );
19431944 SetupLog::Info ("----> Entering maintenance mode " );
19441945 self ::WaitCronTermination ($ oConfig , "maintenance " );
19451946 return $ bPreviousMode ;
@@ -1948,6 +1949,7 @@ public static function EnterMaintenanceMode($oConfig): bool
19481949 public static function ExitMaintenanceMode ($ bLog = true )
19491950 {
19501951 @unlink (MAINTENANCE_MODE_FILE );
1952+ Session::Set ('bBypassMaintenance ' , false );
19511953 if ($ bLog ) {
19521954 SetupLog::Info ("<---- Exiting maintenance mode " );
19531955 }
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ public static function Start()
3535 }
3636
3737 if (!self ::$ bIsInitialized ) {
38- SessionHandler::session_set_save_handler ();
38+ if (defined ('MAINTENANCE_MODE_FILE ' )) {
39+ // Hack for setup, SessionHandler cannot work under setup
40+ SessionHandler::session_set_save_handler ();
41+ }
3942 session_name ('itop- ' .md5 (APPROOT ));
4043 }
4144
You can’t perform that action at this time.
0 commit comments