@@ -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('export_static')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $maxtime = (is_numeric($_POST['maxtime'])) ? $_POST['maxtime'] : 30; |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | $modx->getExportSite()->targetDir = $export_dir; |
16 | 16 | |
17 | 17 | if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
18 | - return $_lang['export_site.static.php6']; |
|
18 | + return $_lang['export_site.static.php6']; |
|
19 | 19 | elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
20 | - return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
20 | + return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
21 | 21 | elseif(!is_writable($export_dir)) |
22 | - return $_lang['export_site_target_unwritable']; |
|
22 | + return $_lang['export_site_target_unwritable']; |
|
23 | 23 | |
24 | 24 | $modx->getExportSite()->generate_mode = $_POST['generate_mode']; |
25 | 25 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ||$includenoncache!==$_POST['includenoncache'] |
36 | 36 | ||$repl_before!==$_POST['repl_before'] |
37 | 37 | ||$repl_after !==$_POST['repl_after']) { |
38 | - $modx->clearCache('full'); |
|
38 | + $modx->clearCache('full'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $total = $modx->getExportSite()->getTotal($_POST['ignore_ids'], $modx->config['export_includenoncache']); |
@@ -1,26 +1,26 @@ 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 | if(!$modx->hasPermission('delete_template')) { |
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 | $forced = isset($_GET['force']) ? $_GET['force'] : 0; |
15 | 15 | |
16 | 16 | // check for relations |
17 | 17 | if(!$forced) { |
18 | - $drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc |
|
18 | + $drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc |
|
19 | 19 | INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); |
20 | - $count = $modx->getDatabase()->getRecordCount($drs); |
|
21 | - if($count > 0) { |
|
22 | - include_once "header.inc.php"; |
|
23 | - ?> |
|
20 | + $count = $modx->getDatabase()->getRecordCount($drs); |
|
21 | + if($count > 0) { |
|
22 | + include_once "header.inc.php"; |
|
23 | + ?> |
|
24 | 24 | <script> |
25 | 25 | var actions = { |
26 | 26 | delete: function() { |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | <p><?= $_lang['tmplvar_inuse'] ?></p> |
43 | 43 | <ul> |
44 | 44 | <?php |
45 | - while($row = $modx->getDatabase()->getRow($drs)) { |
|
46 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>'; |
|
47 | - } |
|
48 | - ?> |
|
45 | + while($row = $modx->getDatabase()->getRow($drs)) { |
|
46 | + echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>'; |
|
47 | + } |
|
48 | + ?> |
|
49 | 49 | </ul> |
50 | 50 | </div> |
51 | 51 | </div> |
52 | 52 | <?php |
53 | - include_once "footer.inc.php"; |
|
54 | - exit; |
|
55 | - } |
|
53 | + include_once "footer.inc.php"; |
|
54 | + exit; |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // Set the item name for logger |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | // invoke OnBeforeTVFormDelete event |
63 | 63 | $modx->invokeEvent("OnBeforeTVFormDelete", array( |
64 | - "id" => $id |
|
64 | + "id" => $id |
|
65 | 65 | )); |
66 | 66 | |
67 | 67 | // delete variable |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | // invoke OnTVFormDelete event |
80 | 80 | $modx->invokeEvent("OnTVFormDelete", array( |
81 | - "id" => $id |
|
81 | + "id" => $id |
|
82 | 82 | )); |
83 | 83 | |
84 | 84 | // empty cache |
@@ -3,12 +3,12 @@ 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('new_module')) { |
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 | // count duplicates |
14 | 14 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'")); |
@@ -18,40 +18,40 @@ discard block |
||
18 | 18 | |
19 | 19 | // duplicate module |
20 | 20 | $newid = $modx->getDatabase()->insert( |
21 | - array( |
|
22 | - 'name'=>'', |
|
23 | - 'description'=>'', |
|
24 | - 'disabled'=>'', |
|
25 | - 'category'=>'', |
|
26 | - 'wrap'=>'', |
|
27 | - 'icon'=>'', |
|
28 | - 'enable_resource'=>'', |
|
29 | - 'resourcefile'=>'', |
|
30 | - 'createdon'=>'', |
|
31 | - 'editedon'=>'', |
|
32 | - 'guid'=>'', |
|
33 | - 'enable_sharedparams'=>'', |
|
34 | - 'properties'=>'', |
|
35 | - 'modulecode'=>'', |
|
36 | - ), $modx->getFullTableName('site_modules'), // Insert into |
|
37 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from |
|
21 | + array( |
|
22 | + 'name'=>'', |
|
23 | + 'description'=>'', |
|
24 | + 'disabled'=>'', |
|
25 | + 'category'=>'', |
|
26 | + 'wrap'=>'', |
|
27 | + 'icon'=>'', |
|
28 | + 'enable_resource'=>'', |
|
29 | + 'resourcefile'=>'', |
|
30 | + 'createdon'=>'', |
|
31 | + 'editedon'=>'', |
|
32 | + 'guid'=>'', |
|
33 | + 'enable_sharedparams'=>'', |
|
34 | + 'properties'=>'', |
|
35 | + 'modulecode'=>'', |
|
36 | + ), $modx->getFullTableName('site_modules'), // Insert into |
|
37 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from |
|
38 | 38 | |
39 | 39 | // duplicate module dependencies |
40 | 40 | $modx->getDatabase()->insert( |
41 | - array( |
|
42 | - 'module'=>'', |
|
43 | - 'resource'=>'', |
|
44 | - 'type'=>'', |
|
45 | - ), $modx->getFullTableName('site_module_depobj'), // Insert into |
|
46 | - "'{$newid}', resource, type", $modx->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from |
|
41 | + array( |
|
42 | + 'module'=>'', |
|
43 | + 'resource'=>'', |
|
44 | + 'type'=>'', |
|
45 | + ), $modx->getFullTableName('site_module_depobj'), // Insert into |
|
46 | + "'{$newid}', resource, type", $modx->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from |
|
47 | 47 | |
48 | 48 | // duplicate module user group access |
49 | 49 | $modx->getDatabase()->insert( |
50 | - array( |
|
51 | - 'module'=>'', |
|
52 | - 'usergroup'=>'', |
|
53 | - ), $modx->getFullTableName('site_module_access'), // Insert into |
|
54 | - "'{$newid}', usergroup", $modx->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from |
|
50 | + array( |
|
51 | + 'module'=>'', |
|
52 | + 'usergroup'=>'', |
|
53 | + ), $modx->getFullTableName('site_module_access'), // Insert into |
|
54 | + "'{$newid}', usergroup", $modx->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from |
|
55 | 55 | |
56 | 56 | // Set the item name for logger |
57 | 57 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_modules'), "id='{$newid}'")); |
@@ -3,33 +3,33 @@ |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | if (isset($_REQUEST['t'])) { |
10 | 10 | |
11 | - if (empty($_REQUEST['t'])) { |
|
12 | - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
13 | - } |
|
11 | + if (empty($_REQUEST['t'])) { |
|
12 | + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
13 | + } |
|
14 | 14 | |
15 | - // Set the item name for logger |
|
16 | - $_SESSION['itemname'] = $_REQUEST['t']; |
|
15 | + // Set the item name for logger |
|
16 | + $_SESSION['itemname'] = $_REQUEST['t']; |
|
17 | 17 | |
18 | - $modx->getDatabase()->optimize($_REQUEST['t']); |
|
18 | + $modx->getDatabase()->optimize($_REQUEST['t']); |
|
19 | 19 | |
20 | 20 | } elseif (isset($_REQUEST['u'])) { |
21 | 21 | |
22 | - if (empty($_REQUEST['u'])) { |
|
23 | - $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); |
|
24 | - } |
|
22 | + if (empty($_REQUEST['u'])) { |
|
23 | + $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); |
|
24 | + } |
|
25 | 25 | |
26 | - // Set the item name for logger |
|
27 | - $_SESSION['itemname'] = $_REQUEST['u']; |
|
26 | + // Set the item name for logger |
|
27 | + $_SESSION['itemname'] = $_REQUEST['u']; |
|
28 | 28 | |
29 | - $modx->getDatabase()->truncate($_REQUEST['u']); |
|
29 | + $modx->getDatabase()->truncate($_REQUEST['u']); |
|
30 | 30 | |
31 | 31 | } else { |
32 | - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
32 | + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $mode = (int)$_REQUEST['mode']; |
@@ -3,12 +3,12 @@ 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('delete_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 | // Set the item name for logger |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeChunkFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeChunkFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the chunk. |
25 | 25 | $modx->getDatabase()->delete($modx->getFullTableName('site_htmlsnippets'), "id='{$id}'"); |
26 | 26 | |
27 | 27 | // invoke OnChunkFormDelete event |
28 | 28 | $modx->invokeEvent("OnChunkFormDelete", |
29 | - array( |
|
30 | - "id" => $id |
|
31 | - )); |
|
29 | + array( |
|
30 | + "id" => $id |
|
31 | + )); |
|
32 | 32 | |
33 | 33 | // empty cache |
34 | 34 | $modx->clearCache('full'); |
@@ -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,25 +11,25 @@ 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); |
22 | - $tbl_manager_users = $modx->getFullTableName('manager_users'); |
|
23 | - $uid = $modx->getLoginUserID(); |
|
24 | - $f['password'] = $modx->getPasswordHash()->HashPassword($pass1); |
|
25 | - $modx->getDatabase()->update($f,$tbl_manager_users,"id='{$uid}'"); |
|
22 | + $tbl_manager_users = $modx->getFullTableName('manager_users'); |
|
23 | + $uid = $modx->getLoginUserID(); |
|
24 | + $f['password'] = $modx->getPasswordHash()->HashPassword($pass1); |
|
25 | + $modx->getDatabase()->update($f,$tbl_manager_users,"id='{$uid}'"); |
|
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); |
@@ -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('access_permissions')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // access group processor. |
@@ -20,113 +20,113 @@ discard block |
||
20 | 20 | $operation = $_REQUEST['operation']; |
21 | 21 | |
22 | 22 | switch ($operation) { |
23 | - case "add_user_group" : |
|
24 | - $newgroup = $_REQUEST['newusergroup']; |
|
25 | - if(empty($newgroup)) { |
|
26 | - $modx->webAlertAndQuit("No group name specified."); |
|
27 | - } else { |
|
28 | - $id = $modx->getDatabase()->insert(array('name' => $modx->getDatabase()->escape($newgroup)), $tbl_membergroup_names); |
|
23 | + case "add_user_group" : |
|
24 | + $newgroup = $_REQUEST['newusergroup']; |
|
25 | + if(empty($newgroup)) { |
|
26 | + $modx->webAlertAndQuit("No group name specified."); |
|
27 | + } else { |
|
28 | + $id = $modx->getDatabase()->insert(array('name' => $modx->getDatabase()->escape($newgroup)), $tbl_membergroup_names); |
|
29 | 29 | |
30 | - // invoke OnManagerCreateGroup event |
|
31 | - $modx->invokeEvent('OnManagerCreateGroup', array( |
|
32 | - 'groupid' => $id, |
|
33 | - 'groupname' => $newgroup, |
|
34 | - )); |
|
35 | - } |
|
36 | - break; |
|
37 | - case "add_document_group" : |
|
38 | - $newgroup = $_REQUEST['newdocgroup']; |
|
39 | - if(empty($newgroup)) { |
|
40 | - $modx->webAlertAndQuit("No group name specified."); |
|
41 | - } else { |
|
42 | - $id = $modx->getDatabase()->insert(array('name' => $modx->getDatabase()->escape($newgroup)), $tbl_documentgroup_names); |
|
30 | + // invoke OnManagerCreateGroup event |
|
31 | + $modx->invokeEvent('OnManagerCreateGroup', array( |
|
32 | + 'groupid' => $id, |
|
33 | + 'groupname' => $newgroup, |
|
34 | + )); |
|
35 | + } |
|
36 | + break; |
|
37 | + case "add_document_group" : |
|
38 | + $newgroup = $_REQUEST['newdocgroup']; |
|
39 | + if(empty($newgroup)) { |
|
40 | + $modx->webAlertAndQuit("No group name specified."); |
|
41 | + } else { |
|
42 | + $id = $modx->getDatabase()->insert(array('name' => $modx->getDatabase()->escape($newgroup)), $tbl_documentgroup_names); |
|
43 | 43 | |
44 | - // invoke OnCreateDocGroup event |
|
45 | - $modx->invokeEvent('OnCreateDocGroup', array( |
|
46 | - 'groupid' => $id, |
|
47 | - 'groupname' => $newgroup, |
|
48 | - )); |
|
49 | - } |
|
50 | - break; |
|
51 | - case "delete_user_group" : |
|
52 | - $updategroupaccess = true; |
|
53 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
54 | - if(empty($usergroup)) { |
|
55 | - $modx->webAlertAndQuit("No user group id specified for deletion."); |
|
56 | - } else { |
|
57 | - $modx->getDatabase()->delete($tbl_membergroup_names, "id='{$usergroup}'"); |
|
44 | + // invoke OnCreateDocGroup event |
|
45 | + $modx->invokeEvent('OnCreateDocGroup', array( |
|
46 | + 'groupid' => $id, |
|
47 | + 'groupname' => $newgroup, |
|
48 | + )); |
|
49 | + } |
|
50 | + break; |
|
51 | + case "delete_user_group" : |
|
52 | + $updategroupaccess = true; |
|
53 | + $usergroup = (int)$_REQUEST['usergroup']; |
|
54 | + if(empty($usergroup)) { |
|
55 | + $modx->webAlertAndQuit("No user group id specified for deletion."); |
|
56 | + } else { |
|
57 | + $modx->getDatabase()->delete($tbl_membergroup_names, "id='{$usergroup}'"); |
|
58 | 58 | |
59 | - $modx->getDatabase()->delete($tbl_membergroup_access, "membergroup='{$usergroup}'"); |
|
59 | + $modx->getDatabase()->delete($tbl_membergroup_access, "membergroup='{$usergroup}'"); |
|
60 | 60 | |
61 | - $modx->getDatabase()->delete($tbl_member_groups, "user_group='{$usergroup}'"); |
|
62 | - } |
|
63 | - break; |
|
64 | - case "delete_document_group" : |
|
65 | - $group = (int)$_REQUEST['documentgroup']; |
|
66 | - if(empty($group)) { |
|
67 | - $modx->webAlertAndQuit("No document group id specified for deletion."); |
|
68 | - } else { |
|
69 | - $modx->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
61 | + $modx->getDatabase()->delete($tbl_member_groups, "user_group='{$usergroup}'"); |
|
62 | + } |
|
63 | + break; |
|
64 | + case "delete_document_group" : |
|
65 | + $group = (int)$_REQUEST['documentgroup']; |
|
66 | + if(empty($group)) { |
|
67 | + $modx->webAlertAndQuit("No document group id specified for deletion."); |
|
68 | + } else { |
|
69 | + $modx->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
70 | 70 | |
71 | - $modx->getDatabase()->delete($tbl_membergroup_access, "documentgroup='{$group}'"); |
|
71 | + $modx->getDatabase()->delete($tbl_membergroup_access, "documentgroup='{$group}'"); |
|
72 | 72 | |
73 | - $modx->getDatabase()->delete($tbl_document_groups, "document_group='{$group}'"); |
|
74 | - } |
|
75 | - break; |
|
76 | - case "rename_user_group" : |
|
77 | - $newgroupname = $_REQUEST['newgroupname']; |
|
78 | - if(empty($newgroupname)) { |
|
79 | - $modx->webAlertAndQuit("No group name specified."); |
|
80 | - } |
|
81 | - $groupid = (int)$_REQUEST['groupid']; |
|
82 | - if(empty($groupid)) { |
|
83 | - $modx->webAlertAndQuit("No group id specified for rename."); |
|
84 | - } |
|
73 | + $modx->getDatabase()->delete($tbl_document_groups, "document_group='{$group}'"); |
|
74 | + } |
|
75 | + break; |
|
76 | + case "rename_user_group" : |
|
77 | + $newgroupname = $_REQUEST['newgroupname']; |
|
78 | + if(empty($newgroupname)) { |
|
79 | + $modx->webAlertAndQuit("No group name specified."); |
|
80 | + } |
|
81 | + $groupid = (int)$_REQUEST['groupid']; |
|
82 | + if(empty($groupid)) { |
|
83 | + $modx->webAlertAndQuit("No group id specified for rename."); |
|
84 | + } |
|
85 | 85 | |
86 | - $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_membergroup_names, "id='{$groupid}'"); |
|
87 | - break; |
|
88 | - case "rename_document_group" : |
|
89 | - $newgroupname = $_REQUEST['newgroupname']; |
|
90 | - if(empty($newgroupname)) { |
|
91 | - $modx->webAlertAndQuit("No group name specified."); |
|
92 | - } |
|
93 | - $groupid = (int)$_REQUEST['groupid']; |
|
94 | - if(empty($groupid)) { |
|
95 | - $modx->webAlertAndQuit("No group id specified for rename."); |
|
96 | - } |
|
86 | + $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_membergroup_names, "id='{$groupid}'"); |
|
87 | + break; |
|
88 | + case "rename_document_group" : |
|
89 | + $newgroupname = $_REQUEST['newgroupname']; |
|
90 | + if(empty($newgroupname)) { |
|
91 | + $modx->webAlertAndQuit("No group name specified."); |
|
92 | + } |
|
93 | + $groupid = (int)$_REQUEST['groupid']; |
|
94 | + if(empty($groupid)) { |
|
95 | + $modx->webAlertAndQuit("No group id specified for rename."); |
|
96 | + } |
|
97 | 97 | |
98 | - $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
99 | - break; |
|
100 | - case "add_document_group_to_user_group" : |
|
101 | - $updategroupaccess = true; |
|
102 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
103 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
104 | - $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
105 | - $limit = $modx->getDatabase()->getValue($rs); |
|
106 | - if($limit<=0) { |
|
107 | - $modx->getDatabase()->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access); |
|
108 | - } else { |
|
109 | - //alert user that coupling already exists? |
|
110 | - } |
|
111 | - break; |
|
112 | - case "remove_document_group_from_user_group" : |
|
113 | - $updategroupaccess = true; |
|
114 | - $coupling = (int)$_REQUEST['coupling']; |
|
115 | - $modx->getDatabase()->delete($tbl_membergroup_access, "id='{$coupling}'"); |
|
116 | - break; |
|
117 | - default : |
|
118 | - $modx->webAlertAndQuit("No operation set in request."); |
|
98 | + $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
99 | + break; |
|
100 | + case "add_document_group_to_user_group" : |
|
101 | + $updategroupaccess = true; |
|
102 | + $usergroup = (int)$_REQUEST['usergroup']; |
|
103 | + $docgroup = (int)$_REQUEST['docgroup']; |
|
104 | + $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
105 | + $limit = $modx->getDatabase()->getValue($rs); |
|
106 | + if($limit<=0) { |
|
107 | + $modx->getDatabase()->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access); |
|
108 | + } else { |
|
109 | + //alert user that coupling already exists? |
|
110 | + } |
|
111 | + break; |
|
112 | + case "remove_document_group_from_user_group" : |
|
113 | + $updategroupaccess = true; |
|
114 | + $coupling = (int)$_REQUEST['coupling']; |
|
115 | + $modx->getDatabase()->delete($tbl_membergroup_access, "id='{$coupling}'"); |
|
116 | + break; |
|
117 | + default : |
|
118 | + $modx->webAlertAndQuit("No operation set in request."); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | // secure manager documents - flag as private |
122 | 122 | if($updategroupaccess==true){ |
123 | - include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
124 | - secureMgrDocument(); |
|
123 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
124 | + secureMgrDocument(); |
|
125 | 125 | |
126 | - // Update the private group column |
|
127 | - $modx->getDatabase()->update( |
|
128 | - 'dgn.private_memgroup = (mga.membergroup IS NOT NULL)', |
|
129 | - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_membergroup_access} AS mga ON mga.documentgroup = dgn.id"); |
|
126 | + // Update the private group column |
|
127 | + $modx->getDatabase()->update( |
|
128 | + 'dgn.private_memgroup = (mga.membergroup IS NOT NULL)', |
|
129 | + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_membergroup_access} AS mga ON mga.documentgroup = dgn.id"); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $header = "Location: index.php?a=40"; |
@@ -3,17 +3,17 @@ 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('delete_user')) { |
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 | // delete the user, but first check if we are deleting our own record |
15 | 15 | if($id==$modx->getLoginUserID()) { |
16 | - $modx->webAlertAndQuit("You can't delete yourself!"); |
|
16 | + $modx->webAlertAndQuit("You can't delete yourself!"); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // Set the item name for logger |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | // invoke OnBeforeUserFormDelete event |
24 | 24 | $modx->invokeEvent("OnBeforeUserFormDelete", |
25 | - array( |
|
26 | - "id" => $id |
|
27 | - )); |
|
25 | + array( |
|
26 | + "id" => $id |
|
27 | + )); |
|
28 | 28 | |
29 | 29 | // delete the user. |
30 | 30 | $modx->getDatabase()->delete($modx->getFullTableName('manager_users'), "id='{$id}'"); |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | |
40 | 40 | // invoke OnManagerDeleteUser event |
41 | 41 | $modx->invokeEvent("OnManagerDeleteUser", |
42 | - array( |
|
43 | - "userid" => $id, |
|
44 | - "username" => $username |
|
45 | - )); |
|
42 | + array( |
|
43 | + "userid" => $id, |
|
44 | + "username" => $username |
|
45 | + )); |
|
46 | 46 | |
47 | 47 | // invoke OnUserFormDelete event |
48 | 48 | $modx->invokeEvent("OnUserFormDelete", |
49 | - array( |
|
50 | - "id" => $id |
|
51 | - )); |
|
49 | + array( |
|
50 | + "id" => $id |
|
51 | + )); |
|
52 | 52 | |
53 | 53 | $header="Location: index.php?a=75"; |
54 | 54 | header($header); |
@@ -3,12 +3,12 @@ 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('new_chunk')) { |
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 |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | |
20 | 20 | // duplicate htmlsnippet |
21 | 21 | $newid = $modx->getDatabase()->insert( |
22 | - array( |
|
23 | - 'name'=>'', |
|
24 | - 'description'=>'', |
|
25 | - 'snippet'=>'', |
|
26 | - 'category'=>'', |
|
27 | - ), $modx->getFullTableName('site_htmlsnippets'), // Insert into |
|
28 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, category", $modx->getFullTableName('site_htmlsnippets'), "id='{$id}'"); // Copy from |
|
22 | + array( |
|
23 | + 'name'=>'', |
|
24 | + 'description'=>'', |
|
25 | + 'snippet'=>'', |
|
26 | + 'category'=>'', |
|
27 | + ), $modx->getFullTableName('site_htmlsnippets'), // Insert into |
|
28 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, category", $modx->getFullTableName('site_htmlsnippets'), "id='{$id}'"); // Copy from |
|
29 | 29 | |
30 | 30 | // Set the item name for logger |
31 | 31 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_htmlsnippets'), "id='{$newid}'")); |