@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | |
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; |
@@ -23,79 +23,79 @@ discard block |
||
23 | 23 | // check to see the snippet editor isn't locked |
24 | 24 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
25 | 25 | if($username = $modx->db->getValue($rs)) { |
26 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
26 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | 30 | if($modx->manager->action == '12') { |
31 | - // get user attribute |
|
32 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | - $userdata = $modx->db->getRow($rs); |
|
34 | - if(!$userdata) { |
|
35 | - $modx->webAlertAndQuit("No user returned!"); |
|
36 | - } |
|
31 | + // get user attribute |
|
32 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | + $userdata = $modx->db->getRow($rs); |
|
34 | + if(!$userdata) { |
|
35 | + $modx->webAlertAndQuit("No user returned!"); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
39 | 39 | $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!'); |
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | - // get user settings |
|
44 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
45 | - $usersettings = array(); |
|
46 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | - // manually extract so that user display settings are not overwritten |
|
48 | - foreach($usersettings as $k => $v) { |
|
49 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | - ${$k} = $v; |
|
51 | - } |
|
52 | - } |
|
43 | + // get user settings |
|
44 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
45 | + $usersettings = array(); |
|
46 | + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | + // manually extract so that user display settings are not overwritten |
|
48 | + foreach($usersettings as $k => $v) { |
|
49 | + if($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | + ${$k} = $v; |
|
51 | + } |
|
52 | + } |
|
53 | 53 | |
54 | - // get user name |
|
55 | - $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
56 | - $usernamedata = $modx->db->getRow($rs); |
|
57 | - if(!$usernamedata) { |
|
58 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
59 | - } |
|
60 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
54 | + // get user name |
|
55 | + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
56 | + $usernamedata = $modx->db->getRow($rs); |
|
57 | + if(!$usernamedata) { |
|
58 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
59 | + } |
|
60 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
61 | 61 | } else { |
62 | - $userdata = array(); |
|
63 | - $usersettings = array(); |
|
64 | - $usernamedata = array(); |
|
65 | - $_SESSION['itemname'] = $_lang["new_user"]; |
|
62 | + $userdata = array(); |
|
63 | + $usersettings = array(); |
|
64 | + $usernamedata = array(); |
|
65 | + $_SESSION['itemname'] = $_lang["new_user"]; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // avoid doubling htmlspecialchars (already encoded in DB) |
69 | 69 | foreach($userdata as $key => $val) { |
70 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
70 | + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
71 | 71 | }; |
72 | 72 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
73 | 73 | |
74 | 74 | // restore saved form |
75 | 75 | $formRestored = false; |
76 | 76 | if($modx->manager->hasFormValues()) { |
77 | - $modx->manager->loadFormValues(); |
|
78 | - // restore post values |
|
79 | - $userdata = array_merge($userdata, $_POST); |
|
80 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
81 | - $usernamedata['username'] = $userdata['newusername']; |
|
82 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
83 | - $usersettings = array_merge($usersettings, $userdata); |
|
84 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
85 | - extract($usersettings, EXTR_OVERWRITE); |
|
77 | + $modx->manager->loadFormValues(); |
|
78 | + // restore post values |
|
79 | + $userdata = array_merge($userdata, $_POST); |
|
80 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
81 | + $usernamedata['username'] = $userdata['newusername']; |
|
82 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
83 | + $usersettings = array_merge($usersettings, $userdata); |
|
84 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
85 | + extract($usersettings, EXTR_OVERWRITE); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // include the country list language file |
89 | 89 | $_country_lang = array(); |
90 | 90 | include_once "lang/country/english_country.inc.php"; |
91 | 91 | if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
92 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
92 | + include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
93 | 93 | } |
94 | 94 | asort($_country_lang); |
95 | 95 | |
96 | 96 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
97 | 97 | if($which_browser == 'default') { |
98 | - $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
98 | + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
99 | 99 | } |
100 | 100 | ?> |
101 | 101 | <script type="text/javascript"> |
@@ -205,14 +205,14 @@ discard block |
||
205 | 205 | <form action="index.php?a=32" method="post" name="userform"> |
206 | 206 | <?php |
207 | 207 | |
208 | - // invoke OnUserFormPrerender event |
|
209 | - $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
210 | - "id" => $user |
|
211 | - )); |
|
212 | - if(is_array($evtOut)) { |
|
213 | - echo implode("", $evtOut); |
|
214 | - } |
|
215 | - ?> |
|
208 | + // invoke OnUserFormPrerender event |
|
209 | + $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
210 | + "id" => $user |
|
211 | + )); |
|
212 | + if(is_array($evtOut)) { |
|
213 | + echo implode("", $evtOut); |
|
214 | + } |
|
215 | + ?> |
|
216 | 216 | <input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>"> |
217 | 217 | <input type="hidden" name="id" value="<?php echo $user ?>"> |
218 | 218 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
@@ -305,21 +305,21 @@ discard block |
||
305 | 305 | <td> </td> |
306 | 306 | <td><?php |
307 | 307 | |
308 | - $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
309 | - ?> |
|
308 | + $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
309 | + ?> |
|
310 | 310 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
311 | 311 | <?php |
312 | - while($row = $modx->db->getRow($rs)) { |
|
313 | - if($modx->manager->action == '11') { |
|
314 | - $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
315 | - } else { |
|
316 | - $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
317 | - } |
|
318 | - ?> |
|
312 | + while($row = $modx->db->getRow($rs)) { |
|
313 | + if($modx->manager->action == '11') { |
|
314 | + $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
315 | + } else { |
|
316 | + $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
317 | + } |
|
318 | + ?> |
|
319 | 319 | <option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option> |
320 | 320 | <?php |
321 | - } |
|
322 | - ?> |
|
321 | + } |
|
322 | + ?> |
|
323 | 323 | </select></td> |
324 | 324 | </tr> |
325 | 325 | <tr> |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
365 | 365 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
366 | 366 | <?php |
367 | - foreach($_country_lang as $key => $country) { |
|
368 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
369 | - } |
|
370 | - ?> |
|
367 | + foreach($_country_lang as $key => $country) { |
|
368 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
369 | + } |
|
370 | + ?> |
|
371 | 371 | </select></td> |
372 | 372 | </tr> |
373 | 373 | <tr> |
@@ -443,21 +443,21 @@ discard block |
||
443 | 443 | <td><select name="manager_language" class="inputBox" onChange="documentDirty=true"> |
444 | 444 | <option value=""></option> |
445 | 445 | <?php |
446 | - $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
447 | - $dir = dir("includes/lang"); |
|
448 | - while($file = $dir->read()) { |
|
449 | - if(strpos($file, ".inc.php") > 0) { |
|
450 | - $endpos = strpos($file, "."); |
|
451 | - $languagename = substr($file, 0, $endpos); |
|
452 | - $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
453 | - ?> |
|
446 | + $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
447 | + $dir = dir("includes/lang"); |
|
448 | + while($file = $dir->read()) { |
|
449 | + if(strpos($file, ".inc.php") > 0) { |
|
450 | + $endpos = strpos($file, "."); |
|
451 | + $languagename = substr($file, 0, $endpos); |
|
452 | + $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
453 | + ?> |
|
454 | 454 | <option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option> |
455 | 455 | <?php |
456 | 456 | |
457 | - } |
|
458 | - } |
|
459 | - $dir->close(); |
|
460 | - ?> |
|
457 | + } |
|
458 | + } |
|
459 | + $dir->close(); |
|
460 | + ?> |
|
461 | 461 | </select></td> |
462 | 462 | </tr> |
463 | 463 | <tr> |
@@ -532,22 +532,22 @@ discard block |
||
532 | 532 | <td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());"> |
533 | 533 | <option value=""></option> |
534 | 534 | <?php |
535 | - $dir = dir("media/style/"); |
|
536 | - while($file = $dir->read()) { |
|
537 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
538 | - $themename = $file; |
|
539 | - if($themename === 'common') { |
|
540 | - continue; |
|
541 | - } |
|
542 | - $attr = 'value="' . $themename . '" '; |
|
543 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
544 | - $attr .= 'selected="selected" '; |
|
545 | - } |
|
546 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
547 | - } |
|
548 | - } |
|
549 | - $dir->close(); |
|
550 | - ?> |
|
535 | + $dir = dir("media/style/"); |
|
536 | + while($file = $dir->read()) { |
|
537 | + if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
538 | + $themename = $file; |
|
539 | + if($themename === 'common') { |
|
540 | + continue; |
|
541 | + } |
|
542 | + $attr = 'value="' . $themename . '" '; |
|
543 | + if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
544 | + $attr .= 'selected="selected" '; |
|
545 | + } |
|
546 | + echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
547 | + } |
|
548 | + } |
|
549 | + $dir->close(); |
|
550 | + ?> |
|
551 | 551 | </select> |
552 | 552 | <input type="hidden" name="theme_refresher" value=""></td> |
553 | 553 | </tr> |
@@ -583,15 +583,15 @@ discard block |
||
583 | 583 | <th><?php echo $_lang["which_browser_title"] ?></th> |
584 | 584 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
585 | 585 | <?php |
586 | - $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
587 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
588 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
589 | - $dir = str_replace('\\', '/', $dir); |
|
590 | - $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
591 | - $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
592 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
593 | - } |
|
594 | - ?> |
|
586 | + $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
587 | + echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
588 | + foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
589 | + $dir = str_replace('\\', '/', $dir); |
|
590 | + $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
591 | + $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
592 | + echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
593 | + } |
|
594 | + ?> |
|
595 | 595 | </select></td> |
596 | 596 | </tr> |
597 | 597 | <tr> |
@@ -668,17 +668,17 @@ discard block |
||
668 | 668 | <option value=""></option> |
669 | 669 | <?php |
670 | 670 | |
671 | - $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
672 | - // invoke OnRichTextEditorRegister event |
|
673 | - $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
674 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
675 | - if(is_array($evtOut)) { |
|
676 | - for($i = 0; $i < count($evtOut); $i++) { |
|
677 | - $editor = $evtOut[$i]; |
|
678 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
679 | - } |
|
680 | - } |
|
681 | - ?> |
|
671 | + $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
672 | + // invoke OnRichTextEditorRegister event |
|
673 | + $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
674 | + echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
675 | + if(is_array($evtOut)) { |
|
676 | + for($i = 0; $i < count($evtOut); $i++) { |
|
677 | + $editor = $evtOut[$i]; |
|
678 | + echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
679 | + } |
|
680 | + } |
|
681 | + ?> |
|
682 | 682 | </select></td> |
683 | 683 | </tr> |
684 | 684 | <tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>"> |
@@ -711,12 +711,12 @@ discard block |
||
711 | 711 | </tr> |
712 | 712 | </table> |
713 | 713 | <?php |
714 | - // invoke OnInterfaceSettingsRender event |
|
715 | - $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
716 | - if(is_array($evtOut)) { |
|
717 | - echo implode("", $evtOut); |
|
718 | - } |
|
719 | - ?> |
|
714 | + // invoke OnInterfaceSettingsRender event |
|
715 | + $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
716 | + if(is_array($evtOut)) { |
|
717 | + echo implode("", $evtOut); |
|
718 | + } |
|
719 | + ?> |
|
720 | 720 | </div> |
721 | 721 | |
722 | 722 | <!-- Photo --> |
@@ -765,39 +765,39 @@ discard block |
||
765 | 765 | </div> |
766 | 766 | <?php if($use_udperms == 1) { |
767 | 767 | |
768 | - $groupsarray = array(); |
|
769 | - |
|
770 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
771 | - $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
772 | - $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
773 | - } |
|
774 | - // retain selected doc groups between post |
|
775 | - if(is_array($_POST['user_groups'])) { |
|
776 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
777 | - } |
|
778 | - ?> |
|
768 | + $groupsarray = array(); |
|
769 | + |
|
770 | + if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
771 | + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
772 | + $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
773 | + } |
|
774 | + // retain selected doc groups between post |
|
775 | + if(is_array($_POST['user_groups'])) { |
|
776 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
777 | + } |
|
778 | + ?> |
|
779 | 779 | <div class="tab-page" id="tabAccess"> |
780 | 780 | <h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2> |
781 | 781 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script> |
782 | 782 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
783 | 783 | <?php |
784 | - $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
785 | - while($row = $modx->db->getRow($rs)) { |
|
786 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
787 | - } |
|
788 | - } |
|
789 | - ?> |
|
784 | + $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
785 | + while($row = $modx->db->getRow($rs)) { |
|
786 | + echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
787 | + } |
|
788 | + } |
|
789 | + ?> |
|
790 | 790 | </div> |
791 | 791 | </div> |
792 | 792 | </div> |
793 | 793 | <input type="submit" name="save" style="display:none"> |
794 | 794 | <?php |
795 | - // invoke OnUserFormRender event |
|
796 | - $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
797 | - "id" => $user |
|
798 | - )); |
|
799 | - if(is_array($evtOut)) { |
|
800 | - echo implode("", $evtOut); |
|
801 | - } |
|
802 | - ?> |
|
795 | + // invoke OnUserFormRender event |
|
796 | + $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
797 | + "id" => $user |
|
798 | + )); |
|
799 | + if(is_array($evtOut)) { |
|
800 | + echo implode("", $evtOut); |
|
801 | + } |
|
802 | + ?> |
|
803 | 803 | </form> |
@@ -1,16 +1,16 @@ discard block |
||
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 | |
6 | -switch($modx->manager->action) { |
|
6 | +switch ($modx->manager->action) { |
|
7 | 7 | case 12: |
8 | - if(!$modx->hasPermission('edit_user')) { |
|
8 | + if (!$modx->hasPermission('edit_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 11: |
13 | - if(!$modx->hasPermission('new_user')) { |
|
13 | + if (!$modx->hasPermission('new_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -18,24 +18,24 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | // check to see the snippet editor isn't locked |
24 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
25 | -if($username = $modx->db->getValue($rs)) { |
|
24 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
25 | +if ($username = $modx->db->getValue($rs)) { |
|
26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | -if($modx->manager->action == '12') { |
|
30 | +if ($modx->manager->action == '12') { |
|
31 | 31 | // get user attribute |
32 | 32 | $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
33 | 33 | $userdata = $modx->db->getRow($rs); |
34 | - if(!$userdata) { |
|
34 | + if (!$userdata) { |
|
35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
36 | 36 | } |
37 | 37 | |
38 | - if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
38 | + if ($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
39 | 39 | $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!'); |
40 | 40 | } |
41 | 41 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | // get user settings |
44 | 44 | $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
45 | 45 | $usersettings = array(); |
46 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
46 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | 47 | // manually extract so that user display settings are not overwritten |
48 | - foreach($usersettings as $k => $v) { |
|
49 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
48 | + foreach ($usersettings as $k => $v) { |
|
49 | + if ($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | 50 | ${$k} = $v; |
51 | 51 | } |
52 | 52 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // get user name |
55 | 55 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
56 | 56 | $usernamedata = $modx->db->getRow($rs); |
57 | - if(!$usernamedata) { |
|
57 | + if (!$usernamedata) { |
|
58 | 58 | $modx->webAlertAndQuit("No user returned while getting username!"); |
59 | 59 | } |
60 | 60 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // avoid doubling htmlspecialchars (already encoded in DB) |
69 | -foreach($userdata as $key => $val) { |
|
69 | +foreach ($userdata as $key => $val) { |
|
70 | 70 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
71 | 71 | }; |
72 | 72 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
73 | 73 | |
74 | 74 | // restore saved form |
75 | 75 | $formRestored = false; |
76 | -if($modx->manager->hasFormValues()) { |
|
76 | +if ($modx->manager->hasFormValues()) { |
|
77 | 77 | $modx->manager->loadFormValues(); |
78 | 78 | // restore post values |
79 | 79 | $userdata = array_merge($userdata, $_POST); |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | // include the country list language file |
89 | 89 | $_country_lang = array(); |
90 | 90 | include_once "lang/country/english_country.inc.php"; |
91 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
92 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
91 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
92 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
93 | 93 | } |
94 | 94 | asort($_country_lang); |
95 | 95 | |
96 | 96 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
97 | -if($which_browser == 'default') { |
|
97 | +if ($which_browser == 'default') { |
|
98 | 98 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
99 | 99 | } |
100 | 100 | ?> |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | document.userform.save.click(); |
187 | 187 | }, |
188 | 188 | delete: function() { |
189 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
189 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
190 | 190 | alert("<?php echo $_lang['alert_delete_self']; ?>"); |
191 | 191 | <?php } else { ?> |
192 | 192 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
210 | 210 | "id" => $user |
211 | 211 | )); |
212 | - if(is_array($evtOut)) { |
|
212 | + if (is_array($evtOut)) { |
|
213 | 213 | echo implode("", $evtOut); |
214 | 214 | } |
215 | 215 | ?> |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
219 | 219 | |
220 | 220 | <h1> |
221 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?> |
|
221 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?> |
|
222 | 222 | </h1> |
223 | 223 | |
224 | 224 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
237 | 237 | <tr> |
238 | 238 | <td colspan="3"><span id="blocked" class="warning"> |
239 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
239 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
240 | 240 | <?php echo $_lang['user_is_blocked']; ?> |
241 | 241 | <?php } ?> |
242 | 242 | </span> |
243 | 243 | <br /></td> |
244 | 244 | </tr> |
245 | - <?php if(!empty($userdata['id'])) { ?> |
|
245 | + <?php if (!empty($userdata['id'])) { ?> |
|
246 | 246 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
247 | 247 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
248 | 248 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
256 | 256 | </tr> |
257 | 257 | <tr> |
258 | - <th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
258 | + <th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
259 | 259 | <td> </td> |
260 | 260 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>> |
261 | 261 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -309,8 +309,8 @@ discard block |
||
309 | 309 | ?> |
310 | 310 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
311 | 311 | <?php |
312 | - while($row = $modx->db->getRow($rs)) { |
|
313 | - if($modx->manager->action == '11') { |
|
312 | + while ($row = $modx->db->getRow($rs)) { |
|
313 | + if ($modx->manager->action == '11') { |
|
314 | 314 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
315 | 315 | } else { |
316 | 316 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -364,8 +364,8 @@ discard block |
||
364 | 364 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
365 | 365 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
366 | 366 | <?php |
367 | - foreach($_country_lang as $key => $country) { |
|
368 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
367 | + foreach ($_country_lang as $key => $country) { |
|
368 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
369 | 369 | } |
370 | 370 | ?> |
371 | 371 | </select></td> |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | <td> </td> |
392 | 392 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td> |
393 | 393 | </tr> |
394 | - <?php if($modx->manager->action == '12') { ?> |
|
394 | + <?php if ($modx->manager->action == '12') { ?> |
|
395 | 395 | <tr> |
396 | 396 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
397 | 397 | <td> </td> |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | </tr> |
429 | 429 | <?php } ?> |
430 | 430 | </table> |
431 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
431 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
432 | 432 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
433 | 433 | <?php } ?> |
434 | 434 | </div> |
@@ -445,8 +445,8 @@ discard block |
||
445 | 445 | <?php |
446 | 446 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
447 | 447 | $dir = dir("includes/lang"); |
448 | - while($file = $dir->read()) { |
|
449 | - if(strpos($file, ".inc.php") > 0) { |
|
448 | + while ($file = $dir->read()) { |
|
449 | + if (strpos($file, ".inc.php") > 0) { |
|
450 | 450 | $endpos = strpos($file, "."); |
451 | 451 | $languagename = substr($file, 0, $endpos); |
452 | 452 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -533,17 +533,17 @@ discard block |
||
533 | 533 | <option value=""></option> |
534 | 534 | <?php |
535 | 535 | $dir = dir("media/style/"); |
536 | - while($file = $dir->read()) { |
|
537 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
536 | + while ($file = $dir->read()) { |
|
537 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
538 | 538 | $themename = $file; |
539 | - if($themename === 'common') { |
|
539 | + if ($themename === 'common') { |
|
540 | 540 | continue; |
541 | 541 | } |
542 | - $attr = 'value="' . $themename . '" '; |
|
543 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
542 | + $attr = 'value="'.$themename.'" '; |
|
543 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
544 | 544 | $attr .= 'selected="selected" '; |
545 | 545 | } |
546 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
546 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
547 | 547 | } |
548 | 548 | } |
549 | 549 | $dir->close(); |
@@ -584,12 +584,12 @@ discard block |
||
584 | 584 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
585 | 585 | <?php |
586 | 586 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
587 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
588 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
587 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
588 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
589 | 589 | $dir = str_replace('\\', '/', $dir); |
590 | 590 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
591 | 591 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
592 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
592 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
593 | 593 | } |
594 | 594 | ?> |
595 | 595 | </select></td> |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | </tr> |
617 | 617 | <tr> |
618 | 618 | <td> </td> |
619 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
619 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
620 | 620 | </tr> |
621 | 621 | <tr> |
622 | 622 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | </tr> |
629 | 629 | <tr> |
630 | 630 | <td> </td> |
631 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
631 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
632 | 632 | </tr> |
633 | 633 | <tr> |
634 | 634 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | </tr> |
641 | 641 | <tr> |
642 | 642 | <td> </td> |
643 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
643 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
644 | 644 | </tr> |
645 | 645 | <tr> |
646 | 646 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | </tr> |
653 | 653 | <tr> |
654 | 654 | <td> </td> |
655 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
655 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
656 | 656 | </tr> |
657 | 657 | <tr class='row2'> |
658 | 658 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -671,11 +671,11 @@ discard block |
||
671 | 671 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
672 | 672 | // invoke OnRichTextEditorRegister event |
673 | 673 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
674 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
675 | - if(is_array($evtOut)) { |
|
676 | - for($i = 0; $i < count($evtOut); $i++) { |
|
674 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
675 | + if (is_array($evtOut)) { |
|
676 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
677 | 677 | $editor = $evtOut[$i]; |
678 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
678 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
679 | 679 | } |
680 | 680 | } |
681 | 681 | ?> |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | <?php |
714 | 714 | // invoke OnInterfaceSettingsRender event |
715 | 715 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
716 | - if(is_array($evtOut)) { |
|
716 | + if (is_array($evtOut)) { |
|
717 | 717 | echo implode("", $evtOut); |
718 | 718 | } |
719 | 719 | ?> |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | function BrowseServer() { |
741 | 741 | var w = screen.width * 0.7; |
742 | 742 | var h = screen.height * 0.7; |
743 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
743 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
744 | 744 | } |
745 | 745 | |
746 | 746 | function SetUrl(url, width, height, alt) { |
@@ -763,17 +763,17 @@ discard block |
||
763 | 763 | </tr> |
764 | 764 | </table> |
765 | 765 | </div> |
766 | - <?php if($use_udperms == 1) { |
|
766 | + <?php if ($use_udperms == 1) { |
|
767 | 767 | |
768 | 768 | $groupsarray = array(); |
769 | 769 | |
770 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
770 | + if ($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
771 | 771 | $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
772 | 772 | $groupsarray = $modx->db->getColumn('user_group', $rs); |
773 | 773 | } |
774 | 774 | // retain selected doc groups between post |
775 | - if(is_array($_POST['user_groups'])) { |
|
776 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
775 | + if (is_array($_POST['user_groups'])) { |
|
776 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
777 | 777 | } |
778 | 778 | ?> |
779 | 779 | <div class="tab-page" id="tabAccess"> |
@@ -782,8 +782,8 @@ discard block |
||
782 | 782 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
783 | 783 | <?php |
784 | 784 | $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
785 | - while($row = $modx->db->getRow($rs)) { |
|
786 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
785 | + while ($row = $modx->db->getRow($rs)) { |
|
786 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
787 | 787 | } |
788 | 788 | } |
789 | 789 | ?> |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
797 | 797 | "id" => $user |
798 | 798 | )); |
799 | - if(is_array($evtOut)) { |
|
799 | + if (is_array($evtOut)) { |
|
800 | 800 | echo implode("", $evtOut); |
801 | 801 | } |
802 | 802 | ?> |