Completed
Pull Request — develop (#526)
by
unknown
06:55
created
install/functions.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 function install_sessionCheck()
3 3
 {
4
-	global $_lang;
4
+    global $_lang;
5 5
 	
6
-	// session loop-back tester
7
-	if(!isset($_GET['action']) || $_GET['action']!=='mode')
8
-	{
9
-		if(!isset($_SESSION['test']) || $_SESSION['test']!=1)
10
-		{
11
-			echo '
6
+    // session loop-back tester
7
+    if(!isset($_GET['action']) || $_GET['action']!=='mode')
8
+    {
9
+        if(!isset($_SESSION['test']) || $_SESSION['test']!=1)
10
+        {
11
+            echo '
12 12
 <html>
13 13
 <head>
14 14
 	<title>Install Problem</title>
@@ -27,88 +27,88 @@  discard block
 block discarded – undo
27 27
 	</div>
28 28
 </body>
29 29
 </html>';
30
-		exit;
31
-		}
32
-	}
30
+        exit;
31
+        }
32
+    }
33 33
 }
34 34
 
35 35
 function parse($src,$ph,$left='[+',$right='+]')
36 36
 {
37
-	foreach($ph as $k=>$v)
38
-	{
39
-		$k = $left . $k . $right;
40
-		$src = str_replace($k,$v,$src);
41
-	}
42
-	return $src;
37
+    foreach($ph as $k=>$v)
38
+    {
39
+        $k = $left . $k . $right;
40
+        $src = str_replace($k,$v,$src);
41
+    }
42
+    return $src;
43 43
 }
44 44
 
45 45
 function ph()
46 46
 {
47
-	global $_lang,$moduleName,$moduleVersion,$modx_textdir,$modx_release_date;
47
+    global $_lang,$moduleName,$moduleVersion,$modx_textdir,$modx_release_date;
48 48
 
49
-	if(isset($_SESSION['installmode'])) $installmode = $_SESSION['installmode'];
50
-	else                                $installmode = get_installmode();
49
+    if(isset($_SESSION['installmode'])) $installmode = $_SESSION['installmode'];
50
+    else                                $installmode = get_installmode();
51 51
 
52
-	$ph['pagetitle']     = $_lang['modx_install'];
53
-	$ph['textdir']       = $modx_textdir ? ' id="rtl"':'';
54
-	$ph['help_link']     = $installmode == 0 ? $_lang['help_link_new'] : $_lang['help_link_upd'];
55
-	$ph['version']       = $moduleVersion;
56
-	$ph['release_date']  = ($modx_textdir ? '&rlm;':'') . $modx_release_date;
57
-	$ph['footer1']       = $_lang['modx_footer1'];
58
-	$ph['footer2']       = $_lang['modx_footer2'];
59
-	$ph['current_year']  = date('Y');
60
-	return $ph;
52
+    $ph['pagetitle']     = $_lang['modx_install'];
53
+    $ph['textdir']       = $modx_textdir ? ' id="rtl"':'';
54
+    $ph['help_link']     = $installmode == 0 ? $_lang['help_link_new'] : $_lang['help_link_upd'];
55
+    $ph['version']       = $moduleVersion;
56
+    $ph['release_date']  = ($modx_textdir ? '&rlm;':'') . $modx_release_date;
57
+    $ph['footer1']       = $_lang['modx_footer1'];
58
+    $ph['footer2']       = $_lang['modx_footer2'];
59
+    $ph['current_year']  = date('Y');
60
+    return $ph;
61 61
 }
62 62
 
63 63
 function get_installmode()
64 64
 {
65
-	global $base_path,$database_server, $database_user, $database_password, $dbase, $table_prefix;
65
+    global $base_path,$database_server, $database_user, $database_password, $dbase, $table_prefix;
66 66
 	
67
-	$conf_path = "{$base_path}manager/includes/config.inc.php";
68
-	if (!is_file($conf_path)) $installmode = 0;
69
-	elseif(isset($_POST['installmode'])) $installmode = $_POST['installmode'];
70
-	else
71
-	{
72
-		include_once("{$base_path}manager/includes/config.inc.php");
67
+    $conf_path = "{$base_path}manager/includes/config.inc.php";
68
+    if (!is_file($conf_path)) $installmode = 0;
69
+    elseif(isset($_POST['installmode'])) $installmode = $_POST['installmode'];
70
+    else
71
+    {
72
+        include_once("{$base_path}manager/includes/config.inc.php");
73 73
 		
74
-		if(!isset($dbase) || empty($dbase)) $installmode = 0;
75
-		else
76
-		{
77
-			$conn = mysqli_connect($database_server, $database_user, $database_password);
78
-			if($conn)
79
-			{
80
-				$_SESSION['database_server']   = $database_server;
81
-				$_SESSION['database_user']     = $database_user;
82
-				$_SESSION['database_password'] = $database_password;
74
+        if(!isset($dbase) || empty($dbase)) $installmode = 0;
75
+        else
76
+        {
77
+            $conn = mysqli_connect($database_server, $database_user, $database_password);
78
+            if($conn)
79
+            {
80
+                $_SESSION['database_server']   = $database_server;
81
+                $_SESSION['database_user']     = $database_user;
82
+                $_SESSION['database_password'] = $database_password;
83 83
 				
84
-				$dbase = trim($dbase, '`');
85
-				$rs = mysqli_select_db($conn, $dbase);
86
-			}
87
-			else $rs = false;
84
+                $dbase = trim($dbase, '`');
85
+                $rs = mysqli_select_db($conn, $dbase);
86
+            }
87
+            else $rs = false;
88 88
 			
89
-			if($rs)
90
-			{
91
-				$_SESSION['dbase']                      = $dbase;
92
-				$_SESSION['table_prefix']               = $table_prefix;
93
-				$_SESSION['database_collation']         = 'utf8_general_ci';
94
-				$_SESSION['database_connection_method'] = 'SET CHARACTER SET';
89
+            if($rs)
90
+            {
91
+                $_SESSION['dbase']                      = $dbase;
92
+                $_SESSION['table_prefix']               = $table_prefix;
93
+                $_SESSION['database_collation']         = 'utf8_general_ci';
94
+                $_SESSION['database_connection_method'] = 'SET CHARACTER SET';
95 95
 				
96
-				$tbl_system_settings = "`{$dbase}`.`{$table_prefix}system_settings`";
97
-				$rs = mysqli_query($conn, "SELECT setting_value FROM {$tbl_system_settings} WHERE setting_name='settings_version'");
98
-				if($rs)
99
-				{
100
-					$row = mysqli_fetch_assoc($rs);
101
-					$settings_version = $row['setting_value'];
102
-				}
103
-				else $settings_version = '';
96
+                $tbl_system_settings = "`{$dbase}`.`{$table_prefix}system_settings`";
97
+                $rs = mysqli_query($conn, "SELECT setting_value FROM {$tbl_system_settings} WHERE setting_name='settings_version'");
98
+                if($rs)
99
+                {
100
+                    $row = mysqli_fetch_assoc($rs);
101
+                    $settings_version = $row['setting_value'];
102
+                }
103
+                else $settings_version = '';
104 104
 				
105
-				if (empty($settings_version)) $installmode = 0;
106
-				else                          $installmode = 1;
107
-			}
108
-			else $installmode = 1;
109
-		}
110
-	}
111
-	return $installmode;
105
+                if (empty($settings_version)) $installmode = 0;
106
+                else                          $installmode = 1;
107
+            }
108
+            else $installmode = 1;
109
+        }
110
+    }
111
+    return $installmode;
112 112
 }
113 113
 
114 114
 function getLangs($install_language)
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     sort($langs);
132 132
 
133 133
     $_ = array();
134
-   foreach ($langs as $language) {
134
+    foreach ($langs as $language) {
135 135
         $abrv_language = explode('.', $language);
136 136
         $selected = (strtolower($abrv_language[0]) == strtolower($manager_language)) ? ' selected' : '';
137 137
         $_[] = sprintf('<option value="%s" %s>%s</option>', $abrv_language[0], $selected,
Please login to merge, or discard this patch.
install/connection.servertest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 $self = 'install/connection.servertest.php';
8 8
 $base_path = str_replace($self,'',str_replace('\\','/', __FILE__));
9 9
 if (is_file("{$base_path}assets/cache/siteManager.php")) {
10
-	include_once("{$base_path}assets/cache/siteManager.php");
10
+    include_once("{$base_path}assets/cache/siteManager.php");
11 11
 }
12 12
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) {
13
-	define('MGR_DIR','manager');
13
+    define('MGR_DIR','manager');
14 14
 }
15 15
 require_once("lang.php");
16 16
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM);
33 33
             $strictMode = false;
34 34
             foreach ($modes as $mode) {
35
-    		    if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true;
35
+                if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true;
36 36
             }
37 37
             if ($strictMode) $output .= '<br /><span style="color:#FF0000;"> '.$_lang['strict_mode'].'</span>';
38 38
         }
Please login to merge, or discard this patch.