@@ -3,12 +3,12 @@ |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('new_snippet')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // count duplicates |
@@ -3,7 +3,7 @@ discard block |
||
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_password')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = $_POST['id']; |
@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | $pass2 = $_POST['pass2']; |
12 | 12 | |
13 | 13 | if($pass1!=$pass2){ |
14 | - $modx->webAlertAndQuit("Passwords don't match!"); |
|
14 | + $modx->webAlertAndQuit("Passwords don't match!"); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | if(strlen($pass1)<6){ |
18 | - $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
|
18 | + $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $pass1 = $modx->getPhpCompat()->htmlspecialchars($pass1, ENT_NOQUOTES); |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | $user = EvolutionCMS\Models\ManagerUser::find($uid); |
25 | 25 | $user->update(['password' => $password]); |
26 | 26 | |
27 | - // invoke OnManagerChangePassword event |
|
28 | - $modx->invokeEvent('OnManagerChangePassword', array ( |
|
29 | - 'userid' => $uid, |
|
30 | - 'username' => $_SESSION['mgrShortname'], |
|
31 | - 'userpassword' => $pass1 |
|
32 | - )); |
|
27 | + // invoke OnManagerChangePassword event |
|
28 | + $modx->invokeEvent('OnManagerChangePassword', array ( |
|
29 | + 'userid' => $uid, |
|
30 | + 'username' => $_SESSION['mgrShortname'], |
|
31 | + 'userpassword' => $pass1 |
|
32 | + )); |
|
33 | 33 | |
34 | 34 | $header="Location: index.php?a=2"; |
35 | 35 | header($header); |
@@ -1,20 +1,20 @@ 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 | switch($modx->getManagerApi()->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) |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | // check to see the module editor isn't locked |
34 | 34 | if($lockedEl = $modx->elementIsLocked(6, $id)) { |
35 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
35 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
36 | 36 | } |
37 | 37 | // end check for lock |
38 | 38 | |
@@ -40,22 +40,22 @@ discard block |
||
40 | 40 | $modx->lockElement(6, $id); |
41 | 41 | |
42 | 42 | if(isset($_GET['id'])) { |
43 | - $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'"); |
|
44 | - $content = $modx->getDatabase()->getRow($rs); |
|
45 | - if(!$content) { |
|
46 | - $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
47 | - } |
|
48 | - $content['properties'] = str_replace("&", "&", $content['properties']); |
|
49 | - $_SESSION['itemname'] = $content['name']; |
|
50 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
51 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
52 | - } |
|
43 | + $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'"); |
|
44 | + $content = $modx->getDatabase()->getRow($rs); |
|
45 | + if(!$content) { |
|
46 | + $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
47 | + } |
|
48 | + $content['properties'] = str_replace("&", "&", $content['properties']); |
|
49 | + $_SESSION['itemname'] = $content['name']; |
|
50 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
51 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
52 | + } |
|
53 | 53 | } else { |
54 | - $_SESSION['itemname'] = $_lang["new_module"]; |
|
55 | - $content['wrap'] = '1'; |
|
54 | + $_SESSION['itemname'] = $_lang["new_module"]; |
|
55 | + $content['wrap'] = '1'; |
|
56 | 56 | } |
57 | 57 | if($modx->getManagerApi()->hasFormValues()) { |
58 | - $modx->getManagerApi()->loadFormValues(); |
|
58 | + $modx->getManagerApi()->loadFormValues(); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | // Add lock-element JS-Script |
@@ -426,18 +426,18 @@ discard block |
||
426 | 426 | |
427 | 427 | <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109"> |
428 | 428 | <?php |
429 | - // invoke OnModFormPrerender event |
|
430 | - $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
431 | - if(is_array($evtOut)) { |
|
432 | - echo implode('', $evtOut); |
|
433 | - } |
|
434 | - |
|
435 | - // Prepare internal params & info-tab via parseDocBlock |
|
436 | - $modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : ''; |
|
437 | - $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
438 | - $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
439 | - $internal = array(); |
|
440 | - ?> |
|
429 | + // invoke OnModFormPrerender event |
|
430 | + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
431 | + if(is_array($evtOut)) { |
|
432 | + echo implode('', $evtOut); |
|
433 | + } |
|
434 | + |
|
435 | + // Prepare internal params & info-tab via parseDocBlock |
|
436 | + $modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : ''; |
|
437 | + $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
438 | + $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
439 | + $internal = array(); |
|
440 | + ?> |
|
441 | 441 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
442 | 442 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>"> |
443 | 443 | |
@@ -490,11 +490,11 @@ discard block |
||
490 | 490 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
491 | 491 | <option> </option> |
492 | 492 | <?php |
493 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
494 | - foreach(getCategories() as $n => $v) { |
|
495 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
496 | - } |
|
497 | - ?> |
|
493 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
494 | + foreach(getCategories() as $n => $v) { |
|
495 | + echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
496 | + } |
|
497 | + ?> |
|
498 | 498 | </select> |
499 | 499 | </div> |
500 | 500 | </div> |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | <i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a> |
602 | 602 | </div> |
603 | 603 | <?php |
604 | - $ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
604 | + $ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
605 | 605 | CASE smd.type |
606 | 606 | WHEN 10 THEN 'Chunk' |
607 | 607 | WHEN 20 THEN 'Document' |
@@ -617,16 +617,16 @@ discard block |
||
617 | 617 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 |
618 | 618 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); |
619 | 619 | |
620 | - $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
621 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
622 | - $grd->cssClass = 'grid'; |
|
623 | - $grd->columnHeaderClass = 'gridHeader'; |
|
624 | - $grd->itemClass = 'gridItem'; |
|
625 | - $grd->altItemClass = 'gridAltItem'; |
|
626 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
627 | - $grd->fields = "name,type"; |
|
628 | - echo $grd->render(); |
|
629 | - ?> |
|
620 | + $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
621 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
622 | + $grd->cssClass = 'grid'; |
|
623 | + $grd->columnHeaderClass = 'gridHeader'; |
|
624 | + $grd->itemClass = 'gridItem'; |
|
625 | + $grd->altItemClass = 'gridAltItem'; |
|
626 | + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
627 | + $grd->fields = "name,type"; |
|
628 | + echo $grd->render(); |
|
629 | + ?> |
|
630 | 630 | </div> |
631 | 631 | </div> |
632 | 632 | <?php endif; ?> |
@@ -638,12 +638,12 @@ discard block |
||
638 | 638 | <div class="container container-body"> |
639 | 639 | <?php if($modx->getConfig('use_udperms')) : ?> |
640 | 640 | <?php |
641 | - // fetch user access permissions for the module |
|
642 | - $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
643 | - $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs); |
|
641 | + // fetch user access permissions for the module |
|
642 | + $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
643 | + $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs); |
|
644 | 644 | |
645 | - if($modx->hasPermission('access_permissions')) { |
|
646 | - ?> |
|
645 | + if($modx->hasPermission('access_permissions')) { |
|
646 | + ?> |
|
647 | 647 | <!-- User Group Access Permissions --> |
648 | 648 | <script type="text/javascript"> |
649 | 649 | function makePublic(b) { |
@@ -667,28 +667,28 @@ discard block |
||
667 | 667 | </script> |
668 | 668 | <p><?= $_lang['module_group_access_msg'] ?></p> |
669 | 669 | <?php |
670 | - } |
|
671 | - $chk = ''; |
|
672 | - $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
673 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
674 | - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
675 | - $checked = in_array($row['id'], $groupsarray); |
|
676 | - if($modx->hasPermission('access_permissions')) { |
|
677 | - if($checked) { |
|
678 | - $notPublic = true; |
|
679 | - } |
|
680 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
681 | - } else { |
|
682 | - if($checked) { |
|
683 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
684 | - } |
|
685 | - } |
|
686 | - } |
|
687 | - if($modx->hasPermission('access_permissions')) { |
|
688 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
689 | - } |
|
690 | - echo $chks; |
|
691 | - ?> |
|
670 | + } |
|
671 | + $chk = ''; |
|
672 | + $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
673 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
674 | + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
675 | + $checked = in_array($row['id'], $groupsarray); |
|
676 | + if($modx->hasPermission('access_permissions')) { |
|
677 | + if($checked) { |
|
678 | + $notPublic = true; |
|
679 | + } |
|
680 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
681 | + } else { |
|
682 | + if($checked) { |
|
683 | + $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
684 | + } |
|
685 | + } |
|
686 | + } |
|
687 | + if($modx->hasPermission('access_permissions')) { |
|
688 | + $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
689 | + } |
|
690 | + echo $chks; |
|
691 | + ?> |
|
692 | 692 | <?php endif; ?> |
693 | 693 | </div> |
694 | 694 | </div> |
@@ -704,11 +704,11 @@ discard block |
||
704 | 704 | |
705 | 705 | <input type="submit" name="save" style="display:none;"> |
706 | 706 | <?php |
707 | - // invoke OnModFormRender event |
|
708 | - $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
709 | - if(is_array($evtOut)) { |
|
710 | - echo implode('', $evtOut); |
|
711 | - } |
|
712 | - ?> |
|
707 | + // invoke OnModFormRender event |
|
708 | + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
709 | + if(is_array($evtOut)) { |
|
710 | + echo implode('', $evtOut); |
|
711 | + } |
|
712 | + ?> |
|
713 | 713 | </form> |
714 | 714 | <script type="text/javascript">setTimeout('showParameters();', 10);</script> |
@@ -4,24 +4,24 @@ discard block |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!$modx->hasPermission('category_manager')) { |
7 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | $_module_params = array( |
11 | - 'module_version' => '1.0.0', |
|
12 | - 'module_params' => '', |
|
13 | - 'module_id' => $_GET['id'], |
|
14 | - 'package_name' => 'Module_Categories_Manager', |
|
15 | - 'native_language' => 'de', |
|
16 | - 'name' => $_lang['manage_categories'], |
|
17 | - 'dirname' => $site_manager_url, |
|
18 | - 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
19 | - 'path' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
20 | - 'inc_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
21 | - 'languages_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
22 | - 'views_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
23 | - 'request_key' => 'module_categories_manager', |
|
24 | - 'messages' => array() |
|
11 | + 'module_version' => '1.0.0', |
|
12 | + 'module_params' => '', |
|
13 | + 'module_id' => $_GET['id'], |
|
14 | + 'package_name' => 'Module_Categories_Manager', |
|
15 | + 'native_language' => 'de', |
|
16 | + 'name' => $_lang['manage_categories'], |
|
17 | + 'dirname' => $site_manager_url, |
|
18 | + 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
19 | + 'path' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
20 | + 'inc_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
21 | + 'languages_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
22 | + 'views_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
23 | + 'request_key' => 'module_categories_manager', |
|
24 | + 'messages' => array() |
|
25 | 25 | ); |
26 | 26 | |
27 | 27 | $cm = new EvolutionCMS\Legacy\ModuleCategoriesManager(); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | // assign module_params to internal params |
30 | 30 | foreach( $_module_params as $param => $value ) |
31 | 31 | { |
32 | - $cm->set( $param, $value ); |
|
32 | + $cm->set( $param, $value ); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // catch the request actions |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | |
38 | 38 | if( !$categories = $cm->getCategories() ) |
39 | 39 | { |
40 | - setcookie('webfxtab_manage-categories-pane', 0 ); |
|
41 | - $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
40 | + setcookie('webfxtab_manage-categories-pane', 0 ); |
|
41 | + $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $cm->renderView('main', $categories ); |
@@ -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->getManagerApi()->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->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
25 | 25 | if($username = $modx->getDatabase()->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->getManagerApi()->action == '12') { |
31 | - // get user attribute |
|
32 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | - $userdata = $modx->getDatabase()->getRow($rs); |
|
34 | - if(!$userdata) { |
|
35 | - $modx->webAlertAndQuit("No user returned!"); |
|
36 | - } |
|
31 | + // get user attribute |
|
32 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | + $userdata = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
|
45 | - $usersettings = array(); |
|
46 | - while($row = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
|
45 | + $usersettings = array(); |
|
46 | + while($row = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_users'), "id = '{$user}'"); |
|
56 | - $usernamedata = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_users'), "id = '{$user}'"); |
|
56 | + $usernamedata = $modx->getDatabase()->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->getManagerApi()->hasFormValues()) { |
77 | - $modx->getManagerApi()->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->getManagerApi()->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 MODX_MANAGER_PATH . "includes/lang/country/english_country.inc.php"; |
91 | 91 | if($manager_language != "english" && file_exists(MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
92 | - include_once MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php"; |
|
92 | + include_once MODX_MANAGER_PATH . "includes/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->getManagerApi()->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" ?>" /> |
@@ -307,25 +307,25 @@ discard block |
||
307 | 307 | <td> </td> |
308 | 308 | <td><?php |
309 | 309 | |
310 | - $rs = $modx->getDatabase()->select( |
|
311 | - 'name, id', |
|
310 | + $rs = $modx->getDatabase()->select( |
|
311 | + 'name, id', |
|
312 | 312 | $modx->getDatabase()->getFullTableName('user_roles'), |
313 | 313 | ($modx->hasPermission('save_role')) ? '' : 'id != 1' |
314 | 314 | ); |
315 | - ?> |
|
315 | + ?> |
|
316 | 316 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
317 | 317 | <?php |
318 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
319 | - if($modx->getManagerApi()->action == '11') { |
|
320 | - $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
321 | - } else { |
|
322 | - $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
323 | - } |
|
324 | - ?> |
|
318 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
319 | + if($modx->getManagerApi()->action == '11') { |
|
320 | + $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
321 | + } else { |
|
322 | + $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
323 | + } |
|
324 | + ?> |
|
325 | 325 | <option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option> |
326 | 326 | <?php |
327 | - } |
|
328 | - ?> |
|
327 | + } |
|
328 | + ?> |
|
329 | 329 | </select></td> |
330 | 330 | </tr> |
331 | 331 | <tr> |
@@ -370,10 +370,10 @@ discard block |
||
370 | 370 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
371 | 371 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
372 | 372 | <?php |
373 | - foreach($_country_lang as $key => $country) { |
|
374 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
375 | - } |
|
376 | - ?> |
|
373 | + foreach($_country_lang as $key => $country) { |
|
374 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
375 | + } |
|
376 | + ?> |
|
377 | 377 | </select></td> |
378 | 378 | </tr> |
379 | 379 | <tr> |
@@ -449,21 +449,21 @@ discard block |
||
449 | 449 | <td><select name="manager_language" class="inputBox" onChange="documentDirty=true"> |
450 | 450 | <option value=""></option> |
451 | 451 | <?php |
452 | - $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
453 | - $dir = dir("includes/lang"); |
|
454 | - while($file = $dir->read()) { |
|
455 | - if(strpos($file, ".inc.php") > 0) { |
|
456 | - $endpos = strpos($file, "."); |
|
457 | - $languagename = substr($file, 0, $endpos); |
|
458 | - $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
459 | - ?> |
|
452 | + $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
453 | + $dir = dir("includes/lang"); |
|
454 | + while($file = $dir->read()) { |
|
455 | + if(strpos($file, ".inc.php") > 0) { |
|
456 | + $endpos = strpos($file, "."); |
|
457 | + $languagename = substr($file, 0, $endpos); |
|
458 | + $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
459 | + ?> |
|
460 | 460 | <option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option> |
461 | 461 | <?php |
462 | 462 | |
463 | - } |
|
464 | - } |
|
465 | - $dir->close(); |
|
466 | - ?> |
|
463 | + } |
|
464 | + } |
|
465 | + $dir->close(); |
|
466 | + ?> |
|
467 | 467 | </select></td> |
468 | 468 | </tr> |
469 | 469 | <tr> |
@@ -538,22 +538,22 @@ discard block |
||
538 | 538 | <td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());"> |
539 | 539 | <option value=""></option> |
540 | 540 | <?php |
541 | - $dir = dir("media/style/"); |
|
542 | - while($file = $dir->read()) { |
|
543 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
544 | - $themename = $file; |
|
545 | - if($themename === 'common') { |
|
546 | - continue; |
|
547 | - } |
|
548 | - $attr = 'value="' . $themename . '" '; |
|
549 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
550 | - $attr .= 'selected="selected" '; |
|
551 | - } |
|
552 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
553 | - } |
|
554 | - } |
|
555 | - $dir->close(); |
|
556 | - ?> |
|
541 | + $dir = dir("media/style/"); |
|
542 | + while($file = $dir->read()) { |
|
543 | + if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
544 | + $themename = $file; |
|
545 | + if($themename === 'common') { |
|
546 | + continue; |
|
547 | + } |
|
548 | + $attr = 'value="' . $themename . '" '; |
|
549 | + if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
550 | + $attr .= 'selected="selected" '; |
|
551 | + } |
|
552 | + echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
553 | + } |
|
554 | + } |
|
555 | + $dir->close(); |
|
556 | + ?> |
|
557 | 557 | </select> |
558 | 558 | <input type="hidden" name="theme_refresher" value=""></td> |
559 | 559 | </tr> |
@@ -589,15 +589,15 @@ discard block |
||
589 | 589 | <th><?php echo $_lang["which_browser_title"] ?></th> |
590 | 590 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
591 | 591 | <?php |
592 | - $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
593 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
594 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
595 | - $dir = str_replace('\\', '/', $dir); |
|
596 | - $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
597 | - $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
598 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
599 | - } |
|
600 | - ?> |
|
592 | + $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
593 | + echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
594 | + foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
595 | + $dir = str_replace('\\', '/', $dir); |
|
596 | + $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
597 | + $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
598 | + echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
599 | + } |
|
600 | + ?> |
|
601 | 601 | </select></td> |
602 | 602 | </tr> |
603 | 603 | <tr> |
@@ -674,17 +674,17 @@ discard block |
||
674 | 674 | <option value=""></option> |
675 | 675 | <?php |
676 | 676 | |
677 | - $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
678 | - // invoke OnRichTextEditorRegister event |
|
679 | - $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
680 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
681 | - if(is_array($evtOut)) { |
|
682 | - for($i = 0; $i < count($evtOut); $i++) { |
|
683 | - $editor = $evtOut[$i]; |
|
684 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
685 | - } |
|
686 | - } |
|
687 | - ?> |
|
677 | + $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
678 | + // invoke OnRichTextEditorRegister event |
|
679 | + $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
680 | + echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
681 | + if(is_array($evtOut)) { |
|
682 | + for($i = 0; $i < count($evtOut); $i++) { |
|
683 | + $editor = $evtOut[$i]; |
|
684 | + echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
685 | + } |
|
686 | + } |
|
687 | + ?> |
|
688 | 688 | </select></td> |
689 | 689 | </tr> |
690 | 690 | <tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>"> |
@@ -717,12 +717,12 @@ discard block |
||
717 | 717 | </tr> |
718 | 718 | </table> |
719 | 719 | <?php |
720 | - // invoke OnInterfaceSettingsRender event |
|
721 | - $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
722 | - if(is_array($evtOut)) { |
|
723 | - echo implode("", $evtOut); |
|
724 | - } |
|
725 | - ?> |
|
720 | + // invoke OnInterfaceSettingsRender event |
|
721 | + $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
722 | + if(is_array($evtOut)) { |
|
723 | + echo implode("", $evtOut); |
|
724 | + } |
|
725 | + ?> |
|
726 | 726 | </div> |
727 | 727 | |
728 | 728 | <!-- Photo --> |
@@ -771,39 +771,39 @@ discard block |
||
771 | 771 | </div> |
772 | 772 | <?php if($modx->getConfig('use_udperms')) { |
773 | 773 | |
774 | - $groupsarray = array(); |
|
775 | - |
|
776 | - if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
777 | - $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
|
778 | - $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
|
779 | - } |
|
780 | - // retain selected doc groups between post |
|
781 | - if(is_array($_POST['user_groups'])) { |
|
782 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
783 | - } |
|
784 | - ?> |
|
774 | + $groupsarray = array(); |
|
775 | + |
|
776 | + if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
777 | + $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
|
778 | + $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
|
779 | + } |
|
780 | + // retain selected doc groups between post |
|
781 | + if(is_array($_POST['user_groups'])) { |
|
782 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
783 | + } |
|
784 | + ?> |
|
785 | 785 | <div class="tab-page" id="tabAccess"> |
786 | 786 | <h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2> |
787 | 787 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script> |
788 | 788 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
789 | 789 | <?php |
790 | - $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('membergroup_names'), '', 'name'); |
|
791 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
792 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
793 | - } |
|
794 | - } |
|
795 | - ?> |
|
790 | + $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('membergroup_names'), '', 'name'); |
|
791 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
792 | + echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
793 | + } |
|
794 | + } |
|
795 | + ?> |
|
796 | 796 | </div> |
797 | 797 | </div> |
798 | 798 | </div> |
799 | 799 | <input type="submit" name="save" style="display:none"> |
800 | 800 | <?php |
801 | - // invoke OnUserFormRender event |
|
802 | - $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
803 | - "id" => $user |
|
804 | - )); |
|
805 | - if(is_array($evtOut)) { |
|
806 | - echo implode("", $evtOut); |
|
807 | - } |
|
808 | - ?> |
|
801 | + // invoke OnUserFormRender event |
|
802 | + $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
803 | + "id" => $user |
|
804 | + )); |
|
805 | + if(is_array($evtOut)) { |
|
806 | + echo implode("", $evtOut); |
|
807 | + } |
|
808 | + ?> |
|
809 | 809 | </form> |
@@ -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->getManagerApi()->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; |
@@ -24,64 +24,64 @@ discard block |
||
24 | 24 | // check to see the snippet editor isn't locked |
25 | 25 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
26 | 26 | if($username = $modx->getDatabase()->getValue($rs)) { |
27 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
|
27 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
|
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
31 | 31 | if($modx->getManagerApi()->action == '88') { |
32 | - // get user attributes |
|
33 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
|
34 | - $userdata = $modx->getDatabase()->getRow($rs); |
|
35 | - if(!$userdata) { |
|
36 | - $modx->webAlertAndQuit("No user returned!"); |
|
37 | - } |
|
38 | - |
|
39 | - // get user settings |
|
40 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
|
41 | - $usersettings = array(); |
|
42 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | - extract($usersettings, EXTR_OVERWRITE); |
|
44 | - |
|
45 | - // get user name |
|
46 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_users'), "id = '{$user}'"); |
|
47 | - $usernamedata = $modx->getDatabase()->getRow($rs); |
|
48 | - if(!$usernamedata) { |
|
49 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
50 | - } |
|
51 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
32 | + // get user attributes |
|
33 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
|
34 | + $userdata = $modx->getDatabase()->getRow($rs); |
|
35 | + if(!$userdata) { |
|
36 | + $modx->webAlertAndQuit("No user returned!"); |
|
37 | + } |
|
38 | + |
|
39 | + // get user settings |
|
40 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
|
41 | + $usersettings = array(); |
|
42 | + while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | + extract($usersettings, EXTR_OVERWRITE); |
|
44 | + |
|
45 | + // get user name |
|
46 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_users'), "id = '{$user}'"); |
|
47 | + $usernamedata = $modx->getDatabase()->getRow($rs); |
|
48 | + if(!$usernamedata) { |
|
49 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
50 | + } |
|
51 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
52 | 52 | } else { |
53 | - $userdata = array(); |
|
54 | - $usersettings = array(); |
|
55 | - $usernamedata = array(); |
|
56 | - $_SESSION['itemname'] = $_lang["new_web_user"]; |
|
53 | + $userdata = array(); |
|
54 | + $usersettings = array(); |
|
55 | + $usernamedata = array(); |
|
56 | + $_SESSION['itemname'] = $_lang["new_web_user"]; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | 60 | foreach($userdata as $key => $val) { |
61 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
61 | + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
62 | 62 | }; |
63 | 63 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 64 | |
65 | 65 | // restore saved form |
66 | 66 | $formRestored = false; |
67 | 67 | if($modx->getManagerApi()->hasFormValues()) { |
68 | - $modx->getManagerApi()->loadFormValues(); |
|
69 | - // restore post values |
|
70 | - $userdata = array_merge($userdata, $_POST); |
|
71 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
72 | - $usernamedata['username'] = $userdata['newusername']; |
|
73 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
74 | - $usersettings = array_merge($usersettings, $userdata); |
|
75 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
76 | - extract($usersettings, EXTR_OVERWRITE); |
|
68 | + $modx->getManagerApi()->loadFormValues(); |
|
69 | + // restore post values |
|
70 | + $userdata = array_merge($userdata, $_POST); |
|
71 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
72 | + $usernamedata['username'] = $userdata['newusername']; |
|
73 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
74 | + $usersettings = array_merge($usersettings, $userdata); |
|
75 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
76 | + extract($usersettings, EXTR_OVERWRITE); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // include the country list language file |
80 | 80 | $_country_lang = array(); |
81 | 81 | if($manager_language != "english" && file_exists(MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
82 | - include_once MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php"; |
|
82 | + include_once MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php"; |
|
83 | 83 | } else { |
84 | - include_once MODX_MANAGER_PATH . "includes/lang/country/english_country.inc.php"; |
|
84 | + include_once MODX_MANAGER_PATH . "includes/lang/country/english_country.inc.php"; |
|
85 | 85 | } |
86 | 86 | asort($_country_lang); |
87 | 87 | |
@@ -189,12 +189,12 @@ discard block |
||
189 | 189 | |
190 | 190 | <form action="index.php?a=89" method="post" name="userform"> |
191 | 191 | <?php |
192 | - // invoke OnWUsrFormPrerender event |
|
193 | - $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
|
194 | - if(is_array($evtOut)) { |
|
195 | - echo implode("", $evtOut); |
|
196 | - } |
|
197 | - ?> |
|
192 | + // invoke OnWUsrFormPrerender event |
|
193 | + $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
|
194 | + if(is_array($evtOut)) { |
|
195 | + echo implode("", $evtOut); |
|
196 | + } |
|
197 | + ?> |
|
198 | 198 | <input type="hidden" name="mode" value="<?php echo $modx->getManagerApi()->action; ?>" /> |
199 | 199 | <input type="hidden" name="id" value="<?php echo $user ?>" /> |
200 | 200 | <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" ?>" /> |
@@ -326,10 +326,10 @@ discard block |
||
326 | 326 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
327 | 327 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
328 | 328 | <?php |
329 | - foreach($_country_lang as $key => $country) { |
|
330 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
331 | - } |
|
332 | - ?> |
|
329 | + foreach($_country_lang as $key => $country) { |
|
330 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
331 | + } |
|
332 | + ?> |
|
333 | 333 | </select></td> |
334 | 334 | </tr> |
335 | 335 | <tr> |
@@ -389,8 +389,8 @@ discard block |
||
389 | 389 | <i onClick="document.userform.blockedafter.value=''; return true;" class="clearDate <?php echo $_style["actions_calendar_delete"] ?>" data-tooltip="<?php echo $_lang['remove_date']; ?>"></i></td> |
390 | 390 | </tr> |
391 | 391 | <?php |
392 | - } |
|
393 | - ?> |
|
392 | + } |
|
393 | + ?> |
|
394 | 394 | </table> |
395 | 395 | </div> |
396 | 396 | |
@@ -498,40 +498,40 @@ discard block |
||
498 | 498 | </table> |
499 | 499 | </div> |
500 | 500 | <?php |
501 | - if($modx->getConfig('use_udperms')) { |
|
502 | - |
|
503 | - $groupsarray = array(); |
|
504 | - |
|
505 | - if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
506 | - $rs = $modx->getDatabase()->select('webgroup', $modx->getDatabase()->getFullTableName('web_groups'), "webuser='{$user}'"); |
|
507 | - $groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs); |
|
508 | - } |
|
509 | - // retain selected user groups between post |
|
510 | - if(is_array($_POST['user_groups'])) { |
|
511 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
512 | - } |
|
513 | - ?> |
|
501 | + if($modx->getConfig('use_udperms')) { |
|
502 | + |
|
503 | + $groupsarray = array(); |
|
504 | + |
|
505 | + if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
506 | + $rs = $modx->getDatabase()->select('webgroup', $modx->getDatabase()->getFullTableName('web_groups'), "webuser='{$user}'"); |
|
507 | + $groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs); |
|
508 | + } |
|
509 | + // retain selected user groups between post |
|
510 | + if(is_array($_POST['user_groups'])) { |
|
511 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
512 | + } |
|
513 | + ?> |
|
514 | 514 | <div class="tab-page" id="tabPermissions"> |
515 | 515 | <h2 class="tab"><?php echo $_lang['web_access_permissions'] ?></h2> |
516 | 516 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabPermissions"));</script> |
517 | 517 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
518 | 518 | <?php |
519 | - $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
|
520 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
521 | - echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
|
522 | - } |
|
523 | - } |
|
524 | - ?> |
|
519 | + $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
|
520 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
521 | + echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
|
522 | + } |
|
523 | + } |
|
524 | + ?> |
|
525 | 525 | </div> |
526 | 526 | <?php |
527 | - // invoke OnWUsrFormRender event |
|
528 | - $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
|
529 | - "id" => $user |
|
530 | - )); |
|
531 | - if(is_array($evtOut)) { |
|
532 | - echo implode("", $evtOut); |
|
533 | - } |
|
534 | - ?> |
|
527 | + // invoke OnWUsrFormRender event |
|
528 | + $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
|
529 | + "id" => $user |
|
530 | + )); |
|
531 | + if(is_array($evtOut)) { |
|
532 | + echo implode("", $evtOut); |
|
533 | + } |
|
534 | + ?> |
|
535 | 535 | </div> |
536 | 536 | </div> |
537 | 537 | <input type="submit" name="save" style="display:none"> |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | define('IN_PARSER_MODE', true); |
84 | 84 | if (! defined('IN_MANAGER_MODE')) { |
85 | - define('IN_MANAGER_MODE', false); |
|
85 | + define('IN_MANAGER_MODE', false); |
|
86 | 86 | } |
87 | 87 | if (! defined('MODX_API_MODE')) { |
88 | 88 | define('MODX_API_MODE', false); |
@@ -5,31 +5,31 @@ |
||
5 | 5 | |
6 | 6 | class CreateActiveUserSessionsTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('active_user_sessions', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->string('sid', 32)->default('')->primary(); |
|
18 | - $table->integer('internalKey')->default(0); |
|
19 | - $table->integer('lasthit')->default(0); |
|
20 | - $table->string('ip', 50)->default(''); |
|
21 | - }); |
|
22 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('active_user_sessions', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->string('sid', 32)->default('')->primary(); |
|
18 | + $table->integer('internalKey')->default(0); |
|
19 | + $table->integer('lasthit')->default(0); |
|
20 | + $table->string('ip', 50)->default(''); |
|
21 | + }); |
|
22 | + } |
|
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * Reverse the migrations. |
|
27 | - * |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public function down() |
|
31 | - { |
|
32 | - Schema::drop('active_user_sessions'); |
|
33 | - } |
|
25 | + /** |
|
26 | + * Reverse the migrations. |
|
27 | + * |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public function down() |
|
31 | + { |
|
32 | + Schema::drop('active_user_sessions'); |
|
33 | + } |
|
34 | 34 | |
35 | 35 | } |
@@ -5,31 +5,31 @@ |
||
5 | 5 | |
6 | 6 | class CreateSystemEventnamesTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('system_eventnames', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->integer('id', true); |
|
18 | - $table->string('name', 50)->default(''); |
|
19 | - $table->boolean('service')->default(0)->comment('System Service number'); |
|
20 | - $table->string('groupname', 20)->default(''); |
|
21 | - }); |
|
22 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('system_eventnames', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->integer('id', true); |
|
18 | + $table->string('name', 50)->default(''); |
|
19 | + $table->boolean('service')->default(0)->comment('System Service number'); |
|
20 | + $table->string('groupname', 20)->default(''); |
|
21 | + }); |
|
22 | + } |
|
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * Reverse the migrations. |
|
27 | - * |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public function down() |
|
31 | - { |
|
32 | - Schema::drop('system_eventnames'); |
|
33 | - } |
|
25 | + /** |
|
26 | + * Reverse the migrations. |
|
27 | + * |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public function down() |
|
31 | + { |
|
32 | + Schema::drop('system_eventnames'); |
|
33 | + } |
|
34 | 34 | |
35 | 35 | } |