Completed
Push — develop ( 7e4f1d...c463ba )
by Dmytro
11:42 queued 04:02
created
manager/actions/mutate_web_user.dynamic.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch($modx->manager->action) {
7
-	case 88:
8
-		if(!$modx->hasPermission('edit_web_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 87:
13
-		if(!$modx->hasPermission('new_web_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 88:
8
+		    if(!$modx->hasPermission('edit_web_user')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 87:
13
+		    if(!$modx->hasPermission('new_web_user')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
manager/actions/mutate_role.dynamic.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch((int) $modx->manager->action) {
7
-	case 35:
8
-		if(!$modx->hasPermission('edit_role')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 38:
13
-		if(!$modx->hasPermission('new_role')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 35:
8
+		    if(!$modx->hasPermission('edit_role')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 38:
13
+		    if(!$modx->hasPermission('new_role')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
manager/actions/mutate_templates.dynamic.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch($modx->manager->action) {
7
-	case 16:
8
-		if(!$modx->hasPermission('edit_template')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 19:
13
-		if(!$modx->hasPermission('new_template')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 16:
8
+		    if(!$modx->hasPermission('edit_template')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 19:
13
+		    if(!$modx->hasPermission('new_template')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@
 block discarded – undo
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 switch($modx->manager->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+	    case 107:
7
+		    if(!$modx->hasPermission('new_module')) {
8
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+		    }
10
+		    break;
11
+	    case 108:
12
+		    if(!$modx->hasPermission('edit_module')) {
13
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+		    }
15
+		    break;
16
+	    default:
17
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
Please login to merge, or discard this patch.
manager/processors/save_user.processor.php 1 patch
Switch Indentation   +237 added lines, -237 removed lines patch added patch discarded remove patch
@@ -69,110 +69,110 @@  discard block
 block discarded – undo
69 69
 }
70 70
 
71 71
 switch($input['mode']) {
72
-	case '11' : // new user
73
-		// check if this user name already exist
74
-		$rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername)));
75
-		$limit = $modx->db->getValue($rs);
76
-		if($limit > 0) {
77
-			webAlertAndQuit("User name is already in use!");
78
-		}
79
-
80
-		// check if the email address already exist
81
-		$rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id));
82
-		$limit = $modx->db->getValue($rs);
83
-		if($limit > 0) {
84
-			webAlertAndQuit("Email is already in use!");
85
-		}
86
-
87
-		// generate a new password for this user
88
-		if($specifiedpassword != "" && $passwordgenmethod == "spec") {
89
-			if(strlen($specifiedpassword) < 6) {
90
-				webAlertAndQuit("Password is too short!");
91
-			} else {
92
-				$newpassword = $specifiedpassword;
93
-			}
94
-		} elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
95
-			webAlertAndQuit("You didn't specify a password for this user!");
96
-		} elseif($passwordgenmethod == 'g') {
97
-			$newpassword = generate_password(8);
98
-		} else {
99
-			webAlertAndQuit("No password generation method specified!");
100
-		}
101
-
102
-		// invoke OnBeforeUserFormSave event
103
-		$modx->invokeEvent("OnBeforeUserFormSave", array(
104
-			"mode" => "new",
105
-		));
106
-
107
-		// create the user account
108
-		$internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users);
109
-
110
-		$field = array();
111
-		$field['password'] = $modx->phpass->HashPassword($newpassword);
112
-		$modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'");
113
-
114
-		$field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter');
115
-		$field = $modx->db->escape($field);
116
-		$modx->db->insert($field, $tbl_user_attributes);
117
-
118
-		// Save user settings
119
-		saveUserSettings($internalKey);
120
-
121
-		// invoke OnManagerSaveUser event
122
-		$modx->invokeEvent("OnManagerSaveUser", array(
123
-			"mode" => "new",
124
-			"userid" => $internalKey,
125
-			"username" => $newusername,
126
-			"userpassword" => $newpassword,
127
-			"useremail" => $email,
128
-			"userfullname" => $fullname,
129
-			"userroleid" => $role
130
-		));
131
-
132
-		// invoke OnUserFormSave event
133
-		$modx->invokeEvent("OnUserFormSave", array(
134
-			"mode" => "new",
135
-			"id" => $internalKey
136
-		));
137
-
138
-		// Set the item name for logger
139
-		$_SESSION['itemname'] = $newusername;
140
-
141
-		/*******************************************************************************/
142
-		// put the user in the user_groups he/ she should be in
143
-		// first, check that up_perms are switched on!
144
-		if($use_udperms == 1) {
145
-			if(!empty($user_groups)) {
146
-				for($i = 0; $i < count($user_groups); $i++) {
147
-					$f = array();
148
-					$f['user_group'] = (int)$user_groups[$i];
149
-					$f['member'] = $internalKey;
150
-					$modx->db->insert($f, $tbl_member_groups);
151
-				}
152
-			}
153
-		}
154
-		// end of user_groups stuff!
155
-
156
-		if($passwordnotifymethod == 'e') {
157
-			sendMailMessage($email, $newusername, $newpassword, $fullname);
158
-			if($input['stay'] != '') {
159
-				$a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11";
160
-				$header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
161
-				header($header);
162
-			} else {
163
-				$header = "Location: index.php?a=75&r=2";
164
-				header($header);
165
-			}
166
-		} else {
167
-			if($input['stay'] != '') {
168
-				$a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11";
169
-				$stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
170
-			} else {
171
-				$stayUrl = "index.php?a=75&r=2";
172
-			}
173
-
174
-			include_once "header.inc.php";
175
-			?>
72
+	    case '11' : // new user
73
+		    // check if this user name already exist
74
+		    $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername)));
75
+		    $limit = $modx->db->getValue($rs);
76
+		    if($limit > 0) {
77
+			    webAlertAndQuit("User name is already in use!");
78
+		    }
79
+
80
+		    // check if the email address already exist
81
+		    $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id));
82
+		    $limit = $modx->db->getValue($rs);
83
+		    if($limit > 0) {
84
+			    webAlertAndQuit("Email is already in use!");
85
+		    }
86
+
87
+		    // generate a new password for this user
88
+		    if($specifiedpassword != "" && $passwordgenmethod == "spec") {
89
+			    if(strlen($specifiedpassword) < 6) {
90
+				    webAlertAndQuit("Password is too short!");
91
+			    } else {
92
+				    $newpassword = $specifiedpassword;
93
+			    }
94
+		    } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
95
+			    webAlertAndQuit("You didn't specify a password for this user!");
96
+		    } elseif($passwordgenmethod == 'g') {
97
+			    $newpassword = generate_password(8);
98
+		    } else {
99
+			    webAlertAndQuit("No password generation method specified!");
100
+		    }
101
+
102
+		    // invoke OnBeforeUserFormSave event
103
+		    $modx->invokeEvent("OnBeforeUserFormSave", array(
104
+			    "mode" => "new",
105
+		    ));
106
+
107
+		    // create the user account
108
+		    $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users);
109
+
110
+		    $field = array();
111
+		    $field['password'] = $modx->phpass->HashPassword($newpassword);
112
+		    $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'");
113
+
114
+		    $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter');
115
+		    $field = $modx->db->escape($field);
116
+		    $modx->db->insert($field, $tbl_user_attributes);
117
+
118
+		    // Save user settings
119
+		    saveUserSettings($internalKey);
120
+
121
+		    // invoke OnManagerSaveUser event
122
+		    $modx->invokeEvent("OnManagerSaveUser", array(
123
+			    "mode" => "new",
124
+			    "userid" => $internalKey,
125
+			    "username" => $newusername,
126
+			    "userpassword" => $newpassword,
127
+			    "useremail" => $email,
128
+			    "userfullname" => $fullname,
129
+			    "userroleid" => $role
130
+		    ));
131
+
132
+		    // invoke OnUserFormSave event
133
+		    $modx->invokeEvent("OnUserFormSave", array(
134
+			    "mode" => "new",
135
+			    "id" => $internalKey
136
+		    ));
137
+
138
+		    // Set the item name for logger
139
+		    $_SESSION['itemname'] = $newusername;
140
+
141
+		    /*******************************************************************************/
142
+		    // put the user in the user_groups he/ she should be in
143
+		    // first, check that up_perms are switched on!
144
+		    if($use_udperms == 1) {
145
+			    if(!empty($user_groups)) {
146
+				    for($i = 0; $i < count($user_groups); $i++) {
147
+					    $f = array();
148
+					    $f['user_group'] = (int)$user_groups[$i];
149
+					    $f['member'] = $internalKey;
150
+					    $modx->db->insert($f, $tbl_member_groups);
151
+				    }
152
+			    }
153
+		    }
154
+		    // end of user_groups stuff!
155
+
156
+		    if($passwordnotifymethod == 'e') {
157
+			    sendMailMessage($email, $newusername, $newpassword, $fullname);
158
+			    if($input['stay'] != '') {
159
+				    $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11";
160
+				    $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
161
+				    header($header);
162
+			    } else {
163
+				    $header = "Location: index.php?a=75&r=2";
164
+				    header($header);
165
+			    }
166
+		    } else {
167
+			    if($input['stay'] != '') {
168
+				    $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11";
169
+				    $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
170
+			    } else {
171
+				    $stayUrl = "index.php?a=75&r=2";
172
+			    }
173
+
174
+			    include_once "header.inc.php";
175
+			    ?>
176 176
 
177 177
 			<h1><?php echo $_lang['user_title']; ?></h1>
178 178
 
@@ -194,125 +194,125 @@  discard block
 block discarded – undo
194 194
 			</div>
195 195
 			<?php
196 196
 
197
-			include_once "footer.inc.php";
198
-		}
199
-		break;
200
-	case '12' : // edit user
201
-		// generate a new password for this user
202
-		if($genpassword == 1) {
203
-			if($specifiedpassword != "" && $passwordgenmethod == "spec") {
204
-				if(strlen($specifiedpassword) < 6) {
205
-					webAlertAndQuit("Password is too short!");
206
-				} else {
207
-					$newpassword = $specifiedpassword;
208
-				}
209
-			} elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
210
-				webAlertAndQuit("You didn't specify a password for this user!");
211
-			} elseif($passwordgenmethod == 'g') {
212
-				$newpassword = generate_password(8);
213
-			} else {
214
-				webAlertAndQuit("No password generation method specified!");
215
-			}
216
-		}
217
-		if($passwordnotifymethod == 'e') {
218
-			sendMailMessage($email, $newusername, $newpassword, $fullname);
219
-		}
220
-
221
-		// check if the username already exist
222
-		$rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id));
223
-		$limit = $modx->db->getValue($rs);
224
-		if($limit > 0) {
225
-			webAlertAndQuit("User name is already in use!");
226
-		}
227
-
228
-		// check if the email address already exists
229
-		$rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id));
230
-		$limit = $modx->db->getValue($rs);
231
-		if($limit > 0) {
232
-			webAlertAndQuit("Email is already in use!");
233
-		}
234
-
235
-		// invoke OnBeforeUserFormSave event
236
-		$modx->invokeEvent("OnBeforeUserFormSave", array(
237
-			"mode" => "upd",
238
-			"id" => $id
239
-		));
240
-
241
-		// update user name and password
242
-		$field = array();
243
-		$field['username'] = $modx->db->escape($newusername);
244
-		if($genpassword == 1) {
245
-			$field['password'] = $modx->phpass->HashPassword($newpassword);
246
-		}
247
-		$modx->db->update($field, $tbl_manager_users, "id='{$id}'");
248
-		$field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter');
249
-		$field = $modx->db->escape($field);
250
-		$modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'");
251
-
252
-		// Save user settings
253
-		saveUserSettings($id);
254
-
255
-		// Set the item name for logger
256
-		$_SESSION['itemname'] = $newusername;
257
-
258
-		// invoke OnManagerSaveUser event
259
-		$modx->invokeEvent("OnManagerSaveUser", array(
260
-			"mode" => "upd",
261
-			"userid" => $id,
262
-			"username" => $newusername,
263
-			"userpassword" => $newpassword,
264
-			"useremail" => $email,
265
-			"userfullname" => $fullname,
266
-			"userroleid" => $role,
267
-			"oldusername" => (($oldusername != $newusername) ? $oldusername : ""),
268
-			"olduseremail" => (($oldemail != $email) ? $oldemail : "")
269
-		));
270
-
271
-		// invoke OnManagerChangePassword event
272
-		if($genpassword == 1) {
273
-			$modx->invokeEvent("OnManagerChangePassword", array(
274
-				"userid" => $id,
275
-				"username" => $newusername,
276
-				"userpassword" => $newpassword
277
-			));
278
-		}
279
-
280
-		// invoke OnUserFormSave event
281
-		$modx->invokeEvent("OnUserFormSave", array(
282
-			"mode" => "upd",
283
-			"id" => $id
284
-		));
285
-
286
-		/*******************************************************************************/
287
-		// put the user in the user_groups he/ she should be in
288
-		// first, check that up_perms are switched on!
289
-		if($use_udperms == 1) {
290
-			// as this is an existing user, delete his/ her entries in the groups before saving the new groups
291
-			$modx->db->delete($tbl_member_groups, "member='{$id}'");
292
-			if(!empty($user_groups)) {
293
-				for($i = 0; $i < count($user_groups); $i++) {
294
-					$field = array();
295
-					$field['user_group'] = (int)$user_groups[$i];
296
-					$field['member'] = $id;
297
-					$modx->db->insert($field, $tbl_member_groups);
298
-				}
299
-			}
300
-		}
301
-		// end of user_groups stuff!
302
-		/*******************************************************************************/
303
-		if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) {
304
-			$modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";');
305
-		}
306
-		if($genpassword == 1 && $passwordnotifymethod == 's') {
307
-			if($input['stay'] != '') {
308
-				$a = ($input['stay'] == '2') ? "12&id={$id}" : "11";
309
-				$stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
310
-			} else {
311
-				$stayUrl = "index.php?a=75&r=2";
312
-			}
313
-
314
-			include_once "header.inc.php";
315
-			?>
197
+			    include_once "footer.inc.php";
198
+		    }
199
+		    break;
200
+	    case '12' : // edit user
201
+		    // generate a new password for this user
202
+		    if($genpassword == 1) {
203
+			    if($specifiedpassword != "" && $passwordgenmethod == "spec") {
204
+				    if(strlen($specifiedpassword) < 6) {
205
+					    webAlertAndQuit("Password is too short!");
206
+				    } else {
207
+					    $newpassword = $specifiedpassword;
208
+				    }
209
+			    } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
210
+				    webAlertAndQuit("You didn't specify a password for this user!");
211
+			    } elseif($passwordgenmethod == 'g') {
212
+				    $newpassword = generate_password(8);
213
+			    } else {
214
+				    webAlertAndQuit("No password generation method specified!");
215
+			    }
216
+		    }
217
+		    if($passwordnotifymethod == 'e') {
218
+			    sendMailMessage($email, $newusername, $newpassword, $fullname);
219
+		    }
220
+
221
+		    // check if the username already exist
222
+		    $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id));
223
+		    $limit = $modx->db->getValue($rs);
224
+		    if($limit > 0) {
225
+			    webAlertAndQuit("User name is already in use!");
226
+		    }
227
+
228
+		    // check if the email address already exists
229
+		    $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id));
230
+		    $limit = $modx->db->getValue($rs);
231
+		    if($limit > 0) {
232
+			    webAlertAndQuit("Email is already in use!");
233
+		    }
234
+
235
+		    // invoke OnBeforeUserFormSave event
236
+		    $modx->invokeEvent("OnBeforeUserFormSave", array(
237
+			    "mode" => "upd",
238
+			    "id" => $id
239
+		    ));
240
+
241
+		    // update user name and password
242
+		    $field = array();
243
+		    $field['username'] = $modx->db->escape($newusername);
244
+		    if($genpassword == 1) {
245
+			    $field['password'] = $modx->phpass->HashPassword($newpassword);
246
+		    }
247
+		    $modx->db->update($field, $tbl_manager_users, "id='{$id}'");
248
+		    $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter');
249
+		    $field = $modx->db->escape($field);
250
+		    $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'");
251
+
252
+		    // Save user settings
253
+		    saveUserSettings($id);
254
+
255
+		    // Set the item name for logger
256
+		    $_SESSION['itemname'] = $newusername;
257
+
258
+		    // invoke OnManagerSaveUser event
259
+		    $modx->invokeEvent("OnManagerSaveUser", array(
260
+			    "mode" => "upd",
261
+			    "userid" => $id,
262
+			    "username" => $newusername,
263
+			    "userpassword" => $newpassword,
264
+			    "useremail" => $email,
265
+			    "userfullname" => $fullname,
266
+			    "userroleid" => $role,
267
+			    "oldusername" => (($oldusername != $newusername) ? $oldusername : ""),
268
+			    "olduseremail" => (($oldemail != $email) ? $oldemail : "")
269
+		    ));
270
+
271
+		    // invoke OnManagerChangePassword event
272
+		    if($genpassword == 1) {
273
+			    $modx->invokeEvent("OnManagerChangePassword", array(
274
+				    "userid" => $id,
275
+				    "username" => $newusername,
276
+				    "userpassword" => $newpassword
277
+			    ));
278
+		    }
279
+
280
+		    // invoke OnUserFormSave event
281
+		    $modx->invokeEvent("OnUserFormSave", array(
282
+			    "mode" => "upd",
283
+			    "id" => $id
284
+		    ));
285
+
286
+		    /*******************************************************************************/
287
+		    // put the user in the user_groups he/ she should be in
288
+		    // first, check that up_perms are switched on!
289
+		    if($use_udperms == 1) {
290
+			    // as this is an existing user, delete his/ her entries in the groups before saving the new groups
291
+			    $modx->db->delete($tbl_member_groups, "member='{$id}'");
292
+			    if(!empty($user_groups)) {
293
+				    for($i = 0; $i < count($user_groups); $i++) {
294
+					    $field = array();
295
+					    $field['user_group'] = (int)$user_groups[$i];
296
+					    $field['member'] = $id;
297
+					    $modx->db->insert($field, $tbl_member_groups);
298
+				    }
299
+			    }
300
+		    }
301
+		    // end of user_groups stuff!
302
+		    /*******************************************************************************/
303
+		    if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) {
304
+			    $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";');
305
+		    }
306
+		    if($genpassword == 1 && $passwordnotifymethod == 's') {
307
+			    if($input['stay'] != '') {
308
+				    $a = ($input['stay'] == '2') ? "12&id={$id}" : "11";
309
+				    $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
310
+			    } else {
311
+				    $stayUrl = "index.php?a=75&r=2";
312
+			    }
313
+
314
+			    include_once "header.inc.php";
315
+			    ?>
316 316
 
317 317
 			<h1><?php echo $_lang['user_title']; ?></h1>
318 318
 
@@ -332,20 +332,20 @@  discard block
 block discarded – undo
332 332
 			</div>
333 333
 			<?php
334 334
 
335
-			include_once "footer.inc.php";
336
-		} else {
337
-			if($input['stay'] != '') {
338
-				$a = ($input['stay'] == '2') ? "12&id={$id}" : "11";
339
-				$header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
340
-				header($header);
341
-			} else {
342
-				$header = "Location: index.php?a=75&r=2";
343
-				header($header);
344
-			}
345
-		}
346
-		break;
347
-	default:
348
-		webAlertAndQuit("No operation set in request.");
335
+			    include_once "footer.inc.php";
336
+		    } else {
337
+			    if($input['stay'] != '') {
338
+				    $a = ($input['stay'] == '2') ? "12&id={$id}" : "11";
339
+				    $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
340
+				    header($header);
341
+			    } else {
342
+				    $header = "Location: index.php?a=75&r=2";
343
+				    header($header);
344
+			    }
345
+		    }
346
+		    break;
347
+	    default:
348
+		    webAlertAndQuit("No operation set in request.");
349 349
 }
350 350
 
351 351
 /**
Please login to merge, or discard this patch.
manager/processors/save_content.processor.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -280,19 +280,19 @@
 block discarded – undo
280 280
             // invoke OnBeforeDocFormSave event
281 281
             switch($modx->config['docid_incrmnt_method'])
282 282
             {
283
-            case '1':
284
-                $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
285
-                $where = "T1.id IS NULL";
286
-                $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
287
-                $id = $modx->db->getValue($rs);
283
+                case '1':
284
+                    $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
285
+                    $where = "T1.id IS NULL";
286
+                    $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
287
+                    $id = $modx->db->getValue($rs);
288
+                    break;
289
+                case '2':
290
+                    $rs = $modx->db->select('MAX(id)+1', $tbl_site_content);
291
+                    $id = $modx->db->getValue($rs);
288 292
                 break;
289
-            case '2':
290
-                $rs = $modx->db->select('MAX(id)+1', $tbl_site_content);
291
-                $id = $modx->db->getValue($rs);
292
-            break;
293 293
 
294
-            default:
295
-                $id = '';
294
+                default:
295
+                    $id = '';
296 296
             }
297 297
 
298 298
         $modx->invokeEvent("OnBeforeDocFormSave", array(
Please login to merge, or discard this patch.
manager/processors/save_web_user.processor.php 1 patch
Switch Indentation   +228 added lines, -228 removed lines patch added patch discarded remove patch
@@ -60,110 +60,110 @@  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}'");
74
-			$limit = $modx->db->getValue($rs);
75
-			if($limit > 0) {
76
-				webAlertAndQuit("Email is already in use!");
77
-			}
78
-		}
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}'");
74
+			    $limit = $modx->db->getValue($rs);
75
+			    if($limit > 0) {
76
+				    webAlertAndQuit("Email is already in use!");
77
+			    }
78
+		    }
79
+
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;
86
+			    }
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
+
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
+			    }
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
+            ));
79 140
 
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;
86
-			}
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
-		}
141
+            // invoke OnWUsrFormSave event
142
+            $modx->invokeEvent("OnWUsrFormSave", array(
143
+                "mode" => "new",
144
+                "id" => $internalKey
145
+            ));
94 146
 
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
-			}
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);
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
-			?>
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
+			    ?>
167 167
 
168 168
 			<h1><?php echo $_lang['web_user_title']; ?></h1>
169 169
 
@@ -185,124 +185,124 @@  discard block
 block discarded – undo
185 185
 			</div>
186 186
 			<?php
187 187
 
188
-			include_once "footer.inc.php";
189
-		}
190
-		break;
191
-	case '88' : // edit user
192
-		// generate a new password for this user
193
-		if($genpassword == 1) {
194
-			if($specifiedpassword != "" && $passwordgenmethod == "spec") {
195
-				if(strlen($specifiedpassword) < 6) {
196
-					webAlertAndQuit("Password is too short!");
197
-				} else {
198
-					$newpassword = $specifiedpassword;
199
-				}
200
-			} elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
201
-				webAlertAndQuit("You didn't specify a password for this user!");
202
-			} elseif($passwordgenmethod == 'g') {
203
-				$newpassword = generate_password(8);
204
-			} else {
205
-				webAlertAndQuit("No password generation method specified!");
206
-			}
207
-		}
208
-		if($passwordnotifymethod == 'e') {
209
-			sendMailMessage($email, $newusername, $newpassword, $fullname);
210
-		}
211
-
212
-		// check if the username already exist
213
-		$rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'");
214
-		$limit = $modx->db->getValue($rs);
215
-		if($limit > 0) {
216
-			webAlertAndQuit("User name is already in use!");
217
-		}
218
-
219
-		// check if the email address already exists
220
-		if ($modx->config['allow_multiple_emails'] != 1) {
221
-			$rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'");
222
-			$limit = $modx->db->getValue($rs);
223
-			if($limit > 0) {
224
-				webAlertAndQuit("Email is already in use!");
225
-			}
226
-		}
227
-
228
-		// invoke OnBeforeWUsrFormSave event
229
-		$modx->invokeEvent("OnBeforeWUsrFormSave", array(
230
-			"mode" => "upd",
231
-			"id" => $id
232
-		));
233
-
234
-		// update user name and password
235
-		$field = array();
236
-		$field['username'] = $esc_newusername;
237
-		if($genpassword == 1) {
238
-			$field['password'] = md5($newpassword);
239
-		}
240
-		$modx->db->update($field, $tbl_web_users, "id='{$id}'");
241
-		$field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter');
242
-		$field = $modx->db->escape($field);
243
-		$modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'");
244
-
245
-		// Save User Settings
246
-		saveUserSettings($id);
247
-
248
-		// Set the item name for logger
249
-		$_SESSION['itemname'] = $newusername;
250
-
251
-		/*******************************************************************************/
252
-		// put the user in the user_groups he/ she should be in
253
-		// first, check that up_perms are switched on!
254
-		if($use_udperms == 1) {
255
-			// as this is an existing user, delete his/ her entries in the groups before saving the new groups
256
-			$modx->db->delete($tbl_web_groups, "webuser='{$id}'");
257
-			if(!empty($user_groups)) {
258
-				for($i = 0; $i < count($user_groups); $i++) {
259
-					$field = array();
260
-					$field['webgroup'] = (int)$user_groups[$i];
261
-					$field['webuser'] = $id;
262
-					$modx->db->insert($field, $tbl_web_groups);
263
-				}
264
-			}
265
-		}
266
-		// end of user_groups stuff!
267
-		/*******************************************************************************/
268
-
269
-        // invoke OnWebSaveUser event
270
-        $modx->invokeEvent("OnWebSaveUser", array(
271
-            "mode" => "upd",
272
-            "userid" => $id,
273
-            "username" => $newusername,
274
-            "userpassword" => $newpassword,
275
-            "useremail" => $email,
276
-            "userfullname" => $fullname,
277
-            "oldusername" => (($oldusername != $newusername) ? $oldusername : ""),
278
-            "olduseremail" => (($oldemail != $email) ? $oldemail : "")
279
-        ));
280
-
281
-        // invoke OnWebChangePassword event
282
-        if($genpassword == 1) {
283
-            $modx->invokeEvent("OnWebChangePassword", array(
188
+			    include_once "footer.inc.php";
189
+		    }
190
+		    break;
191
+	    case '88' : // edit user
192
+		    // generate a new password for this user
193
+		    if($genpassword == 1) {
194
+			    if($specifiedpassword != "" && $passwordgenmethod == "spec") {
195
+				    if(strlen($specifiedpassword) < 6) {
196
+					    webAlertAndQuit("Password is too short!");
197
+				    } else {
198
+					    $newpassword = $specifiedpassword;
199
+				    }
200
+			    } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
201
+				    webAlertAndQuit("You didn't specify a password for this user!");
202
+			    } elseif($passwordgenmethod == 'g') {
203
+				    $newpassword = generate_password(8);
204
+			    } else {
205
+				    webAlertAndQuit("No password generation method specified!");
206
+			    }
207
+		    }
208
+		    if($passwordnotifymethod == 'e') {
209
+			    sendMailMessage($email, $newusername, $newpassword, $fullname);
210
+		    }
211
+
212
+		    // check if the username already exist
213
+		    $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'");
214
+		    $limit = $modx->db->getValue($rs);
215
+		    if($limit > 0) {
216
+			    webAlertAndQuit("User name is already in use!");
217
+		    }
218
+
219
+		    // check if the email address already exists
220
+		    if ($modx->config['allow_multiple_emails'] != 1) {
221
+			    $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'");
222
+			    $limit = $modx->db->getValue($rs);
223
+			    if($limit > 0) {
224
+				    webAlertAndQuit("Email is already in use!");
225
+			    }
226
+		    }
227
+
228
+		    // invoke OnBeforeWUsrFormSave event
229
+		    $modx->invokeEvent("OnBeforeWUsrFormSave", array(
230
+			    "mode" => "upd",
231
+			    "id" => $id
232
+		    ));
233
+
234
+		    // update user name and password
235
+		    $field = array();
236
+		    $field['username'] = $esc_newusername;
237
+		    if($genpassword == 1) {
238
+			    $field['password'] = md5($newpassword);
239
+		    }
240
+		    $modx->db->update($field, $tbl_web_users, "id='{$id}'");
241
+		    $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter');
242
+		    $field = $modx->db->escape($field);
243
+		    $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'");
244
+
245
+		    // Save User Settings
246
+		    saveUserSettings($id);
247
+
248
+		    // Set the item name for logger
249
+		    $_SESSION['itemname'] = $newusername;
250
+
251
+		    /*******************************************************************************/
252
+		    // put the user in the user_groups he/ she should be in
253
+		    // first, check that up_perms are switched on!
254
+		    if($use_udperms == 1) {
255
+			    // as this is an existing user, delete his/ her entries in the groups before saving the new groups
256
+			    $modx->db->delete($tbl_web_groups, "webuser='{$id}'");
257
+			    if(!empty($user_groups)) {
258
+				    for($i = 0; $i < count($user_groups); $i++) {
259
+					    $field = array();
260
+					    $field['webgroup'] = (int)$user_groups[$i];
261
+					    $field['webuser'] = $id;
262
+					    $modx->db->insert($field, $tbl_web_groups);
263
+				    }
264
+			    }
265
+		    }
266
+		    // end of user_groups stuff!
267
+		    /*******************************************************************************/
268
+
269
+            // invoke OnWebSaveUser event
270
+            $modx->invokeEvent("OnWebSaveUser", array(
271
+                "mode" => "upd",
284 272
                 "userid" => $id,
285 273
                 "username" => $newusername,
286
-                "userpassword" => $newpassword
274
+                "userpassword" => $newpassword,
275
+                "useremail" => $email,
276
+                "userfullname" => $fullname,
277
+                "oldusername" => (($oldusername != $newusername) ? $oldusername : ""),
278
+                "olduseremail" => (($oldemail != $email) ? $oldemail : "")
287 279
             ));
288
-        }
289 280
 
290
-        // invoke OnWUsrFormSave event
291
-        $modx->invokeEvent("OnWUsrFormSave", array(
292
-            "mode" => "upd",
293
-            "id" => $id
294
-        ));
281
+            // invoke OnWebChangePassword event
282
+            if($genpassword == 1) {
283
+                $modx->invokeEvent("OnWebChangePassword", array(
284
+                    "userid" => $id,
285
+                    "username" => $newusername,
286
+                    "userpassword" => $newpassword
287
+                ));
288
+            }
289
+
290
+            // invoke OnWUsrFormSave event
291
+            $modx->invokeEvent("OnWUsrFormSave", array(
292
+                "mode" => "upd",
293
+                "id" => $id
294
+            ));
295 295
 
296
-		if($genpassword == 1 && $passwordnotifymethod == 's') {
297
-			if($input['stay'] != '') {
298
-				$a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
299
-				$stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
300
-			} else {
301
-				$stayUrl = "index.php?a=99&r=2";
302
-			}
296
+		    if($genpassword == 1 && $passwordnotifymethod == 's') {
297
+			    if($input['stay'] != '') {
298
+				    $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
299
+				    $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
300
+			    } else {
301
+				    $stayUrl = "index.php?a=99&r=2";
302
+			    }
303 303
 
304
-			include_once "header.inc.php";
305
-			?>
304
+			    include_once "header.inc.php";
305
+			    ?>
306 306
 
307 307
 			<h1><?php echo $_lang['web_user_title']; ?></h1>
308 308
 
@@ -322,20 +322,20 @@  discard block
 block discarded – undo
322 322
 			</div>
323 323
 			<?php
324 324
 
325
-			include_once "footer.inc.php";
326
-		} else {
327
-			if($input['stay'] != '') {
328
-				$a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
329
-				$header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
330
-				header($header);
331
-			} else {
332
-				$header = "Location: index.php?a=99&r=2";
333
-				header($header);
334
-			}
335
-		}
336
-		break;
337
-	default :
338
-		webAlertAndQuit("No operation set in request.");
325
+			    include_once "footer.inc.php";
326
+		    } else {
327
+			    if($input['stay'] != '') {
328
+				    $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
329
+				    $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
330
+				    header($header);
331
+			    } else {
332
+				    $header = "Location: index.php?a=99&r=2";
333
+				    header($header);
334
+			    }
335
+		    }
336
+		    break;
337
+	    default :
338
+		    webAlertAndQuit("No operation set in request.");
339 339
 }
340 340
 
341 341
 /**
Please login to merge, or discard this patch.
manager/actions/mutate_user.dynamic.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch($modx->manager->action) {
7
-	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 12:
8
+		    if(!$modx->hasPermission('edit_user')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 11:
13
+		    if(!$modx->hasPermission('new_user')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.