@@ -3,51 +3,51 @@ 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('exec_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 | |
14 | 14 | // check if user has access permission, except admins |
15 | 15 | if($_SESSION['mgrRole']!=1){ |
16 | - $rs = $modx->getDatabase()->select( |
|
17 | - 'sma.usergroup,mg.member', |
|
18 | - $modx->getFullTableName("site_module_access")." sma |
|
16 | + $rs = $modx->getDatabase()->select( |
|
17 | + 'sma.usergroup,mg.member', |
|
18 | + $modx->getFullTableName("site_module_access")." sma |
|
19 | 19 | LEFT JOIN ".$modx->getFullTableName("member_groups")." mg ON mg.user_group = sma.usergroup AND member='".$modx->getLoginUserID()."'", |
20 | - "sma.module = '{$id}'" |
|
21 | - ); |
|
22 | - //initialize permission to -1, if it stays -1 no permissions |
|
23 | - //attached so permission granted |
|
24 | - $permissionAccessInt = -1; |
|
20 | + "sma.module = '{$id}'" |
|
21 | + ); |
|
22 | + //initialize permission to -1, if it stays -1 no permissions |
|
23 | + //attached so permission granted |
|
24 | + $permissionAccessInt = -1; |
|
25 | 25 | |
26 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | - if($row["usergroup"] && $row["member"]) { |
|
28 | - //if there are permissions and this member has permission, ofcourse |
|
29 | - //this is granted |
|
30 | - $permissionAccessInt = 1; |
|
31 | - } elseif ($permissionAccessInt==-1) { |
|
32 | - //if there are permissions but this member has no permission and the |
|
33 | - //variable was still in init state we set permission to 0; no permissions |
|
34 | - $permissionAccessInt = 0; |
|
35 | - } |
|
36 | - } |
|
26 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | + if($row["usergroup"] && $row["member"]) { |
|
28 | + //if there are permissions and this member has permission, ofcourse |
|
29 | + //this is granted |
|
30 | + $permissionAccessInt = 1; |
|
31 | + } elseif ($permissionAccessInt==-1) { |
|
32 | + //if there are permissions but this member has no permission and the |
|
33 | + //variable was still in init state we set permission to 0; no permissions |
|
34 | + $permissionAccessInt = 0; |
|
35 | + } |
|
36 | + } |
|
37 | 37 | |
38 | - if($permissionAccessInt==0) { |
|
39 | - $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
|
40 | - } |
|
38 | + if($permissionAccessInt==0) { |
|
39 | + $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
|
40 | + } |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | // get module data |
44 | 44 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'"); |
45 | 45 | $content = $modx->getDatabase()->getRow($rs); |
46 | 46 | if(!$content) { |
47 | - $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
|
47 | + $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
|
48 | 48 | } |
49 | 49 | if($content['disabled']) { |
50 | - $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
|
50 | + $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // Set the item name for logger |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | $output = evalModule($content["modulecode"],$parameter); |
64 | 64 | if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) { |
65 | - echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller |
|
65 | + echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller |
|
66 | 66 | } |
67 | 67 | echo $output; |
68 | 68 | include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; |
@@ -4,23 +4,23 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!isset($_GET['id'])) { |
7 | - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | |
9 | - // Remove all locks |
|
10 | - $modx->getDatabase()->truncate($modx->getFullTableName('active_user_locks')); |
|
9 | + // Remove all locks |
|
10 | + $modx->getDatabase()->truncate($modx->getFullTableName('active_user_locks')); |
|
11 | 11 | |
12 | - $header = "Location: index.php?a=2"; |
|
13 | - header($header); |
|
12 | + $header = "Location: index.php?a=2"; |
|
13 | + header($header); |
|
14 | 14 | } else { |
15 | - // Remove single locks via AJAX / window.onbeforeunload |
|
16 | - $type = (int)$_GET['type']; |
|
17 | - $id = (int)$_GET['id']; |
|
18 | - $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
|
19 | - if($type && $id) { |
|
20 | - $modx->unlockElement($type, $id, $includeAllUsers); |
|
21 | - echo '1'; |
|
22 | - exit; |
|
23 | - } else { |
|
24 | - echo 'No type or id sent with request.'; |
|
25 | - } |
|
15 | + // Remove single locks via AJAX / window.onbeforeunload |
|
16 | + $type = (int)$_GET['type']; |
|
17 | + $id = (int)$_GET['id']; |
|
18 | + $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
|
19 | + if($type && $id) { |
|
20 | + $modx->unlockElement($type, $id, $includeAllUsers); |
|
21 | + echo '1'; |
|
22 | + exit; |
|
23 | + } else { |
|
24 | + echo 'No type or id sent with request.'; |
|
25 | + } |
|
26 | 26 | } |
@@ -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('web_access_permissions')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // web access group processor. |
@@ -20,111 +20,111 @@ 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_webgroup_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_webgroup_names); |
|
29 | 29 | |
30 | - // invoke OnWebCreateGroup event |
|
31 | - $modx->invokeEvent('OnWebCreateGroup', 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 OnWebCreateGroup event |
|
31 | + $modx->invokeEvent('OnWebCreateGroup', 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_webgroup_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_webgroup_names, "id='{$usergroup}'"); |
|
58 | 58 | |
59 | - $modx->getDatabase()->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); |
|
59 | + $modx->getDatabase()->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); |
|
60 | 60 | |
61 | - $modx->getDatabase()->delete($tbl_web_groups, "webuser='{$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_web_groups, "webuser='{$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_webgroup_access, "documentgroup='{$group}'"); |
|
71 | + $modx->getDatabase()->delete($tbl_webgroup_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 user group id specified for rename."); |
|
84 | - } |
|
85 | - $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
|
86 | - break; |
|
87 | - case "rename_document_group" : |
|
88 | - $newgroupname = $_REQUEST['newgroupname']; |
|
89 | - if(empty($newgroupname)) { |
|
90 | - $modx->webAlertAndQuit("No group name specified."); |
|
91 | - } |
|
92 | - $groupid = (int)$_REQUEST['groupid']; |
|
93 | - if(empty($groupid)) { |
|
94 | - $modx->webAlertAndQuit("No document group id specified for rename."); |
|
95 | - } |
|
96 | - $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
97 | - break; |
|
98 | - case "add_document_group_to_user_group" : |
|
99 | - $updategroupaccess = true; |
|
100 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
101 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
102 | - $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
103 | - $limit = $modx->getDatabase()->getValue($rs); |
|
104 | - if($limit<=0) { |
|
105 | - $modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
|
106 | - } else { |
|
107 | - //alert user that coupling already exists? |
|
108 | - } |
|
109 | - break; |
|
110 | - case "remove_document_group_from_user_group" : |
|
111 | - $updategroupaccess = true; |
|
112 | - $coupling = (int)$_REQUEST['coupling']; |
|
113 | - $modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'"); |
|
114 | - break; |
|
115 | - default : |
|
116 | - $modx->webAlertAndQuit("No operation set in request."); |
|
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 user group id specified for rename."); |
|
84 | + } |
|
85 | + $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
|
86 | + break; |
|
87 | + case "rename_document_group" : |
|
88 | + $newgroupname = $_REQUEST['newgroupname']; |
|
89 | + if(empty($newgroupname)) { |
|
90 | + $modx->webAlertAndQuit("No group name specified."); |
|
91 | + } |
|
92 | + $groupid = (int)$_REQUEST['groupid']; |
|
93 | + if(empty($groupid)) { |
|
94 | + $modx->webAlertAndQuit("No document group id specified for rename."); |
|
95 | + } |
|
96 | + $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
97 | + break; |
|
98 | + case "add_document_group_to_user_group" : |
|
99 | + $updategroupaccess = true; |
|
100 | + $usergroup = (int)$_REQUEST['usergroup']; |
|
101 | + $docgroup = (int)$_REQUEST['docgroup']; |
|
102 | + $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
103 | + $limit = $modx->getDatabase()->getValue($rs); |
|
104 | + if($limit<=0) { |
|
105 | + $modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
|
106 | + } else { |
|
107 | + //alert user that coupling already exists? |
|
108 | + } |
|
109 | + break; |
|
110 | + case "remove_document_group_from_user_group" : |
|
111 | + $updategroupaccess = true; |
|
112 | + $coupling = (int)$_REQUEST['coupling']; |
|
113 | + $modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'"); |
|
114 | + break; |
|
115 | + default : |
|
116 | + $modx->webAlertAndQuit("No operation set in request."); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | // secure web documents - flag as private |
120 | 120 | if($updategroupaccess==true){ |
121 | - include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
122 | - secureWebDocument(); |
|
121 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
122 | + secureWebDocument(); |
|
123 | 123 | |
124 | - // Update the private group column |
|
125 | - $modx->getDatabase()->update( |
|
126 | - 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', |
|
127 | - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); |
|
124 | + // Update the private group column |
|
125 | + $modx->getDatabase()->update( |
|
126 | + 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', |
|
127 | + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | $header = "Location: index.php?a=91"; |
@@ -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_plugin')) { |
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,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforePluginFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforePluginFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the plugin. |
25 | 25 | $modx->getDatabase()->delete($modx->getFullTableName('site_plugins'), "id='{$id}'"); |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | |
30 | 30 | // invoke OnPluginFormDelete event |
31 | 31 | $modx->invokeEvent("OnPluginFormDelete", |
32 | - array( |
|
33 | - "id" => $id |
|
34 | - )); |
|
32 | + array( |
|
33 | + "id" => $id |
|
34 | + )); |
|
35 | 35 | |
36 | 36 | // empty cache |
37 | 37 | $modx->clearCache('full'); |
@@ -3,22 +3,22 @@ |
||
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_role')) { |
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 | if($id==1){ |
15 | - $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
|
15 | + $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
19 | 19 | $count=$modx->getDatabase()->getValue($rs); |
20 | 20 | if($count>0){ |
21 | - $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
|
21 | + $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | // Set the item name for logger |
@@ -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('save_document')||!$modx->hasPermission('publish_document')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_REQUEST['id'])? (int)$_REQUEST['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 | /************webber ********/ |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | $udperms->role = $_SESSION['mgrRole']; |
33 | 33 | |
34 | 34 | if(!$udperms->checkPermissions()) { |
35 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
35 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // update the document |
39 | 39 | $modx->getDatabase()->update( |
40 | - array( |
|
41 | - 'published' => 1, |
|
42 | - 'pub_date' => 0, |
|
43 | - 'unpub_date' => 0, |
|
44 | - 'editedby' => $modx->getLoginUserID(), |
|
45 | - 'editedon' => time(), |
|
46 | - 'publishedby' => $modx->getLoginUserID(), |
|
47 | - 'publishedon' => time(), |
|
48 | - ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
40 | + array( |
|
41 | + 'published' => 1, |
|
42 | + 'pub_date' => 0, |
|
43 | + 'unpub_date' => 0, |
|
44 | + 'editedby' => $modx->getLoginUserID(), |
|
45 | + 'editedon' => time(), |
|
46 | + 'publishedby' => $modx->getLoginUserID(), |
|
47 | + 'publishedon' => time(), |
|
48 | + ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
49 | 49 | |
50 | 50 | // invoke OnDocPublished event |
51 | 51 | $modx->invokeEvent("OnDocPublished",array("docid"=>$id)); |
@@ -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('messages')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $sendto = $_REQUEST['sendto']; |
@@ -16,55 +16,55 @@ discard block |
||
16 | 16 | $postdate = time(); |
17 | 17 | |
18 | 18 | if($sendto=='u') { |
19 | - if($userid==0) { |
|
20 | - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
21 | - } |
|
22 | - $modx->getDatabase()->insert( |
|
23 | - array( |
|
24 | - 'recipient' => $userid, |
|
25 | - 'sender' => $modx->getLoginUserID(), |
|
26 | - 'subject' => $subject, |
|
27 | - 'message' => $message, |
|
28 | - 'postdate' => $postdate, |
|
29 | - 'type' => 'Message', |
|
30 | - 'private' => 1, |
|
31 | - ), $modx->getFullTableName('user_messages')); |
|
19 | + if($userid==0) { |
|
20 | + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
21 | + } |
|
22 | + $modx->getDatabase()->insert( |
|
23 | + array( |
|
24 | + 'recipient' => $userid, |
|
25 | + 'sender' => $modx->getLoginUserID(), |
|
26 | + 'subject' => $subject, |
|
27 | + 'message' => $message, |
|
28 | + 'postdate' => $postdate, |
|
29 | + 'type' => 'Message', |
|
30 | + 'private' => 1, |
|
31 | + ), $modx->getFullTableName('user_messages')); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if($sendto=='g') { |
35 | - if($groupid==0) { |
|
36 | - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
37 | - } |
|
38 | - $rs = $modx->getDatabase()->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
39 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
40 | - $modx->getDatabase()->insert( |
|
41 | - array( |
|
42 | - 'recipient' => $row['internalKey'], |
|
43 | - 'sender' => $modx->getLoginUserID(), |
|
44 | - 'subject' => $subject, |
|
45 | - 'message' => $message, |
|
46 | - 'postdate' => $postdate, |
|
47 | - 'type' => 'Message', |
|
48 | - 'private' => 0, |
|
49 | - ), $modx->getFullTableName('user_messages')); |
|
50 | - } |
|
35 | + if($groupid==0) { |
|
36 | + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
37 | + } |
|
38 | + $rs = $modx->getDatabase()->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
39 | + while ($row=$modx->getDatabase()->getRow($rs)) { |
|
40 | + $modx->getDatabase()->insert( |
|
41 | + array( |
|
42 | + 'recipient' => $row['internalKey'], |
|
43 | + 'sender' => $modx->getLoginUserID(), |
|
44 | + 'subject' => $subject, |
|
45 | + 'message' => $message, |
|
46 | + 'postdate' => $postdate, |
|
47 | + 'type' => 'Message', |
|
48 | + 'private' => 0, |
|
49 | + ), $modx->getFullTableName('user_messages')); |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | if($sendto=='a') { |
55 | - $rs = $modx->getDatabase()->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
56 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
57 | - $modx->getDatabase()->insert( |
|
58 | - array( |
|
59 | - 'recipient' => $row['id'], |
|
60 | - 'sender' => $modx->getLoginUserID(), |
|
61 | - 'subject' => $subject, |
|
62 | - 'message' => $message, |
|
63 | - 'postdate' => $postdate, |
|
64 | - 'type' => 'Message', |
|
65 | - 'private' => 0, |
|
66 | - ), $modx->getFullTableName('user_messages')); |
|
67 | - } |
|
55 | + $rs = $modx->getDatabase()->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
56 | + while ($row=$modx->getDatabase()->getRow($rs)) { |
|
57 | + $modx->getDatabase()->insert( |
|
58 | + array( |
|
59 | + 'recipient' => $row['id'], |
|
60 | + 'sender' => $modx->getLoginUserID(), |
|
61 | + 'subject' => $subject, |
|
62 | + 'message' => $message, |
|
63 | + 'postdate' => $postdate, |
|
64 | + 'type' => 'Message', |
|
65 | + 'private' => 0, |
|
66 | + ), $modx->getFullTableName('user_messages')); |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $header = "Location: index.php?a=10"; |
@@ -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 OnBeforeSnipFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeSnipFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the snippet. |
25 | 25 | $modx->getDatabase()->delete($modx->getFullTableName('site_snippets'), "id='{$id}'"); |
26 | 26 | |
27 | 27 | // invoke OnSnipFormDelete event |
28 | 28 | $modx->invokeEvent("OnSnipFormDelete", |
29 | - array( |
|
30 | - "id" => $id |
|
31 | - )); |
|
29 | + array( |
|
30 | + "id" => $id |
|
31 | + )); |
|
32 | 32 | |
33 | 33 | // empty cache |
34 | 34 | $modx->clearCache('full'); |
@@ -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('save_document')||!$modx->hasPermission('publish_document')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_REQUEST['id'])? (int)$_REQUEST['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 | /************webber ********/ |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | $udperms->role = $_SESSION['mgrRole']; |
33 | 33 | |
34 | 34 | if(!$udperms->checkPermissions()) { |
35 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
35 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // update the document |
39 | 39 | $modx->getDatabase()->update( |
40 | - array( |
|
41 | - 'published' => 0, |
|
42 | - 'pub_date' => 0, |
|
43 | - 'unpub_date' => 0, |
|
44 | - 'editedby' => $modx->getLoginUserID(), |
|
45 | - 'editedon' => time(), |
|
46 | - 'publishedby' => 0, |
|
47 | - 'publishedon' => 0, |
|
48 | - ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
40 | + array( |
|
41 | + 'published' => 0, |
|
42 | + 'pub_date' => 0, |
|
43 | + 'unpub_date' => 0, |
|
44 | + 'editedby' => $modx->getLoginUserID(), |
|
45 | + 'editedon' => time(), |
|
46 | + 'publishedby' => 0, |
|
47 | + 'publishedon' => 0, |
|
48 | + ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
49 | 49 | |
50 | 50 | // invoke OnDocUnPublished event |
51 | 51 | $modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); |