Completed
Pull Request — develop (#537)
by Agel_Nash
05:20
created
manager/includes/extenders/ex_phpass.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')) {
12
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/phpass.class.inc.php')) {
13 13
     return false;
14 14
 } else {
15 15
     $this->phpass = new PasswordHash;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_maketable.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * Time: 14:38
6 6
  */
7 7
 
8
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/maketable.class.php') {
8
+if (!include_once MODX_MANAGER_PATH.'includes/extenders/maketable.class.php') {
9 9
     return false;
10 10
 } else {
11 11
     $this->table = new MakeTable;
Please login to merge, or discard this patch.
manager/includes/extenders/phpass.class.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
         $this->portable_hashes = $portable_hashes;
50 50
 
51
-        $this->random_state = microtime() . uniqid(mt_rand(), true);
51
+        $this->random_state = microtime().uniqid(mt_rand(), true);
52 52
     }
53 53
 
54 54
     /**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $output = '';
69 69
             for ($i = 0; $i < $count; $i += 16) {
70 70
                 $this->random_state =
71
-                    md5(microtime() . $this->random_state);
71
+                    md5(microtime().$this->random_state);
72 72
                 $output .=
73 73
                     pack('H*', md5($this->random_state));
74 74
             }
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
         // consequently in lower iteration counts and hashes that are
161 161
         // quicker to crack (by non-PHP code).
162 162
 
163
-        $hash = md5($salt . $password, true);
163
+        $hash = md5($salt.$password, true);
164 164
         do {
165
-            $hash = md5($hash . $password, true);
165
+            $hash = md5($hash.$password, true);
166 166
         } while (--$count);
167 167
 
168 168
         $output = substr($setting, 0, 12);
Please login to merge, or discard this patch.
manager/includes/extenders/deprecated.functions.inc.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
         for ($i = 0; $i < $tablevel; $i++) {
119 119
             $tabs .= "\t";
120 120
         }
121
-        $listhtml = $ordered == true ? $tabs . "<ol class='$ulroot'$typestr>\n" : $tabs . "<ul class='$ulroot'$typestr>\n";
121
+        $listhtml = $ordered == true ? $tabs."<ol class='$ulroot'$typestr>\n" : $tabs."<ul class='$ulroot'$typestr>\n";
122 122
         foreach ($array as $key => $value) {
123 123
             if (is_array($value)) {
124
-                $listhtml .= $tabs . "\t<li>" . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix,
125
-                        $type, $ordered, $tablevel + 2) . $tabs . "\t</li>\n";
124
+                $listhtml .= $tabs."\t<li>".$key."\n".$this->makeList($value, $ulprefix.$ulroot, $ulprefix,
125
+                        $type, $ordered, $tablevel + 2).$tabs."\t</li>\n";
126 126
             } else {
127
-                $listhtml .= $tabs . "\t<li>" . $value . "</li>\n";
127
+                $listhtml .= $tabs."\t<li>".$value."</li>\n";
128 128
             }
129 129
         }
130
-        $listhtml .= $ordered == true ? $tabs . "</ol>\n" : $tabs . "</ul>\n";
130
+        $listhtml .= $ordered == true ? $tabs."</ol>\n" : $tabs."</ul>\n";
131 131
 
132 132
         return $listhtml;
133 133
     }
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
         $msg = addslashes($modx->db->escape($msg));
299 299
         if (substr(strtolower($url), 0, 11) == "javascript:") {
300 300
             $act = "__WebAlert();";
301
-            $fnc = "function __WebAlert(){" . substr($url, 11) . "};";
301
+            $fnc = "function __WebAlert(){".substr($url, 11)."};";
302 302
         } else {
303
-            $act = ($url ? "window.location.href='" . addslashes($url) . "';" : "");
303
+            $act = ($url ? "window.location.href='".addslashes($url)."';" : "");
304 304
         }
305 305
         $html = "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>";
306 306
         if ($modx->isFrontend()) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,8 @@
 block discarded – undo
177 177
      * @return bool|string
178 178
      */
179 179
     public function putChunk($chunkName)
180
-    { // alias name >.<
180
+    {
181
+// alias name >.<
181 182
         global $modx;
182 183
 
183 184
         return $modx->getChunk($chunkName);
Please login to merge, or discard this patch.
manager/includes/extenders/ex_modifiers.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
     return true;
10 10
 }
11 11
 
12
-include_once(MODX_MANAGER_PATH . 'includes/extenders/modifiers.class.inc.php');
12
+include_once(MODX_MANAGER_PATH.'includes/extenders/modifiers.class.inc.php');
13 13
 $this->filter = new MODIFIERS;
14 14
 return true;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_managerapi.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * Time: 14:16
6 6
  */
7 7
 
8
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php') {
8
+if (!include_once MODX_MANAGER_PATH.'includes/extenders/manager.api.class.inc.php') {
9 9
     return false;
10 10
 } else {
11 11
     $this->manager = new ManagerAPI;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_modxmailer.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * Time: 14:17
7 7
  */
8 8
 
9
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php')) {
9
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/modxmailer.class.inc.php')) {
10 10
     return false;
11 11
 } else {
12 12
     $this->mail = new MODxMailer;
Please login to merge, or discard this patch.
manager/includes/accesscontrol.inc.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
 }
19 19
 
20 20
 // andrazk 20070416 - if installer is running, destroy active sessions
21
-if (file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) {
22
-    include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
21
+if (file_exists(MODX_BASE_PATH.'assets/cache/installProc.inc.php')) {
22
+    include_once(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
23 23
     if (isset($installStartTime)) {
24 24
         if ((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard
25 25
             unset($installStartTime);
26
-            @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755);
27
-            unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
26
+            @ chmod(MODX_BASE_PATH.'assets/cache/installProc.inc.php', 0755);
27
+            unlink(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
28 28
         } else {
29 29
             if ($_SERVER['REQUEST_METHOD'] != 'POST') {
30 30
                 if (isset($_COOKIE[session_name()])) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                         //						setcookie(session_name(), '', 0, MODX_BASE_URL);
51 51
                     }
52 52
                     header('HTTP/1.0 307 Redirect');
53
-                    header('Location: ' . MODX_MANAGER_URL . 'index.php?installGoingOn=2');
53
+                    header('Location: '.MODX_MANAGER_URL.'index.php?installGoingOn=2');
54 54
                 }
55 55
             }
56 56
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         // establish fallback to English default
63 63
         include_once "lang/english.inc.php";
64 64
         // include localized overrides
65
-        include_once "lang/" . $manager_language . ".inc.php";
65
+        include_once "lang/".$manager_language.".inc.php";
66 66
     } else {
67 67
         include_once "lang/english.inc.php";
68 68
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     $modx->setPlaceholder('modx_charset', $modx_manager_charset);
71 71
     $modx->setPlaceholder('theme', $manager_theme);
72 72
     $modx->setPlaceholder('favicon',
73
-        (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico'));
73
+        (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico'));
74 74
 
75 75
     // invoke OnManagerLoginFormPrerender event
76 76
     $evtOut = $modx->invokeEvent('OnManagerLoginFormPrerender');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]);
83 83
     $modx->setPlaceholder('login_message', $_lang["login_message"]);
84 84
     $modx->setPlaceholder('manager_theme_url',
85
-        MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/');
85
+        MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/');
86 86
     $modx->setPlaceholder('year', date('Y'));
87 87
     $modx->setPlaceholder('manager_theme_style',
88 88
         (isset($_COOKIE['MODX_themeColor']) ? $_COOKIE['MODX_themeColor'] : ''));
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
         switch ($installGoingOn) {
96 96
             case 1 :
97 97
                 $modx->setPlaceholder('login_message',
98
-                    "<p><span class=\"fail\">" . $_lang["login_cancelled_install_in_progress"] . "</p><p>" . $_lang["login_message"] . "</p>");
98
+                    "<p><span class=\"fail\">".$_lang["login_cancelled_install_in_progress"]."</p><p>".$_lang["login_message"]."</p>");
99 99
                 break;
100 100
             case 2 :
101 101
                 $modx->setPlaceholder('login_message',
102
-                    "<p><span class=\"fail\">" . $_lang["login_cancelled_site_was_updated"] . "</p><p>" . $_lang["login_message"] . "</p>");
102
+                    "<p><span class=\"fail\">".$_lang["login_cancelled_site_was_updated"]."</p><p>".$_lang["login_message"]."</p>");
103 103
                 break;
104 104
         }
105 105
     }
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
     if ($modx->config['use_captcha'] == 1) {
108 108
         $modx->setPlaceholder('login_captcha_message', $_lang["login_captcha_message"]);
109 109
         $modx->setPlaceholder('captcha_image',
110
-            '<a href="' . MODX_MANAGER_URL . '" class="loginCaptcha"><img id="captcha_image" src="' . MODX_MANAGER_URL . 'includes/veriword.php?rand=' . rand() . '" alt="' . $_lang["login_captcha_message"] . '" /></a>');
110
+            '<a href="'.MODX_MANAGER_URL.'" class="loginCaptcha"><img id="captcha_image" src="'.MODX_MANAGER_URL.'includes/veriword.php?rand='.rand().'" alt="'.$_lang["login_captcha_message"].'" /></a>');
111 111
         $modx->setPlaceholder('captcha_input',
112
-            '<label>' . $_lang["captcha_code"] . '</label> <input type="text" name="captcha_code" tabindex="3" value="" />');
112
+            '<label>'.$_lang["captcha_code"].'</label> <input type="text" name="captcha_code" tabindex="3" value="" />');
113 113
     }
114 114
 
115 115
     // login info
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     // invoke OnManagerLoginFormRender event
129 129
     $evtOut = $modx->invokeEvent('OnManagerLoginFormRender');
130
-    $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">' . implode('', $evtOut) . '</div>' : '';
130
+    $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">'.implode('', $evtOut).'</div>' : '';
131 131
     $modx->setPlaceholder('OnManagerLoginFormRender', $html);
132 132
 
133 133
     // load template
@@ -145,29 +145,29 @@  discard block
 block discarded – undo
145 145
             $login_tpl = file_get_contents($target);
146 146
         }
147 147
     } else {
148
-        $theme_path = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/';
149
-        if (is_file($theme_path . 'style.php')) {
150
-            include($theme_path . 'style.php');
148
+        $theme_path = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/';
149
+        if (is_file($theme_path.'style.php')) {
150
+            include($theme_path.'style.php');
151 151
         }
152 152
         $chunk = $modx->getChunk($target);
153 153
         if ($chunk !== false && !empty($chunk)) {
154 154
             $login_tpl = $chunk;
155
-        } elseif (is_file(MODX_BASE_PATH . $target)) {
156
-            $target = MODX_BASE_PATH . $target;
155
+        } elseif (is_file(MODX_BASE_PATH.$target)) {
156
+            $target = MODX_BASE_PATH.$target;
157 157
             $login_tpl = file_get_contents($target);
158 158
         } elseif (is_file($target)) {
159 159
             $login_tpl = file_get_contents($target);
160
-        } elseif (is_file($theme_path . 'login.tpl')) {
161
-            $target = $theme_path . 'login.tpl';
160
+        } elseif (is_file($theme_path.'login.tpl')) {
161
+            $target = $theme_path.'login.tpl';
162 162
             $login_tpl = file_get_contents($target);
163
-        } elseif (is_file($theme_path . 'templates/actions/login.tpl')) {
164
-            $target = $theme_path . 'templates/actions/login.tpl';
163
+        } elseif (is_file($theme_path.'templates/actions/login.tpl')) {
164
+            $target = $theme_path.'templates/actions/login.tpl';
165 165
             $login_tpl = file_get_contents($target);
166
-        } elseif (is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible
167
-            $target = $theme_path . 'html/login.html';
166
+        } elseif (is_file($theme_path.'html/login.html')) { // ClipperCMS compatible
167
+            $target = $theme_path.'html/login.html';
168 168
             $login_tpl = file_get_contents($target);
169 169
         } else {
170
-            $target = MODX_MANAGER_PATH . 'media/style/common/login.tpl';
170
+            $target = MODX_MANAGER_PATH.'media/style/common/login.tpl';
171 171
             $login_tpl = file_get_contents($target);
172 172
         }
173 173
     }
@@ -187,17 +187,17 @@  discard block
 block discarded – undo
187 187
     $modx->updateValidatedUserSession();
188 188
 
189 189
     // Update last action in table active_users
190
-    $itemid = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
190
+    $itemid = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
191 191
     $lasthittime = time();
192
-    $action = isset($_REQUEST['a']) ? (int)$_REQUEST['a'] : 1;
192
+    $action = isset($_REQUEST['a']) ? (int) $_REQUEST['a'] : 1;
193 193
 
194 194
     if ($action !== 1) {
195
-        if ((int)$itemid <= 0) {
195
+        if ((int) $itemid <= 0) {
196 196
             $itemid = null;
197 197
         }
198 198
         $sql = sprintf("REPLACE INTO %s (sid, internalKey, username, lasthit, action, id) VALUES ('%s', %d, '%s', %d, '%s', %s)",
199 199
             $modx->getFullTableName('active_users') // Table
200
-            , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string)$action,
200
+            , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string) $action,
201 201
             $itemid == null ? var_export(null, true) : $itemid);
202 202
         $modx->db->query($sql);
203 203
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,8 @@  discard block
 block discarded – undo
21 21
 if (file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) {
22 22
     include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
23 23
     if (isset($installStartTime)) {
24
-        if ((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard
24
+        if ((time() - $installStartTime) > 5 * 60) {
25
+// if install flag older than 5 minutes, discard
25 26
             unset($installStartTime);
26 27
             @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755);
27 28
             unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
@@ -163,7 +164,8 @@  discard block
 block discarded – undo
163 164
         } elseif (is_file($theme_path . 'templates/actions/login.tpl')) {
164 165
             $target = $theme_path . 'templates/actions/login.tpl';
165 166
             $login_tpl = file_get_contents($target);
166
-        } elseif (is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible
167
+        } elseif (is_file($theme_path . 'html/login.html')) {
168
+// ClipperCMS compatible
167 169
             $target = $theme_path . 'html/login.html';
168 170
             $login_tpl = file_get_contents($target);
169 171
         } else {
Please login to merge, or discard this patch.
manager/includes/mutate_settings.ajax.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-require_once(dirname(__FILE__) . '/protect.inc.php');
9
+require_once(dirname(__FILE__).'/protect.inc.php');
10 10
 
11 11
 $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']);
12 12
 $lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']);
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 
24 24
 switch (true) {
25 25
     case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',
26
-            $lang) && file_exists(dirname(__FILE__) . '/lang/' . $lang . '.inc.php')): {
27
-        include(dirname(__FILE__) . '/lang/' . $lang . '.inc.php');
26
+            $lang) && file_exists(dirname(__FILE__).'/lang/'.$lang.'.inc.php')): {
27
+        include(dirname(__FILE__).'/lang/'.$lang.'.inc.php');
28 28
         $str = isset($key, $_lang, $_lang[$key]) ? $_lang[$key] : "";
29 29
         break;
30 30
     }
31 31
     case ($action == 'setsetting' && !empty($key) && !empty($value)): {
32
-        $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) VALUES('{$key}', '{$value}');";
32
+        $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) VALUES('{$key}', '{$value}');";
33 33
         $str = "true";
34 34
         $modx->db->query($sql);
35 35
         $emptyCache = true;
Please login to merge, or discard this patch.