Completed
Pull Request — develop (#518)
by Agel_Nash
05:24
created
manager/includes/extenders/modxmailer.class.inc.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
  *******************************************************
9 9
  */
10 10
 
11
-use PHPMailer\PHPMailer\PHPMailer;
12 11
 use PHPMailer\PHPMailer\Exception;
12
+use PHPMailer\PHPMailer\PHPMailer;
13 13
 
14 14
 require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php';
15 15
 require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php';
Please login to merge, or discard this patch.
install/setup.info.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -170,70 +170,70 @@
 block discarded – undo
170 170
                 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
171 171
             );
172 172
         }
173
-		if (intval($params['shareparams']) || !empty($params['dependencies'])) {
174
-			$dependencies = explode(',', $params['dependencies']);
175
-			foreach ($dependencies as $dependency) {
176
-				$dependency = explode(':', $dependency);
177
-				switch (trim($dependency[0])) {
178
-					case 'template':
179
-						$mdp[] = array(
180
-							'module' => $params['name'],
181
-							'table' => 'templates',
182
-							'column' => 'templatename',
183
-							'type' => 50,
184
-							'name' => trim($dependency[1])
185
-						);
186
-						break;
187
-					case 'tv':
188
-					case 'tmplvar':
189
-						$mdp[] = array(
190
-							'module' => $params['name'],
191
-							'table' => 'tmplvars',
192
-							'column' => 'name',
193
-							'type' => 60,
194
-							'name' => trim($dependency[1])
195
-						);
196
-						break;
197
-					case 'chunk':
198
-					case 'htmlsnippet':
199
-						$mdp[] = array(
200
-							'module' => $params['name'],
201
-							'table' => 'htmlsnippets',
202
-							'column' => 'name',
203
-							'type' => 10,
204
-							'name' => trim($dependency[1])
205
-						);
206
-						break;
207
-					case 'snippet':
208
-						$mdp[] = array(
209
-							'module' => $params['name'],
210
-							'table' => 'snippets',
211
-							'column' => 'name',
212
-							'type' => 40,
213
-							'name' => trim($dependency[1])
214
-						);
215
-						break;
216
-					case 'plugin':
217
-						$mdp[] = array(
218
-							'module' => $params['name'],
219
-							'table' => 'plugins',
220
-							'column' => 'name',
221
-							'type' => 30,
222
-							'name' => trim($dependency[1])
223
-						);
224
-						break;
225
-					case 'resource':
226
-						$mdp[] = array(
227
-							'module' => $params['name'],
228
-							'table' => 'content',
229
-							'column' => 'pagetitle',
230
-							'type' => 20,
231
-							'name' => trim($dependency[1])
232
-						);
233
-						break;
234
-				}
235
-			}
236
-		}
173
+        if (intval($params['shareparams']) || !empty($params['dependencies'])) {
174
+            $dependencies = explode(',', $params['dependencies']);
175
+            foreach ($dependencies as $dependency) {
176
+                $dependency = explode(':', $dependency);
177
+                switch (trim($dependency[0])) {
178
+                    case 'template':
179
+                        $mdp[] = array(
180
+                            'module' => $params['name'],
181
+                            'table' => 'templates',
182
+                            'column' => 'templatename',
183
+                            'type' => 50,
184
+                            'name' => trim($dependency[1])
185
+                        );
186
+                        break;
187
+                    case 'tv':
188
+                    case 'tmplvar':
189
+                        $mdp[] = array(
190
+                            'module' => $params['name'],
191
+                            'table' => 'tmplvars',
192
+                            'column' => 'name',
193
+                            'type' => 60,
194
+                            'name' => trim($dependency[1])
195
+                        );
196
+                        break;
197
+                    case 'chunk':
198
+                    case 'htmlsnippet':
199
+                        $mdp[] = array(
200
+                            'module' => $params['name'],
201
+                            'table' => 'htmlsnippets',
202
+                            'column' => 'name',
203
+                            'type' => 10,
204
+                            'name' => trim($dependency[1])
205
+                        );
206
+                        break;
207
+                    case 'snippet':
208
+                        $mdp[] = array(
209
+                            'module' => $params['name'],
210
+                            'table' => 'snippets',
211
+                            'column' => 'name',
212
+                            'type' => 40,
213
+                            'name' => trim($dependency[1])
214
+                        );
215
+                        break;
216
+                    case 'plugin':
217
+                        $mdp[] = array(
218
+                            'module' => $params['name'],
219
+                            'table' => 'plugins',
220
+                            'column' => 'name',
221
+                            'type' => 30,
222
+                            'name' => trim($dependency[1])
223
+                        );
224
+                        break;
225
+                    case 'resource':
226
+                        $mdp[] = array(
227
+                            'module' => $params['name'],
228
+                            'table' => 'content',
229
+                            'column' => 'pagetitle',
230
+                            'type' => 20,
231
+                            'name' => trim($dependency[1])
232
+                        );
233
+                        break;
234
+                }
235
+            }
236
+        }
237 237
     }
238 238
     $d->close();
239 239
 }
Please login to merge, or discard this patch.
install/actions/action_install.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 <form name="install" id="install_form" action="index.php?action=options" method="post">
21 21
 <?php
22 22
 if ($errors == 0) {
23
-	// check if install folder is removeable
23
+    // check if install folder is removeable
24 24
     if (is_writable("../install")) { ?>
25 25
 <span id="removeinstall" style="float:left;cursor:pointer;color:#505050;line-height:18px;" onclick="var chk=document.install.rminstaller; if(chk) chk.checked=!chk.checked;"><input type="checkbox" name="rminstaller" onclick="event.cancelBubble=true;" <?php echo (empty ($errors) ? 'checked="checked"' : '') ?> style="cursor:default;" /><?php echo $_lang['remove_install_folder_auto'] ?></span>
26 26
 <?php 
Please login to merge, or discard this patch.
install/connection.databasetest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 $self = 'install/connection.databasetest.php';
9 9
 $base_path = str_replace($self,'',str_replace('\\','/', __FILE__));
10 10
 if (is_file("{$base_path}assets/cache/siteManager.php")) {
11
-	include_once("{$base_path}assets/cache/siteManager.php");
11
+    include_once("{$base_path}assets/cache/siteManager.php");
12 12
 }
13 13
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) {
14
-	define('MGR_DIR','manager');
14
+    define('MGR_DIR','manager');
15 15
 }
16 16
 require_once("lang.php");
17 17
 
Please login to merge, or discard this patch.
install/functions.php 1 patch
Indentation   +69 added lines, -69 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,86 +27,86 @@  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
 }
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
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM);
32 32
         $strictMode = false;
33 33
         foreach ($modes as $mode) {
34
-    		    if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true;
34
+                if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true;
35 35
         }
36 36
         if ($strictMode) $output .= '<br /><span style="color:#FF0000;"> '.$_lang['strict_mode'].'</span>';
37 37
     }
Please login to merge, or discard this patch.
install/connection.collation.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 $self = 'install/connection.collation.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
 
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
     $rs = array('recommend'=>'');
60 60
     $order = explode(',', $order);
61 61
     foreach($order as $v) {
62
-    	foreach($array as $name=>$sel) {
63
-        	if(strpos($name,$v)!==false) {
64
-        		$rs[$name] = $array[$name];
65
-        		unset($array[$name]);
66
-        	}
67
-    	}
62
+        foreach($array as $name=>$sel) {
63
+            if(strpos($name,$v)!==false) {
64
+                $rs[$name] = $array[$name];
65
+                unset($array[$name]);
66
+            }
67
+        }
68 68
     }
69 69
     $rs['unrecommend']='';
70 70
     return $rs + $array;
Please login to merge, or discard this patch.
install/index.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@
 block discarded – undo
16 16
 error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
17 17
 
18 18
 if (is_file("{$base_path}assets/cache/siteManager.php")) {
19
-	include_once("{$base_path}assets/cache/siteManager.php");
19
+    include_once("{$base_path}assets/cache/siteManager.php");
20 20
 }
21 21
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) {
22
-	define('MGR_DIR', 'manager');
22
+    define('MGR_DIR', 'manager');
23 23
 }
24 24
 
25 25
 
Please login to merge, or discard this patch.
install/lang.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -16,35 +16,35 @@  discard block
 block discarded – undo
16 16
 $install_language = "english";
17 17
 
18 18
 $_langFiles= array (
19
- "en" => "english",
20
- "bg" => "bulgarian",
21
- "cs" => "czech",
22
- "da" => "danish",
23
- "fi" => "finnish-utf8",
24
- "fr" => "francais-utf8",
25
- "de" => "german",
26
- "he" => "hebrew",
27
- "it" => "italian",
28
- "ja" => "japanese-utf8",
29
- "nl" => "nederlands-utf8",
30
- "no" => "norwegian",
31
- "fa" => "persian",
32
- "pl" => "polish-utf8",
33
- "pt" => "portuguese-br-utf8",
19
+    "en" => "english",
20
+    "bg" => "bulgarian",
21
+    "cs" => "czech",
22
+    "da" => "danish",
23
+    "fi" => "finnish-utf8",
24
+    "fr" => "francais-utf8",
25
+    "de" => "german",
26
+    "he" => "hebrew",
27
+    "it" => "italian",
28
+    "ja" => "japanese-utf8",
29
+    "nl" => "nederlands-utf8",
30
+    "no" => "norwegian",
31
+    "fa" => "persian",
32
+    "pl" => "polish-utf8",
33
+    "pt" => "portuguese-br-utf8",
34 34
 // "pt" => "portuguese",
35
- "ru" => "russian-UTF8",
36
- "es" => "spanish-utf8",
37
- "sv" => "svenska"
35
+    "ru" => "russian-UTF8",
36
+    "es" => "spanish-utf8",
37
+    "sv" => "svenska"
38 38
 );
39 39
 $_langISO6391 = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2);
40 40
 if (!empty($_langFiles[$_langISO6391]))  $install_language = $_langFiles[$_langISO6391];
41 41
 
42 42
 
43 43
 if (isset($_POST['language']) && !stristr($_POST['language'],"..")) {
44
-	$install_language = $_POST['language'];
44
+    $install_language = $_POST['language'];
45 45
 } else {
46
-	if (isset($_GET['language']) && !stristr($_GET['language'],"..")) 
47
-		$install_language = $_GET['language'];
46
+    if (isset($_GET['language']) && !stristr($_GET['language'],"..")) 
47
+        $install_language = $_GET['language'];
48 48
 }
49 49
 # load language file
50 50
 require_once("lang/english.inc.php"); // As fallback
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
 $manager_language = $install_language;
54 54
 
55 55
 if (isset($_POST['managerlanguage']) && !stristr($_POST['managerlanguage'],"..")) {
56
-	$manager_language = $_POST['managerlanguage'];
56
+    $manager_language = $_POST['managerlanguage'];
57 57
 } else {
58
-	if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) 
59
-		$manager_language = $_GET['managerlanguage'];
58
+    if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) 
59
+        $manager_language = $_GET['managerlanguage'];
60 60
 }
61 61
 
62 62
 foreach($_lang as $k=>$v)
63 63
 {
64
-	if(strpos($v,'[+MGR_DIR+]')!==false)
65
-		$_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v);
64
+    if(strpos($v,'[+MGR_DIR+]')!==false)
65
+        $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v);
66 66
 }
67 67
 ?>
68 68
\ No newline at end of file
Please login to merge, or discard this patch.