Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/actions/refresh_site.dynamic.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,10 +29,12 @@
 block discarded – undo
29 29
 
30 30
 <div class="tab-page">
31 31
 	<div class="container container-body">
32
-		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
32
+		<?php if($num_rows_pub) {
33
+    printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33 34
 		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
34 35
 		<?php
35 36
 		$modx->clearCache('full', true);
37
+}
36 38
 		// invoke OnSiteRefresh event
37 39
 		$modx->invokeEvent("OnSiteRefresh");
38 40
 		?>
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
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
 // (un)publishing of documents, version 2!
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33 33
 		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
34 34
 		<?php
35
-		$modx->clearCache('full', true);
36
-		// invoke OnSiteRefresh event
37
-		$modx->invokeEvent("OnSiteRefresh");
38
-		?>
35
+        $modx->clearCache('full', true);
36
+        // invoke OnSiteRefresh event
37
+        $modx->invokeEvent("OnSiteRefresh");
38
+        ?>
39 39
 	</div>
40 40
 </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 
30 30
 <div class="tab-page">
31 31
 	<div class="container container-body">
32
-		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33
-		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
32
+		<?php if ($num_rows_pub)   printf('<p>'.$_lang["refresh_published"].'</p>', $num_rows_pub) ?>
33
+		<?php if ($num_rows_unpub) printf('<p>'.$_lang["refresh_unpublished"].'</p>', $num_rows_unpub) ?>
34 34
 		<?php
35 35
 		$modx->clearCache('full', true);
36 36
 		// invoke OnSiteRefresh event
Please login to merge, or discard this patch.
manager/processors/logout.processor.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 // invoke OnBeforeManagerLogout event
9 9
 $modx->invokeEvent("OnBeforeManagerLogout",
10
-						array(
11
-							"userid"		=> $internalKey,
12
-							"username"		=> $username
13
-						));
10
+                        array(
11
+                            "userid"		=> $internalKey,
12
+                            "username"		=> $username
13
+                        ));
14 14
 
15 15
 //// Unset all of the session variables.
16 16
 //$_SESSION = array();
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 
34 34
 // invoke OnManagerLogout event
35 35
 $modx->invokeEvent("OnManagerLogout",
36
-						array(
37
-							"userid"		=> $internalKey,
38
-							"username"		=> $username
39
-						));
36
+                        array(
37
+                            "userid"		=> $internalKey,
38
+                            "username"		=> $username
39
+                        ));
40 40
 
41 41
 // show login screen
42 42
 header('Location: ' . MODX_MANAGER_URL);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 
@@ -41,4 +41,4 @@  discard block
 block discarded – undo
41 41
 						));
42 42
 
43 43
 // show login screen
44
-header('Location: ' . MODX_MANAGER_URL);
44
+header('Location: '.MODX_MANAGER_URL);
Please login to merge, or discard this patch.
manager/processors/save_settings.processor.php 4 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		}
22 22
 		elseif(is_writable($htaccess))
23 23
 		{
24
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
24
+			$_ = preg_replace('@RewriteBase.+@',"rewritebase {$dir}", $_);
25 25
 			if(!@file_put_contents($htaccess,$_))
26 26
 			{
27 27
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		elseif($modx->config['base_url']!=='/')
38 38
 		{
39 39
 			$_ = file_get_contents($htaccess);
40
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
40
+			$_ = preg_replace('@RewriteBase.+@',"rewritebase {$dir}", $_);
41 41
 			if(!@file_put_contents($htaccess,$_))
42 42
 			{
43 43
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
Please login to merge, or discard this patch.
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 if(!$modx->hasPermission('settings')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 $data = $_POST;
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
@@ -11,41 +11,41 @@  discard block
 block discarded – undo
11 11
 
12 12
 if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
13 13
 {
14
-	$htaccess        = $modx->config['base_path'] . '.htaccess';
15
-	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
-	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
18
-	{
19
-		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
21
-		{
22
-			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23
-		}
24
-		elseif(is_writable($htaccess))
25
-		{
26
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
28
-			{
29
-				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30
-			}
31
-		}
32
-	}
33
-	elseif(is_file($sample_htaccess))
34
-	{
35
-		if(!@rename($sample_htaccess,$htaccess))
14
+    $htaccess        = $modx->config['base_path'] . '.htaccess';
15
+    $sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
+    $dir = '/' . trim($modx->config['base_url'],'/');
17
+    if(is_file($htaccess))
18
+    {
19
+        $_ = file_get_contents($htaccess);
20
+        if(strpos($_,'RewriteBase')===false)
36 21
         {
37
-        	$warnings[] = $_lang["settings_friendlyurls_alert"];
38
-		}
39
-		elseif($modx->config['base_url']!=='/')
40
-		{
41
-			$_ = file_get_contents($htaccess);
42
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
44
-			{
45
-				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46
-			}
47
-		}
48
-	}
22
+            $warnings[] = $_lang["settings_friendlyurls_alert2"];
23
+        }
24
+        elseif(is_writable($htaccess))
25
+        {
26
+            $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
+            if(!@file_put_contents($htaccess,$_))
28
+            {
29
+                $warnings[] = $_lang["settings_friendlyurls_alert2"];
30
+            }
31
+        }
32
+    }
33
+    elseif(is_file($sample_htaccess))
34
+    {
35
+        if(!@rename($sample_htaccess,$htaccess))
36
+        {
37
+            $warnings[] = $_lang["settings_friendlyurls_alert"];
38
+        }
39
+        elseif($modx->config['base_url']!=='/')
40
+        {
41
+            $_ = file_get_contents($htaccess);
42
+            $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
+            if(!@file_put_contents($htaccess,$_))
44
+            {
45
+                $warnings[] = $_lang["settings_friendlyurls_alert2"];
46
+            }
47
+        }
48
+    }
49 49
 }
50 50
 
51 51
 if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
 $data['rb_base_dir']      = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']);
57 57
 
58 58
 if (isset($data) && count($data) > 0) {
59
-	if(isset($data['manager_language'])) {
60
-		$lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
-		if(is_file($lang_path)) {
62
-			include($lang_path);
59
+    if(isset($data['manager_language'])) {
60
+        $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
+        if(is_file($lang_path)) {
62
+            include($lang_path);
63 63
             global $modx_lang_attribute;
64 64
             $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
65
-		}
66
-	}
67
-	$savethese = array();
68
-	$data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']);
69
-	$data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70
-	foreach ($data as $k => $v) {
71
-		switch ($k) {
72
-			case 'site_name':
73
-				$v = htmlspecialchars($v);
74
-				break;
65
+        }
66
+    }
67
+    $savethese = array();
68
+    $data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']);
69
+    $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70
+    foreach ($data as $k => $v) {
71
+        switch ($k) {
72
+            case 'site_name':
73
+                $v = htmlspecialchars($v);
74
+                break;
75 75
             case 'settings_version':{
76 76
                 if($modx->getVersionData('version')!=$data['settings_version']){
77 77
                     $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
                 }
80 80
                 break;
81 81
             }
82
-			case 'error_page':
83
-			case 'unauthorized_page':
84
-			if (trim($v) == '' || !is_numeric($v)) {
85
-				$v = $data['site_start'];
86
-			}
87
-			break;
82
+            case 'error_page':
83
+            case 'unauthorized_page':
84
+            if (trim($v) == '' || !is_numeric($v)) {
85
+                $v = $data['site_start'];
86
+            }
87
+            break;
88 88
 
89
-			case 'lst_custom_contenttype':
90
-			case 'txt_custom_contenttype':
91
-				// Skip these
92
-				$k = '';
93
-				break;
94
-			case 'rb_base_dir':
95
-			case 'rb_base_url':
96
-			case 'filemanager_path':
97
-				$v = trim($v);
98
-				$v = rtrim($v,'/') . '/';
99
-				break;
89
+            case 'lst_custom_contenttype':
90
+            case 'txt_custom_contenttype':
91
+                // Skip these
92
+                $k = '';
93
+                break;
94
+            case 'rb_base_dir':
95
+            case 'rb_base_url':
96
+            case 'filemanager_path':
97
+                $v = trim($v);
98
+                $v = rtrim($v,'/') . '/';
99
+                break;
100 100
             case 'manager_language':
101 101
                 $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang');
102 102
                 $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php');
@@ -104,56 +104,56 @@  discard block
 block discarded – undo
104 104
                 if($langDir !== $langFileDir || !file_exists($langFile)) {
105 105
                     $v = 'english';
106 106
                 }
107
-				break;
108
-			case 'smtppw':
109
-				if ($v !== '********************' && $v !== '') {
110
-					$v = trim($v);
111
-					$v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
-					$v = str_replace('=','%',$v);
113
-				} elseif ($v === '********************') {
114
-					$k = '';
115
-				}
116
-				break;
107
+                break;
108
+            case 'smtppw':
109
+                if ($v !== '********************' && $v !== '') {
110
+                    $v = trim($v);
111
+                    $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
+                    $v = str_replace('=','%',$v);
113
+                } elseif ($v === '********************') {
114
+                    $k = '';
115
+                }
116
+                break;
117 117
             case 'valid_hostnames':
118
-				$v = str_replace(array(' ,', ', '), ',', $v);
119
-				if ($v !== ',') {
120
-					$v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
-					$configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
-					@file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
123
-				}
124
-				$k = '';
125
-				break;
126
-			case 'session_timeout':
127
-				$mail_check_timeperiod = $data['mail_check_timeperiod'];
128
-				$v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129
-				break;
130
-			default:
131
-			break;
132
-		}
133
-		$v = is_array($v) ? implode(",", $v) : $v;
118
+                $v = str_replace(array(' ,', ', '), ',', $v);
119
+                if ($v !== ',') {
120
+                    $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
+                    $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
+                    @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
123
+                }
124
+                $k = '';
125
+                break;
126
+            case 'session_timeout':
127
+                $mail_check_timeperiod = $data['mail_check_timeperiod'];
128
+                $v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129
+                break;
130
+            default:
131
+            break;
132
+        }
133
+        $v = is_array($v) ? implode(",", $v) : $v;
134 134
 
135
-		$modx->config[$k] = $v;
135
+        $modx->config[$k] = $v;
136 136
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
138
-	}
137
+        if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
138
+    }
139 139
 
140
-	// Run a single query to save all the values
141
-	$sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value)
140
+    // Run a single query to save all the values
141
+    $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value)
142 142
 		VALUES ".implode(', ', $savethese);
143
-	$modx->getDatabase()->query($sql);
143
+    $modx->getDatabase()->query($sql);
144 144
 
145
-	// Reset Template Pages
146
-	if (isset($data['reset_template'])) {
147
-		$newtemplate = (int)$data['default_template'];
148
-		$oldtemplate = (int)$data['old_template'];
149
-		$tbl = $modx->getFullTableName('site_content');
150
-		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153
-	}
145
+    // Reset Template Pages
146
+    if (isset($data['reset_template'])) {
147
+        $newtemplate = (int)$data['default_template'];
148
+        $oldtemplate = (int)$data['old_template'];
149
+        $tbl = $modx->getFullTableName('site_content');
150
+        $reset = $data['reset_template'];
151
+        if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
+        else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153
+    }
154 154
 
155
-	// empty cache
156
-	$modx->clearCache('full');
155
+    // empty cache
156
+    $modx->clearCache('full');
157 157
 }
158 158
 $header="Location: index.php?a=7&r=10";
159 159
 header($header);
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,46 +1,46 @@  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('settings')) {
5
+if (!$modx->hasPermission('settings')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 $data = $_POST;
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
10 10
 unset($_POST);
11 11
 
12
-if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
12
+if ($data['friendly_urls'] === '1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') === false)
13 13
 {
14
-	$htaccess        = $modx->config['base_path'] . '.htaccess';
15
-	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
-	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
14
+	$htaccess        = $modx->config['base_path'].'.htaccess';
15
+	$sample_htaccess = $modx->config['base_path'].'ht.access';
16
+	$dir = '/'.trim($modx->config['base_url'], '/');
17
+	if (is_file($htaccess))
18 18
 	{
19 19
 		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
20
+		if (strpos($_, 'RewriteBase') === false)
21 21
 		{
22 22
 			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23 23
 		}
24
-		elseif(is_writable($htaccess))
24
+		elseif (is_writable($htaccess))
25 25
 		{
26
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
26
+			$_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
27
+			if (!@file_put_contents($htaccess, $_))
28 28
 			{
29 29
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30 30
 			}
31 31
 		}
32 32
 	}
33
-	elseif(is_file($sample_htaccess))
33
+	elseif (is_file($sample_htaccess))
34 34
 	{
35
-		if(!@rename($sample_htaccess,$htaccess))
35
+		if (!@rename($sample_htaccess, $htaccess))
36 36
         {
37 37
         	$warnings[] = $_lang["settings_friendlyurls_alert"];
38 38
 		}
39
-		elseif($modx->config['base_url']!=='/')
39
+		elseif ($modx->config['base_url'] !== '/')
40 40
 		{
41 41
 			$_ = file_get_contents($htaccess);
42
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
42
+			$_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
43
+			if (!@file_put_contents($htaccess, $_))
44 44
 			{
45 45
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46 46
 			}
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 }
50 50
 
51
-if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
52
-    unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css');
51
+if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
52
+    unlink(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css');
53 53
 }
54 54
 
55
-$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']);
56
-$data['rb_base_dir']      = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']);
55
+$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']);
56
+$data['rb_base_dir']      = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']);
57 57
 
58 58
 if (isset($data) && count($data) > 0) {
59
-	if(isset($data['manager_language'])) {
60
-		$lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
-		if(is_file($lang_path)) {
59
+	if (isset($data['manager_language'])) {
60
+		$lang_path = MODX_MANAGER_PATH.'includes/lang/'.$data['manager_language'].'.inc.php';
61
+		if (is_file($lang_path)) {
62 62
 			include($lang_path);
63 63
             global $modx_lang_attribute;
64 64
             $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 	$savethese = array();
68 68
 	$data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']);
69
-	$data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
69
+	$data['mail_check_timeperiod'] = (int) $data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70 70
 	foreach ($data as $k => $v) {
71 71
 		switch ($k) {
72 72
 			case 'site_name':
73 73
 				$v = htmlspecialchars($v);
74 74
 				break;
75 75
             case 'settings_version':{
76
-                if($modx->getVersionData('version')!=$data['settings_version']){
77
-                    $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
76
+                if ($modx->getVersionData('version') != $data['settings_version']) {
77
+                    $modx->logEvent(17, 2, '<pre>'.var_export($data['settings_version'], true).'</pre>', 'fake settings_version');
78 78
                     $v = $modx->getVersionData('version');
79 79
                 }
80 80
                 break;
@@ -95,21 +95,21 @@  discard block
 block discarded – undo
95 95
 			case 'rb_base_url':
96 96
 			case 'filemanager_path':
97 97
 				$v = trim($v);
98
-				$v = rtrim($v,'/') . '/';
98
+				$v = rtrim($v, '/').'/';
99 99
 				break;
100 100
             case 'manager_language':
101
-                $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang');
102
-                $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php');
101
+                $langDir = realpath(MODX_MANAGER_PATH.'includes/lang');
102
+                $langFile = realpath(MODX_MANAGER_PATH.'includes/lang/'.$v.'.inc.php');
103 103
                 $langFileDir = dirname($langFile);
104
-                if($langDir !== $langFileDir || !file_exists($langFile)) {
104
+                if ($langDir !== $langFileDir || !file_exists($langFile)) {
105 105
                     $v = 'english';
106 106
                 }
107 107
 				break;
108 108
 			case 'smtppw':
109 109
 				if ($v !== '********************' && $v !== '') {
110 110
 					$v = trim($v);
111
-					$v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
-					$v = str_replace('=','%',$v);
111
+					$v = base64_encode($v).substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
+					$v = str_replace('=', '%', $v);
113 113
 				} elseif ($v === '********************') {
114 114
 					$k = '';
115 115
 				}
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 				$v = str_replace(array(' ,', ', '), ',', $v);
119 119
 				if ($v !== ',') {
120 120
 					$v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
-					$configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
-					@file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
121
+					$configString = '<?php'."\n".'define(\'MODX_SITE_HOSTNAMES\', \''.$v.'\');'."\n";
122
+					@file_put_contents(MODX_BASE_PATH.'assets/cache/siteHostnames.php', $configString);
123 123
 				}
124 124
 				$k = '';
125 125
 				break;
126 126
 			case 'session_timeout':
127 127
 				$mail_check_timeperiod = $data['mail_check_timeperiod'];
128
-				$v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
128
+				$v = (int) $v < ($data['mail_check_timeperiod'] / 60 + 1) ? ($data['mail_check_timeperiod'] / 60 + 1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129 129
 				break;
130 130
 			default:
131 131
 			break;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 		$modx->config[$k] = $v;
136 136
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
137
+		if (!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
138 138
 	}
139 139
 
140 140
 	// Run a single query to save all the values
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
 
145 145
 	// Reset Template Pages
146 146
 	if (isset($data['reset_template'])) {
147
-		$newtemplate = (int)$data['default_template'];
148
-		$oldtemplate = (int)$data['old_template'];
147
+		$newtemplate = (int) $data['default_template'];
148
+		$oldtemplate = (int) $data['old_template'];
149 149
 		$tbl = $modx->getFullTableName('site_content');
150 150
 		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
151
+		if ($reset == 1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
+		else if ($reset == 2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153 153
 	}
154 154
 
155 155
 	// empty cache
156 156
 	$modx->clearCache('full');
157 157
 }
158
-$header="Location: index.php?a=7&r=10";
158
+$header = "Location: index.php?a=7&r=10";
159 159
 header($header);
Please login to merge, or discard this patch.
Braces   +18 added lines, -25 removed lines patch added patch discarded remove patch
@@ -9,39 +9,27 @@  discard block
 block discarded – undo
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
10 10
 unset($_POST);
11 11
 
12
-if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
13
-{
12
+if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) {
14 13
 	$htaccess        = $modx->config['base_path'] . '.htaccess';
15 14
 	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16 15
 	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
18
-	{
16
+	if(is_file($htaccess)) {
19 17
 		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
21
-		{
18
+		if(strpos($_,'RewriteBase')===false) {
22 19
 			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23
-		}
24
-		elseif(is_writable($htaccess))
25
-		{
20
+		} elseif(is_writable($htaccess)) {
26 21
 			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
28
-			{
22
+			if(!@file_put_contents($htaccess,$_)) {
29 23
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30 24
 			}
31 25
 		}
32
-	}
33
-	elseif(is_file($sample_htaccess))
34
-	{
35
-		if(!@rename($sample_htaccess,$htaccess))
36
-        {
26
+	} elseif(is_file($sample_htaccess)) {
27
+		if(!@rename($sample_htaccess,$htaccess)) {
37 28
         	$warnings[] = $_lang["settings_friendlyurls_alert"];
38
-		}
39
-		elseif($modx->config['base_url']!=='/')
40
-		{
29
+		} elseif($modx->config['base_url']!=='/') {
41 30
 			$_ = file_get_contents($htaccess);
42 31
 			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
44
-			{
32
+			if(!@file_put_contents($htaccess,$_)) {
45 33
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46 34
 			}
47 35
 		}
@@ -73,7 +61,7 @@  discard block
 block discarded – undo
73 61
 				$v = htmlspecialchars($v);
74 62
 				break;
75 63
             case 'settings_version':{
76
-                if($modx->getVersionData('version')!=$data['settings_version']){
64
+                if($modx->getVersionData('version')!=$data['settings_version']) {
77 65
                     $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
78 66
                     $v = $modx->getVersionData('version');
79 67
                 }
@@ -134,7 +122,9 @@  discard block
 block discarded – undo
134 122
 
135 123
 		$modx->config[$k] = $v;
136 124
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
125
+		if(!empty($k)) {
126
+		    $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
127
+		}
138 128
 	}
139 129
 
140 130
 	// Run a single query to save all the values
@@ -148,8 +138,11 @@  discard block
 block discarded – undo
148 138
 		$oldtemplate = (int)$data['old_template'];
149 139
 		$tbl = $modx->getFullTableName('site_content');
150 140
 		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
141
+		if($reset==1) {
142
+		    $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
143
+		} else if($reset==2) {
144
+		    $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
145
+		}
153 146
 	}
154 147
 
155 148
 	// empty cache
Please login to merge, or discard this patch.
manager/processors/login.processor.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 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
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
242
+		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, null, $secure, true);
243 243
 	}
244 244
 } else {
245 245
 	$_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
Please login to merge, or discard this patch.
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3
-	header('HTTP/1.0 404 Not Found');
4
-	exit('error');
3
+    header('HTTP/1.0 404 Not Found');
4
+    exit('error');
5 5
 }
6 6
 define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 include_once("{$core_path}lang/english.inc.php");
17 17
 
18 18
 if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
19
-	include_once("{$core_path}lang/{$manager_language}.inc.php");
19
+    include_once("{$core_path}lang/{$manager_language}.inc.php");
20 20
 }
21 21
 
22 22
 // Initialize System Alert Message Queque
23 23
 if(!isset($_SESSION['SystemAlertMsgQueque'])) {
24
-	$_SESSION['SystemAlertMsgQueque'] = array();
24
+    $_SESSION['SystemAlertMsgQueque'] = array();
25 25
 }
26 26
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
27 27
 
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 
37 37
 // invoke OnBeforeManagerLogin event
38 38
 $modx->invokeEvent('OnBeforeManagerLogin', array(
39
-		'username' => $username,
40
-		'userpassword' => $givenPassword,
41
-		'rememberme' => $rememberme
42
-	));
39
+        'username' => $username,
40
+        'userpassword' => $givenPassword,
41
+        'rememberme' => $rememberme
42
+    ));
43 43
 $fields = 'mu.*, ua.*';
44 44
 $from = '[+prefix+]manager_users AS mu, [+prefix+]user_attributes AS ua';
45 45
 $where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id";
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 $limit = $modx->getDatabase()->getRecordCount($rs);
48 48
 
49 49
 if($limit == 0 || $limit > 1) {
50
-	jsAlert($_lang['login_processor_unknown_user']);
51
-	return;
50
+    jsAlert($_lang['login_processor_unknown_user']);
51
+    return;
52 52
 }
53 53
 
54 54
 $row = $modx->getDatabase()->getRow($rs);
@@ -69,127 +69,127 @@  discard block
 block discarded – undo
69 69
 // get the user settings from the database
70 70
 $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
71 71
 while($row = $modx->getDatabase()->getRow($rs)) {
72
-	extract($row);
73
-	${$setting_name} = $setting_value;
72
+    extract($row);
73
+    ${$setting_name} = $setting_value;
74 74
 }
75 75
 
76 76
 // blocked due to number of login errors.
77 77
 if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
78
-	@session_destroy();
79
-	session_unset();
80
-	if($cip = getenv("HTTP_CLIENT_IP")) {
81
-		$ip = $cip;
82
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
83
-		$ip = $cip;
84
-	} elseif($cip = getenv("REMOTE_ADDR")) {
85
-		$ip = $cip;
86
-	} else {
87
-		$ip = "UNKNOWN";
88
-	}
89
-	$log = new EvolutionCMS\Legacy\LogHandler();
90
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
91
-	jsAlert($_lang['login_processor_many_failed_logins']);
92
-	return;
78
+    @session_destroy();
79
+    session_unset();
80
+    if($cip = getenv("HTTP_CLIENT_IP")) {
81
+        $ip = $cip;
82
+    } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
83
+        $ip = $cip;
84
+    } elseif($cip = getenv("REMOTE_ADDR")) {
85
+        $ip = $cip;
86
+    } else {
87
+        $ip = "UNKNOWN";
88
+    }
89
+    $log = new EvolutionCMS\Legacy\LogHandler();
90
+    $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
91
+    jsAlert($_lang['login_processor_many_failed_logins']);
92
+    return;
93 93
 }
94 94
 
95 95
 // blocked due to number of login errors, but get to try again
96 96
 if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
97
-	$fields = array();
98
-	$fields['failedlogincount'] = '0';
99
-	$fields['blockeduntil'] = time() - 1;
100
-	$modx->getDatabase()->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
97
+    $fields = array();
98
+    $fields['failedlogincount'] = '0';
99
+    $fields['blockeduntil'] = time() - 1;
100
+    $modx->getDatabase()->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
101 101
 }
102 102
 
103 103
 // this user has been blocked by an admin, so no way he's loggin in!
104 104
 if($blocked == '1') {
105
-	@session_destroy();
106
-	session_unset();
107
-	jsAlert($_lang['login_processor_blocked1']);
108
-	return;
105
+    @session_destroy();
106
+    session_unset();
107
+    jsAlert($_lang['login_processor_blocked1']);
108
+    return;
109 109
 }
110 110
 
111 111
 // blockuntil: this user has a block until date
112 112
 if($blockeduntildate > time()) {
113
-	@session_destroy();
114
-	session_unset();
115
-	jsAlert($_lang['login_processor_blocked2']);
116
-	return;
113
+    @session_destroy();
114
+    session_unset();
115
+    jsAlert($_lang['login_processor_blocked2']);
116
+    return;
117 117
 }
118 118
 
119 119
 // blockafter: this user has a block after date
120 120
 if($blockedafterdate > 0 && $blockedafterdate < time()) {
121
-	@session_destroy();
122
-	session_unset();
123
-	jsAlert($_lang['login_processor_blocked3']);
124
-	return;
121
+    @session_destroy();
122
+    session_unset();
123
+    jsAlert($_lang['login_processor_blocked3']);
124
+    return;
125 125
 }
126 126
 
127 127
 // allowed ip
128 128
 if($allowed_ip) {
129
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
131
-			jsAlert($_lang['login_processor_remotehost_ip']);
132
-			return;
133
-		}
134
-	}
135
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
136
-		jsAlert($_lang['login_processor_remote_ip']);
137
-		return;
138
-	}
129
+    if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
+        if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
131
+            jsAlert($_lang['login_processor_remotehost_ip']);
132
+            return;
133
+        }
134
+    }
135
+    if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
136
+        jsAlert($_lang['login_processor_remote_ip']);
137
+        return;
138
+    }
139 139
 }
140 140
 
141 141
 // allowed days
142 142
 if($allowed_days) {
143
-	$date = getdate();
144
-	$day = $date['wday'] + 1;
145
-	if(!in_array($day,explode(',',$allowed_days))) {
146
-		jsAlert($_lang['login_processor_date']);
147
-		return;
148
-	}
143
+    $date = getdate();
144
+    $day = $date['wday'] + 1;
145
+    if(!in_array($day,explode(',',$allowed_days))) {
146
+        jsAlert($_lang['login_processor_date']);
147
+        return;
148
+    }
149 149
 }
150 150
 
151 151
 // invoke OnManagerAuthentication event
152 152
 $rt = $modx->invokeEvent('OnManagerAuthentication', array(
153
-		'userid' => $internalKey,
154
-		'username' => $username,
155
-		'userpassword' => $givenPassword,
156
-		'savedpassword' => $dbasePassword,
157
-		'rememberme' => $rememberme
158
-	));
153
+        'userid' => $internalKey,
154
+        'username' => $username,
155
+        'userpassword' => $givenPassword,
156
+        'savedpassword' => $dbasePassword,
157
+        'rememberme' => $rememberme
158
+    ));
159 159
 
160 160
 // check if plugin authenticated the user
161 161
 $matchPassword = false;
162 162
 if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
163
-	// check user password - local authentication
164
-	$hashType = $modx->getManagerApi()->getHashType($dbasePassword);
165
-	if($hashType == 'phpass') {
166
-		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
167
-	} elseif($hashType == 'md5') {
168
-		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
169
-	} elseif($hashType == 'v1') {
170
-		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171
-	} else {
172
-		$matchPassword = false;
173
-	}
163
+    // check user password - local authentication
164
+    $hashType = $modx->getManagerApi()->getHashType($dbasePassword);
165
+    if($hashType == 'phpass') {
166
+        $matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
167
+    } elseif($hashType == 'md5') {
168
+        $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
169
+    } elseif($hashType == 'v1') {
170
+        $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171
+    } else {
172
+        $matchPassword = false;
173
+    }
174 174
 } else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
175
-	$matchPassword = true;
175
+    $matchPassword = true;
176 176
 }
177 177
 
178 178
 if(!$matchPassword) {
179
-	jsAlert($_lang['login_processor_wrong_password']);
180
-	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
181
-	return;
179
+    jsAlert($_lang['login_processor_wrong_password']);
180
+    incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
181
+    return;
182 182
 }
183 183
 
184 184
 if($modx->config['use_captcha'] == 1) {
185
-	if(!isset ($_SESSION['veriword'])) {
186
-		jsAlert($_lang['login_processor_captcha_config']);
187
-		return;
188
-	} elseif($_SESSION['veriword'] != $captcha_code) {
189
-		jsAlert($_lang['login_processor_bad_code']);
190
-		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
191
-		return;
192
-	}
185
+    if(!isset ($_SESSION['veriword'])) {
186
+        jsAlert($_lang['login_processor_captcha_config']);
187
+        return;
188
+    } elseif($_SESSION['veriword'] != $captcha_code) {
189
+        jsAlert($_lang['login_processor_bad_code']);
190
+        incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
191
+        return;
192
+    }
193 193
 }
194 194
 
195 195
 $modx->cleanupExpiredLocks();
@@ -224,36 +224,36 @@  discard block
 block discarded – undo
224 224
 $_SESSION['mgrToken'] = md5($currentsessionid);
225 225
 
226 226
 if($rememberme == '1') {
227
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
228
-
229
-	// Set a cookie separate from the session cookie with the username in it.
230
-	// Are we using secure connection? If so, make sure the cookie is secure
231
-	global $https_port;
232
-
233
-	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
234
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
235
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
236
-	} else {
237
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
238
-	}
227
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
228
+
229
+    // Set a cookie separate from the session cookie with the username in it.
230
+    // Are we using secure connection? If so, make sure the cookie is secure
231
+    global $https_port;
232
+
233
+    $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
234
+    if(version_compare(PHP_VERSION, '5.2', '<')) {
235
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
236
+    } else {
237
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
238
+    }
239 239
 } else {
240
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
240
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
241 241
 
242
-	// Remove the Remember Me cookie
243
-	setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
242
+    // Remove the Remember Me cookie
243
+    setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
244 244
 }
245 245
 
246 246
 // Check if user already has an active session, if not check if user pressed logout end of last session
247 247
 $rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
248 248
 $activeSession = $modx->getDatabase()->getValue($rs);
249 249
 if(!$activeSession) {
250
-	$rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
251
-	if($lastHit = $modx->getDatabase()->getValue($rs)) {
252
-		$_SESSION['show_logout_reminder'] = array(
253
-			'type' => 'logout_reminder',
254
-			'lastHit' => $lastHit
255
-		);
256
-	}
250
+    $rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
251
+    if($lastHit = $modx->getDatabase()->getValue($rs)) {
252
+        $_SESSION['show_logout_reminder'] = array(
253
+            'type' => 'logout_reminder',
254
+            'lastHit' => $lastHit
255
+        );
256
+    }
257 257
 }
258 258
 
259 259
 $log = new EvolutionCMS\Legacy\LogHandler();
@@ -261,27 +261,27 @@  discard block
 block discarded – undo
261 261
 
262 262
 // invoke OnManagerLogin event
263 263
 $modx->invokeEvent('OnManagerLogin', array(
264
-		'userid' => $internalKey,
265
-		'username' => $username,
266
-		'userpassword' => $givenPassword,
267
-		'rememberme' => $rememberme
268
-	));
264
+        'userid' => $internalKey,
265
+        'username' => $username,
266
+        'userpassword' => $givenPassword,
267
+        'rememberme' => $rememberme
268
+    ));
269 269
 
270 270
 // check if we should redirect user to a web page
271 271
 $rs = $modx->getDatabase()->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
272 272
 $id = (int)$modx->getDatabase()->getValue($rs);
273 273
 if($id > 0) {
274
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
275
-	if($_POST['ajax'] == 1) {
276
-		echo $header;
277
-	} else {
278
-		header($header);
279
-	}
274
+    $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
275
+    if($_POST['ajax'] == 1) {
276
+        echo $header;
277
+    } else {
278
+        header($header);
279
+    }
280 280
 } else {
281
-	$header = 'Location: ' . MODX_MANAGER_URL;
282
-	if($_POST['ajax'] == 1) {
283
-		echo $header;
284
-	} else {
285
-		header($header);
286
-	}
281
+    $header = 'Location: ' . MODX_MANAGER_URL;
282
+    if($_POST['ajax'] == 1) {
283
+        echo $header;
284
+    } else {
285
+        header($header);
286
+    }
287 287
 }
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  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->getDatabase()->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 
13
-$core_path = MODX_MANAGER_PATH . 'includes/';
13
+$core_path = MODX_MANAGER_PATH.'includes/';
14 14
 // include_once the language file
15 15
 $_lang = array();
16 16
 include_once("{$core_path}lang/english.inc.php");
17 17
 
18
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
18
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
19 19
 	include_once("{$core_path}lang/{$manager_language}.inc.php");
20 20
 }
21 21
 
22 22
 // Initialize System Alert Message Queque
23
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
23
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
24 24
 	$_SESSION['SystemAlertMsgQueque'] = array();
25 25
 }
26 26
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 $rs = $modx->getDatabase()->select($fields, $from, $where);
47 47
 $limit = $modx->getDatabase()->getRecordCount($rs);
48 48
 
49
-if($limit == 0 || $limit > 1) {
49
+if ($limit == 0 || $limit > 1) {
50 50
 	jsAlert($_lang['login_processor_unknown_user']);
51 51
 	return;
52 52
 }
@@ -68,32 +68,32 @@  discard block
 block discarded – undo
68 68
 
69 69
 // get the user settings from the database
70 70
 $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
71
-while($row = $modx->getDatabase()->getRow($rs)) {
71
+while ($row = $modx->getDatabase()->getRow($rs)) {
72 72
 	extract($row);
73 73
 	${$setting_name} = $setting_value;
74 74
 }
75 75
 
76 76
 // blocked due to number of login errors.
77
-if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
77
+if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
78 78
 	@session_destroy();
79 79
 	session_unset();
80
-	if($cip = getenv("HTTP_CLIENT_IP")) {
80
+	if ($cip = getenv("HTTP_CLIENT_IP")) {
81 81
 		$ip = $cip;
82
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
82
+	} elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
83 83
 		$ip = $cip;
84
-	} elseif($cip = getenv("REMOTE_ADDR")) {
84
+	} elseif ($cip = getenv("REMOTE_ADDR")) {
85 85
 		$ip = $cip;
86 86
 	} else {
87 87
 		$ip = "UNKNOWN";
88 88
 	}
89 89
 	$log = new EvolutionCMS\Legacy\LogHandler();
90
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
90
+	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip);
91 91
 	jsAlert($_lang['login_processor_many_failed_logins']);
92 92
 	return;
93 93
 }
94 94
 
95 95
 // blocked due to number of login errors, but get to try again
96
-if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
96
+if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
97 97
 	$fields = array();
98 98
 	$fields['failedlogincount'] = '0';
99 99
 	$fields['blockeduntil'] = time() - 1;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 // this user has been blocked by an admin, so no way he's loggin in!
104
-if($blocked == '1') {
104
+if ($blocked == '1') {
105 105
 	@session_destroy();
106 106
 	session_unset();
107 107
 	jsAlert($_lang['login_processor_blocked1']);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 }
110 110
 
111 111
 // blockuntil: this user has a block until date
112
-if($blockeduntildate > time()) {
112
+if ($blockeduntildate > time()) {
113 113
 	@session_destroy();
114 114
 	session_unset();
115 115
 	jsAlert($_lang['login_processor_blocked2']);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 // blockafter: this user has a block after date
120
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
120
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
121 121
 	@session_destroy();
122 122
 	session_unset();
123 123
 	jsAlert($_lang['login_processor_blocked3']);
@@ -125,24 +125,24 @@  discard block
 block discarded – undo
125 125
 }
126 126
 
127 127
 // allowed ip
128
-if($allowed_ip) {
129
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
128
+if ($allowed_ip) {
129
+	if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
+		if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
131 131
 			jsAlert($_lang['login_processor_remotehost_ip']);
132 132
 			return;
133 133
 		}
134 134
 	}
135
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
135
+	if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
136 136
 		jsAlert($_lang['login_processor_remote_ip']);
137 137
 		return;
138 138
 	}
139 139
 }
140 140
 
141 141
 // allowed days
142
-if($allowed_days) {
142
+if ($allowed_days) {
143 143
 	$date = getdate();
144 144
 	$day = $date['wday'] + 1;
145
-	if(!in_array($day,explode(',',$allowed_days))) {
145
+	if (!in_array($day, explode(',', $allowed_days))) {
146 146
 		jsAlert($_lang['login_processor_date']);
147 147
 		return;
148 148
 	}
@@ -159,33 +159,33 @@  discard block
 block discarded – undo
159 159
 
160 160
 // check if plugin authenticated the user
161 161
 $matchPassword = false;
162
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
162
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
163 163
 	// check user password - local authentication
164 164
 	$hashType = $modx->getManagerApi()->getHashType($dbasePassword);
165
-	if($hashType == 'phpass') {
165
+	if ($hashType == 'phpass') {
166 166
 		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
167
-	} elseif($hashType == 'md5') {
167
+	} elseif ($hashType == 'md5') {
168 168
 		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
169
-	} elseif($hashType == 'v1') {
169
+	} elseif ($hashType == 'v1') {
170 170
 		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171 171
 	} else {
172 172
 		$matchPassword = false;
173 173
 	}
174
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
174
+} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
175 175
 	$matchPassword = true;
176 176
 }
177 177
 
178
-if(!$matchPassword) {
178
+if (!$matchPassword) {
179 179
 	jsAlert($_lang['login_processor_wrong_password']);
180 180
 	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
181 181
 	return;
182 182
 }
183 183
 
184
-if($modx->config['use_captcha'] == 1) {
185
-	if(!isset ($_SESSION['veriword'])) {
184
+if ($modx->config['use_captcha'] == 1) {
185
+	if (!isset ($_SESSION['veriword'])) {
186 186
 		jsAlert($_lang['login_processor_captcha_config']);
187 187
 		return;
188
-	} elseif($_SESSION['veriword'] != $captcha_code) {
188
+	} elseif ($_SESSION['veriword'] != $captcha_code) {
189 189
 		jsAlert($_lang['login_processor_bad_code']);
190 190
 		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
191 191
 		return;
@@ -213,25 +213,25 @@  discard block
 block discarded – undo
213 213
 $_SESSION['mgrPermissions'] = $modx->getDatabase()->getRow($rs);
214 214
 
215 215
 // successful login so reset fail count and update key values
216
-$modx->getDatabase()->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
216
+$modx->getDatabase()->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
217 217
 
218 218
 // get user's document groups
219 219
 $i = 0;
220
-$rs = $modx->getDatabase()->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
221
-		INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
220
+$rs = $modx->getDatabase()->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug
221
+		INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
222 222
 $_SESSION['mgrDocgroups'] = $modx->getDatabase()->getColumn('documentgroup', $rs);
223 223
 
224 224
 $_SESSION['mgrToken'] = md5($currentsessionid);
225 225
 
226
-if($rememberme == '1') {
227
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
226
+if ($rememberme == '1') {
227
+	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
228 228
 
229 229
 	// Set a cookie separate from the session cookie with the username in it.
230 230
 	// Are we using secure connection? If so, make sure the cookie is secure
231 231
 	global $https_port;
232 232
 
233 233
 	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
234
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
234
+	if (version_compare(PHP_VERSION, '5.2', '<')) {
235 235
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
236 236
 	} else {
237 237
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 // Check if user already has an active session, if not check if user pressed logout end of last session
247 247
 $rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
248 248
 $activeSession = $modx->getDatabase()->getValue($rs);
249
-if(!$activeSession) {
249
+if (!$activeSession) {
250 250
 	$rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
251
-	if($lastHit = $modx->getDatabase()->getValue($rs)) {
251
+	if ($lastHit = $modx->getDatabase()->getValue($rs)) {
252 252
 		$_SESSION['show_logout_reminder'] = array(
253 253
 			'type' => 'logout_reminder',
254 254
 			'lastHit' => $lastHit
@@ -269,17 +269,17 @@  discard block
 block discarded – undo
269 269
 
270 270
 // check if we should redirect user to a web page
271 271
 $rs = $modx->getDatabase()->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
272
-$id = (int)$modx->getDatabase()->getValue($rs);
273
-if($id > 0) {
274
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
275
-	if($_POST['ajax'] == 1) {
272
+$id = (int) $modx->getDatabase()->getValue($rs);
273
+if ($id > 0) {
274
+	$header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
275
+	if ($_POST['ajax'] == 1) {
276 276
 		echo $header;
277 277
 	} else {
278 278
 		header($header);
279 279
 	}
280 280
 } else {
281
-	$header = 'Location: ' . MODX_MANAGER_URL;
282
-	if($_POST['ajax'] == 1) {
281
+	$header = 'Location: '.MODX_MANAGER_URL;
282
+	if ($_POST['ajax'] == 1) {
283 283
 		echo $header;
284 284
 	} else {
285 285
 		header($header);
Please login to merge, or discard this patch.
manager/frames/1.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -236,9 +236,9 @@
 block discarded – undo
236 236
         lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?>
237 237
       };
238 238
       <?php
239
-      $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
240
-      echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
241
-      ?>
239
+        $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
240
+        echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
241
+        ?>
242 242
     </script>
243 243
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
244 244
     <?php if ($modx->config['show_picker'] != "0") { ?>
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 header("X-XSS-Protection: 0");
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49 49
 if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50
-    $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
50
+    $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']];
51 51
 } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52
-    $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
52
+    $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
@@ -82,36 +82,36 @@  discard block
 block discarded – undo
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85
-$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
85
+$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime;
86 86
 
87 87
 if ($modx->config['manager_theme'] == 'default') {
88
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
89
-        require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
88
+    if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) {
89
+        require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
92
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css');
93
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css');
94
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css');
95
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css');
96
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css');
97
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css');
98
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css');
99
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css');
100
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css');
101
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css');
91
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css');
92
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css');
93
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css');
94
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css');
95
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css');
96
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css');
97
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css');
98
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css');
99
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css');
100
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css');
101
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css');
102 102
         $css = $minifier->minify();
103
-        file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
103
+        file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css);
104 104
     }
105
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
106
-        $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
105
+    if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
106
+        $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime;
107 107
     }
108 108
 }
109 109
 
110
-$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
110
+$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
111 111
 
112 112
 ?>
113 113
 <!DOCTYPE html>
114
-<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>>
114
+<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>>
115 115
 <head>
116 116
     <title><?= $site_name ?>- (EVO CMS Manager)</title>
117 117
     <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" />
@@ -142,21 +142,21 @@  discard block
 block discarded – undo
142 142
         MODX_SITE_URL: '<?= MODX_SITE_URL ?>',
143 143
         MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>',
144 144
         user: {
145
-          role: <?= (int)$user['role'] ?>,
145
+          role: <?= (int) $user['role'] ?>,
146 146
           username: '<?= $user['username'] ?>'
147 147
         },
148 148
         config: {
149 149
           mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>,
150
-          menu_height: <?= (int)$menu_height ?>,
151
-          tree_width: <?= (int)$tree_width ?>,
152
-          tree_min_width: <?= (int)$tree_min_width ?>,
153
-          session_timeout: <?= (int)$modx->config['session_timeout'] ?>,
154
-          site_start: <?= (int)$modx->config['site_start'] ?>,
155
-          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>,
150
+          menu_height: <?= (int) $menu_height ?>,
151
+          tree_width: <?= (int) $tree_width ?>,
152
+          tree_min_width: <?= (int) $tree_min_width ?>,
153
+          session_timeout: <?= (int) $modx->config['session_timeout'] ?>,
154
+          site_start: <?= (int) $modx->config['site_start'] ?>,
155
+          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>,
156 156
           theme: '<?= $modx->config['manager_theme'] ?>',
157 157
           theme_mode: '<?= $modx->config['manager_theme_mode'] ?>',
158 158
           which_browser: '<?= $user['which_browser'] ?>',
159
-          layout: <?= (int)$manager_layout ?>,
159
+          layout: <?= (int) $manager_layout ?>,
160 160
           textdir: '<?= $modx_textdir ?>',
161 161
           global_tabs: <?= $modx->config['global_tabs'] ?>
162 162
 
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
           delete a[b];
242 242
         },
243 243
         openedArray: [],
244
-        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?>
244
+        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?>
245 245
       };
246 246
       <?php
247 247
       $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
248
-      echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
248
+      echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n		modx.openedArray[", $opened).'] = 1;')."\n";
249 249
       ?>
250 250
     </script>
251 251
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                             <a href="javascript:;" class="dropdown-toggle" onclick="return false;">
328 328
                                 <span class="username"><?= $user['username'] ?></span>
329 329
                                 <?php if ($user['photo']) { ?>
330
-                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span>
330
+                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span>
331 331
                                 <?php } else { ?>
332 332
                                     <span class="icon"><?= $_style['menu_user'] ?></span>
333 333
                                 <?php } ?>
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                                 $version = 'Evolution';
355 355
                                 ?>
356 356
                                 <?php
357
-                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>' . $version . ' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
357
+                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>'.$version.' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
358 358
                                 ?>
359 359
                             </ul>
360 360
                         </li>
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
     </div>
536 536
 
537 537
     <?php
538
-    if(!function_exists('constructLink')) {
538
+    if (!function_exists('constructLink')) {
539 539
         /**
540 540
          * @param string $action
541 541
          * @param string $img
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
          */
545 545
         function constructLink($action, $img, $text, $allowed)
546 546
         {
547
-            if ((bool)$allowed) {
547
+            if ((bool) $allowed) {
548 548
                 echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action,
549 549
                     $action);
550 550
                 echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
     <script type="text/javascript">
558 558
 
559 559
       if (document.getElementById('treeMenu')) {
560
-          <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
560
+          <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
561 561
 
562 562
         document.getElementById('treeMenu_openelements').onclick = function(e) {
563 563
           e.preventDefault();
@@ -575,12 +575,12 @@  discard block
 block discarded – undo
575 575
           }
576 576
         };
577 577
           <?php } ?>
578
-          <?php if($use_browser && $modx->hasPermission('assets_images')) { ?>
578
+          <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?>
579 579
 
580 580
         document.getElementById('treeMenu_openimages').onclick = function(e) {
581 581
           e.preventDefault();
582 582
           if (modx.config.global_tabs && !e.shiftKey) {
583
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
583
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
584 584
           } else {
585 585
             var randomNum = '<?= $_lang["files_files"] ?>';
586 586
             if (e.shiftKey) {
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
           }
594 594
         };
595 595
           <?php } ?>
596
-          <?php if($use_browser && $modx->hasPermission('assets_files')) { ?>
596
+          <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?>
597 597
 
598 598
         document.getElementById('treeMenu_openfiles').onclick = function(e) {
599 599
           e.preventDefault();
600 600
           if (modx.config.global_tabs && !e.shiftKey) {
601
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
601
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
602 602
           } else {
603 603
             var randomNum = '<?= $_lang["files_files"] ?>';
604 604
             if (e.shiftKey) {
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 
653 653
 </div>
654 654
 <?php if ($modx->config['show_picker'] != "0") {
655
-    include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
655
+    include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php');
656 656
 } ?>
657 657
 </body>
658 658
 </html>
Please login to merge, or discard this patch.
Braces   +32 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 header("X-XSS-Protection: 0");
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
11 11
 
12 12
 $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
13 13
 
14
-if (!isset($modx->config['manager_menu_height'])) {
14
+if (!isset($modx->config['manager_menu_height'])) {
15 15
     $modx->config['manager_menu_height'] = 2.2; // rem
16 16
 }
17 17
 
18
-if (!isset($modx->config['manager_tree_width'])) {
18
+if (!isset($modx->config['manager_tree_width'])) {
19 19
     $modx->config['manager_tree_width'] = 20; // rem
20 20
 }
21 21
 
22
-if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
22
+if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
23 23
     $initMainframeAction = $_SESSION['onLoginForwardToAction'];
24 24
     unset($_SESSION['onLoginForwardToAction']);
25
-} else {
25
+} else {
26 26
     $initMainframeAction = 2; // welcome.static
27 27
 }
28 28
 
29
-if (!isset($_SESSION['tree_show_only_folders'])) {
29
+if (!isset($_SESSION['tree_show_only_folders'])) {
30 30
     $_SESSION['tree_show_only_folders'] = 0;
31 31
 }
32 32
 
@@ -35,29 +35,29 @@  discard block
 block discarded – undo
35 35
 $tree_width = $modx->config['manager_tree_width'];
36 36
 $tree_min_width = 0;
37 37
 
38
-if (isset($_COOKIE['MODX_widthSideBar'])) {
38
+if (isset($_COOKIE['MODX_widthSideBar'])) {
39 39
     $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar'];
40
-} else {
40
+} else {
41 41
     $MODX_widthSideBar = $tree_width;
42 42
 }
43 43
 
44
-if (!$MODX_widthSideBar) {
44
+if (!$MODX_widthSideBar) {
45 45
     $body_class .= 'sidebar-closed';
46 46
 }
47 47
 
48 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49
-if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
49
+if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50 50
     $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
51
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
51
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52 52
     $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
56
-if ($navbar_position == 'left') {
56
+if ($navbar_position == 'left') {
57 57
     $body_class .= ' navbar-left navbar-left-icon-and-text';
58 58
 }
59 59
 
60
-if (isset($modx->pluginCache['ElementsInTree'])) {
60
+if (isset($modx->pluginCache['ElementsInTree'])) {
61 61
     $body_class .= ' ElementsInTree';
62 62
 }
63 63
 
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
     'type8' => $_lang["lock_element_type_8"]
74 74
 );
75 75
 
76
-foreach ($unlockTranslations as $key => $value) {
76
+foreach ($unlockTranslations as $key => $value) {
77 77
     $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
78 78
 }
79 79
 
80 80
 $user = $modx->getUserInfo($modx->getLoginUserID());
81
-if ($user['which_browser'] == 'default') {
81
+if ($user['which_browser'] == 'default') {
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85 85
 $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
86 86
 
87
-if ($modx->config['manager_theme'] == 'default') {
88
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
87
+if ($modx->config['manager_theme'] == 'default') {
88
+    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
89 89
         require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91 91
         $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $css = $minifier->minify();
103 103
         file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
104 104
     }
105
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
105
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
106 106
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
107 107
     }
108 108
 }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     <?php
258 258
     // invoke OnManagerTopPrerender event
259 259
     $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST);
260
-    if (is_array($evtOut)) {
260
+    if (is_array($evtOut)) {
261 261
         echo implode("\n", $evtOut);
262 262
     }
263 263
     ?>
@@ -428,11 +428,14 @@  discard block
 block discarded – undo
428 428
             <div id="evo-tab-page-home" class="evo-tab-page show iframe-scroller">
429 429
                 <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
430 430
             </div>
431
-        <?php else: ?>
431
+        <?php else {
432
+    : ?>
432 433
             <div class="iframe-scroller">
433 434
                 <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
434 435
             </div>
435
-        <?php endif; ?>
436
+        <?php endif;
437
+}
438
+?>
436 439
         <script>
437 440
             if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
438 441
                 document.getElementById('mainframe').setAttribute('scrolling', 'no');
@@ -451,11 +454,11 @@  discard block
 block discarded – undo
451 454
             'tree_sortdir',
452 455
             'tree_nodename'
453 456
         );
454
-        foreach ($sortParams as $param) {
455
-            if (isset($_REQUEST[$param])) {
457
+        foreach ($sortParams as $param) {
458
+            if (isset($_REQUEST[$param])) {
456 459
                 $modx->getManagerApi()->saveLastUserSetting($param, $_REQUEST[$param]);
457 460
                 $_SESSION[$param] = $_REQUEST[$param];
458
-            } else if (!isset($_SESSION[$param])) {
461
+            } else if (!isset($_SESSION[$param])) {
459 462
                 $_SESSION[$param] = $modx->getManagerApi()->getLastUserSetting($param);
460 463
             }
461 464
         }
@@ -506,16 +509,16 @@  discard block
 block discarded – undo
506 509
     </div>
507 510
 
508 511
     <?php
509
-    if(!function_exists('constructLink')) {
512
+    if(!function_exists('constructLink')) {
510 513
         /**
511 514
          * @param string $action
512 515
          * @param string $img
513 516
          * @param string $text
514 517
          * @param bool $allowed
515 518
          */
516
-        function constructLink($action, $img, $text, $allowed)
517
-        {
518
-            if ((bool)$allowed) {
519
+        function constructLink($action, $img, $text, $allowed)
520
+        {
521
+            if ((bool)$allowed) {
519 522
                 echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action,
520 523
                     $action);
521 524
                 echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
@@ -650,7 +653,7 @@  discard block
 block discarded – undo
650 653
     ?>
651 654
 
652 655
 </div>
653
-<?php if ($modx->config['show_picker'] != "0") {
656
+<?php if ($modx->config['show_picker'] != "0") {
654 657
     include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
655 658
 } ?>
656 659
 </body>
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/types/type_img.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** This file is part of KCFinder project
4
-  *
5
-  *      @desc Image detection class
6
-  *   @package KCFinder
7
-  *   @version 2.54
8
-  *    @author Pavel Tzonkov <[email protected]>
9
-  * @copyright 2010-2014 KCFinder Project
10
-  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
-  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
-  *      @link http://kcfinder.sunhater.com
13
-  */
4
+ *
5
+ *      @desc Image detection class
6
+ *   @package KCFinder
7
+ *   @version 2.54
8
+ *    @author Pavel Tzonkov <[email protected]>
9
+ * @copyright 2010-2014 KCFinder Project
10
+ *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
+ *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
+ *      @link http://kcfinder.sunhater.com
13
+ */
14 14
 
15 15
 class type_img {
16 16
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_img {
15
+class type_img{
16 16
 
17
-    public function checkFile($file, array $config) {
17
+    public function checkFile($file, array $config){
18 18
 
19 19
         $driver = isset($config['imageDriversPriority'])
20 20
             ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd";
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,17 +12,20 @@
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_img {
15
+class type_img
16
+{
16 17
 
17
-    public function checkFile($file, array $config) {
18
+    public function checkFile($file, array $config)
19
+    {
18 20
 
19 21
         $driver = isset($config['imageDriversPriority'])
20 22
             ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd";
21 23
 
22 24
         $img = image::factory($driver, $file);
23 25
 
24
-        if ($img->initError)
25
-            return "Unknown image format/encoding.";
26
+        if ($img->initError) {
27
+                    return "Unknown image format/encoding.";
28
+        }
26 29
 
27 30
         return true;
28 31
     }
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/types/type_mime.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** This file is part of KCFinder project
4
-  *
5
-  *      @desc MIME type detection class
6
-  *   @package KCFinder
7
-  *   @version 2.54
8
-  *    @author Pavel Tzonkov <[email protected]>
9
-  * @copyright 2010-2014 KCFinder Project
10
-  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
-  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
-  *      @link http://kcfinder.sunhater.com
13
-  */
4
+ *
5
+ *      @desc MIME type detection class
6
+ *   @package KCFinder
7
+ *   @version 2.54
8
+ *    @author Pavel Tzonkov <[email protected]>
9
+ * @copyright 2010-2014 KCFinder Project
10
+ *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
+ *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
+ *      @link http://kcfinder.sunhater.com
13
+ */
14 14
 
15 15
 class type_mime {
16 16
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_mime {
15
+class type_mime{
16 16
 
17
-    public function checkFile($file, array $config) {
17
+    public function checkFile($file, array $config){
18 18
         if (!class_exists("finfo"))
19 19
             return "Fileinfo PECL extension is missing.";
20 20
 
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
         $mimes = $config['params'];
34 34
         if (substr($mimes, 0, 1) == "!") {
35 35
             $mimes = trim(substr($mimes, 1));
36
-            return in_array($type , explode(" ", $mimes))
36
+            return in_array($type, explode(" ", $mimes))
37 37
                 ? "You can't upload such files."
38 38
                 : true;
39 39
         }
40 40
 
41
-        return !in_array($type , explode(" ", $mimes))
41
+        return !in_array($type, explode(" ", $mimes))
42 42
             ? "You can't upload such files."
43 43
             : true;
44 44
     }
Please login to merge, or discard this patch.
Braces   +13 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,20 +12,25 @@
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_mime {
15
+class type_mime
16
+{
16 17
 
17
-    public function checkFile($file, array $config) {
18
-        if (!class_exists("finfo"))
19
-            return "Fileinfo PECL extension is missing.";
18
+    public function checkFile($file, array $config)
19
+    {
20
+        if (!class_exists("finfo")) {
21
+                    return "Fileinfo PECL extension is missing.";
22
+        }
20 23
 
21
-        if (!isset($config['params']))
22
-            return "Undefined MIME types.";
24
+        if (!isset($config['params'])) {
25
+                    return "Undefined MIME types.";
26
+        }
23 27
 
24 28
         $finfo = strlen($config['mime_magic'])
25 29
             ? new finfo(FILEINFO_MIME, $config['mime_magic'])
26 30
             : new finfo(FILEINFO_MIME);
27
-        if (!$finfo)
28
-            return "Opening fileinfo database failed.";
31
+        if (!$finfo) {
32
+                    return "Opening fileinfo database failed.";
33
+        }
29 34
 
30 35
         $type = $finfo->file($file);
31 36
         $type = substr($type, 0, strrpos($type, ";"));
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/autoload.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** This file is part of KCFinder project
4
-  *
5
-  *      @desc This file is included first, before each other
6
-  *   @package KCFinder
7
-  *   @version 2.54
8
-  *    @author Pavel Tzonkov <[email protected]>
9
-  * @copyright 2010-2014 KCFinder Project
10
-  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
-  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
-  *      @link http://kcfinder.sunhater.com
13
-  *
14
-  * This file is the place you can put any code (at the end of the file),
15
-  * which will be executed before any other. Suitable for:
16
-  *     1. Set PHP ini settings using ini_set()
17
-  *     2. Custom session save handler with session_set_save_handler()
18
-  *     3. Any custom integration code. If you use any global variables
19
-  *        here, they can be accessed in config.php via $GLOBALS array.
20
-  *        It's recommended to use constants instead.
21
-  */
4
+ *
5
+ *      @desc This file is included first, before each other
6
+ *   @package KCFinder
7
+ *   @version 2.54
8
+ *    @author Pavel Tzonkov <[email protected]>
9
+ * @copyright 2010-2014 KCFinder Project
10
+ *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
+ *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
+ *      @link http://kcfinder.sunhater.com
13
+ *
14
+ * This file is the place you can put any code (at the end of the file),
15
+ * which will be executed before any other. Suitable for:
16
+ *     1. Set PHP ini settings using ini_set()
17
+ *     2. Custom session save handler with session_set_save_handler()
18
+ *     3. Any custom integration code. If you use any global variables
19
+ *        here, they can be accessed in config.php via $GLOBALS array.
20
+ *        It's recommended to use constants instead.
21
+ */
22 22
 include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php");
23 23
 require_once('../../../includes/protect.inc.php');
24 24
 include_once('../../../includes/config.inc.php');
Please login to merge, or discard this patch.
Braces   +25 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,17 +41,20 @@  discard block
 block discarded – undo
41 41
 $_GET['langCode'] = $modx_lang_attribute;
42 42
 
43 43
 // PHP VERSION CHECK
44
-if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5)
44
+if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) {
45 45
     die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution.");
46
+}
46 47
 
47 48
 
48 49
 // SAFE MODE CHECK
49
-if (ini_get("safe_mode"))
50
+if (ini_get("safe_mode")) {
50 51
     die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode.");
52
+}
51 53
 
52 54
 
53 55
 // MAGIC AUTOLOAD CLASSES FUNCTION
54
-function autoloadda9d06472ccb71b84928677ce2a6ca89($class) {
56
+function autoloadda9d06472ccb71b84928677ce2a6ca89($class)
57
+{
55 58
     static $classes = null;
56 59
     if ($classes === null) {
57 60
         $classes = array(
@@ -84,7 +87,8 @@  discard block
 block discarded – undo
84 87
 // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING
85 88
 if (!function_exists("json_encode")) {
86 89
 
87
-    function kcfinder_json_string_encode($string) {
90
+    function kcfinder_json_string_encode($string)
91
+    {
88 92
         return '"' .
89 93
             str_replace('/', "\\/",
90 94
             str_replace("\t", "\\t",
@@ -95,37 +99,43 @@  discard block
 block discarded – undo
95 99
         $string)))))) . '"';
96 100
     }
97 101
 
98
-    function json_encode($data) {
102
+    function json_encode($data)
103
+    {
99 104
 
100 105
         if (is_array($data)) {
101 106
             $ret = array();
102 107
 
103 108
             // OBJECT
104 109
             if (array_keys($data) !== range(0, count($data) - 1)) {
105
-                foreach ($data as $key => $val)
106
-                    $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val);
110
+                foreach ($data as $key => $val) {
111
+                                    $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val);
112
+                }
107 113
                 return "{" . implode(",", $ret) . "}";
108 114
 
109 115
             // ARRAY
110 116
             } else {
111
-                foreach ($data as $val)
112
-                    $ret[] = json_encode($val);
117
+                foreach ($data as $val) {
118
+                                    $ret[] = json_encode($val);
119
+                }
113 120
                 return "[" . implode(",", $ret) . "]";
114 121
             }
115 122
 
116 123
         // BOOLEAN OR NULL
117
-        } elseif (is_bool($data) || ($data === null))
118
-            return ($data === null)
124
+        } elseif (is_bool($data) || ($data === null)) {
125
+                    return ($data === null)
119 126
                 ? "null"
120 127
                 : ($data ? "true" : "false");
128
+        }
121 129
 
122 130
         // FLOAT
123
-        elseif (is_float($data))
124
-            return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), ".");
131
+        elseif (is_float($data)) {
132
+                    return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), ".");
133
+        }
125 134
 
126 135
         // INTEGER
127
-        elseif (is_int($data))
128
-            return $data;
136
+        elseif (is_int($data)) {
137
+                    return $data;
138
+        }
129 139
 
130 140
         // STRING
131 141
         return kcfinder_json_string_encode($data);
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $modx = evolutionCMS();
27 27
 $modx->getDatabase()->connect();
28 28
 startCMSSession();
29
-if(!isset($_SESSION['mgrValidated'])) {
29
+if (!isset($_SESSION['mgrValidated'])) {
30 30
         die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
31 31
 }
32 32
 define('IN_MANAGER_MODE', true);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 $manager_language = $modx->config['manager_language'];
36 36
 // Pass language code from MODX to KCFinder
37
-if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
37
+if (!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
38 38
     $manager_language = "english"; // if not set, get the english language file.
39 39
 }
40 40
 include_once "../../../includes/lang/".$manager_language.".inc.php";
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 // PHP VERSION CHECK
44 44
 if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5)
45
-    die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution.");
45
+    die("You are using PHP ".PHP_VERSION." when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution.");
46 46
 
47 47
 
48 48
 // SAFE MODE CHECK
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 
53 53
 // MAGIC AUTOLOAD CLASSES FUNCTION
54
-function autoloadda9d06472ccb71b84928677ce2a6ca89($class) {
54
+function autoloadda9d06472ccb71b84928677ce2a6ca89($class){
55 55
     static $classes = null;
56 56
     if ($classes === null) {
57 57
         $classes = array(
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         );
76 76
     }
77 77
     if (isset($classes[$class])) {
78
-        require dirname(__FILE__) . $classes[$class];
78
+        require dirname(__FILE__).$classes[$class];
79 79
     }
80 80
 }
81 81
 spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true);
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
 // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING
85 85
 if (!function_exists("json_encode")) {
86 86
 
87
-    function kcfinder_json_string_encode($string) {
88
-        return '"' .
87
+    function kcfinder_json_string_encode($string){
88
+        return '"'.
89 89
             str_replace('/', "\\/",
90 90
             str_replace("\t", "\\t",
91 91
             str_replace("\r", "\\r",
92 92
             str_replace("\n", "\\n",
93 93
             str_replace('"', "\\\"",
94 94
             str_replace("\\", "\\\\",
95
-        $string)))))) . '"';
95
+        $string)))))).'"';
96 96
     }
97 97
 
98
-    function json_encode($data) {
98
+    function json_encode($data){
99 99
 
100 100
         if (is_array($data)) {
101 101
             $ret = array();
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
             // OBJECT
104 104
             if (array_keys($data) !== range(0, count($data) - 1)) {
105 105
                 foreach ($data as $key => $val)
106
-                    $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val);
107
-                return "{" . implode(",", $ret) . "}";
106
+                    $ret[] = kcfinder_json_string_encode($key).':'.json_encode($val);
107
+                return "{".implode(",", $ret)."}";
108 108
 
109 109
             // ARRAY
110 110
             } else {
111 111
                 foreach ($data as $val)
112 112
                     $ret[] = json_encode($val);
113
-                return "[" . implode(",", $ret) . "]";
113
+                return "[".implode(",", $ret)."]";
114 114
             }
115 115
 
116 116
         // BOOLEAN OR NULL
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/tpl/tpl_css.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1
-<link href="css.php?type=<?php echo $this->type ?><?php echo ($this->cms ? "&amp;cms={$this->cms}" : "" ) ?>" rel="stylesheet" type="text/css" />
1
+<link href="css.php?type=<?php echo $this->type ?><?php echo ($this->cms ? "&amp;cms={$this->cms}" : "") ?>" rel="stylesheet" type="text/css" />
2 2
 <link href="themes/<?php echo $this->config['theme'] ?>/style.css" rel="stylesheet" type="text/css" />
Please login to merge, or discard this patch.