Completed
Push — develop ( ef95a6...f399f2 )
by Maxim
06:16
created
manager/processors/execute_module.processor.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('exec_module')) {
5
+if (!$modx->hasPermission('exec_module')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // check if user has access permission, except admins
15
-if($_SESSION['mgrRole']!=1){
15
+if ($_SESSION['mgrRole'] != 1) {
16 16
 	$rs = $modx->db->select(
17 17
 		'sma.usergroup,mg.member',
18 18
 		$modx->getFullTableName("site_module_access")." sma
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 	$permissionAccessInt = -1;
25 25
 
26 26
 	while ($row = $modx->db->getRow($rs)) {
27
-		if($row["usergroup"] && $row["member"]) {
27
+		if ($row["usergroup"] && $row["member"]) {
28 28
 			//if there are permissions and this member has permission, ofcourse
29 29
 			//this is granted
30 30
 			$permissionAccessInt = 1;
31
-		} elseif ($permissionAccessInt==-1) {
31
+		} elseif ($permissionAccessInt == -1) {
32 32
 			//if there are permissions but this member has no permission and the
33 33
 			//variable was still in init state we set permission to 0; no permissions
34 34
 			$permissionAccessInt = 0;
35 35
 		}
36 36
 	}
37 37
 
38
-	if($permissionAccessInt==0) {
38
+	if ($permissionAccessInt == 0) {
39 39
 		$modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40 40
 	}
41 41
 }
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 // get module data
44 44
 $rs = $modx->db->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'");
45 45
 $content = $modx->db->getRow($rs);
46
-if(!$content) {
46
+if (!$content) {
47 47
 	$modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106");
48 48
 }
49
-if($content['disabled']) {
49
+if ($content['disabled']) {
50 50
 	$modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106");
51 51
 }
52 52
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 $_SESSION['itemname'] = $content['name'];
61 61
 
62 62
 
63
-$output = evalModule($content["modulecode"],$parameter);
64
-if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) {
63
+$output = evalModule($content["modulecode"], $parameter);
64
+if (strpos(trim($output), '<') === 0 && strpos(trim($output), '<?xml') !== 0) {
65 65
 	echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller
66 66
 }
67 67
 echo $output;
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
  * @param array $params
75 75
  * @return string
76 76
  */
77
-function evalModule($moduleCode,$params){
77
+function evalModule($moduleCode, $params){
78 78
 	$modx = evolutionCMS();
79 79
 	$modx->event->params = &$params; // store params inside event object
80
-	if(is_array($params)) {
80
+	if (is_array($params)) {
81 81
 		extract($params, EXTR_SKIP);
82 82
 	}
83 83
 	ob_start();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	if (isset($php_errormsg))
88 88
 	{
89 89
 		$error_info = error_get_last();
90
-        switch($error_info['type'])
90
+        switch ($error_info['type'])
91 91
         {
92 92
         	case E_NOTICE :
93 93
         		$error_level = 1;
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
         	default:
102 102
         		$error_level = 99;
103 103
         }
104
-		if($modx->config['error_reporting']==='99' || 2<$error_level)
104
+		if ($modx->config['error_reporting'] === '99' || 2 < $error_level)
105 105
 		{
106
-			$modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg);
106
+			$modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg);
107 107
 			$modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>");
108 108
 		}
109 109
 	}
Please login to merge, or discard this patch.
manager/processors/login.processor.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
2
+if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3 3
 	header('HTTP/1.0 404 Not Found');
4 4
 	exit('error');
5 5
 }
6
-define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
6
+define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
8
-include_once(__DIR__ . '/../../index.php');
8
+include_once(__DIR__.'/../../index.php');
9 9
 $modx->db->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 $modx->loadExtension('ManagerAPI');
13 13
 $modx->loadExtension('phpass');
14 14
 
15
-$core_path = MODX_MANAGER_PATH . 'includes/';
15
+$core_path = MODX_MANAGER_PATH.'includes/';
16 16
 // include_once the language file
17 17
 $_lang = array();
18 18
 include_once("{$core_path}lang/english.inc.php");
19 19
 
20
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
20
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
21 21
 	include_once("{$core_path}lang/{$manager_language}.inc.php");
22 22
 }
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 include_once("{$core_path}log.class.inc.php");
26 26
 
27 27
 // Initialize System Alert Message Queque
28
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
28
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
29 29
 	$_SESSION['SystemAlertMsgQueque'] = array();
30 30
 }
31 31
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 $rs = $modx->db->select($fields, $from, $where);
52 52
 $limit = $modx->db->getRecordCount($rs);
53 53
 
54
-if($limit == 0 || $limit > 1) {
54
+if ($limit == 0 || $limit > 1) {
55 55
 	jsAlert($_lang['login_processor_unknown_user']);
56 56
 	return;
57 57
 }
@@ -73,32 +73,32 @@  discard block
 block discarded – undo
73 73
 
74 74
 // get the user settings from the database
75 75
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
76
-while($row = $modx->db->getRow($rs)) {
76
+while ($row = $modx->db->getRow($rs)) {
77 77
 	extract($row);
78 78
 	${$setting_name} = $setting_value;
79 79
 }
80 80
 
81 81
 // blocked due to number of login errors.
82
-if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
82
+if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
83 83
 	@session_destroy();
84 84
 	session_unset();
85
-	if($cip = getenv("HTTP_CLIENT_IP")) {
85
+	if ($cip = getenv("HTTP_CLIENT_IP")) {
86 86
 		$ip = $cip;
87
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
87
+	} elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88 88
 		$ip = $cip;
89
-	} elseif($cip = getenv("REMOTE_ADDR")) {
89
+	} elseif ($cip = getenv("REMOTE_ADDR")) {
90 90
 		$ip = $cip;
91 91
 	} else {
92 92
 		$ip = "UNKNOWN";
93 93
 	}
94 94
 	$log = new logHandler;
95
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
95
+	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip);
96 96
 	jsAlert($_lang['login_processor_many_failed_logins']);
97 97
 	return;
98 98
 }
99 99
 
100 100
 // blocked due to number of login errors, but get to try again
101
-if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
101
+if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
102 102
 	$fields = array();
103 103
 	$fields['failedlogincount'] = '0';
104 104
 	$fields['blockeduntil'] = time() - 1;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 // this user has been blocked by an admin, so no way he's loggin in!
109
-if($blocked == '1') {
109
+if ($blocked == '1') {
110 110
 	@session_destroy();
111 111
 	session_unset();
112 112
 	jsAlert($_lang['login_processor_blocked1']);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 }
115 115
 
116 116
 // blockuntil: this user has a block until date
117
-if($blockeduntildate > time()) {
117
+if ($blockeduntildate > time()) {
118 118
 	@session_destroy();
119 119
 	session_unset();
120 120
 	jsAlert($_lang['login_processor_blocked2']);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 }
123 123
 
124 124
 // blockafter: this user has a block after date
125
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
125
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
126 126
 	@session_destroy();
127 127
 	session_unset();
128 128
 	jsAlert($_lang['login_processor_blocked3']);
@@ -130,24 +130,24 @@  discard block
 block discarded – undo
130 130
 }
131 131
 
132 132
 // allowed ip
133
-if($allowed_ip) {
134
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
133
+if ($allowed_ip) {
134
+	if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
+		if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
136 136
 			jsAlert($_lang['login_processor_remotehost_ip']);
137 137
 			return;
138 138
 		}
139 139
 	}
140
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
140
+	if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
141 141
 		jsAlert($_lang['login_processor_remote_ip']);
142 142
 		return;
143 143
 	}
144 144
 }
145 145
 
146 146
 // allowed days
147
-if($allowed_days) {
147
+if ($allowed_days) {
148 148
 	$date = getdate();
149 149
 	$day = $date['wday'] + 1;
150
-	if(!in_array($day,explode(',',$allowed_days))) {
150
+	if (!in_array($day, explode(',', $allowed_days))) {
151 151
 		jsAlert($_lang['login_processor_date']);
152 152
 		return;
153 153
 	}
@@ -164,33 +164,33 @@  discard block
 block discarded – undo
164 164
 
165 165
 // check if plugin authenticated the user
166 166
 $matchPassword = false;
167
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
167
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
168 168
 	// check user password - local authentication
169 169
 	$hashType = $modx->manager->getHashType($dbasePassword);
170
-	if($hashType == 'phpass') {
170
+	if ($hashType == 'phpass') {
171 171
 		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
172
-	} elseif($hashType == 'md5') {
172
+	} elseif ($hashType == 'md5') {
173 173
 		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
174
-	} elseif($hashType == 'v1') {
174
+	} elseif ($hashType == 'v1') {
175 175
 		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
176 176
 	} else {
177 177
 		$matchPassword = false;
178 178
 	}
179
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
179
+} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
180 180
 	$matchPassword = true;
181 181
 }
182 182
 
183
-if(!$matchPassword) {
183
+if (!$matchPassword) {
184 184
 	jsAlert($_lang['login_processor_wrong_password']);
185 185
 	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
186 186
 	return;
187 187
 }
188 188
 
189
-if($modx->config['use_captcha'] == 1) {
190
-	if(!isset ($_SESSION['veriword'])) {
189
+if ($modx->config['use_captcha'] == 1) {
190
+	if (!isset ($_SESSION['veriword'])) {
191 191
 		jsAlert($_lang['login_processor_captcha_config']);
192 192
 		return;
193
-	} elseif($_SESSION['veriword'] != $captcha_code) {
193
+	} elseif ($_SESSION['veriword'] != $captcha_code) {
194 194
 		jsAlert($_lang['login_processor_bad_code']);
195 195
 		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
196 196
 		return;
@@ -218,25 +218,25 @@  discard block
 block discarded – undo
218 218
 $_SESSION['mgrPermissions'] = $modx->db->getRow($rs);
219 219
 
220 220
 // successful login so reset fail count and update key values
221
-$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
221
+$modx->db->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
222 222
 
223 223
 // get user's document groups
224 224
 $i = 0;
225
-$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
226
-		INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
225
+$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug
226
+		INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
227 227
 $_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs);
228 228
 
229 229
 $_SESSION['mgrToken'] = md5($currentsessionid);
230 230
 
231
-if($rememberme == '1') {
232
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
231
+if ($rememberme == '1') {
232
+	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
233 233
 
234 234
 	// Set a cookie separate from the session cookie with the username in it.
235 235
 	// Are we using secure connection? If so, make sure the cookie is secure
236 236
 	global $https_port;
237 237
 
238 238
 	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
239
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
239
+	if (version_compare(PHP_VERSION, '5.2', '<')) {
240 240
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
241 241
 	} else {
242 242
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 // Check if user already has an active session, if not check if user pressed logout end of last session
252 252
 $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
253 253
 $activeSession = $modx->db->getValue($rs);
254
-if(!$activeSession) {
254
+if (!$activeSession) {
255 255
 	$rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
256
-	if($lastHit = $modx->db->getValue($rs)) {
256
+	if ($lastHit = $modx->db->getValue($rs)) {
257 257
 		$_SESSION['show_logout_reminder'] = array(
258 258
 			'type' => 'logout_reminder',
259 259
 			'lastHit' => $lastHit
@@ -274,17 +274,17 @@  discard block
 block discarded – undo
274 274
 
275 275
 // check if we should redirect user to a web page
276 276
 $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
277
-$id = (int)$modx->db->getValue($rs);
278
-if($id > 0) {
279
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
280
-	if($_POST['ajax'] == 1) {
277
+$id = (int) $modx->db->getValue($rs);
278
+if ($id > 0) {
279
+	$header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
280
+	if ($_POST['ajax'] == 1) {
281 281
 		echo $header;
282 282
 	} else {
283 283
 		header($header);
284 284
 	}
285 285
 } else {
286
-	$header = 'Location: ' . MODX_MANAGER_URL;
287
-	if($_POST['ajax'] == 1) {
286
+	$header = 'Location: '.MODX_MANAGER_URL;
287
+	if ($_POST['ajax'] == 1) {
288 288
 		echo $header;
289 289
 	} else {
290 290
 		header($header);
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
  *
297 297
  * @param string $msg
298 298
  */
299
-function jsAlert($msg) {
299
+function jsAlert($msg){
300 300
 	$modx = evolutionCMS();
301
-	if($_POST['ajax'] != 1) {
302
-		echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
301
+	if ($_POST['ajax'] != 1) {
302
+		echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>";
303 303
 	} else {
304
-		echo $msg . "\n";
304
+		echo $msg."\n";
305 305
 	}
306 306
 }
307 307
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
  * @param string $dbasePassword
312 312
  * @return bool
313 313
  */
314
-function login($username, $givenPassword, $dbasePassword) {
314
+function login($username, $givenPassword, $dbasePassword){
315 315
 	$modx = evolutionCMS();
316 316
 	return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
317 317
 }
@@ -323,21 +323,21 @@  discard block
 block discarded – undo
323 323
  * @param string $username
324 324
  * @return bool
325 325
  */
326
-function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
326
+function loginV1($internalKey, $givenPassword, $dbasePassword, $username){
327 327
 	$modx = evolutionCMS();
328 328
 
329 329
 	$user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
330 330
 
331
-	if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
331
+	if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
332 332
 		$modx->config['pwd_hash_algo'] = 'UNCRYPT';
333 333
 	}
334 334
 
335
-	if($user_algo !== $modx->config['pwd_hash_algo']) {
335
+	if ($user_algo !== $modx->config['pwd_hash_algo']) {
336 336
 		$bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
337 337
 		$modx->config['pwd_hash_algo'] = $user_algo;
338 338
 	}
339 339
 
340
-	if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
340
+	if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
341 341
 		return false;
342 342
 	}
343 343
 
@@ -353,10 +353,10 @@  discard block
 block discarded – undo
353 353
  * @param string $username
354 354
  * @return bool
355 355
  */
356
-function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
356
+function loginMD5($internalKey, $givenPassword, $dbasePassword, $username){
357 357
 	$modx = evolutionCMS();
358 358
 
359
-	if($dbasePassword != md5($givenPassword)) {
359
+	if ($dbasePassword != md5($givenPassword)) {
360 360
 		return false;
361 361
 	}
362 362
 	updateNewHash($username, $givenPassword);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
  * @param string $username
368 368
  * @param string $password
369 369
  */
370
-function updateNewHash($username, $password) {
370
+function updateNewHash($username, $password){
371 371
 	$modx = evolutionCMS();
372 372
 
373 373
 	$field = array();
@@ -381,23 +381,23 @@  discard block
 block discarded – undo
381 381
  * @param int $failed_allowed
382 382
  * @param int $blocked_minutes
383 383
  */
384
-function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
384
+function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes){
385 385
 	$modx = evolutionCMS();
386 386
 
387 387
 	$failedlogins += 1;
388 388
 
389 389
 	$fields = array('failedlogincount' => $failedlogins);
390
-	if($failedlogins >= $failed_allowed) //block user for too many fail attempts
390
+	if ($failedlogins >= $failed_allowed) //block user for too many fail attempts
391 391
 	{
392 392
 		$fields['blockeduntil'] = time() + ($blocked_minutes * 60);
393 393
 	}
394 394
 
395 395
 	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
396 396
 
397
-	if($failedlogins < $failed_allowed) {
397
+	if ($failedlogins < $failed_allowed) {
398 398
 		//sleep to help prevent brute force attacks
399 399
 		$sleep = (int) $failedlogins / 2;
400
-		if($sleep > 5) {
400
+		if ($sleep > 5) {
401 401
 			$sleep = 5;
402 402
 		}
403 403
 		sleep($sleep);
Please login to merge, or discard this patch.
manager/actions/welcome.static.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 
6 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8
-if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
8
+if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9 9
 	// seems to be a new install - send the user to the configuration page
10 10
 	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
@@ -16,62 +16,62 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
19
+if ($modx->hasPermission('messages')) {
20
+	include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
23 23
 
24 24
 	$msg = array();
25 25
 	$msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
26
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : '';
27 27
 	$msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
28
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0';
29 29
 	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30 30
 	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31 31
 	$ph['MessageInfo'] = implode("\n", $msg);
32 32
 }
33 33
 
34 34
 // setup icons
35
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
35
+if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36 36
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
37 37
 	$ph['SecurityIcon'] = wrapIcon($icon, 75);
38 38
 }
39
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
39
+if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40 40
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
41 41
 	$ph['WebUserIcon'] = wrapIcon($icon, 99);
42 42
 }
43
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
43
+if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44 44
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
45 45
 	$ph['ModulesIcon'] = wrapIcon($icon, 106);
46 46
 }
47
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
47
+if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48 48
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
49 49
 	$ph['ResourcesIcon'] = wrapIcon($icon, 76);
50 50
 }
51
-if($modx->hasPermission('bk_manager')) {
51
+if ($modx->hasPermission('bk_manager')) {
52 52
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
53 53
 	$ph['BackupIcon'] = wrapIcon($icon, 93);
54 54
 }
55
-if($modx->hasPermission('help')) {
55
+if ($modx->hasPermission('help')) {
56 56
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
57 57
 	$ph['HelpIcon'] = wrapIcon($icon, 9);
58 58
 }
59 59
 
60
-if($modx->hasPermission('new_document')) {
60
+if ($modx->hasPermission('new_document')) {
61 61
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
62 62
 	$ph['ResourceIcon'] = wrapIcon($icon, 4);
63 63
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
64 64
 	$ph['WeblinkIcon'] = wrapIcon($icon, 72);
65 65
 }
66
-if($modx->hasPermission('assets_images')) {
66
+if ($modx->hasPermission('assets_images')) {
67 67
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
68 68
 	$ph['ImagesIcon'] = wrapIcon($icon, 72);
69 69
 }
70
-if($modx->hasPermission('assets_files')) {
70
+if ($modx->hasPermission('assets_files')) {
71 71
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
72 72
 	$ph['FilesIcon'] = wrapIcon($icon, 72);
73 73
 }
74
-if($modx->hasPermission('change_password')) {
74
+if ($modx->hasPermission('change_password')) {
75 75
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
76 76
 	$ph['PasswordIcon'] = wrapIcon($icon, 28);
77 77
 }
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 $ph['LogoutIcon'] = wrapIcon($icon, 8);
80 80
 
81 81
 // do some config checks
82
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
84
-	if($config_check_results != $_lang['configcheck_ok']) {
82
+if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83
+	include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php');
84
+	if ($config_check_results != $_lang['configcheck_ok']) {
85 85
 		$ph['config_check_results'] = $config_check_results;
86 86
 		$ph['config_display'] = 'block';
87 87
 	} else {
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 }
93 93
 
94 94
 // Check logout-reminder
95
-if(isset($_SESSION['show_logout_reminder'])) {
96
-	switch($_SESSION['show_logout_reminder']['type']) {
95
+if (isset($_SESSION['show_logout_reminder'])) {
96
+	switch ($_SESSION['show_logout_reminder']['type']) {
97 97
 		case 'logout_reminder':
98 98
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
99 99
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	</tr>
148 148
 </table>';
149 149
 
150
-$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
150
+$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>';
151 151
 
152 152
 $ph['UserInfo'] = $modx->parseText($tpl, array(
153 153
 	'username' => $modx->getLoginUserName(),
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
163 163
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
164 164
 
165
-if($modx->db->getRecordCount($rs) < 1) {
165
+if ($modx->db->getRecordCount($rs) < 1) {
166 166
 	$html = '<p>[%no_active_users_found%]</p>';
167 167
 } else {
168
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
168
+	include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
169 169
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
170 170
 	$ph['now'] = strftime('%H:%M:%S', $now);
171 171
 	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	$userList = array();
191 191
 	$userCount = array();
192 192
 	// Create userlist with session-count first before output
193
-	while($activeusers = $modx->db->getRow($rs)) {
193
+	while ($activeusers = $modx->db->getRow($rs)) {
194 194
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
195 195
 
196 196
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 			$currentaction
209 209
 		);
210 210
 	}
211
-	foreach($userList as $params) {
211
+	foreach ($userList as $params) {
212 212
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
213
-		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
213
+		$html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
214 214
 	}
215 215
 
216 216
 	$html .= '
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 $ph['OnlineInfo'] = $html;
223 223
 
224 224
 // include rss feeds for important forum topics
225
-include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php');
225
+include_once(MODX_MANAGER_PATH.'includes/rss.inc.php');
226 226
 $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content'];
227 227
 $ph['modx_news_content'] = $feedData['modx_news_content'];
228 228
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 // invoke event OnManagerWelcomePrerender
255 255
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
256
-if(is_array($evtOut)) {
256
+if (is_array($evtOut)) {
257 257
 	$output = implode('', $evtOut);
258 258
 	$ph['OnManagerWelcomePrerender'] = $output;
259 259
 }
@@ -383,57 +383,57 @@  discard block
 block discarded – undo
383 383
 
384 384
 // invoke OnManagerWelcomeHome event
385 385
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
386
-if(is_array($sitewidgets)) {
386
+if (is_array($sitewidgets)) {
387 387
 	$newwidgets = array();
388
-    foreach($sitewidgets as $widget){
388
+    foreach ($sitewidgets as $widget) {
389 389
         $newwidgets = array_merge($newwidgets, unserialize($widget));
390 390
     }
391 391
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
392 392
 }
393 393
 
394
-usort($widgets, function ($a, $b) {
394
+usort($widgets, function($a, $b){
395 395
 	return $a['menuindex'] - $b['menuindex'];
396 396
 });
397 397
 
398 398
 $tpl = getTplWidget();
399 399
 $output = '';
400
-foreach($widgets as $widget) {
401
-	if ($widget['hide'] != '1'){
400
+foreach ($widgets as $widget) {
401
+	if ($widget['hide'] != '1') {
402 402
 		$output .= $modx->parseText($tpl, $widget);
403 403
 	}
404 404
 }
405 405
 $ph['widgets'] = $output;
406 406
 
407 407
 // load template
408
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
409
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
408
+if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
409
+	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl';
410 410
 }
411 411
 
412 412
 $target = $modx->config['manager_welcome_tpl'];
413 413
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
414 414
 $target = $modx->mergeSettingsContent($target);
415 415
 
416
-if(substr($target, 0, 1) === '@') {
417
-	if(substr($target, 0, 6) === '@CHUNK') {
416
+if (substr($target, 0, 1) === '@') {
417
+	if (substr($target, 0, 6) === '@CHUNK') {
418 418
 		$content = $modx->getChunk(trim(substr($target, 7)));
419
-	} elseif(substr($target, 0, 5) === '@FILE') {
419
+	} elseif (substr($target, 0, 5) === '@FILE') {
420 420
 		$content = file_get_contents(trim(substr($target, 6)));
421 421
 	} else {
422 422
 		$content = '';
423 423
 	}
424 424
 } else {
425 425
 	$chunk = $modx->getChunk($target);
426
-	if($chunk !== false && !empty($chunk)) {
426
+	if ($chunk !== false && !empty($chunk)) {
427 427
 		$content = $chunk;
428
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
429
-		$content = file_get_contents(MODX_BASE_PATH . $target);
430
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
431
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
432
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
428
+	} elseif (is_file(MODX_BASE_PATH.$target)) {
429
+		$content = file_get_contents(MODX_BASE_PATH.$target);
430
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) {
431
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl');
432
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible
433 433
 	{
434
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
434
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html');
435 435
 	} else {
436
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
436
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl');
437 437
 	}
438 438
 }
439 439
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 $content = $modx->mergeConditionalTagsContent($content);
442 442
 $content = $modx->mergeSettingsContent($content);
443 443
 $content = $modx->parseText($content, $ph);
444
-if(strpos($content, '[+') !== false) {
444
+if (strpos($content, '[+') !== false) {
445 445
 	$modx->toPlaceholders($ph);
446 446
 	$content = $modx->mergePlaceholderContent($content);
447 447
 }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 $content = $modx->parseText($content, $_style, '[&', '&]');
451 451
 $content = $modx->cleanUpMODXTags($content); //cleanup
452 452
 
453
-if($js = $modx->getRegisteredClientScripts()) {
453
+if ($js = $modx->getRegisteredClientScripts()) {
454 454
 	$content .= $js;
455 455
 }
456 456
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 //	<a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a>
461 461
 //  <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a>
462 462
 //</span>
463
-function getTplWidget() { // recent document info
463
+function getTplWidget(){ // recent document info
464 464
 	return '
465 465
 		<div class="[+cols+]" id="[+id+]">
466 466
 			<div class="card"[+cardAttr+]>
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 ';
472 472
 }
473 473
 
474
-function getRecentInfo() { // recent document info
474
+function getRecentInfo(){ // recent document info
475 475
 	$modx = evolutionCMS();
476 476
 
477 477
 	$modx->addSnippet('recentInfoList', 'getRecentInfoList');
@@ -497,12 +497,12 @@  discard block
 block discarded – undo
497 497
 	return $html;
498 498
 }
499 499
 
500
-function getRecentInfoList() {
500
+function getRecentInfoList(){
501 501
 	$modx = evolutionCMS();
502 502
 
503 503
 	$rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
504 504
 
505
-	if($modx->db->getRecordCount($rs) < 1) {
505
+	if ($modx->db->getRecordCount($rs) < 1) {
506 506
 		return '<tr><td>[%no_activity_message%]</td></tr>';
507 507
 	}
508 508
 
@@ -512,20 +512,20 @@  discard block
 block discarded – undo
512 512
 	$btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&amp;id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> ';
513 513
 
514 514
 	$output = array();
515
-	while($ph = $modx->db->getRow($rs)) {
515
+	while ($ph = $modx->db->getRow($rs)) {
516 516
 		$docid = $ph['id'];
517 517
 		$_ = $modx->getUserInfo($ph['editedby']);
518 518
 		$ph['username'] = $_['username'];
519 519
 
520
-		if($ph['deleted'] == 1) {
520
+		if ($ph['deleted'] == 1) {
521 521
 			$ph['status'] = 'deleted text-danger';
522
-		} elseif($ph['published'] == 0) {
522
+		} elseif ($ph['published'] == 0) {
523 523
 			$ph['status'] = 'unpublished font-italic text-muted';
524 524
 		} else {
525 525
 			$ph['status'] = 'published';
526 526
 		}
527 527
 
528
-		if($modx->hasPermission('edit_document')) {
528
+		if ($modx->hasPermission('edit_document')) {
529 529
 			$ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
530 530
 		} else {
531 531
 			$ph['edit_btn'] = '';
@@ -540,8 +540,8 @@  discard block
 block discarded – undo
540 540
 			$preview_disabled
541 541
 		), $btntpl['preview_btn']);
542 542
 
543
-		if($modx->hasPermission('delete_document')) {
544
-			if($ph['deleted'] == 0) {
543
+		if ($modx->hasPermission('delete_document')) {
544
+			if ($ph['deleted'] == 0) {
545 545
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&amp;id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> ';
546 546
 			} else {
547 547
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&amp;id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> ';
@@ -551,11 +551,11 @@  discard block
 block discarded – undo
551 551
 			$ph['delete_btn'] = '';
552 552
 		}
553 553
 
554
-		if($ph['deleted'] == 1 && $ph['published'] == 0) {
554
+		if ($ph['deleted'] == 1 && $ph['published'] == 0) {
555 555
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
556
-		} elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
556
+		} elseif ($ph['deleted'] == 1 && $ph['published'] == 1) {
557 557
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
558
-		} elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
558
+		} elseif ($ph['deleted'] == 0 && $ph['published'] == 0) {
559 559
 			$publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
560 560
 		} else {
561 561
 			$publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
@@ -564,16 +564,16 @@  discard block
 block discarded – undo
564 564
 
565 565
 		$ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
566 566
 
567
-		if($ph['longtitle'] == '') {
567
+		if ($ph['longtitle'] == '') {
568 568
 			$ph['longtitle'] = '(<i>[%not_set%]</i>)';
569 569
 		}
570
-		if($ph['description'] == '') {
570
+		if ($ph['description'] == '') {
571 571
 			$ph['description'] = '(<i>[%not_set%]</i>)';
572 572
 		}
573
-		if($ph['introtext'] == '') {
573
+		if ($ph['introtext'] == '') {
574 574
 			$ph['introtext'] = '(<i>[%not_set%]</i>)';
575 575
 		}
576
-		if($ph['alias'] == '') {
576
+		if ($ph['alias'] == '') {
577 577
 			$ph['alias'] = '(<i>[%not_set%]</i>)';
578 578
 		}
579 579
 
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 	return implode("\n", $output);
583 583
 }
584 584
 
585
-function getRecentInfoRowTpl() {
585
+function getRecentInfoRowTpl(){
586 586
 	$tpl = '
587 587
 						<tr>
588 588
 							<td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td>
@@ -611,11 +611,11 @@  discard block
 block discarded – undo
611 611
 }
612 612
 
613 613
 // setup icons
614
-function wrapIcon($i, $action) {
614
+function wrapIcon($i, $action){
615 615
 	return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i);
616 616
 }
617 617
 
618
-function getStartUpScript() {
618
+function getStartUpScript(){
619 619
 	$script = '
620 620
         <script type="text/javascript">
621 621
         function hideConfigCheckWarning(key) {
Please login to merge, or discard this patch.
manager/includes/log.class.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
         $action = "",
37 37
         $itemid = "",
38 38
         $itemname = ""
39
-    ) {
39
+    ){
40 40
         $modx = evolutionCMS();
41 41
         $this->entry['msg'] = $msg; // writes testmessage to the object
42
-        $this->entry['action'] = empty($action) ? $modx->manager->action : $action;    // writes the action to the object
42
+        $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object
43 43
 
44 44
         // User Credentials
45 45
         $this->entry['internalKey'] = $internalKey == "" ? $modx->getLoginUserID() : $internalKey;
46 46
         $this->entry['username'] = $username == "" ? $modx->getLoginUserName() : $username;
47 47
 
48
-        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int)$_REQUEST['id'] : $itemid;  // writes the id to the object
48
+        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int) $_REQUEST['id'] : $itemid; // writes the id to the object
49 49
         if ($this->entry['itemId'] == 0) {
50 50
             $this->entry['itemId'] = "-";
51 51
         } // to stop items having id 0
@@ -96,20 +96,20 @@  discard block
 block discarded – undo
96 96
             
97 97
         $insert_id = $modx->db->insert($fields, $tbl_manager_log);
98 98
         if (!$insert_id) {
99
-            $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError());
99
+            $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->db->getLastError());
100 100
         } else {
101
-            $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->config['manager_log_limit'] : 3000;
102
-            $trim = (isset($modx->config['manager_log_trim'])) ? (int)$modx->config['manager_log_trim'] : 100;
101
+            $limit = (isset($modx->config['manager_log_limit'])) ? (int) $modx->config['manager_log_limit'] : 3000;
102
+            $trim = (isset($modx->config['manager_log_trim'])) ? (int) $modx->config['manager_log_trim'] : 100;
103 103
             if (($insert_id % $trim) === 0) {
104 104
                 $modx->rotate_log('manager_log', $limit, $trim);
105 105
             }
106 106
         }
107 107
     }
108 108
 
109
-    private function getUserIP() {
110
-        if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
111
-            if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) {
112
-                $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']);
109
+    private function getUserIP(){
110
+        if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
111
+            if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') > 0) {
112
+                $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);
113 113
                 return trim($addr[0]);
114 114
             } else {
115 115
                 return $_SERVER['HTTP_X_FORWARDED_FOR'];
Please login to merge, or discard this patch.
manager/includes/extenders/modxmailer.class.inc.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 use PHPMailer\PHPMailer\PHPMailer;
12 12
 use PHPMailer\PHPMailer\Exception as PHPMailerException;
13 13
 
14
-require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php';
15
-require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php';
16
-require MODX_MANAGER_PATH . 'includes/controls/phpmailer/SMTP.php';
14
+require MODX_MANAGER_PATH.'includes/controls/phpmailer/Exception.php';
15
+require MODX_MANAGER_PATH.'includes/controls/phpmailer/PHPMailer.php';
16
+require MODX_MANAGER_PATH.'includes/controls/phpmailer/SMTP.php';
17 17
 
18 18
 /**
19 19
  * Class MODxMailer
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function init(DocumentParser $modx)
47 47
     {
48 48
         $this->modx = $modx;
49
-        $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/';
49
+        $this->PluginDir = MODX_MANAGER_PATH.'includes/controls/phpmailer/';
50 50
 
51 51
         switch ($modx->config['email_method']) {
52 52
             case 'smtp':
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             mb_language($this->mb_language);
113 113
             mb_internal_encoding($modx->config['modx_charset']);
114 114
         }
115
-        $exconf = MODX_MANAGER_PATH . 'includes/controls/phpmailer/config.inc.php';
115
+        $exconf = MODX_MANAGER_PATH.'includes/controls/phpmailer/config.inc.php';
116 116
         if (is_file($exconf)) {
117 117
             include($exconf);
118 118
         }
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
         }
181 181
 
182 182
         if ($this->modx->debug) {
183
-            $debug_info = 'CharSet = ' . $this->CharSet . "\n";
184
-            $debug_info .= 'Encoding = ' . $this->Encoding . "\n";
185
-            $debug_info .= 'mb_language = ' . $this->mb_language . "\n";
186
-            $debug_info .= 'encode_header_method = ' . $this->encode_header_method . "\n";
183
+            $debug_info = 'CharSet = '.$this->CharSet."\n";
184
+            $debug_info .= 'Encoding = '.$this->Encoding."\n";
185
+            $debug_info .= 'mb_language = '.$this->mb_language."\n";
186
+            $debug_info .= 'encode_header_method = '.$this->encode_header_method."\n";
187 187
             $debug_info .= "send_mode = {$mode}\n";
188
-            $debug_info .= 'Subject = ' . $this->Subject . "\n";
188
+            $debug_info .= 'Subject = '.$this->Subject."\n";
189 189
             $log = "<pre>{$debug_info}\n{$header}\n{$org_body}</pre>";
190 190
             $this->modx->logEvent(1, 1, $log, 'MODxMailer debug information');
191 191
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             ini_set('sendmail_from', $old_from);
252 252
         }
253 253
         if (!$rt) {
254
-            $msg = $this->Lang('instantiate') . "<br />\n";
254
+            $msg = $this->Lang('instantiate')."<br />\n";
255 255
             $msg .= "{$this->Subject}<br />\n";
256 256
             $msg .= "{$this->FromName}&lt;{$this->From}&gt;<br />\n";
257 257
             $msg .= mb_convert_encoding($body, $this->modx->config['modx_charset'], $this->CharSet);
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
         $classDump = call_user_func('get_object_vars', $this);
274 274
         unset($classDump['modx']);
275 275
         $this->modx->config['send_errormail'] = '0';
276
-        $this->modx->logEvent(0, 3, $msg . '<pre>' . print_r($classDump, true) . '</pre>', 'phpmailer');
276
+        $this->modx->logEvent(0, 3, $msg.'<pre>'.print_r($classDump, true).'</pre>', 'phpmailer');
277 277
 
278 278
         return parent::SetError($msg);
279 279
     }
Please login to merge, or discard this patch.
manager/media/style/default/ajax.php 1 patch
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 $modx->loadExtension("ManagerAPI");
20 20
 
21 21
 $_lang = array();
22
-include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php';
22
+include_once MODX_MANAGER_PATH.'/includes/lang/english.inc.php';
23 23
 if ($modx->config['manager_language'] != 'english') {
24
-    include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php';
24
+    include_once MODX_MANAGER_PATH.'/includes/lang/'.$modx->config['manager_language'].'.inc.php';
25 25
 }
26
-include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php';
26
+include_once MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/style.php';
27 27
 
28 28
 $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
29 29
 $frame = isset($_REQUEST['f']) ? $_REQUEST['f'] : '';
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
             switch ($frame) {
42 42
                 case 'nodes':
43
-                    include_once MODX_MANAGER_PATH . '/frames/nodes.php';
43
+                    include_once MODX_MANAGER_PATH.'/frames/nodes.php';
44 44
 
45 45
                     break;
46 46
             }
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
                 $sql = '';
59 59
                 $a = '';
60 60
                 $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '%*_') : '';
61
-                $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->db->escape($filter) . '%"' : '';
62
-                $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
61
+                $sqlLike = $filter ? 'WHERE t1.name LIKE "'.$modx->db->escape($filter).'%"' : '';
62
+                $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
63 63
 
64 64
                 switch ($elements) {
65 65
                     case 'element_templates':
66 66
                         $a = 16;
67
-                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->db->escape($filter) . '%"' : '';
67
+                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "'.$modx->db->escape($filter).'%"' : '';
68 68
                         $sql = $modx->db->query('SELECT t1.*, t1.templatename AS name
69
-                        FROM ' . $modx->getFullTableName('site_templates') . ' AS t1
70
-                        ' . $sqlLike . '
69
+                        FROM ' . $modx->getFullTableName('site_templates').' AS t1
70
+                        ' . $sqlLike.'
71 71
                         ORDER BY t1.templatename ASC
72 72
                         ' . $sqlLimit);
73 73
 
74 74
                         if ($modx->hasPermission('new_template')) {
75
-                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>';
75
+                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>'.$_lang['new_template'].'</a></li>';
76 76
                         }
77 77
 
78 78
                         break;
@@ -80,15 +80,15 @@  discard block
 block discarded – undo
80 80
                     case 'element_tplvars':
81 81
                         $a = 301;
82 82
                         $sql = $modx->db->query('SELECT t1.id,t1.name,t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled
83
-                        FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1
84
-                        LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid
85
-                        ' . $sqlLike . '
83
+                        FROM ' . $modx->getFullTableName('site_tmplvars').' AS t1
84
+                        LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates').' AS t2 ON t1.id=t2.tmplvarid
85
+                        ' . $sqlLike.'
86 86
                         GROUP BY t1.id
87 87
                         ORDER BY t1.name ASC
88 88
                         ' . $sqlLimit);
89 89
 
90 90
                         if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
91
-                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>';
91
+                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>'.$_lang['new_tmplvars'].'</a></li>';
92 92
                         }
93 93
 
94 94
                         break;
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
                     case 'element_htmlsnippets':
97 97
                         $a = 78;
98 98
                         $sql = $modx->db->query('SELECT t1.*
99
-                        FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' AS t1
100
-                        ' . $sqlLike . '
99
+                        FROM ' . $modx->getFullTableName('site_htmlsnippets').' AS t1
100
+                        ' . $sqlLike.'
101 101
                         ORDER BY t1.name ASC
102 102
                         ' . $sqlLimit);
103 103
 
104 104
                         if ($modx->hasPermission('new_chunk')) {
105
-                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>';
105
+                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>'.$_lang['new_htmlsnippet'].'</a></li>';
106 106
                         }
107 107
 
108 108
                         break;
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
                     case 'element_snippets':
111 111
                         $a = 22;
112 112
                         $sql = $modx->db->query('SELECT t1.*
113
-                        FROM ' . $modx->getFullTableName('site_snippets') . ' AS t1
114
-                        ' . $sqlLike . '
113
+                        FROM ' . $modx->getFullTableName('site_snippets').' AS t1
114
+                        ' . $sqlLike.'
115 115
                         ORDER BY t1.name ASC
116 116
                         ' . $sqlLimit);
117 117
 
118 118
                         if ($modx->hasPermission('new_snippet')) {
119
-                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>';
119
+                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>'.$_lang['new_snippet'].'</a></li>';
120 120
                         }
121 121
 
122 122
                         break;
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
                     case 'element_plugins':
125 125
                         $a = 102;
126 126
                         $sql = $modx->db->query('SELECT t1.*
127
-                        FROM ' . $modx->getFullTableName('site_plugins') . ' AS t1
128
-                        ' . $sqlLike . '
127
+                        FROM ' . $modx->getFullTableName('site_plugins').' AS t1
128
+                        ' . $sqlLike.'
129 129
                         ORDER BY t1.name ASC
130 130
                         ' . $sqlLimit);
131 131
 
132 132
                         if ($modx->hasPermission('new_plugin')) {
133
-                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>';
133
+                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>'.$_lang['new_plugin'].'</a></li>';
134 134
                         }
135 135
 
136 136
                         break;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                             continue;
146 146
                         }
147 147
 
148
-                        $items .= '<li class="item ' . ($row['disabled'] ? 'disabled' : '') . ($row['locked'] ? ' locked' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main" data-parent-id="a_76__elements_' . $elements . '">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>' . "\n";
148
+                        $items .= '<li class="item '.($row['disabled'] ? 'disabled' : '').($row['locked'] ? ' locked' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main" data-parent-id="a_76__elements_'.$elements.'">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'."\n";
149 149
                     }
150 150
                 }
151 151
 
@@ -166,18 +166,18 @@  discard block
 block discarded – undo
166 166
             $output = '';
167 167
             $items = '';
168 168
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
169
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->db->escape($filter) . '%"' : '';
170
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
169
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->db->escape($filter).'%"' : '';
170
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
171 171
 
172 172
             $sql = $modx->db->query('SELECT t1.*, t1.username AS name, t2.blocked
173
-				FROM ' . $modx->getFullTableName('manager_users') . ' AS t1
174
-				LEFT JOIN ' . $modx->getFullTableName('user_attributes') . ' AS t2 ON t1.id=t2.internalKey
175
-				' . $sqlLike . '
173
+				FROM ' . $modx->getFullTableName('manager_users').' AS t1
174
+				LEFT JOIN ' . $modx->getFullTableName('user_attributes').' AS t2 ON t1.id=t2.internalKey
175
+				' . $sqlLike.'
176 176
 				ORDER BY t1.username ASC
177 177
 				' . $sqlLimit);
178 178
 
179 179
             if ($modx->hasPermission('new_user')) {
180
-                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>';
180
+                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>'.$_lang['new_user'].'</a></li>';
181 181
             }
182 182
 
183 183
             if ($count = $modx->db->getRecordCount($sql)) {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
186 186
                 }
187 187
                 while ($row = $modx->db->getRow($sql)) {
188
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
188
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
189 189
                 }
190 190
             }
191 191
 
@@ -205,18 +205,18 @@  discard block
 block discarded – undo
205 205
             $output = '';
206 206
             $items = '';
207 207
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
208
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->db->escape($filter) . '%"' : '';
209
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
208
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->db->escape($filter).'%"' : '';
209
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
210 210
 
211 211
             $sql = $modx->db->query('SELECT t1.*, t1.username AS name, t2.blocked
212
-				FROM ' . $modx->getFullTableName('web_users') . ' AS t1
213
-				LEFT JOIN ' . $modx->getFullTableName('web_user_attributes') . ' AS t2 ON t1.id=t2.internalKey
214
-				' . $sqlLike . '
212
+				FROM ' . $modx->getFullTableName('web_users').' AS t1
213
+				LEFT JOIN ' . $modx->getFullTableName('web_user_attributes').' AS t2 ON t1.id=t2.internalKey
214
+				' . $sqlLike.'
215 215
 				ORDER BY t1.username ASC
216 216
 				' . $sqlLimit);
217 217
 
218 218
             if ($modx->hasPermission('new_web_user')) {
219
-                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>';
219
+                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>'.$_lang['new_web_user'].'</a></li>';
220 220
             }
221 221
 
222 222
             if ($count = $modx->db->getRecordCount($sql)) {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
225 225
                 }
226 226
                 while ($row = $modx->db->getRow($sql)) {
227
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
227
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
228 228
                 }
229 229
             }
230 230
 
@@ -250,35 +250,35 @@  discard block
 block discarded – undo
250 250
                     case 'SnippetNoCache': {
251 251
 
252 252
                         $sql = $modx->db->query('SELECT *
253
-						FROM ' . $modx->getFullTableName('site_snippets') . '
254
-						WHERE name="' . $name . '"
253
+						FROM ' . $modx->getFullTableName('site_snippets').'
254
+						WHERE name="' . $name.'"
255 255
 						LIMIT 1');
256 256
 
257 257
                         if ($modx->db->getRecordCount($sql)) {
258 258
                             $row = $modx->db->getRow($sql);
259 259
                             $contextmenu = array(
260 260
                                 'header' => array(
261
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
261
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
262 262
                                 ),
263 263
                                 'item' => array(
264
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
265
-                                    'url' => "index.php?a=22&id=" . $row['id']
264
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
265
+                                    'url' => "index.php?a=22&id=".$row['id']
266 266
                                 )
267 267
                             );
268 268
                             if (!empty($row['description'])) {
269 269
                                 $contextmenu['seperator'] = '';
270 270
                                 $contextmenu['description'] = array(
271
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
271
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
272 272
                                 );
273 273
                             }
274 274
                         } else {
275 275
                             $contextmenu = array(
276 276
                                 'header' => array(
277
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $name
277
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$name
278 278
                                 ),
279 279
                                 'item' => array(
280
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
281
-                                    'url' => "index.php?a=23&itemname=" . $name
280
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
281
+                                    'url' => "index.php?a=23&itemname=".$name
282 282
                                 )
283 283
                             );
284 284
                         }
@@ -288,35 +288,35 @@  discard block
 block discarded – undo
288 288
                     case 'Chunk' : {
289 289
 
290 290
                         $sql = $modx->db->query('SELECT *
291
-						FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
292
-						WHERE name="' . $name . '"
291
+						FROM ' . $modx->getFullTableName('site_htmlsnippets').'
292
+						WHERE name="' . $name.'"
293 293
 						LIMIT 1');
294 294
 
295 295
                         if ($modx->db->getRecordCount($sql)) {
296 296
                             $row = $modx->db->getRow($sql);
297 297
                             $contextmenu = array(
298 298
                                 'header' => array(
299
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $row['name']
299
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$row['name']
300 300
                                 ),
301 301
                                 'item' => array(
302
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
303
-                                    'url' => "index.php?a=78&id=" . $row['id']
302
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
303
+                                    'url' => "index.php?a=78&id=".$row['id']
304 304
                                 )
305 305
                             );
306 306
                             if (!empty($row['description'])) {
307 307
                                 $contextmenu['seperator'] = '';
308 308
                                 $contextmenu['description'] = array(
309
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
309
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
310 310
                                 );
311 311
                             }
312 312
                         } else {
313 313
                             $contextmenu = array(
314 314
                                 'header' => array(
315
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name
315
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$name
316 316
                                 ),
317 317
                                 'item' => array(
318
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
319
-                                    'url' => "index.php?a=77&itemname=" . $name
318
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
319
+                                    'url' => "index.php?a=77&itemname=".$name
320 320
                                 )
321 321
                             );
322 322
                         }
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
                     }
326 326
                     case 'AttributeValue': {
327 327
                         $sql = $modx->db->query('SELECT *
328
-						FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
329
-						WHERE name="' . $name . '"
328
+						FROM ' . $modx->getFullTableName('site_htmlsnippets').'
329
+						WHERE name="' . $name.'"
330 330
 						LIMIT 1');
331 331
 
332 332
                         if ($modx->db->getRecordCount($sql)) {
@@ -336,52 +336,52 @@  discard block
 block discarded – undo
336 336
                                     'innerText' => $row['name']
337 337
                                 ),
338 338
                                 'item' => array(
339
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
340
-                                    'url' => "index.php?a=78&id=" . $row['id']
339
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
340
+                                    'url' => "index.php?a=78&id=".$row['id']
341 341
                                 )
342 342
                             );
343 343
                             if (!empty($row['description'])) {
344 344
                                 $contextmenu['seperator'] = '';
345 345
                                 $contextmenu['description'] = array(
346
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
346
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
347 347
                                 );
348 348
                             }
349 349
                         } else {
350 350
 
351 351
                             $sql = $modx->db->query('SELECT *
352
-							FROM ' . $modx->getFullTableName('site_snippets') . '
353
-							WHERE name="' . $name . '"
352
+							FROM ' . $modx->getFullTableName('site_snippets').'
353
+							WHERE name="' . $name.'"
354 354
 							LIMIT 1');
355 355
 
356 356
                             if ($modx->db->getRecordCount($sql)) {
357 357
                                 $row = $modx->db->getRow($sql);
358 358
                                 $contextmenu = array(
359 359
                                     'header' => array(
360
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
360
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
361 361
                                     ),
362 362
                                     'item' => array(
363
-                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
364
-                                        'url' => "index.php?a=22&id=" . $row['id']
363
+                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
364
+                                        'url' => "index.php?a=22&id=".$row['id']
365 365
                                     )
366 366
                                 );
367 367
                                 if (!empty($row['description'])) {
368 368
                                     $contextmenu['seperator'] = '';
369 369
                                     $contextmenu['description'] = array(
370
-                                        'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
370
+                                        'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
371 371
                                     );
372 372
                                 }
373 373
                             } else {
374 374
                                 $contextmenu = array(
375 375
                                     'header' => array(
376
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $name
376
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$name
377 377
                                     ),
378 378
                                     'item' => array(
379
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
380
-                                        'url' => "index.php?a=77&itemname=" . $name
379
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
380
+                                        'url' => "index.php?a=77&itemname=".$name
381 381
                                     ),
382 382
                                     'item2' => array(
383
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
384
-                                        'url' => "index.php?a=23&itemname=" . $name
383
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
384
+                                        'url' => "index.php?a=23&itemname=".$name
385 385
                                     )
386 386
                                 );
387 387
                             }
@@ -437,35 +437,35 @@  discard block
 block discarded – undo
437 437
                         }
438 438
 
439 439
                         $sql = $modx->db->query('SELECT *
440
-						FROM ' . $modx->getFullTableName('site_tmplvars') . '
441
-						WHERE name="' . $name . '"
440
+						FROM ' . $modx->getFullTableName('site_tmplvars').'
441
+						WHERE name="' . $name.'"
442 442
 						LIMIT 1');
443 443
 
444 444
                         if ($modx->db->getRecordCount($sql)) {
445 445
                             $row = $modx->db->getRow($sql);
446 446
                             $contextmenu = array(
447 447
                                 'header' => array(
448
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $row['name']
448
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$row['name']
449 449
                                 ),
450 450
                                 'item' => array(
451
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
452
-                                    'url' => "index.php?a=301&id=" . $row['id']
451
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
452
+                                    'url' => "index.php?a=301&id=".$row['id']
453 453
                                 )
454 454
                             );
455 455
                             if (!empty($row['description'])) {
456 456
                                 $contextmenu['seperator'] = '';
457 457
                                 $contextmenu['description'] = array(
458
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
458
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
459 459
                                 );
460 460
                             }
461 461
                         } else {
462 462
                             $contextmenu = array(
463 463
                                 'header' => array(
464
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name
464
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$name
465 465
                                 ),
466 466
                                 'item' => array(
467
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_tmplvars'],
468
-                                    'url' => "index.php?a=300&itemname=" . $name
467
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_tmplvars'],
468
+                                    'url' => "index.php?a=300&itemname=".$name
469 469
                                 )
470 470
                             );
471 471
                         }
@@ -484,15 +484,15 @@  discard block
 block discarded – undo
484 484
             $json = array();
485 485
 
486 486
             if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
487
-                $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
488
-                $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0;
487
+                $id = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
488
+                $parent = isset($_REQUEST['parent']) ? (int) $_REQUEST['parent'] : 0;
489 489
                 $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
490 490
 
491 491
                 // set parent
492 492
                 if ($id && $parent >= 0) {
493 493
 
494 494
                     // find older parent
495
-                    $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
495
+                    $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id='.$id));
496 496
 
497 497
                     $eventOut = $modx->invokeEvent('onBeforeMoveDocument', [
498 498
                         'id_document' => $id,
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
                     if (empty($json['errors'])) {
514 514
                         // check privileges user for move docs
515 515
                         if (!empty($modx->config['tree_show_protected']) && $role != 1) {
516
-                            $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
516
+                            $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN('.$id.','.$parent.','.$parentOld.')');
517 517
                             if ($modx->db->getRecordCount($sql)) {
518 518
                                 $document_groups = array();
519 519
                                 while ($row = $modx->db->getRow($sql)) {
@@ -538,22 +538,22 @@  discard block
 block discarded – undo
538 538
                             // set new parent
539 539
                             $modx->db->update(array(
540 540
                                 'parent' => $parent
541
-                            ), $modx->getFullTableName('site_content'), 'id=' . $id);
541
+                            ), $modx->getFullTableName('site_content'), 'id='.$id);
542 542
                             // set parent isfolder = 1
543 543
                             $modx->db->update(array(
544 544
                                 'isfolder' => 1
545
-                            ), $modx->getFullTableName('site_content'), 'id=' . $parent);
545
+                            ), $modx->getFullTableName('site_content'), 'id='.$parent);
546 546
 
547 547
                             if ($parent != $parentOld) {
548 548
                                 // check children docs and set parent isfolder
549
-                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
549
+                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent='.$parentOld))) {
550 550
                                     $modx->db->update(array(
551 551
                                         'isfolder' => 1
552
-                                    ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
552
+                                    ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
553 553
                                 } else {
554 554
                                     $modx->db->update(array(
555 555
                                         'isfolder' => 0
556
-                                    ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
556
+                                    ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
557 557
                                 }
558 558
                             }
559 559
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
                             if (!empty($menuindex)) {
562 562
                                 $menuindex = explode(',', $menuindex);
563 563
                                 foreach ($menuindex as $key => $value) {
564
-                                    $modx->db->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
564
+                                    $modx->db->query('UPDATE '.$modx->getFullTableName('site_content').' SET menuindex='.$key.' WHERE id='.$value);
565 565
                                 }
566 566
                             } else {
567 567
                                 // TODO: max(*) menuindex
@@ -590,19 +590,19 @@  discard block
 block discarded – undo
590 590
         }
591 591
 
592 592
         case 'getLockedElements': {
593
-            $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : 0;
594
-            $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
593
+            $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : 0;
594
+            $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
595 595
 
596 596
             $output = !!$modx->elementIsLocked($type, $id, true);
597 597
 
598 598
             if (!$output) {
599 599
                 $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
600
-                $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
600
+                $docgrp_cond = $docgrp ? ' OR dg.document_group IN ('.$docgrp.')' : '';
601 601
                 $sql = '
602
-                    SELECT MAX(IF(1=' . $role . ' OR sc.privatemgr=0' . $docgrp_cond . ', 0, 1)) AS locked
603
-                    FROM ' . $modx->getFullTableName('site_content') . ' AS sc 
604
-                    LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
605
-                    WHERE sc.id=' . $id . ' GROUP BY sc.id';
602
+                    SELECT MAX(IF(1=' . $role.' OR sc.privatemgr=0'.$docgrp_cond.', 0, 1)) AS locked
603
+                    FROM ' . $modx->getFullTableName('site_content').' AS sc 
604
+                    LEFT JOIN ' . $modx->getFullTableName('document_groups').' dg ON dg.document=sc.id
605
+                    WHERE sc.id=' . $id.' GROUP BY sc.id';
606 606
                 $sql = $modx->db->query($sql);
607 607
                 if ($modx->db->getRecordCount($sql)) {
608 608
                     $row = $modx->db->getRow($sql);
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab3_user_settings.inc.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
   <tr>
7 7
     <td nowrap class="warning"><?php echo $_lang['udperms_title'] ?><br><small>[(use_udperms)]</small></td>
8 8
     <td>
9
-        <?php echo wrap_label($_lang['yes'],form_radio('use_udperms', 1, 'id="udPermsOn"'));?><br />
10
-        <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"'));?>
9
+        <?php echo wrap_label($_lang['yes'], form_radio('use_udperms', 1, 'id="udPermsOn"')); ?><br />
10
+        <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"')); ?>
11 11
     </td>
12 12
   </tr>
13 13
   <tr>
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
   <tr>
18 18
     <td colspan="2"><div class="split"></div></td>
19 19
   </tr>
20
-  <tr class="udPerms" <?php echo showHide($use_udperms==1);?>>
20
+  <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>>
21 21
     <td nowrap class="warning"><?php echo $_lang['udperms_allowroot_title'] ?><br><small>[(udperms_allowroot)]</small></td>
22 22
     <td>
23
-      <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot=='1' ? 'checked="checked"' : "" ; ?> />
23
+      <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot == '1' ? 'checked="checked"' : ""; ?> />
24 24
       <?php echo $_lang['yes']?></label><br />
25
-      <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot=='0' ? 'checked="checked"' : "" ; ?> />
25
+      <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot == '0' ? 'checked="checked"' : ""; ?> />
26 26
       <?php echo $_lang['no']?></label>
27 27
     </td>
28 28
   </tr>
29
-  <tr class="udPerms" <?php echo showHide($use_udperms==1);?>>
29
+  <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>>
30 30
     <td width="200">&nbsp;</td>
31 31
     <td class="comment"><?php echo $_lang['udperms_allowroot_message'] ?></td>
32 32
   </tr>
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
   <tr>
38 38
     <td nowrap class="warning"><?php echo $_lang['email_sender_method'] ?><br><small>[(email_sender_method)]</small></td>
39 39
     <td>
40
-      <label><input type="radio" name="email_sender_method" value="1" <?php echo $email_sender_method=='1' ? 'checked="checked"' : "" ; ?> />
40
+      <label><input type="radio" name="email_sender_method" value="1" <?php echo $email_sender_method == '1' ? 'checked="checked"' : ""; ?> />
41 41
       <?php echo $_lang['auto']?></label><br />
42
-      <label><input type="radio" name="email_sender_method" value="0" <?php echo $email_sender_method=='0' ? 'checked="checked"' : "" ; ?> />
42
+      <label><input type="radio" name="email_sender_method" value="0" <?php echo $email_sender_method == '0' ? 'checked="checked"' : ""; ?> />
43 43
       <?php echo $_lang['use_emailsender']?></label>
44 44
     </td>
45 45
   </tr>
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
   <tr>
56 56
     <td nowrap class="warning"><?php echo $_lang['email_method_title'] ?><br><small>[(email_method)]</small></td>
57 57
     <td>
58
-        <?php echo wrap_label($_lang['email_method_mail'],form_radio('email_method','mail','id="useMail"'));?><br />
59
-        <?php echo wrap_label($_lang['email_method_smtp'],form_radio('email_method','smtp','id="useSmtp"'));?>
60
-        <div class="smtpRow" <?php echo showHide($email_method=='smtp');?>>
61
-            <?php include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/snippet_smtp.inc.php'); ?>
58
+        <?php echo wrap_label($_lang['email_method_mail'], form_radio('email_method', 'mail', 'id="useMail"')); ?><br />
59
+        <?php echo wrap_label($_lang['email_method_smtp'], form_radio('email_method', 'smtp', 'id="useSmtp"')); ?>
60
+        <div class="smtpRow" <?php echo showHide($email_method == 'smtp'); ?>>
61
+            <?php include_once(MODX_MANAGER_PATH.'actions/mutate_settings/snippet_smtp.inc.php'); ?>
62 62
         </div>
63 63
     </td>
64 64
   </tr>
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
       <br />
71 71
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
72 72
       <select name="reload_emailsubject" id="reload_emailsubject_select" onchange="confirmLangChange(this, 'emailsubject_default', 'emailsubject_field');">
73
-<?php echo get_lang_options('emailsubject_default');?>
73
+<?php echo get_lang_options('emailsubject_default'); ?>
74 74
       </select>
75 75
     </td>
76 76
     <td ><input id="emailsubject_field" name="emailsubject" onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" value="<?php echo $emailsubject; ?>" />
77
-        <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']);?>" />
77
+        <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']); ?>" />
78 78
     </td>
79 79
   </tr>
80 80
   <tr>
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
       <br />
90 90
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
91 91
       <select name="reload_signupemail_message" id="reload_signupemail_message_select" onchange="confirmLangChange(this, 'system_email_signup', 'signupemail_message_textarea');">
92
-<?php echo get_lang_options('system_email_signup');?>
92
+<?php echo get_lang_options('system_email_signup'); ?>
93 93
       </select>
94 94
     </td>
95 95
     <td> <textarea id="signupemail_message_textarea" name="signupemail_message" style="width:100%; height: 120px;"><?php echo $signupemail_message; ?></textarea>
96
-        <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']);?>" />
96
+        <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']); ?>" />
97 97
     </td>
98 98
   </tr>
99 99
   <tr>
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
       <br />
109 109
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
110 110
       <select name="reload_websignupemail_message" id="reload_websignupemail_message_select" onchange="confirmLangChange(this, 'system_email_websignup', 'websignupemail_message_textarea');">
111
-<?php echo get_lang_options('system_email_websignup');?>
111
+<?php echo get_lang_options('system_email_websignup'); ?>
112 112
       </select>
113 113
     </td>
114 114
     <td> <textarea id="websignupemail_message_textarea" name="websignupemail_message" style="width:100%; height: 120px;"><?php echo $websignupemail_message; ?></textarea>
115
-        <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']);?>" />
115
+        <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']); ?>" />
116 116
     </td>
117 117
   </tr>
118 118
   <tr>
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
       <br />
128 128
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
129 129
       <select name="reload_system_email_webreminder_message" id="reload_system_email_webreminder_select" onchange="confirmLangChange(this, 'system_email_webreminder', 'system_email_webreminder_textarea');">
130
-<?php echo get_lang_options('system_email_webreminder');?>
130
+<?php echo get_lang_options('system_email_webreminder'); ?>
131 131
       </select>
132 132
     </td>
133 133
     <td> <textarea id="system_email_webreminder_textarea" name="webpwdreminder_message" style="width:100%; height: 120px;"><?php echo $webpwdreminder_message; ?></textarea>
134
-        <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']);?>" />
134
+        <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']); ?>" />
135 135
     </td>
136 136
   </tr>
137 137
   <tr>
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
   <tr>
145 145
     <td nowrap class="warning" valign="top"><?php echo $_lang['allow_multiple_emails_title'] ?><br><small>[(allow_multiple_emails)]</small></td>
146 146
     <td>
147
-      <?php echo wrap_label($_lang['yes'],form_radio('allow_multiple_emails','1'));?><br />
148
-      <?php echo wrap_label($_lang['no'], form_radio('allow_multiple_emails','0'));?>
147
+      <?php echo wrap_label($_lang['yes'], form_radio('allow_multiple_emails', '1')); ?><br />
148
+      <?php echo wrap_label($_lang['no'], form_radio('allow_multiple_emails', '0')); ?>
149 149
     </td>
150 150
   </tr>
151 151
   <tr>
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         <?php
158 158
             // invoke OnUserSettingsRender event
159 159
             $evtOut = $modx->invokeEvent('OnUserSettingsRender');
160
-            if(is_array($evtOut)) echo implode("",$evtOut);
160
+            if (is_array($evtOut)) echo implode("", $evtOut);
161 161
         ?>
162 162
     </td>
163 163
   </tr>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab5_security_settings.inc.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
     $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4
3
-    if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) {
3
+    if (empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) {
4 4
         $valid_hostnames = $_SERVER['HTTP_HOST'];
5 5
     } else {
6 6
         $valid_hostnames = $MODX_SITE_HOSTNAMES;
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 <tr>
16 16
 <th><?php echo $_lang['allow_eval_title']; ?><br><small>[(allow_eval)]</small></th>
17 17
 <td>
18
-<?php echo wrap_label($_lang['allow_eval_with_scan']         , form_radio('allow_eval','with_scan'));?><br />
19
-<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'] , form_radio('allow_eval','with_scan_at_post'));?><br />
20
-<?php echo wrap_label($_lang['allow_eval_everytime_eval']    , form_radio('allow_eval','everytime_eval'));?><br />
21
-<?php echo wrap_label($_lang['allow_eval_dont_eval']         , form_radio('allow_eval','dont_eval'));?>
18
+<?php echo wrap_label($_lang['allow_eval_with_scan'], form_radio('allow_eval', 'with_scan')); ?><br />
19
+<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'], form_radio('allow_eval', 'with_scan_at_post')); ?><br />
20
+<?php echo wrap_label($_lang['allow_eval_everytime_eval'], form_radio('allow_eval', 'everytime_eval')); ?><br />
21
+<?php echo wrap_label($_lang['allow_eval_dont_eval'], form_radio('allow_eval', 'dont_eval')); ?>
22 22
     <div class="comment">
23 23
         <?php echo $_lang['allow_eval_msg'] ?>
24 24
     </div>
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 <tr>
44 44
     <th><?php echo $_lang['check_files_onlogin_title'] ?><br><small>[(check_files_onlogin)]</small></th>
45 45
     <td>
46
-      <textarea name="check_files_onlogin"><?php echo $check_files_onlogin;?></textarea><br />
46
+      <textarea name="check_files_onlogin"><?php echo $check_files_onlogin; ?></textarea><br />
47 47
         
48 48
 </td>
49 49
 </tr>
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
     <tr>
54 54
       <td nowrap class="warning"><?php echo $_lang['validate_referer_title'] ?><br><small>[(validate_referer)]</small></td>
55 55
       <td>
56
-        <?php echo wrap_label($_lang['yes'],form_radio('validate_referer', 1));?><br />
57
-        <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0));?>
56
+        <?php echo wrap_label($_lang['yes'], form_radio('validate_referer', 1)); ?><br />
57
+        <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0)); ?>
58 58
       </td>
59 59
     </tr>
60 60
     <tr>
@@ -89,25 +89,25 @@  discard block
 block discarded – undo
89 89
   <tr>
90 90
 <th><?php echo $_lang['a17_error_reporting_title']; ?><br><small>[(error_reporting)]</small></th>
91 91
 <td>
92
-<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting','0'));?><br />
93
-<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting','1'));?><br />
94
-<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting','2'));?><br />
95
-<?php echo wrap_label($_lang['a17_error_reporting_opt99'],form_radio('error_reporting','99'));?>
92
+<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting', '0')); ?><br />
93
+<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting', '1')); ?><br />
94
+<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting', '2')); ?><br />
95
+<?php echo wrap_label($_lang['a17_error_reporting_opt99'], form_radio('error_reporting', '99')); ?>
96 96
 </td>
97 97
 </tr>
98 98
 <tr>
99 99
     <td width="200">&nbsp;</td>
100
-    <td class="comment"> <?php echo $_lang['a17_error_reporting_msg'];?></td>
100
+    <td class="comment"> <?php echo $_lang['a17_error_reporting_msg']; ?></td>
101 101
 </tr>
102 102
 <tr><td colspan="2"><div class="split"></div></td></tr>
103 103
 <tr>
104 104
 <th><?php echo $_lang['mutate_settings.dynamic.php6']; ?><br><small>[(send_errormail)]</small></th>
105 105
 <td>
106
-<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'],form_radio('send_errormail','0'));?><br />
107
-<?php echo wrap_label('error',form_radio('send_errormail','3'));?><br />
108
-<?php echo wrap_label('error + warning',form_radio('send_errormail','2'));?><br />
109
-<?php echo wrap_label('error + warning + information',form_radio('send_errormail','1'));?><br />
110
-<?php echo parseText($_lang['mutate_settings.dynamic.php8'],array('emailsender'=>$modx->config['emailsender']));?></td>
106
+<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'], form_radio('send_errormail', '0')); ?><br />
107
+<?php echo wrap_label('error', form_radio('send_errormail', '3')); ?><br />
108
+<?php echo wrap_label('error + warning', form_radio('send_errormail', '2')); ?><br />
109
+<?php echo wrap_label('error + warning + information', form_radio('send_errormail', '1')); ?><br />
110
+<?php echo parseText($_lang['mutate_settings.dynamic.php8'], array('emailsender'=>$modx->config['emailsender'])); ?></td>
111 111
 </tr>
112 112
    <tr>
113 113
     <td colspan="2"><div class="split"></div></td>
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 <tr>
116 116
 <th><?php echo $_lang['enable_bindings_title'] ?><br><small>[(enable_bindings)]</small></th>
117 117
 <td>
118
-<?php echo wrap_label($_lang['yes'],form_radio('enable_bindings','1'));?><br />
119
-<?php echo wrap_label($_lang['no'], form_radio('enable_bindings','0'));?>
118
+<?php echo wrap_label($_lang['yes'], form_radio('enable_bindings', '1')); ?><br />
119
+<?php echo wrap_label($_lang['no'], form_radio('enable_bindings', '0')); ?>
120 120
 
121 121
 </td>
122 122
 </tr>
@@ -157,20 +157,20 @@  discard block
 block discarded – undo
157 157
 <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th>
158 158
 <td>
159 159
 <?php
160
-if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1;
161
-$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1;
162
-$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1;
163
-$phm['e']['SHA512']     = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1;
164
-$phm['e']['SHA256']     = $modx->manager->checkHashAlgorithm('SHA256') ? 0:1;
165
-$phm['e']['MD5']        = $modx->manager->checkHashAlgorithm('MD5') ? 0:1;
166
-$phm['e']['UNCRYPT']    = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1;
160
+if (empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1;
161
+$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0 : 1;
162
+$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0 : 1;
163
+$phm['e']['SHA512']     = $modx->manager->checkHashAlgorithm('SHA512') ? 0 : 1;
164
+$phm['e']['SHA256']     = $modx->manager->checkHashAlgorithm('SHA256') ? 0 : 1;
165
+$phm['e']['MD5']        = $modx->manager->checkHashAlgorithm('MD5') ? 0 : 1;
166
+$phm['e']['UNCRYPT']    = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0 : 1;
167 167
 ?>
168
-<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt &amp; stretch)',form_radio('pwd_hash_algo','BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y']));?><br />
169
-<?php echo wrap_label('CRYPT_BLOWFISH_A (salt &amp; stretch)',form_radio('pwd_hash_algo','BLOWFISH_A', '', $phm['e']['BLOWFISH_A']));?><br />
170
-<?php echo wrap_label('CRYPT_SHA512 (salt &amp; stretch)'    ,form_radio('pwd_hash_algo','SHA512'    , '', $phm['e']['SHA512']));?><br />
171
-<?php echo wrap_label('CRYPT_SHA256 (salt &amp; stretch)'    ,form_radio('pwd_hash_algo','SHA256'    , '', $phm['e']['SHA256']));?><br />
172
-<?php echo wrap_label('CRYPT_MD5 (salt &amp; stretch)'       ,form_radio('pwd_hash_algo','MD5'       , '', $phm['e']['MD5']));?><br />
173
-<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)'  ,form_radio('pwd_hash_algo','UNCRYPT'  , '', $phm['e']['UNCRYPT']));?>
168
+<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt &amp; stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y'])); ?><br />
169
+<?php echo wrap_label('CRYPT_BLOWFISH_A (salt &amp; stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_A', '', $phm['e']['BLOWFISH_A'])); ?><br />
170
+<?php echo wrap_label('CRYPT_SHA512 (salt &amp; stretch)', form_radio('pwd_hash_algo', 'SHA512', '', $phm['e']['SHA512'])); ?><br />
171
+<?php echo wrap_label('CRYPT_SHA256 (salt &amp; stretch)', form_radio('pwd_hash_algo', 'SHA256', '', $phm['e']['SHA256'])); ?><br />
172
+<?php echo wrap_label('CRYPT_MD5 (salt &amp; stretch)', form_radio('pwd_hash_algo', 'MD5', '', $phm['e']['MD5'])); ?><br />
173
+<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)', form_radio('pwd_hash_algo', 'UNCRYPT', '', $phm['e']['UNCRYPT'])); ?>
174 174
 </td>
175 175
 </tr>
176 176
 <tr>
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
   ?>
187 187
 <?php
188 188
 $gdAvailable = extension_loaded('gd');
189
-if(!$gdAvailable) $use_captcha = 0;
189
+if (!$gdAvailable) $use_captcha = 0;
190 190
 ?>
191 191
   <tr>
192 192
     <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td>
193
-    <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha==1) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> />
193
+    <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha == 1) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> />
194 194
       <?php echo $_lang['yes']?></label><br />
195
-      <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha==0) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : '';?> />
195
+      <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha == 0) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> />
196 196
       <?php echo $_lang['no']?></label> </td>
197 197
   </tr>
198 198
   <tr>
@@ -202,23 +202,23 @@  discard block
 block discarded – undo
202 202
   <tr>
203 203
     <td colspan="2"><div class="split"></div></td>
204 204
   </tr>
205
-  <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>>
205
+  <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>>
206 206
     <td nowrap class="warning"><?php echo $_lang['captcha_words_title'] ?><br><small>[(captcha_words)]</small>
207 207
       <br />
208 208
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
209 209
       <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');">
210
-<?php echo get_lang_options('captcha_words_default');?>
210
+<?php echo get_lang_options('captcha_words_default'); ?>
211 211
       </select>
212 212
     </td>
213 213
     <td><input type="text" id="captcha_words_input" name="captcha_words" style="width:250px" value="<?php echo $captcha_words; ?>" />
214
-        <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']);?>" />
214
+        <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']); ?>" />
215 215
     </td>
216 216
   </tr>
217
-  <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>>
217
+  <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>>
218 218
     <td width="200">&nbsp;</td>
219 219
     <td class="comment"><?php echo $_lang['captcha_words_message'] ?></td>
220 220
   </tr>
221
-  <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>>
221
+  <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>>
222 222
     <td colspan="2"><div class="split"></div></td>
223 223
   </tr>
224 224
   <tr>
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         <?php
227 227
             // invoke OnMiscSettingsRender event
228 228
             $evtOut = $modx->invokeEvent('OnSecuritySettingsRender');
229
-            if(is_array($evtOut)) echo implode("",$evtOut);
229
+            if (is_array($evtOut)) echo implode("", $evtOut);
230 230
         ?>
231 231
     </td>
232 232
   </tr>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab6_filemanager_settings.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
         <?php
114 114
             // invoke OnMiscSettingsRender event
115 115
             $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender');
116
-            if(is_array($evtOut)) echo implode("",$evtOut);
116
+            if (is_array($evtOut)) echo implode("", $evtOut);
117 117
         ?>
118 118
     </td>
119 119
   </tr>
Please login to merge, or discard this patch.