@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
3 | 3 | if(!$modx->hasPermission('delete_snippet')) { |
4 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
4 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | $id = isset($_GET['id'])? intval($_GET['id']) : 0; |
8 | 8 | if($id==0) { |
9 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | // Set the item name for logger |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | |
16 | 16 | // invoke OnBeforeSnipFormDelete event |
17 | 17 | $modx->invokeEvent("OnBeforeSnipFormDelete", |
18 | - array( |
|
19 | - "id" => $id |
|
20 | - )); |
|
18 | + array( |
|
19 | + "id" => $id |
|
20 | + )); |
|
21 | 21 | |
22 | 22 | // delete the snippet. |
23 | 23 | $modx->db->delete($modx->getFullTableName('site_snippets'), "id='{$id}'"); |
24 | 24 | |
25 | 25 | // invoke OnSnipFormDelete event |
26 | 26 | $modx->invokeEvent("OnSnipFormDelete", |
27 | - array( |
|
28 | - "id" => $id |
|
29 | - )); |
|
27 | + array( |
|
28 | + "id" => $id |
|
29 | + )); |
|
30 | 30 | |
31 | 31 | // empty cache |
32 | 32 | $modx->clearCache('full'); |
@@ -1,51 +1,51 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
3 | 3 | if(!$modx->hasPermission('exec_module')) { |
4 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
4 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | $id = isset($_GET['id'])? intval($_GET['id']) : 0; |
8 | 8 | if($id==0) { |
9 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | // check if user has access permission, except admins |
13 | 13 | if($_SESSION['mgrRole']!=1){ |
14 | - $rs = $modx->db->select( |
|
15 | - 'sma.usergroup,mg.member', |
|
16 | - $modx->getFullTableName("site_module_access")." sma |
|
14 | + $rs = $modx->db->select( |
|
15 | + 'sma.usergroup,mg.member', |
|
16 | + $modx->getFullTableName("site_module_access")." sma |
|
17 | 17 | LEFT JOIN ".$modx->getFullTableName("member_groups")." mg ON mg.user_group = sma.usergroup AND member='".$modx->getLoginUserID()."'", |
18 | - "sma.module = '{$id}'" |
|
19 | - ); |
|
20 | - //initialize permission to -1, if it stays -1 no permissions |
|
21 | - //attached so permission granted |
|
22 | - $permissionAccessInt = -1; |
|
18 | + "sma.module = '{$id}'" |
|
19 | + ); |
|
20 | + //initialize permission to -1, if it stays -1 no permissions |
|
21 | + //attached so permission granted |
|
22 | + $permissionAccessInt = -1; |
|
23 | 23 | |
24 | - while ($row = $modx->db->getRow($rs)) { |
|
25 | - if($row["usergroup"] && $row["member"]) { |
|
26 | - //if there are permissions and this member has permission, ofcourse |
|
27 | - //this is granted |
|
28 | - $permissionAccessInt = 1; |
|
29 | - } elseif ($permissionAccessInt==-1) { |
|
30 | - //if there are permissions but this member has no permission and the |
|
31 | - //variable was still in init state we set permission to 0; no permissions |
|
32 | - $permissionAccessInt = 0; |
|
33 | - } |
|
34 | - } |
|
24 | + while ($row = $modx->db->getRow($rs)) { |
|
25 | + if($row["usergroup"] && $row["member"]) { |
|
26 | + //if there are permissions and this member has permission, ofcourse |
|
27 | + //this is granted |
|
28 | + $permissionAccessInt = 1; |
|
29 | + } elseif ($permissionAccessInt==-1) { |
|
30 | + //if there are permissions but this member has no permission and the |
|
31 | + //variable was still in init state we set permission to 0; no permissions |
|
32 | + $permissionAccessInt = 0; |
|
33 | + } |
|
34 | + } |
|
35 | 35 | |
36 | - if($permissionAccessInt==0) { |
|
37 | - $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
|
38 | - } |
|
36 | + if($permissionAccessInt==0) { |
|
37 | + $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | // get module data |
42 | 42 | $rs = $modx->db->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'"); |
43 | 43 | $content = $modx->db->getRow($rs); |
44 | 44 | if(!$content) { |
45 | - $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
|
45 | + $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
|
46 | 46 | } |
47 | 47 | if($content['disabled']) { |
48 | - $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
|
48 | + $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // Set the item name for logger |
@@ -63,38 +63,38 @@ discard block |
||
63 | 63 | |
64 | 64 | // evalModule |
65 | 65 | function evalModule($moduleCode,$params){ |
66 | - global $modx; |
|
67 | - $modx->event->params = &$params; // store params inside event object |
|
68 | - if(is_array($params)) { |
|
69 | - extract($params, EXTR_SKIP); |
|
70 | - } |
|
71 | - ob_start(); |
|
72 | - $mod = eval($moduleCode); |
|
73 | - $msg = ob_get_contents(); |
|
74 | - ob_end_clean(); |
|
75 | - if (isset($php_errormsg)) |
|
76 | - { |
|
77 | - $error_info = error_get_last(); |
|
66 | + global $modx; |
|
67 | + $modx->event->params = &$params; // store params inside event object |
|
68 | + if(is_array($params)) { |
|
69 | + extract($params, EXTR_SKIP); |
|
70 | + } |
|
71 | + ob_start(); |
|
72 | + $mod = eval($moduleCode); |
|
73 | + $msg = ob_get_contents(); |
|
74 | + ob_end_clean(); |
|
75 | + if (isset($php_errormsg)) |
|
76 | + { |
|
77 | + $error_info = error_get_last(); |
|
78 | 78 | switch($error_info['type']) |
79 | 79 | { |
80 | - case E_NOTICE : |
|
81 | - $error_level = 1; |
|
82 | - case E_USER_NOTICE : |
|
83 | - break; |
|
84 | - case E_DEPRECATED : |
|
85 | - case E_USER_DEPRECATED : |
|
86 | - case E_STRICT : |
|
87 | - $error_level = 2; |
|
88 | - break; |
|
89 | - default: |
|
90 | - $error_level = 99; |
|
80 | + case E_NOTICE : |
|
81 | + $error_level = 1; |
|
82 | + case E_USER_NOTICE : |
|
83 | + break; |
|
84 | + case E_DEPRECATED : |
|
85 | + case E_USER_DEPRECATED : |
|
86 | + case E_STRICT : |
|
87 | + $error_level = 2; |
|
88 | + break; |
|
89 | + default: |
|
90 | + $error_level = 99; |
|
91 | + } |
|
92 | + if($modx->config['error_reporting']==='99' || 2<$error_level) |
|
93 | + { |
|
94 | + $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
|
95 | + $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
|
91 | 96 | } |
92 | - if($modx->config['error_reporting']==='99' || 2<$error_level) |
|
93 | - { |
|
94 | - $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
|
95 | - $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
|
96 | - } |
|
97 | - } |
|
98 | - unset($modx->event->params); |
|
99 | - return $mod.$msg; |
|
97 | + } |
|
98 | + unset($modx->event->params); |
|
99 | + return $mod.$msg; |
|
100 | 100 | } |
@@ -1,22 +1,22 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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']) ? intval($_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 template, but first check it doesn't have any documents using it |
15 | 15 | $rs = $modx->db->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0"); |
16 | 16 | $limit = $modx->db->getRecordCount($rs); |
17 | 17 | if($limit > 0) { |
18 | - include "header.inc.php"; |
|
19 | - ?> |
|
18 | + include "header.inc.php"; |
|
19 | + ?> |
|
20 | 20 | |
21 | 21 | <h1><?php echo $_lang['manage_templates']; ?></h1> |
22 | 22 | |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | <p>Documents using this template:</p> |
29 | 29 | <ul> |
30 | 30 | <?php |
31 | - while($row = $modx->db->getRow($rs)) { |
|
32 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
33 | - } |
|
34 | - ?> |
|
31 | + while($row = $modx->db->getRow($rs)) { |
|
32 | + echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
33 | + } |
|
34 | + ?> |
|
35 | 35 | </ul> |
36 | 36 | </div> |
37 | 37 | </div> |
38 | 38 | <?php |
39 | - include_once "footer.inc.php"; |
|
40 | - exit; |
|
39 | + include_once "footer.inc.php"; |
|
40 | + exit; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | if($id == $default_template) { |
44 | - $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
|
44 | + $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Set the item name for logger |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | // invoke OnBeforeTempFormDelete event |
52 | 52 | $modx->invokeEvent("OnBeforeTempFormDelete", array( |
53 | - "id" => $id |
|
54 | - )); |
|
53 | + "id" => $id |
|
54 | + )); |
|
55 | 55 | |
56 | 56 | // delete the document. |
57 | 57 | $modx->db->delete($modx->getFullTableName('site_templates'), "id='{$id}'"); |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | // invoke OnTempFormDelete event |
62 | 62 | $modx->invokeEvent("OnTempFormDelete", array( |
63 | - "id" => $id |
|
64 | - )); |
|
63 | + "id" => $id |
|
64 | + )); |
|
65 | 65 | |
66 | 66 | // empty cache |
67 | 67 | $modx->clearCache('full'); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
3 | 3 | if(!$modx->hasPermission('web_access_permissions')) { |
4 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
4 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | // web access group processor. |
@@ -18,111 +18,111 @@ discard block |
||
18 | 18 | $operation = $_REQUEST['operation']; |
19 | 19 | |
20 | 20 | switch ($operation) { |
21 | - case "add_user_group" : |
|
22 | - $newgroup = $_REQUEST['newusergroup']; |
|
23 | - if(empty($newgroup)) { |
|
24 | - $modx->webAlertAndQuit("No group name specified."); |
|
25 | - } else { |
|
26 | - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); |
|
21 | + case "add_user_group" : |
|
22 | + $newgroup = $_REQUEST['newusergroup']; |
|
23 | + if(empty($newgroup)) { |
|
24 | + $modx->webAlertAndQuit("No group name specified."); |
|
25 | + } else { |
|
26 | + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); |
|
27 | 27 | |
28 | - // invoke OnWebCreateGroup event |
|
29 | - $modx->invokeEvent('OnWebCreateGroup', array( |
|
30 | - 'groupid' => $id, |
|
31 | - 'groupname' => $newgroup, |
|
32 | - )); |
|
33 | - } |
|
34 | - break; |
|
35 | - case "add_document_group" : |
|
36 | - $newgroup = $_REQUEST['newdocgroup']; |
|
37 | - if(empty($newgroup)) { |
|
38 | - $modx->webAlertAndQuit("No group name specified."); |
|
39 | - } else { |
|
40 | - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); |
|
28 | + // invoke OnWebCreateGroup event |
|
29 | + $modx->invokeEvent('OnWebCreateGroup', array( |
|
30 | + 'groupid' => $id, |
|
31 | + 'groupname' => $newgroup, |
|
32 | + )); |
|
33 | + } |
|
34 | + break; |
|
35 | + case "add_document_group" : |
|
36 | + $newgroup = $_REQUEST['newdocgroup']; |
|
37 | + if(empty($newgroup)) { |
|
38 | + $modx->webAlertAndQuit("No group name specified."); |
|
39 | + } else { |
|
40 | + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); |
|
41 | 41 | |
42 | - // invoke OnCreateDocGroup event |
|
43 | - $modx->invokeEvent('OnCreateDocGroup', array( |
|
44 | - 'groupid' => $id, |
|
45 | - 'groupname' => $newgroup, |
|
46 | - )); |
|
47 | - } |
|
48 | - break; |
|
49 | - case "delete_user_group" : |
|
50 | - $updategroupaccess = true; |
|
51 | - $usergroup = intval($_REQUEST['usergroup']); |
|
52 | - if(empty($usergroup)) { |
|
53 | - $modx->webAlertAndQuit("No user group id specified for deletion."); |
|
54 | - } else { |
|
55 | - $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); |
|
42 | + // invoke OnCreateDocGroup event |
|
43 | + $modx->invokeEvent('OnCreateDocGroup', array( |
|
44 | + 'groupid' => $id, |
|
45 | + 'groupname' => $newgroup, |
|
46 | + )); |
|
47 | + } |
|
48 | + break; |
|
49 | + case "delete_user_group" : |
|
50 | + $updategroupaccess = true; |
|
51 | + $usergroup = intval($_REQUEST['usergroup']); |
|
52 | + if(empty($usergroup)) { |
|
53 | + $modx->webAlertAndQuit("No user group id specified for deletion."); |
|
54 | + } else { |
|
55 | + $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); |
|
56 | 56 | |
57 | - $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); |
|
57 | + $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); |
|
58 | 58 | |
59 | - $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); |
|
60 | - } |
|
61 | - break; |
|
62 | - case "delete_document_group" : |
|
63 | - $group = intval($_REQUEST['documentgroup']); |
|
64 | - if(empty($group)) { |
|
65 | - $modx->webAlertAndQuit("No document group id specified for deletion."); |
|
66 | - } else { |
|
67 | - $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
59 | + $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); |
|
60 | + } |
|
61 | + break; |
|
62 | + case "delete_document_group" : |
|
63 | + $group = intval($_REQUEST['documentgroup']); |
|
64 | + if(empty($group)) { |
|
65 | + $modx->webAlertAndQuit("No document group id specified for deletion."); |
|
66 | + } else { |
|
67 | + $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
68 | 68 | |
69 | - $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); |
|
69 | + $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); |
|
70 | 70 | |
71 | - $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); |
|
72 | - } |
|
73 | - break; |
|
74 | - case "rename_user_group" : |
|
75 | - $newgroupname = $_REQUEST['newgroupname']; |
|
76 | - if(empty($newgroupname)) { |
|
77 | - $modx->webAlertAndQuit("No group name specified."); |
|
78 | - } |
|
79 | - $groupid = intval($_REQUEST['groupid']); |
|
80 | - if(empty($groupid)) { |
|
81 | - $modx->webAlertAndQuit("No user group id specified for rename."); |
|
82 | - } |
|
83 | - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
|
84 | - break; |
|
85 | - case "rename_document_group" : |
|
86 | - $newgroupname = $_REQUEST['newgroupname']; |
|
87 | - if(empty($newgroupname)) { |
|
88 | - $modx->webAlertAndQuit("No group name specified."); |
|
89 | - } |
|
90 | - $groupid = intval($_REQUEST['groupid']); |
|
91 | - if(empty($groupid)) { |
|
92 | - $modx->webAlertAndQuit("No document group id specified for rename."); |
|
93 | - } |
|
94 | - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
95 | - break; |
|
96 | - case "add_document_group_to_user_group" : |
|
97 | - $updategroupaccess = true; |
|
98 | - $usergroup = intval($_REQUEST['usergroup']); |
|
99 | - $docgroup = intval($_REQUEST['docgroup']); |
|
100 | - $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
101 | - $limit = $modx->db->getValue($rs); |
|
102 | - if($limit<=0) { |
|
103 | - $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
|
104 | - } else { |
|
105 | - //alert user that coupling already exists? |
|
106 | - } |
|
107 | - break; |
|
108 | - case "remove_document_group_from_user_group" : |
|
109 | - $updategroupaccess = true; |
|
110 | - $coupling = intval($_REQUEST['coupling']); |
|
111 | - $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); |
|
112 | - break; |
|
113 | - default : |
|
114 | - $modx->webAlertAndQuit("No operation set in request."); |
|
71 | + $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); |
|
72 | + } |
|
73 | + break; |
|
74 | + case "rename_user_group" : |
|
75 | + $newgroupname = $_REQUEST['newgroupname']; |
|
76 | + if(empty($newgroupname)) { |
|
77 | + $modx->webAlertAndQuit("No group name specified."); |
|
78 | + } |
|
79 | + $groupid = intval($_REQUEST['groupid']); |
|
80 | + if(empty($groupid)) { |
|
81 | + $modx->webAlertAndQuit("No user group id specified for rename."); |
|
82 | + } |
|
83 | + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
|
84 | + break; |
|
85 | + case "rename_document_group" : |
|
86 | + $newgroupname = $_REQUEST['newgroupname']; |
|
87 | + if(empty($newgroupname)) { |
|
88 | + $modx->webAlertAndQuit("No group name specified."); |
|
89 | + } |
|
90 | + $groupid = intval($_REQUEST['groupid']); |
|
91 | + if(empty($groupid)) { |
|
92 | + $modx->webAlertAndQuit("No document group id specified for rename."); |
|
93 | + } |
|
94 | + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
95 | + break; |
|
96 | + case "add_document_group_to_user_group" : |
|
97 | + $updategroupaccess = true; |
|
98 | + $usergroup = intval($_REQUEST['usergroup']); |
|
99 | + $docgroup = intval($_REQUEST['docgroup']); |
|
100 | + $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
101 | + $limit = $modx->db->getValue($rs); |
|
102 | + if($limit<=0) { |
|
103 | + $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
|
104 | + } else { |
|
105 | + //alert user that coupling already exists? |
|
106 | + } |
|
107 | + break; |
|
108 | + case "remove_document_group_from_user_group" : |
|
109 | + $updategroupaccess = true; |
|
110 | + $coupling = intval($_REQUEST['coupling']); |
|
111 | + $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); |
|
112 | + break; |
|
113 | + default : |
|
114 | + $modx->webAlertAndQuit("No operation set in request."); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | // secure web documents - flag as private |
118 | 118 | if($updategroupaccess==true){ |
119 | - include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
120 | - secureWebDocument(); |
|
119 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
120 | + secureWebDocument(); |
|
121 | 121 | |
122 | - // Update the private group column |
|
123 | - $modx->db->update( |
|
124 | - 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', |
|
125 | - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); |
|
122 | + // Update the private group column |
|
123 | + $modx->db->update( |
|
124 | + 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', |
|
125 | + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | $header = "Location: index.php?a=91"; |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
3 | 3 | if(!$modx->hasPermission('new_module')) { |
4 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
4 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | $id = isset($_GET['id'])? intval($_GET['id']) : 0; |
8 | 8 | if($id==0) { |
9 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | // create globally unique identifiers (guid) |
13 | 13 | function createGUID(){ |
14 | - srand((double)microtime()*1000000); |
|
15 | - $r = rand() ; |
|
16 | - $u = uniqid(getmypid() . $r . (double)microtime()*1000000,1); |
|
17 | - $m = md5 ($u); |
|
18 | - return $m; |
|
14 | + srand((double)microtime()*1000000); |
|
15 | + $r = rand() ; |
|
16 | + $u = uniqid(getmypid() . $r . (double)microtime()*1000000,1); |
|
17 | + $m = md5 ($u); |
|
18 | + return $m; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | // count duplicates |
@@ -26,40 +26,40 @@ discard block |
||
26 | 26 | |
27 | 27 | // duplicate module |
28 | 28 | $newid = $modx->db->insert( |
29 | - array( |
|
30 | - 'name'=>'', |
|
31 | - 'description'=>'', |
|
32 | - 'disabled'=>'', |
|
33 | - 'category'=>'', |
|
34 | - 'wrap'=>'', |
|
35 | - 'icon'=>'', |
|
36 | - 'enable_resource'=>'', |
|
37 | - 'resourcefile'=>'', |
|
38 | - 'createdon'=>'', |
|
39 | - 'editedon'=>'', |
|
40 | - 'guid'=>'', |
|
41 | - 'enable_sharedparams'=>'', |
|
42 | - 'properties'=>'', |
|
43 | - 'modulecode'=>'', |
|
44 | - ), $modx->getFullTableName('site_modules'), // Insert into |
|
45 | - "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 |
|
29 | + array( |
|
30 | + 'name'=>'', |
|
31 | + 'description'=>'', |
|
32 | + 'disabled'=>'', |
|
33 | + 'category'=>'', |
|
34 | + 'wrap'=>'', |
|
35 | + 'icon'=>'', |
|
36 | + 'enable_resource'=>'', |
|
37 | + 'resourcefile'=>'', |
|
38 | + 'createdon'=>'', |
|
39 | + 'editedon'=>'', |
|
40 | + 'guid'=>'', |
|
41 | + 'enable_sharedparams'=>'', |
|
42 | + 'properties'=>'', |
|
43 | + 'modulecode'=>'', |
|
44 | + ), $modx->getFullTableName('site_modules'), // Insert into |
|
45 | + "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 |
|
46 | 46 | |
47 | 47 | // duplicate module dependencies |
48 | 48 | $modx->db->insert( |
49 | - array( |
|
50 | - 'module'=>'', |
|
51 | - 'resource'=>'', |
|
52 | - 'type'=>'', |
|
53 | - ), $modx->getFullTableName('site_module_depobj'), // Insert into |
|
54 | - "'{$newid}', resource, type", $modx->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from |
|
49 | + array( |
|
50 | + 'module'=>'', |
|
51 | + 'resource'=>'', |
|
52 | + 'type'=>'', |
|
53 | + ), $modx->getFullTableName('site_module_depobj'), // Insert into |
|
54 | + "'{$newid}', resource, type", $modx->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from |
|
55 | 55 | |
56 | 56 | // duplicate module user group access |
57 | 57 | $modx->db->insert( |
58 | - array( |
|
59 | - 'module'=>'', |
|
60 | - 'usergroup'=>'', |
|
61 | - ), $modx->getFullTableName('site_module_access'), // Insert into |
|
62 | - "'{$newid}', usergroup", $modx->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from |
|
58 | + array( |
|
59 | + 'module'=>'', |
|
60 | + 'usergroup'=>'', |
|
61 | + ), $modx->getFullTableName('site_module_access'), // Insert into |
|
62 | + "'{$newid}', usergroup", $modx->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from |
|
63 | 63 | |
64 | 64 | // Set the item name for logger |
65 | 65 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$newid}'")); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
3 | 3 | if(!$modx->hasPermission('delete_document')) { |
4 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
4 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | $id = isset($_REQUEST['id'])? intval($_REQUEST['id']) : 0; |
8 | 8 | if($id==0) { |
9 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | /************ webber ********/ |
@@ -30,50 +30,50 @@ discard block |
||
30 | 30 | $udperms->role = $_SESSION['mgrRole']; |
31 | 31 | |
32 | 32 | if(!$udperms->checkPermissions()) { |
33 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
33 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // get the timestamp on which the document was deleted. |
37 | 37 | $rs = $modx->db->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1"); |
38 | 38 | $deltime = $modx->db->getValue($rs); |
39 | 39 | if(!$deltime) { |
40 | - $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); |
|
40 | + $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $children = array(); |
44 | 44 | |
45 | 45 | function getChildren($parent) { |
46 | 46 | |
47 | - global $modx; |
|
48 | - global $children; |
|
49 | - global $deltime; |
|
47 | + global $modx; |
|
48 | + global $children; |
|
49 | + global $deltime; |
|
50 | 50 | |
51 | - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='{$parent}' AND deleted=1 AND deletedon='{$deltime}'"); |
|
52 | - // the document has children documents, we'll need to delete those too |
|
53 | - while ($row=$modx->db->getRow($rs)) { |
|
54 | - $children[] = $row['id']; |
|
55 | - getChildren($row['id']); |
|
56 | - //echo "Found childNode of parentNode $parent: ".$row['id']."<br />"; |
|
57 | - } |
|
51 | + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='{$parent}' AND deleted=1 AND deletedon='{$deltime}'"); |
|
52 | + // the document has children documents, we'll need to delete those too |
|
53 | + while ($row=$modx->db->getRow($rs)) { |
|
54 | + $children[] = $row['id']; |
|
55 | + getChildren($row['id']); |
|
56 | + //echo "Found childNode of parentNode $parent: ".$row['id']."<br />"; |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | getChildren($id); |
61 | 61 | |
62 | 62 | if(count($children)>0) { |
63 | - $modx->db->update( |
|
64 | - array( |
|
65 | - 'deleted' => 0, |
|
66 | - 'deletedby' => 0, |
|
67 | - 'deletedon' => 0, |
|
68 | - ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); |
|
63 | + $modx->db->update( |
|
64 | + array( |
|
65 | + 'deleted' => 0, |
|
66 | + 'deletedby' => 0, |
|
67 | + 'deletedon' => 0, |
|
68 | + ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); |
|
69 | 69 | } |
70 | 70 | //'undelete' the document. |
71 | 71 | $modx->db->update( |
72 | - array( |
|
73 | - 'deleted' => 0, |
|
74 | - 'deletedby' => 0, |
|
75 | - 'deletedon' => 0, |
|
76 | - ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
72 | + array( |
|
73 | + 'deleted' => 0, |
|
74 | + 'deletedby' => 0, |
|
75 | + 'deletedon' => 0, |
|
76 | + ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
77 | 77 | |
78 | 78 | $modx->invokeEvent("OnDocFormUnDelete", |
79 | 79 | array( |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
3 | 3 | if(!$modx->hasPermission('settings')) { |
4 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
4 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | 5 | } |
6 | 6 | $data = $_POST; |
7 | 7 | // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 |
@@ -9,41 +9,41 @@ discard block |
||
9 | 9 | |
10 | 10 | if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) |
11 | 11 | { |
12 | - $htaccess = $modx->config['base_path'] . '.htaccess'; |
|
13 | - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; |
|
14 | - $dir = '/' . trim($modx->config['base_url'],'/'); |
|
15 | - if(is_file($htaccess)) |
|
16 | - { |
|
17 | - $_ = file_get_contents($htaccess); |
|
18 | - if(strpos($_,'RewriteBase')===false) |
|
19 | - { |
|
20 | - $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
21 | - } |
|
22 | - elseif(is_writable($htaccess)) |
|
23 | - { |
|
24 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
25 | - if(!@file_put_contents($htaccess,$_)) |
|
26 | - { |
|
27 | - $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
28 | - } |
|
29 | - } |
|
30 | - } |
|
31 | - elseif(is_file($sample_htaccess)) |
|
32 | - { |
|
33 | - if(!@rename($sample_htaccess,$htaccess)) |
|
12 | + $htaccess = $modx->config['base_path'] . '.htaccess'; |
|
13 | + $sample_htaccess = $modx->config['base_path'] . 'ht.access'; |
|
14 | + $dir = '/' . trim($modx->config['base_url'],'/'); |
|
15 | + if(is_file($htaccess)) |
|
16 | + { |
|
17 | + $_ = file_get_contents($htaccess); |
|
18 | + if(strpos($_,'RewriteBase')===false) |
|
34 | 19 | { |
35 | - $warnings[] = $_lang["settings_friendlyurls_alert"]; |
|
36 | - } |
|
37 | - elseif($modx->config['base_url']!=='/') |
|
38 | - { |
|
39 | - $_ = file_get_contents($htaccess); |
|
40 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
41 | - if(!@file_put_contents($htaccess,$_)) |
|
42 | - { |
|
43 | - $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
44 | - } |
|
45 | - } |
|
46 | - } |
|
20 | + $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
21 | + } |
|
22 | + elseif(is_writable($htaccess)) |
|
23 | + { |
|
24 | + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
25 | + if(!@file_put_contents($htaccess,$_)) |
|
26 | + { |
|
27 | + $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
28 | + } |
|
29 | + } |
|
30 | + } |
|
31 | + elseif(is_file($sample_htaccess)) |
|
32 | + { |
|
33 | + if(!@rename($sample_htaccess,$htaccess)) |
|
34 | + { |
|
35 | + $warnings[] = $_lang["settings_friendlyurls_alert"]; |
|
36 | + } |
|
37 | + elseif($modx->config['base_url']!=='/') |
|
38 | + { |
|
39 | + $_ = file_get_contents($htaccess); |
|
40 | + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
41 | + if(!@file_put_contents($htaccess,$_)) |
|
42 | + { |
|
43 | + $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
44 | + } |
|
45 | + } |
|
46 | + } |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
@@ -54,19 +54,19 @@ discard block |
||
54 | 54 | $data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); |
55 | 55 | |
56 | 56 | if (isset($data) && count($data) > 0) { |
57 | - if(isset($data['manager_language'])) { |
|
58 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; |
|
59 | - if(is_file($lang_path)) { |
|
60 | - include($lang_path); |
|
57 | + if(isset($data['manager_language'])) { |
|
58 | + $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; |
|
59 | + if(is_file($lang_path)) { |
|
60 | + include($lang_path); |
|
61 | 61 | global $modx_lang_attribute; |
62 | 62 | $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
63 | - } |
|
64 | - } |
|
65 | - $savethese = array(); |
|
66 | - $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); |
|
67 | - $data['mail_check_timeperiod'] = intval($data['mail_check_timeperiod']) < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
68 | - foreach ($data as $k => $v) { |
|
69 | - switch ($k) { |
|
63 | + } |
|
64 | + } |
|
65 | + $savethese = array(); |
|
66 | + $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); |
|
67 | + $data['mail_check_timeperiod'] = intval($data['mail_check_timeperiod']) < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
68 | + foreach ($data as $k => $v) { |
|
69 | + switch ($k) { |
|
70 | 70 | case 'settings_version':{ |
71 | 71 | if($modx->getVersionData('version')!=$data['settings_version']){ |
72 | 72 | $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version'); |
@@ -74,24 +74,24 @@ discard block |
||
74 | 74 | } |
75 | 75 | break; |
76 | 76 | } |
77 | - case 'error_page': |
|
78 | - case 'unauthorized_page': |
|
79 | - if (trim($v) == '' || !is_numeric($v)) { |
|
80 | - $v = $data['site_start']; |
|
81 | - } |
|
82 | - break; |
|
77 | + case 'error_page': |
|
78 | + case 'unauthorized_page': |
|
79 | + if (trim($v) == '' || !is_numeric($v)) { |
|
80 | + $v = $data['site_start']; |
|
81 | + } |
|
82 | + break; |
|
83 | 83 | |
84 | - case 'lst_custom_contenttype': |
|
85 | - case 'txt_custom_contenttype': |
|
86 | - // Skip these |
|
87 | - $k = ''; |
|
88 | - break; |
|
89 | - case 'rb_base_dir': |
|
90 | - case 'rb_base_url': |
|
91 | - case 'filemanager_path': |
|
92 | - $v = trim($v); |
|
93 | - $v = rtrim($v,'/') . '/'; |
|
94 | - break; |
|
84 | + case 'lst_custom_contenttype': |
|
85 | + case 'txt_custom_contenttype': |
|
86 | + // Skip these |
|
87 | + $k = ''; |
|
88 | + break; |
|
89 | + case 'rb_base_dir': |
|
90 | + case 'rb_base_url': |
|
91 | + case 'filemanager_path': |
|
92 | + $v = trim($v); |
|
93 | + $v = rtrim($v,'/') . '/'; |
|
94 | + break; |
|
95 | 95 | case 'manager_language': |
96 | 96 | $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); |
97 | 97 | $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); |
@@ -99,56 +99,56 @@ discard block |
||
99 | 99 | if($langDir !== $langFileDir || !file_exists($langFile)) { |
100 | 100 | $v = 'english'; |
101 | 101 | } |
102 | - break; |
|
103 | - case 'smtppw': |
|
104 | - if ($v !== '********************' && $v !== '') { |
|
105 | - $v = trim($v); |
|
106 | - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
107 | - $v = str_replace('=','%',$v); |
|
108 | - } elseif ($v === '********************') { |
|
109 | - $k = ''; |
|
110 | - } |
|
111 | - break; |
|
102 | + break; |
|
103 | + case 'smtppw': |
|
104 | + if ($v !== '********************' && $v !== '') { |
|
105 | + $v = trim($v); |
|
106 | + $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
107 | + $v = str_replace('=','%',$v); |
|
108 | + } elseif ($v === '********************') { |
|
109 | + $k = ''; |
|
110 | + } |
|
111 | + break; |
|
112 | 112 | case 'valid_hostnames': |
113 | - $v = str_replace(array(' ,', ', '), ',', $v); |
|
114 | - if ($v !== ',') { |
|
115 | - $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; |
|
116 | - $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n"; |
|
117 | - @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString); |
|
118 | - } |
|
119 | - $k = ''; |
|
120 | - break; |
|
121 | - case 'session_timeout': |
|
122 | - $mail_check_timeperiod = $data['mail_check_timeperiod']; |
|
123 | - $v = intval($v) < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
124 | - break; |
|
125 | - default: |
|
126 | - break; |
|
127 | - } |
|
128 | - $v = is_array($v) ? implode(",", $v) : $v; |
|
113 | + $v = str_replace(array(' ,', ', '), ',', $v); |
|
114 | + if ($v !== ',') { |
|
115 | + $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; |
|
116 | + $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n"; |
|
117 | + @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString); |
|
118 | + } |
|
119 | + $k = ''; |
|
120 | + break; |
|
121 | + case 'session_timeout': |
|
122 | + $mail_check_timeperiod = $data['mail_check_timeperiod']; |
|
123 | + $v = intval($v) < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
124 | + break; |
|
125 | + default: |
|
126 | + break; |
|
127 | + } |
|
128 | + $v = is_array($v) ? implode(",", $v) : $v; |
|
129 | 129 | |
130 | - $modx->config[$k] = $v; |
|
130 | + $modx->config[$k] = $v; |
|
131 | 131 | |
132 | - if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; |
|
133 | - } |
|
132 | + if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; |
|
133 | + } |
|
134 | 134 | |
135 | - // Run a single query to save all the values |
|
136 | - $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) |
|
135 | + // Run a single query to save all the values |
|
136 | + $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) |
|
137 | 137 | VALUES ".implode(', ', $savethese); |
138 | - $modx->db->query($sql); |
|
138 | + $modx->db->query($sql); |
|
139 | 139 | |
140 | - // Reset Template Pages |
|
141 | - if (isset($data['reset_template'])) { |
|
142 | - $newtemplate = intval($data['default_template']); |
|
143 | - $oldtemplate = intval($data['old_template']); |
|
144 | - $tbl = $modx->getFullTableName('site_content'); |
|
145 | - $reset = $data['reset_template']; |
|
146 | - if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
147 | - else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
148 | - } |
|
140 | + // Reset Template Pages |
|
141 | + if (isset($data['reset_template'])) { |
|
142 | + $newtemplate = intval($data['default_template']); |
|
143 | + $oldtemplate = intval($data['old_template']); |
|
144 | + $tbl = $modx->getFullTableName('site_content'); |
|
145 | + $reset = $data['reset_template']; |
|
146 | + if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
147 | + else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
148 | + } |
|
149 | 149 | |
150 | - // empty cache |
|
151 | - $modx->clearCache('full'); |
|
150 | + // empty cache |
|
151 | + $modx->clearCache('full'); |
|
152 | 152 | } |
153 | 153 | $header="Location: index.php?a=7&r=10"; |
154 | 154 | header($header); |
@@ -16,24 +16,24 @@ |
||
16 | 16 | $pth = dirname(dirname(dirname(__FILE__)))."/install/"; |
17 | 17 | $pth = str_replace("\\","/",$pth); |
18 | 18 | if(isset($_GET["rminstall"])) { |
19 | - if(is_dir($pth)) { |
|
20 | - if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; |
|
21 | - } |
|
19 | + if(is_dir($pth)) { |
|
20 | + if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | if($msg) echo "<script>alert('".addslashes($msg)."');</script>"; |
24 | 24 | echo "<script>window.location='../index.php?a=2';</script>"; |
25 | 25 | |
26 | 26 | // rmdirRecursive - detects symbollic links on unix |
27 | 27 | function rmdirRecursive($path,$followLinks=false) { |
28 | - $dir = opendir($path) ; |
|
29 | - while ($entry = readdir($dir)) { |
|
30 | - if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { |
|
31 | - @unlink( "$path/$entry" ); |
|
32 | - } |
|
33 | - elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { |
|
34 | - rmdirRecursive("$path/$entry"); // recursive |
|
35 | - } |
|
36 | - } |
|
37 | - closedir($dir); |
|
38 | - return @rmdir($path); |
|
28 | + $dir = opendir($path) ; |
|
29 | + while ($entry = readdir($dir)) { |
|
30 | + if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { |
|
31 | + @unlink( "$path/$entry" ); |
|
32 | + } |
|
33 | + elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { |
|
34 | + rmdirRecursive("$path/$entry"); // recursive |
|
35 | + } |
|
36 | + } |
|
37 | + closedir($dir); |
|
38 | + return @rmdir($path); |
|
39 | 39 | } |
@@ -491,7 +491,7 @@ |
||
491 | 491 | }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
492 | 492 | $publishedon = $pub_date; |
493 | 493 | $publishedby = $modx->getLoginUserID(); |
494 | - }elseif ($was_published && !$published) { |
|
494 | + }elseif ($was_published && !$published) { |
|
495 | 495 | $publishedon = 0; |
496 | 496 | $publishedby = 0; |
497 | 497 | } else { |