@@ -1,22 +1,22 @@ |
||
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_role')) { |
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 | if($id==1){ |
13 | - $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
|
13 | + $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
17 | 17 | $count=$modx->db->getValue($rs); |
18 | 18 | if($count>0){ |
19 | - $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
|
19 | + $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // Set the item name for logger |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
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 | -if(!$modx->hasPermission('delete_role')) { |
|
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 | +if (!$modx->hasPermission('delete_role')) { |
|
4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 5 | } |
6 | 6 | |
7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
8 | -if($id==0) { |
|
7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
8 | +if ($id == 0) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
10 | 10 | } |
11 | 11 | |
12 | -if($id==1){ |
|
12 | +if ($id == 1) { |
|
13 | 13 | $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
14 | 14 | } |
15 | 15 | |
16 | 16 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
17 | -$count=$modx->db->getValue($rs); |
|
18 | -if($count>0){ |
|
17 | +$count = $modx->db->getValue($rs); |
|
18 | +if ($count > 0) { |
|
19 | 19 | $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
20 | 20 | } |
21 | 21 | |
@@ -26,5 +26,5 @@ discard block |
||
26 | 26 | // delete the attributes |
27 | 27 | $modx->db->delete($modx->getFullTableName('user_roles'), "id='{$id}'"); |
28 | 28 | |
29 | -$header="Location: index.php?a=86"; |
|
29 | +$header = "Location: index.php?a=86"; |
|
30 | 30 | header($header); |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
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."); |
|
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."); |
|
4 | +} |
|
3 | 5 | if(!$modx->hasPermission('delete_role')) { |
4 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 7 | } |
@@ -9,13 +11,13 @@ discard block |
||
9 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
10 | 12 | } |
11 | 13 | |
12 | -if($id==1){ |
|
14 | +if($id==1) { |
|
13 | 15 | $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
14 | 16 | } |
15 | 17 | |
16 | 18 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
17 | 19 | $count=$modx->db->getValue($rs); |
18 | -if($count>0){ |
|
20 | +if($count>0) { |
|
19 | 21 | $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
20 | 22 | } |
21 | 23 |
@@ -1,17 +1,17 @@ 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_user')) { |
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 | // delete the user, but first check if we are deleting our own record |
13 | 13 | if($id==$modx->getLoginUserID()) { |
14 | - $modx->webAlertAndQuit("You can't delete yourself!"); |
|
14 | + $modx->webAlertAndQuit("You can't delete yourself!"); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | // Set the item name for logger |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | // invoke OnBeforeUserFormDelete event |
22 | 22 | $modx->invokeEvent("OnBeforeUserFormDelete", |
23 | - array( |
|
24 | - "id" => $id |
|
25 | - )); |
|
23 | + array( |
|
24 | + "id" => $id |
|
25 | + )); |
|
26 | 26 | |
27 | 27 | // delete the user. |
28 | 28 | $modx->db->delete($modx->getFullTableName('manager_users'), "id='{$id}'"); |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | |
38 | 38 | // invoke OnManagerDeleteUser event |
39 | 39 | $modx->invokeEvent("OnManagerDeleteUser", |
40 | - array( |
|
41 | - "userid" => $id, |
|
42 | - "username" => $username |
|
43 | - )); |
|
40 | + array( |
|
41 | + "userid" => $id, |
|
42 | + "username" => $username |
|
43 | + )); |
|
44 | 44 | |
45 | 45 | // invoke OnUserFormDelete event |
46 | 46 | $modx->invokeEvent("OnUserFormDelete", |
47 | - array( |
|
48 | - "id" => $id |
|
49 | - )); |
|
47 | + array( |
|
48 | + "id" => $id |
|
49 | + )); |
|
50 | 50 | |
51 | 51 | $header="Location: index.php?a=75"; |
52 | 52 | header($header); |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
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 | -if(!$modx->hasPermission('delete_user')) { |
|
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 | +if (!$modx->hasPermission('delete_user')) { |
|
4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 5 | } |
6 | 6 | |
7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
8 | -if($id==0) { |
|
7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
8 | +if ($id == 0) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
10 | 10 | } |
11 | 11 | |
12 | 12 | // delete the user, but first check if we are deleting our own record |
13 | -if($id==$modx->getLoginUserID()) { |
|
13 | +if ($id == $modx->getLoginUserID()) { |
|
14 | 14 | $modx->webAlertAndQuit("You can't delete yourself!"); |
15 | 15 | } |
16 | 16 | |
@@ -48,5 +48,5 @@ discard block |
||
48 | 48 | "id" => $id |
49 | 49 | )); |
50 | 50 | |
51 | -$header="Location: index.php?a=75"; |
|
51 | +$header = "Location: index.php?a=75"; |
|
52 | 52 | header($header); |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
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."); |
|
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."); |
|
4 | +} |
|
3 | 5 | if(!$modx->hasPermission('delete_user')) { |
4 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 7 | } |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | -if (IN_MANAGER_MODE!="true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('messages')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
10 | -if ($id==0) { |
|
9 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit("Wrong number of messages returned!"); |
19 | 19 | } |
20 | 20 | |
21 | -if ($message['recipient']!=$modx->getLoginUserID()) { |
|
21 | +if ($message['recipient'] != $modx->getLoginUserID()) { |
|
22 | 22 | $modx->webAlertAndQuit("You are not allowed to delete this message!"); |
23 | 23 | } |
24 | 24 | |
25 | 25 | // delete message |
26 | 26 | $modx->db->delete($modx->getFullTableName('user_messages'), "id='{$id}'"); |
27 | 27 | |
28 | -$header="Location: index.php?a=10"; |
|
28 | +$header = "Location: index.php?a=10"; |
|
29 | 29 | header($header); |
@@ -1,26 +1,26 @@ 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 | $forced = isset($_GET['force']) ? $_GET['force'] : 0; |
15 | 15 | |
16 | 16 | // check for relations |
17 | 17 | if(!$forced) { |
18 | - $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc |
|
18 | + $drs = $modx->db->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->db->getRecordCount($drs); |
|
21 | - if($count > 0) { |
|
22 | - include_once "header.inc.php"; |
|
23 | - ?> |
|
20 | + $count = $modx->db->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->db->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->db->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 |
@@ -1,24 +1,24 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('delete_template')) { |
|
5 | +if (!$modx->hasPermission('delete_template')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
10 | -if($id == 0) { |
|
10 | +if ($id == 0) { |
|
11 | 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 | -if(!$forced) { |
|
18 | - $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc |
|
19 | - INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); |
|
17 | +if (!$forced) { |
|
18 | + $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content')." AS sc |
|
19 | + INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues')." AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); |
|
20 | 20 | $count = $modx->db->getRecordCount($drs); |
21 | - if($count > 0) { |
|
21 | + if ($count > 0) { |
|
22 | 22 | include_once "header.inc.php"; |
23 | 23 | ?> |
24 | 24 | <script> |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | <p><?= $_lang['tmplvar_inuse'] ?></p> |
43 | 43 | <ul> |
44 | 44 | <?php |
45 | - while($row = $modx->db->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>'; |
|
45 | + while ($row = $modx->db->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 | 47 | } |
48 | 48 | ?> |
49 | 49 | </ul> |
@@ -59,125 +59,125 @@ |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | switch ($_POST['mode']) { |
62 | - case '107': |
|
63 | - // invoke OnBeforeModFormSave event |
|
64 | - $modx->invokeEvent("OnBeforeModFormSave", array( |
|
65 | - "mode" => "new", |
|
66 | - "id" => $id |
|
67 | - )); |
|
68 | - |
|
69 | - // disallow duplicate names for new modules |
|
70 | - $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}'"); |
|
71 | - $count = $modx->db->getValue($rs); |
|
72 | - if ($count > 0) { |
|
73 | - $modx->manager->saveFormValues(107); |
|
74 | - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=107"); |
|
75 | - } |
|
62 | + case '107': |
|
63 | + // invoke OnBeforeModFormSave event |
|
64 | + $modx->invokeEvent("OnBeforeModFormSave", array( |
|
65 | + "mode" => "new", |
|
66 | + "id" => $id |
|
67 | + )); |
|
68 | + |
|
69 | + // disallow duplicate names for new modules |
|
70 | + $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}'"); |
|
71 | + $count = $modx->db->getValue($rs); |
|
72 | + if ($count > 0) { |
|
73 | + $modx->manager->saveFormValues(107); |
|
74 | + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=107"); |
|
75 | + } |
|
76 | 76 | |
77 | - // save the new module |
|
78 | - $newid = $modx->db->insert(array( |
|
79 | - 'name' => $name, |
|
80 | - 'description' => $description, |
|
81 | - 'disabled' => $disabled, |
|
82 | - 'wrap' => $wrap, |
|
83 | - 'locked' => $locked, |
|
84 | - 'icon' => $icon, |
|
85 | - 'resourcefile' => $resourcefile, |
|
86 | - 'enable_resource' => $enable_resource, |
|
87 | - 'category' => $categoryid, |
|
88 | - 'enable_sharedparams' => $enable_sharedparams, |
|
89 | - 'guid' => $guid, |
|
90 | - 'modulecode' => $modulecode, |
|
91 | - 'properties' => $properties, |
|
92 | - 'createdon' => $currentdate, |
|
93 | - 'editedon' => $currentdate |
|
94 | - ), $modx->getFullTableName('site_modules')); |
|
95 | - |
|
96 | - // save user group access permissions |
|
97 | - saveUserGroupAccessPermissons(); |
|
98 | - |
|
99 | - // invoke OnModFormSave event |
|
100 | - $modx->invokeEvent("OnModFormSave", array( |
|
101 | - "mode" => "new", |
|
102 | - "id" => $newid |
|
103 | - )); |
|
104 | - |
|
105 | - // Set the item name for logger |
|
106 | - $_SESSION['itemname'] = $name; |
|
107 | - |
|
108 | - // empty cache |
|
109 | - $modx->clearCache('full'); |
|
110 | - |
|
111 | - // finished emptying cache - redirect |
|
112 | - if ($_POST['stay'] != '') { |
|
113 | - $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107"; |
|
114 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
115 | - header($header); |
|
116 | - } else { |
|
117 | - $header = "Location: index.php?a=106&r=2"; |
|
118 | - header($header); |
|
119 | - } |
|
120 | - break; |
|
121 | - case '108': |
|
122 | - // invoke OnBeforeModFormSave event |
|
123 | - $modx->invokeEvent("OnBeforeModFormSave", array( |
|
124 | - "mode" => "upd", |
|
125 | - "id" => $id |
|
126 | - )); |
|
127 | - |
|
128 | - // disallow duplicate names for new modules |
|
129 | - $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}' AND id!='{$id}'"); |
|
130 | - if ($modx->db->getValue($rs) > 0) { |
|
131 | - $modx->manager->saveFormValues(108); |
|
132 | - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=108&id={$id}"); |
|
133 | - } |
|
77 | + // save the new module |
|
78 | + $newid = $modx->db->insert(array( |
|
79 | + 'name' => $name, |
|
80 | + 'description' => $description, |
|
81 | + 'disabled' => $disabled, |
|
82 | + 'wrap' => $wrap, |
|
83 | + 'locked' => $locked, |
|
84 | + 'icon' => $icon, |
|
85 | + 'resourcefile' => $resourcefile, |
|
86 | + 'enable_resource' => $enable_resource, |
|
87 | + 'category' => $categoryid, |
|
88 | + 'enable_sharedparams' => $enable_sharedparams, |
|
89 | + 'guid' => $guid, |
|
90 | + 'modulecode' => $modulecode, |
|
91 | + 'properties' => $properties, |
|
92 | + 'createdon' => $currentdate, |
|
93 | + 'editedon' => $currentdate |
|
94 | + ), $modx->getFullTableName('site_modules')); |
|
95 | + |
|
96 | + // save user group access permissions |
|
97 | + saveUserGroupAccessPermissons(); |
|
98 | + |
|
99 | + // invoke OnModFormSave event |
|
100 | + $modx->invokeEvent("OnModFormSave", array( |
|
101 | + "mode" => "new", |
|
102 | + "id" => $newid |
|
103 | + )); |
|
104 | + |
|
105 | + // Set the item name for logger |
|
106 | + $_SESSION['itemname'] = $name; |
|
107 | + |
|
108 | + // empty cache |
|
109 | + $modx->clearCache('full'); |
|
110 | + |
|
111 | + // finished emptying cache - redirect |
|
112 | + if ($_POST['stay'] != '') { |
|
113 | + $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107"; |
|
114 | + $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
115 | + header($header); |
|
116 | + } else { |
|
117 | + $header = "Location: index.php?a=106&r=2"; |
|
118 | + header($header); |
|
119 | + } |
|
120 | + break; |
|
121 | + case '108': |
|
122 | + // invoke OnBeforeModFormSave event |
|
123 | + $modx->invokeEvent("OnBeforeModFormSave", array( |
|
124 | + "mode" => "upd", |
|
125 | + "id" => $id |
|
126 | + )); |
|
127 | + |
|
128 | + // disallow duplicate names for new modules |
|
129 | + $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}' AND id!='{$id}'"); |
|
130 | + if ($modx->db->getValue($rs) > 0) { |
|
131 | + $modx->manager->saveFormValues(108); |
|
132 | + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=108&id={$id}"); |
|
133 | + } |
|
134 | 134 | |
135 | - // save the edited module |
|
136 | - $modx->db->update(array( |
|
137 | - 'name' => $name, |
|
138 | - 'description' => $description, |
|
139 | - 'icon' => $icon, |
|
140 | - 'enable_resource' => $enable_resource, |
|
141 | - 'resourcefile' => $resourcefile, |
|
142 | - 'disabled' => $disabled, |
|
143 | - 'wrap' => $wrap, |
|
144 | - 'locked' => $locked, |
|
145 | - 'category' => $categoryid, |
|
146 | - 'enable_sharedparams' => $enable_sharedparams, |
|
147 | - 'guid' => $guid, |
|
148 | - 'modulecode' => $modulecode, |
|
149 | - 'properties' => $properties, |
|
150 | - 'editedon' => $currentdate |
|
151 | - ), $modx->getFullTableName('site_modules'), "id='{$id}'"); |
|
152 | - |
|
153 | - // save user group access permissions |
|
154 | - saveUserGroupAccessPermissons(); |
|
155 | - |
|
156 | - // invoke OnModFormSave event |
|
157 | - $modx->invokeEvent("OnModFormSave", array( |
|
158 | - "mode" => "upd", |
|
159 | - "id" => $id |
|
160 | - )); |
|
161 | - |
|
162 | - // Set the item name for logger |
|
163 | - $_SESSION['itemname'] = $name; |
|
164 | - |
|
165 | - // empty cache |
|
166 | - $modx->clearCache('full'); |
|
167 | - |
|
168 | - // finished emptying cache - redirect |
|
169 | - if ($_POST['stay'] != '') { |
|
170 | - $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107"; |
|
171 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
172 | - header($header); |
|
173 | - } else { |
|
174 | - $modx->unlockElement(6, $id); |
|
175 | - $header = "Location: index.php?a=106&r=2"; |
|
176 | - header($header); |
|
177 | - } |
|
178 | - break; |
|
179 | - default: |
|
180 | - $modx->webAlertAndQuit("No operation set in request."); |
|
135 | + // save the edited module |
|
136 | + $modx->db->update(array( |
|
137 | + 'name' => $name, |
|
138 | + 'description' => $description, |
|
139 | + 'icon' => $icon, |
|
140 | + 'enable_resource' => $enable_resource, |
|
141 | + 'resourcefile' => $resourcefile, |
|
142 | + 'disabled' => $disabled, |
|
143 | + 'wrap' => $wrap, |
|
144 | + 'locked' => $locked, |
|
145 | + 'category' => $categoryid, |
|
146 | + 'enable_sharedparams' => $enable_sharedparams, |
|
147 | + 'guid' => $guid, |
|
148 | + 'modulecode' => $modulecode, |
|
149 | + 'properties' => $properties, |
|
150 | + 'editedon' => $currentdate |
|
151 | + ), $modx->getFullTableName('site_modules'), "id='{$id}'"); |
|
152 | + |
|
153 | + // save user group access permissions |
|
154 | + saveUserGroupAccessPermissons(); |
|
155 | + |
|
156 | + // invoke OnModFormSave event |
|
157 | + $modx->invokeEvent("OnModFormSave", array( |
|
158 | + "mode" => "upd", |
|
159 | + "id" => $id |
|
160 | + )); |
|
161 | + |
|
162 | + // Set the item name for logger |
|
163 | + $_SESSION['itemname'] = $name; |
|
164 | + |
|
165 | + // empty cache |
|
166 | + $modx->clearCache('full'); |
|
167 | + |
|
168 | + // finished emptying cache - redirect |
|
169 | + if ($_POST['stay'] != '') { |
|
170 | + $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107"; |
|
171 | + $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
172 | + header($header); |
|
173 | + } else { |
|
174 | + $modx->unlockElement(6, $id); |
|
175 | + $header = "Location: index.php?a=106&r=2"; |
|
176 | + header($header); |
|
177 | + } |
|
178 | + break; |
|
179 | + default: |
|
180 | + $modx->webAlertAndQuit("No operation set in request."); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | // saves module user group access |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
30 | 30 | $categoryid = 0; |
31 | 31 | } else { |
32 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
32 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
33 | 33 | $categoryid = checkCategory($_POST['newcategory']); |
34 | 34 | if (!$categoryid) { |
35 | 35 | $categoryid = newCategory($_POST['newcategory']); |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | $enable_sharedparams = isset($parsed['shareparams']) ? intval($parsed['shareparams']) : $enable_sharedparams; |
49 | 49 | |
50 | 50 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
51 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
51 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
52 | 52 | if ($version) { |
53 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
53 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
54 | 54 | } |
55 | 55 | if (isset($parsed['modx_category'])) { |
56 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
56 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
57 | 57 | $categoryid = getCategory($parsed['modx_category']); |
58 | 58 | } |
59 | 59 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // finished emptying cache - redirect |
112 | 112 | if ($_POST['stay'] != '') { |
113 | 113 | $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107"; |
114 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
114 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
115 | 115 | header($header); |
116 | 116 | } else { |
117 | 117 | $header = "Location: index.php?a=106&r=2"; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | // finished emptying cache - redirect |
169 | 169 | if ($_POST['stay'] != '') { |
170 | 170 | $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107"; |
171 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
171 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
172 | 172 | header($header); |
173 | 173 | } else { |
174 | 174 | $modx->unlockElement(6, $id); |
@@ -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,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
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 | -if(!$modx->hasPermission('delete_snippet')) { |
|
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 | +if (!$modx->hasPermission('delete_snippet')) { |
|
4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 5 | } |
6 | 6 | |
7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
8 | -if($id==0) { |
|
7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
8 | +if ($id == 0) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
10 | 10 | } |
11 | 11 | |
@@ -32,5 +32,5 @@ discard block |
||
32 | 32 | $modx->clearCache('full'); |
33 | 33 | |
34 | 34 | // finished emptying cache - redirect |
35 | -$header="Location: index.php?a=76&r=2"; |
|
35 | +$header = "Location: index.php?a=76&r=2"; |
|
36 | 36 | header($header); |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
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."); |
|
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."); |
|
4 | +} |
|
3 | 5 | if(!$modx->hasPermission('delete_snippet')) { |
4 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 7 | } |
@@ -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,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
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 | -if(!$modx->hasPermission('exec_module')) { |
|
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 | +if (!$modx->hasPermission('exec_module')) { |
|
4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 5 | } |
6 | 6 | |
7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
8 | -if($id==0) { |
|
7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
8 | +if ($id == 0) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
10 | 10 | } |
11 | 11 | |
12 | 12 | // check if user has access permission, except admins |
13 | -if($_SESSION['mgrRole']!=1){ |
|
13 | +if ($_SESSION['mgrRole'] != 1) { |
|
14 | 14 | $rs = $modx->db->select( |
15 | 15 | 'sma.usergroup,mg.member', |
16 | 16 | $modx->getFullTableName("site_module_access")." sma |
@@ -22,18 +22,18 @@ discard block |
||
22 | 22 | $permissionAccessInt = -1; |
23 | 23 | |
24 | 24 | while ($row = $modx->db->getRow($rs)) { |
25 | - if($row["usergroup"] && $row["member"]) { |
|
25 | + if ($row["usergroup"] && $row["member"]) { |
|
26 | 26 | //if there are permissions and this member has permission, ofcourse |
27 | 27 | //this is granted |
28 | 28 | $permissionAccessInt = 1; |
29 | - } elseif ($permissionAccessInt==-1) { |
|
29 | + } elseif ($permissionAccessInt == -1) { |
|
30 | 30 | //if there are permissions but this member has no permission and the |
31 | 31 | //variable was still in init state we set permission to 0; no permissions |
32 | 32 | $permissionAccessInt = 0; |
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | - if($permissionAccessInt==0) { |
|
36 | + if ($permissionAccessInt == 0) { |
|
37 | 37 | $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
38 | 38 | } |
39 | 39 | } |
@@ -41,10 +41,10 @@ discard block |
||
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 | -if(!$content) { |
|
44 | +if (!$content) { |
|
45 | 45 | $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
46 | 46 | } |
47 | -if($content['disabled']) { |
|
47 | +if ($content['disabled']) { |
|
48 | 48 | $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
49 | 49 | } |
50 | 50 | |
@@ -57,15 +57,15 @@ discard block |
||
57 | 57 | // Set the item name for logger |
58 | 58 | $_SESSION['itemname'] = $content['name']; |
59 | 59 | |
60 | -$output = evalModule($content["modulecode"],$parameter); |
|
60 | +$output = evalModule($content["modulecode"], $parameter); |
|
61 | 61 | echo $output; |
62 | 62 | include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; |
63 | 63 | |
64 | 64 | // evalModule |
65 | -function evalModule($moduleCode,$params){ |
|
65 | +function evalModule($moduleCode, $params){ |
|
66 | 66 | global $modx; |
67 | 67 | $modx->event->params = &$params; // store params inside event object |
68 | - if(is_array($params)) { |
|
68 | + if (is_array($params)) { |
|
69 | 69 | extract($params, EXTR_SKIP); |
70 | 70 | } |
71 | 71 | ob_start(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if (isset($php_errormsg)) |
76 | 76 | { |
77 | 77 | $error_info = error_get_last(); |
78 | - switch($error_info['type']) |
|
78 | + switch ($error_info['type']) |
|
79 | 79 | { |
80 | 80 | case E_NOTICE : |
81 | 81 | $error_level = 1; |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | default: |
90 | 90 | $error_level = 99; |
91 | 91 | } |
92 | - if($modx->config['error_reporting']==='99' || 2<$error_level) |
|
92 | + if ($modx->config['error_reporting'] === '99' || 2 < $error_level) |
|
93 | 93 | { |
94 | - $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
|
94 | + $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg); |
|
95 | 95 | $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
96 | 96 | } |
97 | 97 | } |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
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 | -if(!$modx->hasPermission('exec_module')) { |
|
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."); |
|
4 | +} |
|
5 | +if(!$modx->hasPermission('exec_module')) { |
|
4 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 7 | } |
6 | 8 | |
@@ -10,7 +12,7 @@ discard block |
||
10 | 12 | } |
11 | 13 | |
12 | 14 | // check if user has access permission, except admins |
13 | -if($_SESSION['mgrRole']!=1){ |
|
15 | +if($_SESSION['mgrRole']!=1) { |
|
14 | 16 | $rs = $modx->db->select( |
15 | 17 | 'sma.usergroup,mg.member', |
16 | 18 | $modx->getFullTableName("site_module_access")." sma |
@@ -62,7 +64,8 @@ discard block |
||
62 | 64 | include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; |
63 | 65 | |
64 | 66 | // evalModule |
65 | -function evalModule($moduleCode,$params){ |
|
67 | +function evalModule($moduleCode,$params) |
|
68 | +{ |
|
66 | 69 | global $modx; |
67 | 70 | $modx->event->params = &$params; // store params inside event object |
68 | 71 | if(is_array($params)) { |
@@ -72,11 +75,9 @@ discard block |
||
72 | 75 | $mod = eval($moduleCode); |
73 | 76 | $msg = ob_get_contents(); |
74 | 77 | ob_end_clean(); |
75 | - if (isset($php_errormsg)) |
|
76 | - { |
|
78 | + if (isset($php_errormsg)) { |
|
77 | 79 | $error_info = error_get_last(); |
78 | - switch($error_info['type']) |
|
79 | - { |
|
80 | + switch($error_info['type']) { |
|
80 | 81 | case E_NOTICE : |
81 | 82 | $error_level = 1; |
82 | 83 | case E_USER_NOTICE : |
@@ -89,8 +90,7 @@ discard block |
||
89 | 90 | default: |
90 | 91 | $error_level = 99; |
91 | 92 | } |
92 | - if($modx->config['error_reporting']==='99' || 2<$error_level) |
|
93 | - { |
|
93 | + if($modx->config['error_reporting']==='99' || 2<$error_level) { |
|
94 | 94 | $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
95 | 95 | $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
96 | 96 | } |
@@ -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,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('delete_template')) { |
|
5 | +if (!$modx->hasPermission('delete_template')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
10 | -if($id == 0) { |
|
10 | +if ($id == 0) { |
|
11 | 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 | -if($limit > 0) { |
|
17 | +if ($limit > 0) { |
|
18 | 18 | include "header.inc.php"; |
19 | 19 | ?> |
20 | 20 | |
@@ -28,8 +28,8 @@ 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>'; |
|
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 | 33 | } |
34 | 34 | ?> |
35 | 35 | </ul> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | exit; |
41 | 41 | } |
42 | 42 | |
43 | -if($id == $default_template) { |
|
43 | +if ($id == $default_template) { |
|
44 | 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 |
@@ -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,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
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 | -if(!$modx->hasPermission('web_access_permissions')) { |
|
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 | +if (!$modx->hasPermission('web_access_permissions')) { |
|
4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 5 | } |
6 | 6 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | switch ($operation) { |
21 | 21 | case "add_user_group" : |
22 | 22 | $newgroup = $_REQUEST['newusergroup']; |
23 | - if(empty($newgroup)) { |
|
23 | + if (empty($newgroup)) { |
|
24 | 24 | $modx->webAlertAndQuit("No group name specified."); |
25 | 25 | } else { |
26 | 26 | $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | break; |
35 | 35 | case "add_document_group" : |
36 | 36 | $newgroup = $_REQUEST['newdocgroup']; |
37 | - if(empty($newgroup)) { |
|
37 | + if (empty($newgroup)) { |
|
38 | 38 | $modx->webAlertAndQuit("No group name specified."); |
39 | 39 | } else { |
40 | 40 | $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | case "delete_user_group" : |
50 | 50 | $updategroupaccess = true; |
51 | 51 | $usergroup = intval($_REQUEST['usergroup']); |
52 | - if(empty($usergroup)) { |
|
52 | + if (empty($usergroup)) { |
|
53 | 53 | $modx->webAlertAndQuit("No user group id specified for deletion."); |
54 | 54 | } else { |
55 | 55 | $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | break; |
62 | 62 | case "delete_document_group" : |
63 | 63 | $group = intval($_REQUEST['documentgroup']); |
64 | - if(empty($group)) { |
|
64 | + if (empty($group)) { |
|
65 | 65 | $modx->webAlertAndQuit("No document group id specified for deletion."); |
66 | 66 | } else { |
67 | 67 | $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
@@ -73,22 +73,22 @@ discard block |
||
73 | 73 | break; |
74 | 74 | case "rename_user_group" : |
75 | 75 | $newgroupname = $_REQUEST['newgroupname']; |
76 | - if(empty($newgroupname)) { |
|
76 | + if (empty($newgroupname)) { |
|
77 | 77 | $modx->webAlertAndQuit("No group name specified."); |
78 | 78 | } |
79 | 79 | $groupid = intval($_REQUEST['groupid']); |
80 | - if(empty($groupid)) { |
|
80 | + if (empty($groupid)) { |
|
81 | 81 | $modx->webAlertAndQuit("No user group id specified for rename."); |
82 | 82 | } |
83 | 83 | $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
84 | 84 | break; |
85 | 85 | case "rename_document_group" : |
86 | 86 | $newgroupname = $_REQUEST['newgroupname']; |
87 | - if(empty($newgroupname)) { |
|
87 | + if (empty($newgroupname)) { |
|
88 | 88 | $modx->webAlertAndQuit("No group name specified."); |
89 | 89 | } |
90 | 90 | $groupid = intval($_REQUEST['groupid']); |
91 | - if(empty($groupid)) { |
|
91 | + if (empty($groupid)) { |
|
92 | 92 | $modx->webAlertAndQuit("No document group id specified for rename."); |
93 | 93 | } |
94 | 94 | $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $docgroup = intval($_REQUEST['docgroup']); |
100 | 100 | $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
101 | 101 | $limit = $modx->db->getValue($rs); |
102 | - if($limit<=0) { |
|
102 | + if ($limit <= 0) { |
|
103 | 103 | $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
104 | 104 | } else { |
105 | 105 | //alert user that coupling already exists? |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | // secure web documents - flag as private |
118 | -if($updategroupaccess==true){ |
|
118 | +if ($updategroupaccess == true) { |
|
119 | 119 | include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
120 | 120 | secureWebDocument(); |
121 | 121 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
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."); |
|
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."); |
|
4 | +} |
|
3 | 5 | if(!$modx->hasPermission('web_access_permissions')) { |
4 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 7 | } |
@@ -115,7 +117,7 @@ discard block |
||
115 | 117 | } |
116 | 118 | |
117 | 119 | // secure web documents - flag as private |
118 | -if($updategroupaccess==true){ |
|
120 | +if($updategroupaccess==true) { |
|
119 | 121 | include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
120 | 122 | secureWebDocument(); |
121 | 123 |