@@ -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->db->insert(array('name'=>$modx->db->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->db->insert(array('name'=>$modx->db->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->db->insert(array('name'=>$modx->db->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->db->insert(array('name'=>$modx->db->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->db->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->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); |
|
58 | 58 | |
59 | - $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); |
|
59 | + $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); |
|
60 | 60 | |
61 | - $modx->db->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->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
61 | + $modx->db->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->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
70 | 70 | |
71 | - $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); |
|
71 | + $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); |
|
72 | 72 | |
73 | - $modx->db->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->db->update(array('name' => $modx->db->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->db->update(array('name' => $modx->db->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->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
103 | - $limit = $modx->db->getValue($rs); |
|
104 | - if($limit<=0) { |
|
105 | - $modx->db->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->db->delete($tbl_webgroup_access, "id='{$coupling}'"); |
|
114 | - break; |
|
115 | - default : |
|
116 | - $modx->webAlertAndQuit("No operation set in request."); |
|
73 | + $modx->db->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->db->update(array('name' => $modx->db->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->db->update(array('name' => $modx->db->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->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
103 | + $limit = $modx->db->getValue($rs); |
|
104 | + if($limit<=0) { |
|
105 | + $modx->db->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->db->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->db->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->db->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_web_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // Set the item name for logger |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeWUsrFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeWUsrFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the user. |
25 | 25 | $modx->db->delete($modx->getFullTableName('web_users'), "id='{$id}'"); |
@@ -32,16 +32,16 @@ discard block |
||
32 | 32 | |
33 | 33 | // invoke OnWebDeleteUser event |
34 | 34 | $modx->invokeEvent("OnWebDeleteUser", |
35 | - array( |
|
36 | - "userid" => $id, |
|
37 | - "username" => $username |
|
38 | - )); |
|
35 | + array( |
|
36 | + "userid" => $id, |
|
37 | + "username" => $username |
|
38 | + )); |
|
39 | 39 | |
40 | 40 | // invoke OnWUsrFormDelete event |
41 | 41 | $modx->invokeEvent("OnWUsrFormDelete", |
42 | - array( |
|
43 | - "id" => $id |
|
44 | - )); |
|
42 | + array( |
|
43 | + "id" => $id |
|
44 | + )); |
|
45 | 45 | |
46 | 46 | $header="Location: index.php?a=99"; |
47 | 47 | header($header); |
@@ -3,17 +3,17 @@ |
||
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_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | if (isset($_GET['cls']) && $_GET['cls']==1) { |
10 | - $where = ''; |
|
10 | + $where = ''; |
|
11 | 11 | } else { |
12 | - $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
13 | - if($id==0) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
15 | - } |
|
16 | - $where = "id='{$id}'"; |
|
12 | + $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
13 | + if($id==0) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
15 | + } |
|
16 | + $where = "id='{$id}'"; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // delete event log |
@@ -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('settings')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | $data = $_POST; |
9 | 9 | // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 |
@@ -11,41 +11,41 @@ discard block |
||
11 | 11 | |
12 | 12 | if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) |
13 | 13 | { |
14 | - $htaccess = $modx->config['base_path'] . '.htaccess'; |
|
15 | - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; |
|
16 | - $dir = '/' . trim($modx->config['base_url'],'/'); |
|
17 | - if(is_file($htaccess)) |
|
18 | - { |
|
19 | - $_ = file_get_contents($htaccess); |
|
20 | - if(strpos($_,'RewriteBase')===false) |
|
21 | - { |
|
22 | - $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
23 | - } |
|
24 | - elseif(is_writable($htaccess)) |
|
25 | - { |
|
26 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
27 | - if(!@file_put_contents($htaccess,$_)) |
|
28 | - { |
|
29 | - $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
30 | - } |
|
31 | - } |
|
32 | - } |
|
33 | - elseif(is_file($sample_htaccess)) |
|
34 | - { |
|
35 | - if(!@rename($sample_htaccess,$htaccess)) |
|
14 | + $htaccess = $modx->config['base_path'] . '.htaccess'; |
|
15 | + $sample_htaccess = $modx->config['base_path'] . 'ht.access'; |
|
16 | + $dir = '/' . trim($modx->config['base_url'],'/'); |
|
17 | + if(is_file($htaccess)) |
|
18 | + { |
|
19 | + $_ = file_get_contents($htaccess); |
|
20 | + if(strpos($_,'RewriteBase')===false) |
|
36 | 21 | { |
37 | - $warnings[] = $_lang["settings_friendlyurls_alert"]; |
|
38 | - } |
|
39 | - elseif($modx->config['base_url']!=='/') |
|
40 | - { |
|
41 | - $_ = file_get_contents($htaccess); |
|
42 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
43 | - if(!@file_put_contents($htaccess,$_)) |
|
44 | - { |
|
45 | - $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
46 | - } |
|
47 | - } |
|
48 | - } |
|
22 | + $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
23 | + } |
|
24 | + elseif(is_writable($htaccess)) |
|
25 | + { |
|
26 | + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
27 | + if(!@file_put_contents($htaccess,$_)) |
|
28 | + { |
|
29 | + $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
30 | + } |
|
31 | + } |
|
32 | + } |
|
33 | + elseif(is_file($sample_htaccess)) |
|
34 | + { |
|
35 | + if(!@rename($sample_htaccess,$htaccess)) |
|
36 | + { |
|
37 | + $warnings[] = $_lang["settings_friendlyurls_alert"]; |
|
38 | + } |
|
39 | + elseif($modx->config['base_url']!=='/') |
|
40 | + { |
|
41 | + $_ = file_get_contents($htaccess); |
|
42 | + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
43 | + if(!@file_put_contents($htaccess,$_)) |
|
44 | + { |
|
45 | + $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
|
46 | + } |
|
47 | + } |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | $data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); |
57 | 57 | |
58 | 58 | if (isset($data) && count($data) > 0) { |
59 | - if(isset($data['manager_language'])) { |
|
60 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; |
|
61 | - if(is_file($lang_path)) { |
|
62 | - include($lang_path); |
|
59 | + if(isset($data['manager_language'])) { |
|
60 | + $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; |
|
61 | + if(is_file($lang_path)) { |
|
62 | + include($lang_path); |
|
63 | 63 | global $modx_lang_attribute; |
64 | 64 | $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
65 | - } |
|
66 | - } |
|
67 | - $savethese = array(); |
|
68 | - $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); |
|
69 | - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
70 | - foreach ($data as $k => $v) { |
|
71 | - switch ($k) { |
|
65 | + } |
|
66 | + } |
|
67 | + $savethese = array(); |
|
68 | + $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); |
|
69 | + $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
70 | + foreach ($data as $k => $v) { |
|
71 | + switch ($k) { |
|
72 | 72 | case 'settings_version':{ |
73 | 73 | if($modx->getVersionData('version')!=$data['settings_version']){ |
74 | 74 | $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version'); |
@@ -76,24 +76,24 @@ discard block |
||
76 | 76 | } |
77 | 77 | break; |
78 | 78 | } |
79 | - case 'error_page': |
|
80 | - case 'unauthorized_page': |
|
81 | - if (trim($v) == '' || !is_numeric($v)) { |
|
82 | - $v = $data['site_start']; |
|
83 | - } |
|
84 | - break; |
|
79 | + case 'error_page': |
|
80 | + case 'unauthorized_page': |
|
81 | + if (trim($v) == '' || !is_numeric($v)) { |
|
82 | + $v = $data['site_start']; |
|
83 | + } |
|
84 | + break; |
|
85 | 85 | |
86 | - case 'lst_custom_contenttype': |
|
87 | - case 'txt_custom_contenttype': |
|
88 | - // Skip these |
|
89 | - $k = ''; |
|
90 | - break; |
|
91 | - case 'rb_base_dir': |
|
92 | - case 'rb_base_url': |
|
93 | - case 'filemanager_path': |
|
94 | - $v = trim($v); |
|
95 | - $v = rtrim($v,'/') . '/'; |
|
96 | - break; |
|
86 | + case 'lst_custom_contenttype': |
|
87 | + case 'txt_custom_contenttype': |
|
88 | + // Skip these |
|
89 | + $k = ''; |
|
90 | + break; |
|
91 | + case 'rb_base_dir': |
|
92 | + case 'rb_base_url': |
|
93 | + case 'filemanager_path': |
|
94 | + $v = trim($v); |
|
95 | + $v = rtrim($v,'/') . '/'; |
|
96 | + break; |
|
97 | 97 | case 'manager_language': |
98 | 98 | $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); |
99 | 99 | $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); |
@@ -101,56 +101,56 @@ discard block |
||
101 | 101 | if($langDir !== $langFileDir || !file_exists($langFile)) { |
102 | 102 | $v = 'english'; |
103 | 103 | } |
104 | - break; |
|
105 | - case 'smtppw': |
|
106 | - if ($v !== '********************' && $v !== '') { |
|
107 | - $v = trim($v); |
|
108 | - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
109 | - $v = str_replace('=','%',$v); |
|
110 | - } elseif ($v === '********************') { |
|
111 | - $k = ''; |
|
112 | - } |
|
113 | - break; |
|
104 | + break; |
|
105 | + case 'smtppw': |
|
106 | + if ($v !== '********************' && $v !== '') { |
|
107 | + $v = trim($v); |
|
108 | + $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
109 | + $v = str_replace('=','%',$v); |
|
110 | + } elseif ($v === '********************') { |
|
111 | + $k = ''; |
|
112 | + } |
|
113 | + break; |
|
114 | 114 | case 'valid_hostnames': |
115 | - $v = str_replace(array(' ,', ', '), ',', $v); |
|
116 | - if ($v !== ',') { |
|
117 | - $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; |
|
118 | - $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n"; |
|
119 | - @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString); |
|
120 | - } |
|
121 | - $k = ''; |
|
122 | - break; |
|
123 | - case 'session_timeout': |
|
124 | - $mail_check_timeperiod = $data['mail_check_timeperiod']; |
|
125 | - $v = (int)$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 |
|
126 | - break; |
|
127 | - default: |
|
128 | - break; |
|
129 | - } |
|
130 | - $v = is_array($v) ? implode(",", $v) : $v; |
|
115 | + $v = str_replace(array(' ,', ', '), ',', $v); |
|
116 | + if ($v !== ',') { |
|
117 | + $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; |
|
118 | + $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n"; |
|
119 | + @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString); |
|
120 | + } |
|
121 | + $k = ''; |
|
122 | + break; |
|
123 | + case 'session_timeout': |
|
124 | + $mail_check_timeperiod = $data['mail_check_timeperiod']; |
|
125 | + $v = (int)$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 |
|
126 | + break; |
|
127 | + default: |
|
128 | + break; |
|
129 | + } |
|
130 | + $v = is_array($v) ? implode(",", $v) : $v; |
|
131 | 131 | |
132 | - $modx->config[$k] = $v; |
|
132 | + $modx->config[$k] = $v; |
|
133 | 133 | |
134 | - if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; |
|
135 | - } |
|
134 | + if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; |
|
135 | + } |
|
136 | 136 | |
137 | - // Run a single query to save all the values |
|
138 | - $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) |
|
137 | + // Run a single query to save all the values |
|
138 | + $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) |
|
139 | 139 | VALUES ".implode(', ', $savethese); |
140 | - $modx->db->query($sql); |
|
140 | + $modx->db->query($sql); |
|
141 | 141 | |
142 | - // Reset Template Pages |
|
143 | - if (isset($data['reset_template'])) { |
|
144 | - $newtemplate = (int)$data['default_template']; |
|
145 | - $oldtemplate = (int)$data['old_template']; |
|
146 | - $tbl = $modx->getFullTableName('site_content'); |
|
147 | - $reset = $data['reset_template']; |
|
148 | - if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
149 | - else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
150 | - } |
|
142 | + // Reset Template Pages |
|
143 | + if (isset($data['reset_template'])) { |
|
144 | + $newtemplate = (int)$data['default_template']; |
|
145 | + $oldtemplate = (int)$data['old_template']; |
|
146 | + $tbl = $modx->getFullTableName('site_content'); |
|
147 | + $reset = $data['reset_template']; |
|
148 | + if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
149 | + else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
150 | + } |
|
151 | 151 | |
152 | - // empty cache |
|
153 | - $modx->clearCache('full'); |
|
152 | + // empty cache |
|
153 | + $modx->clearCache('full'); |
|
154 | 154 | } |
155 | 155 | $header="Location: index.php?a=7&r=10"; |
156 | 156 | header($header); |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('new_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 | // count duplicates |
@@ -19,25 +19,25 @@ discard block |
||
19 | 19 | |
20 | 20 | // duplicate Plugin |
21 | 21 | $newid = $modx->db->insert( |
22 | - array( |
|
23 | - 'name'=>'', |
|
24 | - 'description'=>'', |
|
25 | - 'disabled'=>'', |
|
26 | - 'moduleguid'=>'', |
|
27 | - 'plugincode'=>'', |
|
28 | - 'properties'=>'', |
|
29 | - 'category'=>'', |
|
30 | - ), $modx->getFullTableName('site_plugins'), // Insert into |
|
31 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from |
|
22 | + array( |
|
23 | + 'name'=>'', |
|
24 | + 'description'=>'', |
|
25 | + 'disabled'=>'', |
|
26 | + 'moduleguid'=>'', |
|
27 | + 'plugincode'=>'', |
|
28 | + 'properties'=>'', |
|
29 | + 'category'=>'', |
|
30 | + ), $modx->getFullTableName('site_plugins'), // Insert into |
|
31 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from |
|
32 | 32 | |
33 | 33 | // duplicate Plugin Event Listeners |
34 | 34 | $modx->db->insert( |
35 | - array( |
|
36 | - 'pluginid'=>'', |
|
37 | - 'evtid'=>'', |
|
38 | - 'priority'=>'', |
|
39 | - ), $modx->getFullTableName('site_plugin_events'), // Insert into |
|
40 | - "'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from |
|
35 | + array( |
|
36 | + 'pluginid'=>'', |
|
37 | + 'evtid'=>'', |
|
38 | + 'priority'=>'', |
|
39 | + ), $modx->getFullTableName('site_plugin_events'), // Insert into |
|
40 | + "'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from |
|
41 | 41 | |
42 | 42 | // Set the item name for logger |
43 | 43 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$newid}'")); |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('delete_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // delete the user, but first check if we are deleting our own record |
15 | 15 | if($id==$modx->getLoginUserID()) { |
16 | - $modx->webAlertAndQuit("You can't delete yourself!"); |
|
16 | + $modx->webAlertAndQuit("You can't delete yourself!"); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // Set the item name for logger |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | // invoke OnBeforeUserFormDelete event |
24 | 24 | $modx->invokeEvent("OnBeforeUserFormDelete", |
25 | - array( |
|
26 | - "id" => $id |
|
27 | - )); |
|
25 | + array( |
|
26 | + "id" => $id |
|
27 | + )); |
|
28 | 28 | |
29 | 29 | // delete the user. |
30 | 30 | $modx->db->delete($modx->getFullTableName('manager_users'), "id='{$id}'"); |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | |
40 | 40 | // invoke OnManagerDeleteUser event |
41 | 41 | $modx->invokeEvent("OnManagerDeleteUser", |
42 | - array( |
|
43 | - "userid" => $id, |
|
44 | - "username" => $username |
|
45 | - )); |
|
42 | + array( |
|
43 | + "userid" => $id, |
|
44 | + "username" => $username |
|
45 | + )); |
|
46 | 46 | |
47 | 47 | // invoke OnUserFormDelete event |
48 | 48 | $modx->invokeEvent("OnUserFormDelete", |
49 | - array( |
|
50 | - "id" => $id |
|
51 | - )); |
|
49 | + array( |
|
50 | + "id" => $id |
|
51 | + )); |
|
52 | 52 | |
53 | 53 | $header="Location: index.php?a=75"; |
54 | 54 | header($header); |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('new_snippet')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // count duplicates |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | |
20 | 20 | // duplicate Snippet |
21 | 21 | $newid = $modx->db->insert( |
22 | - array( |
|
23 | - 'name'=>'', |
|
24 | - 'description'=>'', |
|
25 | - 'snippet'=>'', |
|
26 | - 'properties'=>'', |
|
27 | - 'category'=>'', |
|
28 | - ), $modx->getFullTableName('site_snippets'), // Insert into |
|
29 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
22 | + array( |
|
23 | + 'name'=>'', |
|
24 | + 'description'=>'', |
|
25 | + 'snippet'=>'', |
|
26 | + 'properties'=>'', |
|
27 | + 'category'=>'', |
|
28 | + ), $modx->getFullTableName('site_snippets'), // Insert into |
|
29 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
30 | 30 | |
31 | 31 | // Set the item name for logger |
32 | 32 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$newid}'")); |
@@ -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 ********/ |
@@ -33,20 +33,20 @@ discard block |
||
33 | 33 | $udperms->role = $_SESSION['mgrRole']; |
34 | 34 | |
35 | 35 | if(!$udperms->checkPermissions()) { |
36 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
36 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // update the document |
40 | 40 | $modx->db->update( |
41 | - array( |
|
42 | - 'published' => 0, |
|
43 | - 'pub_date' => 0, |
|
44 | - 'unpub_date' => 0, |
|
45 | - 'editedby' => $modx->getLoginUserID(), |
|
46 | - 'editedon' => time(), |
|
47 | - 'publishedby' => 0, |
|
48 | - 'publishedon' => 0, |
|
49 | - ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
41 | + array( |
|
42 | + 'published' => 0, |
|
43 | + 'pub_date' => 0, |
|
44 | + 'unpub_date' => 0, |
|
45 | + 'editedby' => $modx->getLoginUserID(), |
|
46 | + 'editedon' => time(), |
|
47 | + 'publishedby' => 0, |
|
48 | + 'publishedon' => 0, |
|
49 | + ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
50 | 50 | |
51 | 51 | // invoke OnDocUnPublished event |
52 | 52 | $modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); |
@@ -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_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 | // Set the item name for logger |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeModFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeModFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the module. |
25 | 25 | $modx->db->delete($modx->getFullTableName('site_modules'), "id='{$id}'"); |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | |
33 | 33 | // invoke OnModFormDelete event |
34 | 34 | $modx->invokeEvent("OnModFormDelete", |
35 | - array( |
|
36 | - "id" => $id |
|
37 | - )); |
|
35 | + array( |
|
36 | + "id" => $id |
|
37 | + )); |
|
38 | 38 | |
39 | 39 | // empty cache |
40 | 40 | $modx->clearCache('full'); |