Completed
Push — develop ( e6bcf2...351294 )
by Dmytro
06:18
created
manager/processors/save_tmplvars.processor.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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
 if (!$modx->hasPermission('save_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $name = $modx->db->escape(trim($_POST['name']));
11 11
 $description = $modx->db->escape($_POST['description']);
12 12
 $caption = $modx->db->escape($_POST['caption']);
@@ -17,17 +17,17 @@  discard block
 block discarded – undo
17 17
 $display = $modx->db->escape($_POST['display']);
18 18
 $params = $modx->db->escape($_POST['params']);
19 19
 $locked = $_POST['locked'] == 'on' ? 1 : 0;
20
-$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76;
21
-$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null;
20
+$origin = isset($_REQUEST['or']) ? (int) $_REQUEST['or'] : 76;
21
+$originId = isset($_REQUEST['oid']) ? (int) $_REQUEST['oid'] : null;
22 22
 $currentdate = time() + $modx->config['server_offset_time'];
23 23
 
24 24
 //Kyle Jaebker - added category support
25 25
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
26
-    $categoryid = (int)$_POST['categoryid'];
26
+    $categoryid = (int) $_POST['categoryid'];
27 27
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
28 28
     $categoryid = 0;
29 29
 } else {
30
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
30
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
31 31
     $categoryid = checkCategory($_POST['newcategory']);
32 32
     if (!$categoryid) {
33 33
         $categoryid = newCategory($_POST['newcategory']);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         // finished emptying cache - redirect
100 100
         if ($_POST['stay'] != '') {
101 101
             $a = ($_POST['stay'] == '2') ? "301&id=$newid" : "300";
102
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
102
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
103 103
             header($header);
104 104
         } else {
105 105
             $header = "Location: index.php?a=76&r=2";
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
         // finished emptying cache - redirect
161 161
         if ($_POST['stay'] != '') {
162 162
             $a = ($_POST['stay'] == '2') ? "301&id=$id" : "300";
163
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'] . "&or=" . $origin . "&oid=" . $originId;
163
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']."&or=".$origin."&oid=".$originId;
164 164
             header($header);
165 165
         } else {
166 166
             $modx->unlockElement(2, $id);
167
-            $header = "Location: index.php?a=" . $origin . "&r=2" . (empty($originId) ? '' : '&id=' . $originId);
167
+            $header = "Location: index.php?a=".$origin."&r=2".(empty($originId) ? '' : '&id='.$originId);
168 168
             header($header);
169 169
         }
170 170
 
Please login to merge, or discard this patch.
manager/processors/login.processor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,16 +3,16 @@  discard block
 block discarded – undo
3 3
     header('HTTP/1.0 404 Not Found');
4 4
     exit('error');
5 5
 }
6
-define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
6
+define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
8
-include_once(__DIR__ . '/../../index.php');
8
+include_once(__DIR__.'/../../index.php');
9 9
 $modx->db->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 $modx->loadExtension('ManagerAPI');
13 13
 $modx->loadExtension('phpass');
14 14
 
15
-$core_path = MODX_MANAGER_PATH . 'includes/';
15
+$core_path = MODX_MANAGER_PATH.'includes/';
16 16
 // include_once the language file
17 17
 $_lang = array();
18 18
 include_once("{$core_path}lang/english.inc.php");
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $ip = "UNKNOWN";
93 93
     }
94 94
     $log = new logHandler;
95
-    $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
95
+    $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip);
96 96
     jsAlert($_lang['login_processor_many_failed_logins']);
97 97
     return;
98 98
 }
@@ -218,18 +218,18 @@  discard block
 block discarded – undo
218 218
 $_SESSION['mgrPermissions'] = $modx->db->getRow($rs);
219 219
 
220 220
 // successful login so reset fail count and update key values
221
-$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
221
+$modx->db->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
222 222
 
223 223
 // get user's document groups
224 224
 $i = 0;
225
-$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
226
-		INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
225
+$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug
226
+		INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
227 227
 $_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs);
228 228
 
229 229
 $_SESSION['mgrToken'] = md5($currentsessionid);
230 230
 
231 231
 if ($rememberme == '1') {
232
-    $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
232
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
233 233
 
234 234
     // Set a cookie separate from the session cookie with the username in it.
235 235
     // Are we using secure connection? If so, make sure the cookie is secure
@@ -274,16 +274,16 @@  discard block
 block discarded – undo
274 274
 
275 275
 // check if we should redirect user to a web page
276 276
 $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
277
-$id = (int)$modx->db->getValue($rs);
277
+$id = (int) $modx->db->getValue($rs);
278 278
 if ($id > 0) {
279
-    $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
279
+    $header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
280 280
     if ($_POST['ajax'] == 1) {
281 281
         echo $header;
282 282
     } else {
283 283
         header($header);
284 284
     }
285 285
 } else {
286
-    $header = 'Location: ' . MODX_MANAGER_URL;
286
+    $header = 'Location: '.MODX_MANAGER_URL;
287 287
     if ($_POST['ajax'] == 1) {
288 288
         echo $header;
289 289
     } else {
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 {
301 301
     $modx = evolutionCMS();
302 302
     if ($_POST['ajax'] != 1) {
303
-        echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
303
+        echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>";
304 304
     } else {
305
-        echo $msg . "\n";
305
+        echo $msg."\n";
306 306
     }
307 307
 }
308 308
 
Please login to merge, or discard this patch.
manager/processors/purge_plugin.processor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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
     exit();
4 4
 }
5 5
 
Please login to merge, or discard this patch.
manager/processors/empty_table.processor.php 1 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
 if (!$modx->hasPermission('settings')) {
@@ -8,5 +8,5 @@  discard block
 block discarded – undo
8 8
 
9 9
 $modx->db->truncate($modx->getFullTableName('manager_log'));
10 10
 
11
-$header="Location: index.php?a=13";
11
+$header = "Location: index.php?a=13";
12 12
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_plugin.processor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
 if (!$modx->hasPermission('delete_plugin')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -37,5 +37,5 @@  discard block
 block discarded – undo
37 37
 $modx->clearCache('full');
38 38
 
39 39
 // finished emptying cache - redirect
40
-$header="Location: index.php?a=76&r=2";
40
+$header = "Location: index.php?a=76&r=2";
41 41
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_module.processor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
 if (!$modx->hasPermission('delete_module')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -40,5 +40,5 @@  discard block
 block discarded – undo
40 40
 $modx->clearCache('full');
41 41
 
42 42
 // finished emptying cache - redirect
43
-$header="Location: index.php?a=106&r=2";
43
+$header = "Location: index.php?a=106&r=2";
44 44
 header($header);
Please login to merge, or discard this patch.
manager/processors/remove_installer.processor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,18 +12,18 @@  discard block
 block discarded – undo
12 12
  *
13 13
  */
14 14
 
15
-$msg ='';
16
-$pth = dirname(dirname(dirname(__FILE__))) . "/install/";
15
+$msg = '';
16
+$pth = dirname(dirname(dirname(__FILE__)))."/install/";
17 17
 $pth = str_replace("\\", "/", $pth);
18 18
 if (isset($_GET["rminstall"])) {
19 19
     if (is_dir($pth)) {
20 20
         if (!rmdirRecursive($pth)) {
21
-            $msg="An error occured while attempting to remove the install folder";
21
+            $msg = "An error occured while attempting to remove the install folder";
22 22
         }
23 23
     }
24 24
 }
25 25
 if ($msg) {
26
-    echo "<script>alert('" . addslashes($msg) . "');</script>";
26
+    echo "<script>alert('".addslashes($msg)."');</script>";
27 27
 }
28 28
 echo "<script>window.location='../index.php?a=2';</script>";
29 29
 
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
  * @param bool $followLinks
35 35
  * @return bool
36 36
  */
37
-function rmdirRecursive($path, $followLinks=false)
37
+function rmdirRecursive($path, $followLinks = false)
38 38
 {
39
-    $dir = opendir($path) ;
39
+    $dir = opendir($path);
40 40
     while ($entry = readdir($dir)) {
41 41
         if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) {
42 42
             @unlink("$path/$entry");
43
-        } elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') {
43
+        } elseif (is_dir("$path/$entry") && $entry != '.' && $entry != '..') {
44 44
             rmdirRecursive("$path/$entry"); // recursive
45 45
         }
46 46
     }
Please login to merge, or discard this patch.
manager/processors/send_message.processor.php 1 patch
Spacing   +14 added lines, -14 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
 if (!$modx->hasPermission('messages')) {
@@ -10,17 +10,17 @@  discard block
 block discarded – undo
10 10
 $userid = $_REQUEST['user'];
11 11
 $groupid = $_REQUEST['group'];
12 12
 $subject = $modx->db->escape($_REQUEST['messagesubject']);
13
-if ($subject=="") {
14
-    $subject="(no subject)";
13
+if ($subject == "") {
14
+    $subject = "(no subject)";
15 15
 }
16 16
 $message = $modx->db->escape($_REQUEST['messagebody']);
17
-if ($message=="") {
18
-    $message="(no message)";
17
+if ($message == "") {
18
+    $message = "(no message)";
19 19
 }
20 20
 $postdate = time();
21 21
 
22
-if ($sendto=='u') {
23
-    if ($userid==0) {
22
+if ($sendto == 'u') {
23
+    if ($userid == 0) {
24 24
         $modx->webAlertAndQuit($_lang["error_no_user_selected"]);
25 25
     }
26 26
     $modx->db->insert(
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
         ), $modx->getFullTableName('user_messages'));
36 36
 }
37 37
 
38
-if ($sendto=='g') {
39
-    if ($groupid==0) {
38
+if ($sendto == 'g') {
39
+    if ($groupid == 0) {
40 40
         $modx->webAlertAndQuit($_lang["error_no_group_selected"]);
41 41
     }
42
-    $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='" . $modx->getLoginUserID() . "'");
43
-    while ($row=$modx->db->getRow($rs)) {
42
+    $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'");
43
+    while ($row = $modx->db->getRow($rs)) {
44 44
         $modx->db->insert(
45 45
             array(
46 46
                 'recipient' => $row['internalKey'],
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 }
56 56
 
57 57
 
58
-if ($sendto=='a') {
59
-    $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='" . $modx->getLoginUserID() . "'");
60
-    while ($row=$modx->db->getRow($rs)) {
58
+if ($sendto == 'a') {
59
+    $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'");
60
+    while ($row = $modx->db->getRow($rs)) {
61 61
         $modx->db->insert(
62 62
             array(
63 63
                 'recipient' => $row['id'],
Please login to merge, or discard this patch.
manager/processors/access_groups.processor.php 1 patch
Spacing   +11 added lines, -11 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
 if (!$modx->hasPermission('access_permissions')) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     break;
51 51
     case "delete_user_group":
52 52
         $updategroupaccess = true;
53
-        $usergroup = (int)$_REQUEST['usergroup'];
53
+        $usergroup = (int) $_REQUEST['usergroup'];
54 54
         if (empty($usergroup)) {
55 55
             $modx->webAlertAndQuit("No user group id specified for deletion.");
56 56
         } else {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         }
63 63
     break;
64 64
     case "delete_document_group":
65
-        $group = (int)$_REQUEST['documentgroup'];
65
+        $group = (int) $_REQUEST['documentgroup'];
66 66
         if (empty($group)) {
67 67
             $modx->webAlertAndQuit("No document group id specified for deletion.");
68 68
         } else {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         if (empty($newgroupname)) {
79 79
             $modx->webAlertAndQuit("No group name specified.");
80 80
         }
81
-        $groupid = (int)$_REQUEST['groupid'];
81
+        $groupid = (int) $_REQUEST['groupid'];
82 82
         if (empty($groupid)) {
83 83
             $modx->webAlertAndQuit("No group id specified for rename.");
84 84
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         if (empty($newgroupname)) {
91 91
             $modx->webAlertAndQuit("No group name specified.");
92 92
         }
93
-        $groupid = (int)$_REQUEST['groupid'];
93
+        $groupid = (int) $_REQUEST['groupid'];
94 94
         if (empty($groupid)) {
95 95
             $modx->webAlertAndQuit("No group id specified for rename.");
96 96
         }
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
     break;
100 100
     case "add_document_group_to_user_group":
101 101
         $updategroupaccess = true;
102
-        $usergroup = (int)$_REQUEST['usergroup'];
103
-        $docgroup = (int)$_REQUEST['docgroup'];
102
+        $usergroup = (int) $_REQUEST['usergroup'];
103
+        $docgroup = (int) $_REQUEST['docgroup'];
104 104
         $rs = $modx->db->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'");
105 105
         $limit = $modx->db->getValue($rs);
106
-        if ($limit<=0) {
106
+        if ($limit <= 0) {
107 107
             $modx->db->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access);
108 108
         } else {
109 109
             //alert user that coupling already exists?
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     break;
112 112
     case "remove_document_group_from_user_group":
113 113
         $updategroupaccess = true;
114
-        $coupling = (int)$_REQUEST['coupling'];
114
+        $coupling = (int) $_REQUEST['coupling'];
115 115
         $modx->db->delete($tbl_membergroup_access, "id='{$coupling}'");
116 116
     break;
117 117
     default:
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 }
120 120
 
121 121
 // secure manager documents - flag as private
122
-if ($updategroupaccess==true) {
123
-    include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php";
122
+if ($updategroupaccess == true) {
123
+    include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php";
124 124
     secureMgrDocument();
125 125
 
126 126
     // Update the private group column
Please login to merge, or discard this patch.