Completed
Push — develop ( d568f8...c061fc )
by Agel_Nash
06:25
created
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.
manager/processors/duplicate_template.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  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('new_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('templatename', $modx->getFullTableName('site_templates'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('templatename', $modx->getFullTableName('site_templates'), "templatename LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if ($count>=1) {
18
-    $count = ' ' . ($count+1);
17
+if ($count >= 1) {
18
+    $count = ' '.($count + 1);
19 19
 } else {
20 20
     $count = '';
21 21
 }
@@ -44,5 +44,5 @@  discard block
 block discarded – undo
44 44
 $_SESSION['itemname'] = $name;
45 45
 
46 46
 // finish duplicating - redirect to new template
47
-$header="Location: index.php?r=2&a=16&id=$newid";
47
+$header = "Location: index.php?r=2&a=16&id=$newid";
48 48
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_htmlsnippet.processor.php 1 patch
Spacing   +6 added lines, -6 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_chunk')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $snippet = $modx->db->escape($_POST['post']);
11 11
 $name = $modx->db->escape(trim($_POST['name']));
12 12
 $description = $modx->db->escape($_POST['description']);
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 
17 17
 //Kyle Jaebker - added category support
18 18
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
19
-    $categoryid = (int)$_POST['categoryid'];
19
+    $categoryid = (int) $_POST['categoryid'];
20 20
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
21 21
     $categoryid = 0;
22 22
 } else {
23
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
23
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
24 24
     $categoryid = checkCategory($_POST['newcategory']);
25 25
     if (!$categoryid) {
26 26
         $categoryid = newCategory($_POST['newcategory']);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         // finished emptying cache - redirect
81 81
         if ($_POST['stay'] != '') {
82 82
             $a = ($_POST['stay'] == '2') ? "78&id=$newid" : "77";
83
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
83
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
84 84
             header($header);
85 85
         } else {
86 86
             $header = "Location: index.php?a=76&r=2";
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         // finished emptying cache - redirect
130 130
         if ($_POST['stay'] != '') {
131 131
             $a = ($_POST['stay'] == '2') ? "78&id=$id" : "77";
132
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
132
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
133 133
             header($header);
134 134
         } else {
135 135
             $modx->unlockElement(3, $id);
Please login to merge, or discard this patch.