0
0

Moved all configurations away from $GLOBALS to independent variables

This commit is contained in:
Bryan Pedini
2019-07-18 11:38:03 +02:00
parent f2a56c2abc
commit 68884270f3
9 changed files with 44 additions and 44 deletions

View File

@@ -1,19 +1,19 @@
<?php
session_start ( );
$GLOBALS [ 'request_uri' ] = explode ( "/", $_GET [ 'URI' ] );
$request_uri = explode ( "/", $_GET [ 'URI' ] );
if ( ! file_exists ( 'config.json' ) ) {
if ( $GLOBALS[ 'request_uri' ] [ 0 ] !== "install" ) {
if ( $request_uri [ 0 ] !== "install" ) {
header ( "Location: " . substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 ) . "/install" );
}
}
if ( $GLOBALS [ 'request_uri' ] [ 0 ] == "install" ) {
if ( $request_uri [ 0 ] == "install" ) {
include ( 'lib/php/install.php' );
exit;
}
require_once ( 'functions.php' );
$GLOBALS [ 'config' ] = load_config ( );
if ( isset ( $GLOBALS [ 'request_uri' ] [ 0 ] ) && $GLOBALS [ 'request_uri' ] [ 0 ] != "" ) {
switch ( $GLOBALS [ 'request_uri' ] [ 0 ] ) {
$config = load_config ( );
if ( isset ( $request_uri [ 0 ] ) && $request_uri [ 0 ] != "" ) {
switch ( $request_uri [ 0 ] ) {
case "go":
include ( 'lib/php/go.php' );
break;
@@ -33,5 +33,5 @@
}
}
else {
header ( "Location: " . $GLOBALS [ 'config' ] [ 'installation_path' ] . "/login" );
header ( "Location: " . $config [ 'installation_path' ] . "/login" );
}