Completed
Push — develop ( d568f8...c061fc )
by Agel_Nash
06:25
created
manager/processors/execute_module.processor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  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('exec_module')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // check if user has access permission, except admins
15
-if ($_SESSION['mgrRole']!=1) {
15
+if ($_SESSION['mgrRole'] != 1) {
16 16
     $rs = $modx->db->select(
17 17
         'sma.usergroup,mg.member',
18
-        $modx->getFullTableName("site_module_access") . " sma
19
-			LEFT JOIN " . $modx->getFullTableName("member_groups") . " mg ON mg.user_group = sma.usergroup AND member='" . $modx->getLoginUserID() . "'",
18
+        $modx->getFullTableName("site_module_access")." sma
19
+			LEFT JOIN " . $modx->getFullTableName("member_groups")." mg ON mg.user_group = sma.usergroup AND member='".$modx->getLoginUserID()."'",
20 20
         "sma.module = '{$id}'"
21 21
         );
22 22
     //initialize permission to -1, if it stays -1 no permissions
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
             //if there are permissions and this member has permission, ofcourse
29 29
             //this is granted
30 30
             $permissionAccessInt = 1;
31
-        } elseif ($permissionAccessInt==-1) {
31
+        } elseif ($permissionAccessInt == -1) {
32 32
             //if there are permissions but this member has no permission and the
33 33
             //variable was still in init state we set permission to 0; no permissions
34 34
             $permissionAccessInt = 0;
35 35
         }
36 36
     }
37 37
 
38
-    if ($permissionAccessInt==0) {
38
+    if ($permissionAccessInt == 0) {
39 39
         $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40 40
     }
41 41
 }
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 
62 62
 
63 63
 $output = evalModule($content["modulecode"], $parameter);
64
-if (strpos(trim($output), '<')===0 && strpos(trim($output), '<?xml')!==0) {
64
+if (strpos(trim($output), '<') === 0 && strpos(trim($output), '<?xml') !== 0) {
65 65
     echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller
66 66
 }
67 67
 echo $output;
68
-include MODX_MANAGER_PATH . "includes/sysalert.display.inc.php";
68
+include MODX_MANAGER_PATH."includes/sysalert.display.inc.php";
69 69
 
70 70
 /**
71 71
  * evalModule
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
             default:
102 102
                 $error_level = 99;
103 103
         }
104
-        if ($modx->config['error_reporting']==='99' || 2<$error_level) {
105
-            $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg);
104
+        if ($modx->config['error_reporting'] === '99' || 2 < $error_level) {
105
+            $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg);
106 106
             $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>");
107 107
         }
108 108
     }
109 109
     unset($modx->event->params);
110
-    return $mod . $msg;
110
+    return $mod.$msg;
111 111
 }
Please login to merge, or discard this patch.
manager/processors/save_web_user.processor.php 2 patches
Switch Indentation   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -60,109 +60,109 @@  discard block
 block discarded – undo
60 60
 }
61 61
 
62 62
 switch ($input['mode']) {
63
-    case '87': // new user
64
-        // check if this user name already exist
65
-        $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'");
66
-        $limit = $modx->db->getValue($rs);
67
-        if ($limit > 0) {
68
-            webAlertAndQuit("User name is already in use!");
69
-        }
70
-
71
-        // check if the email address already exist
72
-        if ($modx->config['allow_multiple_emails'] != 1) {
73
-            $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'");
63
+        case '87': // new user
64
+            // check if this user name already exist
65
+            $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'");
74 66
             $limit = $modx->db->getValue($rs);
75 67
             if ($limit > 0) {
76
-                webAlertAndQuit("Email is already in use!");
68
+                webAlertAndQuit("User name is already in use!");
77 69
             }
78
-        }
79 70
 
80
-        // generate a new password for this user
81
-        if ($specifiedpassword != "" && $passwordgenmethod == "spec") {
82
-            if (strlen($specifiedpassword) < 6) {
83
-                webAlertAndQuit("Password is too short!");
84
-            } else {
85
-                $newpassword = $specifiedpassword;
71
+            // check if the email address already exist
72
+            if ($modx->config['allow_multiple_emails'] != 1) {
73
+                $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'");
74
+                $limit = $modx->db->getValue($rs);
75
+                if ($limit > 0) {
76
+                    webAlertAndQuit("Email is already in use!");
77
+                }
86 78
             }
87
-        } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") {
88
-            webAlertAndQuit("You didn't specify a password for this user!");
89
-        } elseif ($passwordgenmethod == 'g') {
90
-            $newpassword = generate_password(8);
91
-        } else {
92
-            webAlertAndQuit("No password generation method specified!");
93
-        }
94 79
 
95
-        // invoke OnBeforeWUsrFormSave event
96
-        $modx->invokeEvent("OnBeforeWUsrFormSave", array(
97
-            "mode" => "new",
98
-        ));
99
-
100
-        // create the user account
101
-        $field = array();
102
-        $field['username'] = $esc_newusername;
103
-        $field['password'] = md5($newpassword);
104
-        $internalKey = $modx->db->insert($field, $tbl_web_users);
105
-
106
-        $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter');
107
-        $field = $modx->db->escape($field);
108
-        $modx->db->insert($field, $tbl_web_user_attributes);
109
-
110
-        // Save User Settings
111
-        saveUserSettings($internalKey);
112
-
113
-        // Set the item name for logger
114
-        $_SESSION['itemname'] = $newusername;
115
-
116
-        /*******************************************************************************/
117
-        // put the user in the user_groups he/ she should be in
118
-        // first, check that up_perms are switched on!
119
-        if ($use_udperms == 1) {
120
-            if (!empty($user_groups)) {
121
-                for ($i = 0; $i < count($user_groups); $i++) {
122
-                    $f = array();
123
-                    $f['webgroup'] = (int)$user_groups[$i];
124
-                    $f['webuser'] = $internalKey;
125
-                    $modx->db->insert($f, $tbl_web_groups);
80
+            // generate a new password for this user
81
+            if ($specifiedpassword != "" && $passwordgenmethod == "spec") {
82
+                if (strlen($specifiedpassword) < 6) {
83
+                    webAlertAndQuit("Password is too short!");
84
+                } else {
85
+                    $newpassword = $specifiedpassword;
126 86
                 }
127
-            }
128
-        }
129
-        // end of user_groups stuff!
130
-
131
-        // invoke OnWebSaveUser event
132
-        $modx->invokeEvent("OnWebSaveUser", array(
133
-            "mode" => "new",
134
-            "userid" => $internalKey,
135
-            "username" => $newusername,
136
-            "userpassword" => $newpassword,
137
-            "useremail" => $email,
138
-            "userfullname" => $fullname
139
-        ));
140
-
141
-        // invoke OnWUsrFormSave event
142
-        $modx->invokeEvent("OnWUsrFormSave", array(
143
-            "mode" => "new",
144
-            "id" => $internalKey
145
-        ));
146
-
147
-        if ($passwordnotifymethod == 'e') {
148
-            sendMailMessage($email, $newusername, $newpassword, $fullname);
149
-            if ($input['stay'] != '') {
150
-                $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
151
-                $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
152
-                header($header);
87
+            } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") {
88
+                webAlertAndQuit("You didn't specify a password for this user!");
89
+            } elseif ($passwordgenmethod == 'g') {
90
+                $newpassword = generate_password(8);
153 91
             } else {
154
-                $header = "Location: index.php?a=99&r=2";
155
-                header($header);
92
+                webAlertAndQuit("No password generation method specified!");
156 93
             }
157
-        } else {
158
-            if ($input['stay'] != '') {
159
-                $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
160
-                $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
161
-            } else {
162
-                $stayUrl = "index.php?a=99&r=2";
94
+
95
+            // invoke OnBeforeWUsrFormSave event
96
+            $modx->invokeEvent("OnBeforeWUsrFormSave", array(
97
+                "mode" => "new",
98
+            ));
99
+
100
+            // create the user account
101
+            $field = array();
102
+            $field['username'] = $esc_newusername;
103
+            $field['password'] = md5($newpassword);
104
+            $internalKey = $modx->db->insert($field, $tbl_web_users);
105
+
106
+            $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter');
107
+            $field = $modx->db->escape($field);
108
+            $modx->db->insert($field, $tbl_web_user_attributes);
109
+
110
+            // Save User Settings
111
+            saveUserSettings($internalKey);
112
+
113
+            // Set the item name for logger
114
+            $_SESSION['itemname'] = $newusername;
115
+
116
+            /*******************************************************************************/
117
+            // put the user in the user_groups he/ she should be in
118
+            // first, check that up_perms are switched on!
119
+            if ($use_udperms == 1) {
120
+                if (!empty($user_groups)) {
121
+                    for ($i = 0; $i < count($user_groups); $i++) {
122
+                        $f = array();
123
+                        $f['webgroup'] = (int)$user_groups[$i];
124
+                        $f['webuser'] = $internalKey;
125
+                        $modx->db->insert($f, $tbl_web_groups);
126
+                    }
127
+                }
163 128
             }
129
+            // end of user_groups stuff!
130
+
131
+            // invoke OnWebSaveUser event
132
+            $modx->invokeEvent("OnWebSaveUser", array(
133
+                "mode" => "new",
134
+                "userid" => $internalKey,
135
+                "username" => $newusername,
136
+                "userpassword" => $newpassword,
137
+                "useremail" => $email,
138
+                "userfullname" => $fullname
139
+            ));
140
+
141
+            // invoke OnWUsrFormSave event
142
+            $modx->invokeEvent("OnWUsrFormSave", array(
143
+                "mode" => "new",
144
+                "id" => $internalKey
145
+            ));
164 146
 
165
-            include_once "header.inc.php"; ?>
147
+            if ($passwordnotifymethod == 'e') {
148
+                sendMailMessage($email, $newusername, $newpassword, $fullname);
149
+                if ($input['stay'] != '') {
150
+                    $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
151
+                    $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
152
+                    header($header);
153
+                } else {
154
+                    $header = "Location: index.php?a=99&r=2";
155
+                    header($header);
156
+                }
157
+            } else {
158
+                if ($input['stay'] != '') {
159
+                    $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
160
+                    $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
161
+                } else {
162
+                    $stayUrl = "index.php?a=99&r=2";
163
+                }
164
+
165
+                include_once "header.inc.php"; ?>
166 166
 
167 167
 			<h1><?php echo $_lang['web_user_title']; ?></h1>
168 168
 
@@ -184,123 +184,123 @@  discard block
 block discarded – undo
184 184
 			</div>
185 185
 			<?php
186 186
 
187
-            include_once "footer.inc.php";
188
-        }
189
-        break;
190
-    case '88': // edit user
191
-        // generate a new password for this user
192
-        if ($genpassword == 1) {
193
-            if ($specifiedpassword != "" && $passwordgenmethod == "spec") {
194
-                if (strlen($specifiedpassword) < 6) {
195
-                    webAlertAndQuit("Password is too short!");
187
+                include_once "footer.inc.php";
188
+            }
189
+            break;
190
+        case '88': // edit user
191
+            // generate a new password for this user
192
+            if ($genpassword == 1) {
193
+                if ($specifiedpassword != "" && $passwordgenmethod == "spec") {
194
+                    if (strlen($specifiedpassword) < 6) {
195
+                        webAlertAndQuit("Password is too short!");
196
+                    } else {
197
+                        $newpassword = $specifiedpassword;
198
+                    }
199
+                } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") {
200
+                    webAlertAndQuit("You didn't specify a password for this user!");
201
+                } elseif ($passwordgenmethod == 'g') {
202
+                    $newpassword = generate_password(8);
196 203
                 } else {
197
-                    $newpassword = $specifiedpassword;
204
+                    webAlertAndQuit("No password generation method specified!");
198 205
                 }
199
-            } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") {
200
-                webAlertAndQuit("You didn't specify a password for this user!");
201
-            } elseif ($passwordgenmethod == 'g') {
202
-                $newpassword = generate_password(8);
203
-            } else {
204
-                webAlertAndQuit("No password generation method specified!");
205 206
             }
206
-        }
207
-        if ($passwordnotifymethod == 'e') {
208
-            sendMailMessage($email, $newusername, $newpassword, $fullname);
209
-        }
210
-
211
-        // check if the username already exist
212
-        $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'");
213
-        $limit = $modx->db->getValue($rs);
214
-        if ($limit > 0) {
215
-            webAlertAndQuit("User name is already in use!");
216
-        }
207
+            if ($passwordnotifymethod == 'e') {
208
+                sendMailMessage($email, $newusername, $newpassword, $fullname);
209
+            }
217 210
 
218
-        // check if the email address already exists
219
-        if ($modx->config['allow_multiple_emails'] != 1) {
220
-            $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'");
211
+            // check if the username already exist
212
+            $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'");
221 213
             $limit = $modx->db->getValue($rs);
222 214
             if ($limit > 0) {
223
-                webAlertAndQuit("Email is already in use!");
215
+                webAlertAndQuit("User name is already in use!");
216
+            }
217
+
218
+            // check if the email address already exists
219
+            if ($modx->config['allow_multiple_emails'] != 1) {
220
+                $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'");
221
+                $limit = $modx->db->getValue($rs);
222
+                if ($limit > 0) {
223
+                    webAlertAndQuit("Email is already in use!");
224
+                }
224 225
             }
225
-        }
226 226
 
227
-        // invoke OnBeforeWUsrFormSave event
228
-        $modx->invokeEvent("OnBeforeWUsrFormSave", array(
229
-            "mode" => "upd",
230
-            "id" => $id
231
-        ));
227
+            // invoke OnBeforeWUsrFormSave event
228
+            $modx->invokeEvent("OnBeforeWUsrFormSave", array(
229
+                "mode" => "upd",
230
+                "id" => $id
231
+            ));
232 232
 
233
-        // update user name and password
234
-        $field = array();
235
-        $field['username'] = $esc_newusername;
236
-        if ($genpassword == 1) {
237
-            $field['password'] = md5($newpassword);
238
-        }
239
-        $modx->db->update($field, $tbl_web_users, "id='{$id}'");
240
-        $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter');
241
-        $field = $modx->db->escape($field);
242
-        $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'");
243
-
244
-        // Save User Settings
245
-        saveUserSettings($id);
246
-
247
-        // Set the item name for logger
248
-        $_SESSION['itemname'] = $newusername;
249
-
250
-        /*******************************************************************************/
251
-        // put the user in the user_groups he/ she should be in
252
-        // first, check that up_perms are switched on!
253
-        if ($use_udperms == 1) {
254
-            // as this is an existing user, delete his/ her entries in the groups before saving the new groups
255
-            $modx->db->delete($tbl_web_groups, "webuser='{$id}'");
256
-            if (!empty($user_groups)) {
257
-                for ($i = 0; $i < count($user_groups); $i++) {
258
-                    $field = array();
259
-                    $field['webgroup'] = (int)$user_groups[$i];
260
-                    $field['webuser'] = $id;
261
-                    $modx->db->insert($field, $tbl_web_groups);
233
+            // update user name and password
234
+            $field = array();
235
+            $field['username'] = $esc_newusername;
236
+            if ($genpassword == 1) {
237
+                $field['password'] = md5($newpassword);
238
+            }
239
+            $modx->db->update($field, $tbl_web_users, "id='{$id}'");
240
+            $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter');
241
+            $field = $modx->db->escape($field);
242
+            $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'");
243
+
244
+            // Save User Settings
245
+            saveUserSettings($id);
246
+
247
+            // Set the item name for logger
248
+            $_SESSION['itemname'] = $newusername;
249
+
250
+            /*******************************************************************************/
251
+            // put the user in the user_groups he/ she should be in
252
+            // first, check that up_perms are switched on!
253
+            if ($use_udperms == 1) {
254
+                // as this is an existing user, delete his/ her entries in the groups before saving the new groups
255
+                $modx->db->delete($tbl_web_groups, "webuser='{$id}'");
256
+                if (!empty($user_groups)) {
257
+                    for ($i = 0; $i < count($user_groups); $i++) {
258
+                        $field = array();
259
+                        $field['webgroup'] = (int)$user_groups[$i];
260
+                        $field['webuser'] = $id;
261
+                        $modx->db->insert($field, $tbl_web_groups);
262
+                    }
262 263
                 }
263 264
             }
264
-        }
265
-        // end of user_groups stuff!
266
-        /*******************************************************************************/
267
-
268
-        // invoke OnWebSaveUser event
269
-        $modx->invokeEvent("OnWebSaveUser", array(
270
-            "mode" => "upd",
271
-            "userid" => $id,
272
-            "username" => $newusername,
273
-            "userpassword" => $newpassword,
274
-            "useremail" => $email,
275
-            "userfullname" => $fullname,
276
-            "oldusername" => (($oldusername != $newusername) ? $oldusername : ""),
277
-            "olduseremail" => (($oldemail != $email) ? $oldemail : "")
278
-        ));
279
-
280
-        // invoke OnWebChangePassword event
281
-        if ($genpassword == 1) {
282
-            $modx->invokeEvent("OnWebChangePassword", array(
265
+            // end of user_groups stuff!
266
+            /*******************************************************************************/
267
+
268
+            // invoke OnWebSaveUser event
269
+            $modx->invokeEvent("OnWebSaveUser", array(
270
+                "mode" => "upd",
283 271
                 "userid" => $id,
284 272
                 "username" => $newusername,
285
-                "userpassword" => $newpassword
273
+                "userpassword" => $newpassword,
274
+                "useremail" => $email,
275
+                "userfullname" => $fullname,
276
+                "oldusername" => (($oldusername != $newusername) ? $oldusername : ""),
277
+                "olduseremail" => (($oldemail != $email) ? $oldemail : "")
286 278
             ));
287
-        }
288
-
289
-        // invoke OnWUsrFormSave event
290
-        $modx->invokeEvent("OnWUsrFormSave", array(
291
-            "mode" => "upd",
292
-            "id" => $id
293
-        ));
294 279
 
295
-        if ($genpassword == 1 && $passwordnotifymethod == 's') {
296
-            if ($input['stay'] != '') {
297
-                $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
298
-                $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
299
-            } else {
300
-                $stayUrl = "index.php?a=99&r=2";
280
+            // invoke OnWebChangePassword event
281
+            if ($genpassword == 1) {
282
+                $modx->invokeEvent("OnWebChangePassword", array(
283
+                    "userid" => $id,
284
+                    "username" => $newusername,
285
+                    "userpassword" => $newpassword
286
+                ));
301 287
             }
302 288
 
303
-            include_once "header.inc.php"; ?>
289
+            // invoke OnWUsrFormSave event
290
+            $modx->invokeEvent("OnWUsrFormSave", array(
291
+                "mode" => "upd",
292
+                "id" => $id
293
+            ));
294
+
295
+            if ($genpassword == 1 && $passwordnotifymethod == 's') {
296
+                if ($input['stay'] != '') {
297
+                    $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
298
+                    $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
299
+                } else {
300
+                    $stayUrl = "index.php?a=99&r=2";
301
+                }
302
+
303
+                include_once "header.inc.php"; ?>
304 304
 
305 305
 			<h1><?php echo $_lang['web_user_title']; ?></h1>
306 306
 
@@ -320,20 +320,20 @@  discard block
 block discarded – undo
320 320
 			</div>
321 321
 			<?php
322 322
 
323
-            include_once "footer.inc.php";
324
-        } else {
325
-            if ($input['stay'] != '') {
326
-                $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
327
-                $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
328
-                header($header);
323
+                include_once "footer.inc.php";
329 324
             } else {
330
-                $header = "Location: index.php?a=99&r=2";
331
-                header($header);
325
+                if ($input['stay'] != '') {
326
+                    $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
327
+                    $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
328
+                    header($header);
329
+                } else {
330
+                    $header = "Location: index.php?a=99&r=2";
331
+                    header($header);
332
+                }
332 333
             }
333
-        }
334
-        break;
335
-    default:
336
-        webAlertAndQuit("No operation set in request.");
334
+            break;
335
+        default:
336
+            webAlertAndQuit("No operation set in request.");
337 337
 }
338 338
 
339 339
 /**
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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('save_web_user')) {
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     $input[$k] = $v;
19 19
 }
20 20
 
21
-$id = (int)$input['id'];
21
+$id = (int) $input['id'];
22 22
 $oldusername = $input['oldusername'];
23 23
 $newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User";
24 24
 $esc_newusername = $modx->db->escape($newusername);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             if (!empty($user_groups)) {
121 121
                 for ($i = 0; $i < count($user_groups); $i++) {
122 122
                     $f = array();
123
-                    $f['webgroup'] = (int)$user_groups[$i];
123
+                    $f['webgroup'] = (int) $user_groups[$i];
124 124
                     $f['webuser'] = $internalKey;
125 125
                     $modx->db->insert($f, $tbl_web_groups);
126 126
                 }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             sendMailMessage($email, $newusername, $newpassword, $fullname);
149 149
             if ($input['stay'] != '') {
150 150
                 $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
151
-                $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
151
+                $header = "Location: index.php?a={$a}&r=2&stay=".$input['stay'];
152 152
                 header($header);
153 153
             } else {
154 154
                 $header = "Location: index.php?a=99&r=2";
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         } else {
158 158
             if ($input['stay'] != '') {
159 159
                 $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
160
-                $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
160
+                $stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay'];
161 161
             } else {
162 162
                 $stayUrl = "index.php?a=99&r=2";
163 163
             }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             if (!empty($user_groups)) {
257 257
                 for ($i = 0; $i < count($user_groups); $i++) {
258 258
                     $field = array();
259
-                    $field['webgroup'] = (int)$user_groups[$i];
259
+                    $field['webgroup'] = (int) $user_groups[$i];
260 260
                     $field['webuser'] = $id;
261 261
                     $modx->db->insert($field, $tbl_web_groups);
262 262
                 }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         if ($genpassword == 1 && $passwordnotifymethod == 's') {
296 296
             if ($input['stay'] != '') {
297 297
                 $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
298
-                $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
298
+                $stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay'];
299 299
             } else {
300 300
                 $stayUrl = "index.php?a=99&r=2";
301 301
             }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         } else {
325 325
             if ($input['stay'] != '') {
326 326
                 $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
327
-                $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
327
+                $header = "Location: index.php?a={$a}&r=2&stay=".$input['stay'];
328 328
                 header($header);
329 329
             } else {
330 330
                 $header = "Location: index.php?a=99&r=2";
@@ -345,13 +345,13 @@  discard block
 block discarded – undo
345 345
 function save_user_quoted_printable($string)
346 346
 {
347 347
     $crlf = "\n";
348
-    $string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string) . $crlf;
348
+    $string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string).$crlf;
349 349
     $f[] = '/([\000-\010\013\014\016-\037\075\177-\377])/e';
350 350
     $r[] = "'=' . sprintf('%02X', ord('\\1'))";
351
-    $f[] = '/([\011\040])' . $crlf . '/e';
352
-    $r[] = "'=' . sprintf('%02X', ord('\\1')) . '" . $crlf . "'";
351
+    $f[] = '/([\011\040])'.$crlf.'/e';
352
+    $r[] = "'=' . sprintf('%02X', ord('\\1')) . '".$crlf."'";
353 353
     $string = preg_replace($f, $r, $string);
354
-    return trim(wordwrap($string, 70, ' =' . $crlf));
354
+    return trim(wordwrap($string, 70, ' ='.$crlf));
355 355
 }
356 356
 
357 357
 /**
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     global $id, $modx;
428 428
     $mode = $_POST['mode'];
429 429
     $modx->manager->saveFormValues($mode);
430
-    $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : ''));
430
+    $modx->webAlertAndQuit($msg, "index.php?a={$mode}".($mode == '88' ? "&id={$id}" : ''));
431 431
 }
432 432
 
433 433
 // Generate password
Please login to merge, or discard this patch.
manager/processors/move_document.processor.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('edit_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0;
10
-$documentID = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
9
+$newParentID = isset($_REQUEST['new_parent']) ? (int) $_REQUEST['new_parent'] : 0;
10
+$documentID = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
11 11
 
12 12
 // ok, two things to check.
13 13
 // first, document cannot be moved to itself
14 14
 // second, new parent must be a folder. If not, set it to folder.
15
-if ($documentID==$newParentID) {
15
+if ($documentID == $newParentID) {
16 16
     $modx->webAlertAndQuit($_lang["error_movedocument1"]);
17 17
 }
18 18
 if ($documentID <= 0) {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 if ($use_udperms == 1) {
36 36
     if ($oldparent != $newParentID) {
37
-        include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
37
+        include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
38 38
         $udperms = new udperms();
39 39
         $udperms->user = $modx->getLoginUserID();
40 40
         $udperms->document = $newParentID;
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 function allChildren($currDocID)
54 54
 {
55 55
     $modx = evolutionCMS();
56
-    $children= array();
56
+    $children = array();
57 57
     $currDocID = $modx->db->escape($currDocID);
58 58
     $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'");
59
-    while ($child= $modx->db->getRow($rs)) {
60
-        $children[]= $child['id'];
61
-        $children= array_merge($children, allChildren($child['id']));
59
+    while ($child = $modx->db->getRow($rs)) {
60
+        $children[] = $child['id'];
61
+        $children = array_merge($children, allChildren($child['id']));
62 62
     }
63 63
     return $children;
64 64
 }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'");
94 94
     $limit = $modx->db->getValue($rs);
95 95
 
96
-    if (!$limit>0) {
96
+    if (!$limit > 0) {
97 97
         $modx->db->update(array(
98 98
             'isfolder' => 0,
99 99
         ), $modx->getFullTableName('site_content'), "id='{$oldparent}'");
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     // empty cache & sync site
112 112
     $modx->clearCache('full');
113 113
 
114
-    $header="Location: index.php?a=3&id={$documentID}&r=9";
114
+    $header = "Location: index.php?a=3&id={$documentID}&r=9";
115 115
     header($header);
116 116
 } else {
117 117
     $modx->webAlertAndQuit("You cannot move a document to a child document!");
Please login to merge, or discard this patch.
manager/processors/delete_message.processor.php 1 patch
Spacing   +5 added lines, -5 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('messages')) {
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
 
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
     $modx->webAlertAndQuit("Wrong number of messages returned!");
19 19
 }
20 20
 
21
-if ($message['recipient']!=$modx->getLoginUserID()) {
21
+if ($message['recipient'] != $modx->getLoginUserID()) {
22 22
     $modx->webAlertAndQuit("You are not allowed to delete this message!");
23 23
 }
24 24
 
25 25
 // delete message
26 26
 $modx->db->delete($modx->getFullTableName('user_messages'), "id='{$id}'");
27 27
 
28
-$header="Location: index.php?a=10";
28
+$header = "Location: index.php?a=10";
29 29
 header($header);
Please login to merge, or discard this patch.
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 2 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -393,7 +393,8 @@
 block discarded – undo
393 393
     $failedlogins += 1;
394 394
 
395 395
     $fields = array('failedlogincount' => $failedlogins);
396
-    if ($failedlogins >= $failed_allowed) { //block user for too many fail attempts
396
+    if ($failedlogins >= $failed_allowed) {
397
+//block user for too many fail attempts
397 398
 
398 399
         $fields['blockeduntil'] = time() + ($blocked_minutes * 60);
399 400
     }
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.