@@ -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('messages')) { |
4 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
4 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | $sendto = $_REQUEST['sendto']; |
@@ -14,55 +14,55 @@ discard block |
||
14 | 14 | $postdate = time(); |
15 | 15 | |
16 | 16 | if($sendto=='u') { |
17 | - if($userid==0) { |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
19 | - } |
|
20 | - $modx->db->insert( |
|
21 | - array( |
|
22 | - 'recipient' => $userid, |
|
23 | - 'sender' => $modx->getLoginUserID(), |
|
24 | - 'subject' => $subject, |
|
25 | - 'message' => $message, |
|
26 | - 'postdate' => $postdate, |
|
27 | - 'type' => 'Message', |
|
28 | - 'private' => 1, |
|
29 | - ), $modx->getFullTableName('user_messages')); |
|
17 | + if($userid==0) { |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
19 | + } |
|
20 | + $modx->db->insert( |
|
21 | + array( |
|
22 | + 'recipient' => $userid, |
|
23 | + 'sender' => $modx->getLoginUserID(), |
|
24 | + 'subject' => $subject, |
|
25 | + 'message' => $message, |
|
26 | + 'postdate' => $postdate, |
|
27 | + 'type' => 'Message', |
|
28 | + 'private' => 1, |
|
29 | + ), $modx->getFullTableName('user_messages')); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | if($sendto=='g') { |
33 | - if($groupid==0) { |
|
34 | - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
35 | - } |
|
36 | - $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
37 | - while ($row=$modx->db->getRow($rs)) { |
|
38 | - $modx->db->insert( |
|
39 | - array( |
|
40 | - 'recipient' => $row['internalKey'], |
|
41 | - 'sender' => $modx->getLoginUserID(), |
|
42 | - 'subject' => $subject, |
|
43 | - 'message' => $message, |
|
44 | - 'postdate' => $postdate, |
|
45 | - 'type' => 'Message', |
|
46 | - 'private' => 0, |
|
47 | - ), $modx->getFullTableName('user_messages')); |
|
48 | - } |
|
33 | + if($groupid==0) { |
|
34 | + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
35 | + } |
|
36 | + $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
37 | + while ($row=$modx->db->getRow($rs)) { |
|
38 | + $modx->db->insert( |
|
39 | + array( |
|
40 | + 'recipient' => $row['internalKey'], |
|
41 | + 'sender' => $modx->getLoginUserID(), |
|
42 | + 'subject' => $subject, |
|
43 | + 'message' => $message, |
|
44 | + 'postdate' => $postdate, |
|
45 | + 'type' => 'Message', |
|
46 | + 'private' => 0, |
|
47 | + ), $modx->getFullTableName('user_messages')); |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | if($sendto=='a') { |
53 | - $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
54 | - while ($row=$modx->db->getRow($rs)) { |
|
55 | - $modx->db->insert( |
|
56 | - array( |
|
57 | - 'recipient' => $row['id'], |
|
58 | - 'sender' => $modx->getLoginUserID(), |
|
59 | - 'subject' => $subject, |
|
60 | - 'message' => $message, |
|
61 | - 'postdate' => $postdate, |
|
62 | - 'type' => 'Message', |
|
63 | - 'private' => 0, |
|
64 | - ), $modx->getFullTableName('user_messages')); |
|
65 | - } |
|
53 | + $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
54 | + while ($row=$modx->db->getRow($rs)) { |
|
55 | + $modx->db->insert( |
|
56 | + array( |
|
57 | + 'recipient' => $row['id'], |
|
58 | + 'sender' => $modx->getLoginUserID(), |
|
59 | + 'subject' => $subject, |
|
60 | + 'message' => $message, |
|
61 | + 'postdate' => $postdate, |
|
62 | + 'type' => 'Message', |
|
63 | + 'private' => 0, |
|
64 | + ), $modx->getFullTableName('user_messages')); |
|
65 | + } |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $header = "Location: index.php?a=10"; |
@@ -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('messages')) { |
|
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('messages')) { |
|
4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 5 | } |
6 | 6 | |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | $userid = $_REQUEST['user']; |
9 | 9 | $groupid = $_REQUEST['group']; |
10 | 10 | $subject = $modx->db->escape($_REQUEST['messagesubject']); |
11 | -if($subject=="") $subject="(no subject)"; |
|
11 | +if ($subject == "") $subject = "(no subject)"; |
|
12 | 12 | $message = $modx->db->escape($_REQUEST['messagebody']); |
13 | -if($message=="") $message="(no message)"; |
|
13 | +if ($message == "") $message = "(no message)"; |
|
14 | 14 | $postdate = time(); |
15 | 15 | |
16 | -if($sendto=='u') { |
|
17 | - if($userid==0) { |
|
16 | +if ($sendto == 'u') { |
|
17 | + if ($userid == 0) { |
|
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
19 | 19 | } |
20 | 20 | $modx->db->insert( |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | ), $modx->getFullTableName('user_messages')); |
30 | 30 | } |
31 | 31 | |
32 | -if($sendto=='g') { |
|
33 | - if($groupid==0) { |
|
32 | +if ($sendto == 'g') { |
|
33 | + if ($groupid == 0) { |
|
34 | 34 | $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
35 | 35 | } |
36 | 36 | $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
37 | - while ($row=$modx->db->getRow($rs)) { |
|
37 | + while ($row = $modx->db->getRow($rs)) { |
|
38 | 38 | $modx->db->insert( |
39 | 39 | array( |
40 | 40 | 'recipient' => $row['internalKey'], |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | -if($sendto=='a') { |
|
52 | +if ($sendto == 'a') { |
|
53 | 53 | $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
54 | - while ($row=$modx->db->getRow($rs)) { |
|
54 | + while ($row = $modx->db->getRow($rs)) { |
|
55 | 55 | $modx->db->insert( |
56 | 56 | array( |
57 | 57 | 'recipient' => $row['id'], |
@@ -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('messages')) { |
4 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 7 | } |
@@ -8,9 +10,13 @@ discard block |
||
8 | 10 | $userid = $_REQUEST['user']; |
9 | 11 | $groupid = $_REQUEST['group']; |
10 | 12 | $subject = $modx->db->escape($_REQUEST['messagesubject']); |
11 | -if($subject=="") $subject="(no subject)"; |
|
13 | +if($subject=="") { |
|
14 | + $subject="(no subject)"; |
|
15 | +} |
|
12 | 16 | $message = $modx->db->escape($_REQUEST['messagebody']); |
13 | -if($message=="") $message="(no message)"; |
|
17 | +if($message=="") { |
|
18 | + $message="(no message)"; |
|
19 | +} |
|
14 | 20 | $postdate = time(); |
15 | 21 | |
16 | 22 | if($sendto=='u') { |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
3 | - header('HTTP/1.0 404 Not Found'); |
|
4 | - exit('error'); |
|
3 | + header('HTTP/1.0 404 Not Found'); |
|
4 | + exit('error'); |
|
5 | 5 | } |
6 | 6 | define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through |
7 | 7 | define('MODX_API_MODE', true); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | include_once("{$core_path}lang/english.inc.php"); |
19 | 19 | |
20 | 20 | if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) { |
21 | - include_once("{$core_path}lang/{$manager_language}.inc.php"); |
|
21 | + include_once("{$core_path}lang/{$manager_language}.inc.php"); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | // include the logger |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // Initialize System Alert Message Queque |
28 | 28 | if(!isset($_SESSION['SystemAlertMsgQueque'])) { |
29 | - $_SESSION['SystemAlertMsgQueque'] = array(); |
|
29 | + $_SESSION['SystemAlertMsgQueque'] = array(); |
|
30 | 30 | } |
31 | 31 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
32 | 32 | |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | |
42 | 42 | // invoke OnBeforeManagerLogin event |
43 | 43 | $modx->invokeEvent('OnBeforeManagerLogin', array( |
44 | - 'username' => $username, |
|
45 | - 'userpassword' => $givenPassword, |
|
46 | - 'rememberme' => $rememberme |
|
47 | - )); |
|
44 | + 'username' => $username, |
|
45 | + 'userpassword' => $givenPassword, |
|
46 | + 'rememberme' => $rememberme |
|
47 | + )); |
|
48 | 48 | $fields = 'mu.*, ua.*'; |
49 | 49 | $from = '[+prefix+]manager_users AS mu, [+prefix+]user_attributes AS ua'; |
50 | 50 | $where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id"; |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | $limit = $modx->db->getRecordCount($rs); |
53 | 53 | |
54 | 54 | if($limit == 0 || $limit > 1) { |
55 | - jsAlert($_lang['login_processor_unknown_user']); |
|
56 | - return; |
|
55 | + jsAlert($_lang['login_processor_unknown_user']); |
|
56 | + return; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $row = $modx->db->getRow($rs); |
@@ -74,127 +74,127 @@ discard block |
||
74 | 74 | // get the user settings from the database |
75 | 75 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''"); |
76 | 76 | while($row = $modx->db->getRow($rs)) { |
77 | - extract($row); |
|
78 | - ${$setting_name} = $setting_value; |
|
77 | + extract($row); |
|
78 | + ${$setting_name} = $setting_value; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | // blocked due to number of login errors. |
82 | 82 | if($failedlogins >= $failed_allowed && $blockeduntildate > time()) { |
83 | - @session_destroy(); |
|
84 | - session_unset(); |
|
85 | - if($cip = getenv("HTTP_CLIENT_IP")) { |
|
86 | - $ip = $cip; |
|
87 | - } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) { |
|
88 | - $ip = $cip; |
|
89 | - } elseif($cip = getenv("REMOTE_ADDR")) { |
|
90 | - $ip = $cip; |
|
91 | - } else { |
|
92 | - $ip = "UNKNOWN"; |
|
93 | - } |
|
94 | - $log = new logHandler; |
|
95 | - $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip); |
|
96 | - jsAlert($_lang['login_processor_many_failed_logins']); |
|
97 | - return; |
|
83 | + @session_destroy(); |
|
84 | + session_unset(); |
|
85 | + if($cip = getenv("HTTP_CLIENT_IP")) { |
|
86 | + $ip = $cip; |
|
87 | + } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) { |
|
88 | + $ip = $cip; |
|
89 | + } elseif($cip = getenv("REMOTE_ADDR")) { |
|
90 | + $ip = $cip; |
|
91 | + } else { |
|
92 | + $ip = "UNKNOWN"; |
|
93 | + } |
|
94 | + $log = new logHandler; |
|
95 | + $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip); |
|
96 | + jsAlert($_lang['login_processor_many_failed_logins']); |
|
97 | + return; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | // blocked due to number of login errors, but get to try again |
101 | 101 | if($failedlogins >= $failed_allowed && $blockeduntildate < time()) { |
102 | - $fields = array(); |
|
103 | - $fields['failedlogincount'] = '0'; |
|
104 | - $fields['blockeduntil'] = time() - 1; |
|
105 | - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
|
102 | + $fields = array(); |
|
103 | + $fields['failedlogincount'] = '0'; |
|
104 | + $fields['blockeduntil'] = time() - 1; |
|
105 | + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // this user has been blocked by an admin, so no way he's loggin in! |
109 | 109 | if($blocked == '1') { |
110 | - @session_destroy(); |
|
111 | - session_unset(); |
|
112 | - jsAlert($_lang['login_processor_blocked1']); |
|
113 | - return; |
|
110 | + @session_destroy(); |
|
111 | + session_unset(); |
|
112 | + jsAlert($_lang['login_processor_blocked1']); |
|
113 | + return; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | // blockuntil: this user has a block until date |
117 | 117 | if($blockeduntildate > time()) { |
118 | - @session_destroy(); |
|
119 | - session_unset(); |
|
120 | - jsAlert($_lang['login_processor_blocked2']); |
|
121 | - return; |
|
118 | + @session_destroy(); |
|
119 | + session_unset(); |
|
120 | + jsAlert($_lang['login_processor_blocked2']); |
|
121 | + return; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // blockafter: this user has a block after date |
125 | 125 | if($blockedafterdate > 0 && $blockedafterdate < time()) { |
126 | - @session_destroy(); |
|
127 | - session_unset(); |
|
128 | - jsAlert($_lang['login_processor_blocked3']); |
|
129 | - return; |
|
126 | + @session_destroy(); |
|
127 | + session_unset(); |
|
128 | + jsAlert($_lang['login_processor_blocked3']); |
|
129 | + return; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | // allowed ip |
133 | 133 | if($allowed_ip) { |
134 | - if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) { |
|
135 | - if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) { |
|
136 | - jsAlert($_lang['login_processor_remotehost_ip']); |
|
137 | - return; |
|
138 | - } |
|
139 | - } |
|
140 | - if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) { |
|
141 | - jsAlert($_lang['login_processor_remote_ip']); |
|
142 | - return; |
|
143 | - } |
|
134 | + if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) { |
|
135 | + if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) { |
|
136 | + jsAlert($_lang['login_processor_remotehost_ip']); |
|
137 | + return; |
|
138 | + } |
|
139 | + } |
|
140 | + if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) { |
|
141 | + jsAlert($_lang['login_processor_remote_ip']); |
|
142 | + return; |
|
143 | + } |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | // allowed days |
147 | 147 | if($allowed_days) { |
148 | - $date = getdate(); |
|
149 | - $day = $date['wday'] + 1; |
|
150 | - if(strpos($allowed_days, $day) === false) { |
|
151 | - jsAlert($_lang['login_processor_date']); |
|
152 | - return; |
|
153 | - } |
|
148 | + $date = getdate(); |
|
149 | + $day = $date['wday'] + 1; |
|
150 | + if(strpos($allowed_days, $day) === false) { |
|
151 | + jsAlert($_lang['login_processor_date']); |
|
152 | + return; |
|
153 | + } |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | // invoke OnManagerAuthentication event |
157 | 157 | $rt = $modx->invokeEvent('OnManagerAuthentication', array( |
158 | - 'userid' => $internalKey, |
|
159 | - 'username' => $username, |
|
160 | - 'userpassword' => $givenPassword, |
|
161 | - 'savedpassword' => $dbasePassword, |
|
162 | - 'rememberme' => $rememberme |
|
163 | - )); |
|
158 | + 'userid' => $internalKey, |
|
159 | + 'username' => $username, |
|
160 | + 'userpassword' => $givenPassword, |
|
161 | + 'savedpassword' => $dbasePassword, |
|
162 | + 'rememberme' => $rememberme |
|
163 | + )); |
|
164 | 164 | |
165 | 165 | // check if plugin authenticated the user |
166 | 166 | $matchPassword = false; |
167 | 167 | if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) { |
168 | - // check user password - local authentication |
|
169 | - $hashType = $modx->manager->getHashType($dbasePassword); |
|
170 | - if($hashType == 'phpass') { |
|
171 | - $matchPassword = login($username, $_REQUEST['password'], $dbasePassword); |
|
172 | - } elseif($hashType == 'md5') { |
|
173 | - $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username); |
|
174 | - } elseif($hashType == 'v1') { |
|
175 | - $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username); |
|
176 | - } else { |
|
177 | - $matchPassword = false; |
|
178 | - } |
|
168 | + // check user password - local authentication |
|
169 | + $hashType = $modx->manager->getHashType($dbasePassword); |
|
170 | + if($hashType == 'phpass') { |
|
171 | + $matchPassword = login($username, $_REQUEST['password'], $dbasePassword); |
|
172 | + } elseif($hashType == 'md5') { |
|
173 | + $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username); |
|
174 | + } elseif($hashType == 'v1') { |
|
175 | + $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username); |
|
176 | + } else { |
|
177 | + $matchPassword = false; |
|
178 | + } |
|
179 | 179 | } else if($rt === true || (is_array($rt) && in_array(true, $rt))) { |
180 | - $matchPassword = true; |
|
180 | + $matchPassword = true; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | if(!$matchPassword) { |
184 | - jsAlert($_lang['login_processor_wrong_password']); |
|
185 | - incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); |
|
186 | - return; |
|
184 | + jsAlert($_lang['login_processor_wrong_password']); |
|
185 | + incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); |
|
186 | + return; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | if($modx->config['use_captcha'] == 1) { |
190 | - if(!isset ($_SESSION['veriword'])) { |
|
191 | - jsAlert($_lang['login_processor_captcha_config']); |
|
192 | - return; |
|
193 | - } elseif($_SESSION['veriword'] != $captcha_code) { |
|
194 | - jsAlert($_lang['login_processor_bad_code']); |
|
195 | - incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); |
|
196 | - return; |
|
197 | - } |
|
190 | + if(!isset ($_SESSION['veriword'])) { |
|
191 | + jsAlert($_lang['login_processor_captcha_config']); |
|
192 | + return; |
|
193 | + } elseif($_SESSION['veriword'] != $captcha_code) { |
|
194 | + jsAlert($_lang['login_processor_bad_code']); |
|
195 | + incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); |
|
196 | + return; |
|
197 | + } |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $modx->cleanupExpiredLocks(); |
@@ -229,36 +229,36 @@ discard block |
||
229 | 229 | $_SESSION['mgrToken'] = md5($currentsessionid); |
230 | 230 | |
231 | 231 | if($rememberme == '1') { |
232 | - $_SESSION['modx.mgr.session.cookie.lifetime'] = intval($modx->config['session.cookie.lifetime']); |
|
233 | - |
|
234 | - // Set a cookie separate from the session cookie with the username in it. |
|
235 | - // Are we using secure connection? If so, make sure the cookie is secure |
|
236 | - global $https_port; |
|
237 | - |
|
238 | - $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); |
|
239 | - if(version_compare(PHP_VERSION, '5.2', '<')) { |
|
240 | - setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure); |
|
241 | - } else { |
|
242 | - setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true); |
|
243 | - } |
|
232 | + $_SESSION['modx.mgr.session.cookie.lifetime'] = intval($modx->config['session.cookie.lifetime']); |
|
233 | + |
|
234 | + // Set a cookie separate from the session cookie with the username in it. |
|
235 | + // Are we using secure connection? If so, make sure the cookie is secure |
|
236 | + global $https_port; |
|
237 | + |
|
238 | + $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); |
|
239 | + if(version_compare(PHP_VERSION, '5.2', '<')) { |
|
240 | + setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure); |
|
241 | + } else { |
|
242 | + setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true); |
|
243 | + } |
|
244 | 244 | } else { |
245 | - $_SESSION['modx.mgr.session.cookie.lifetime'] = 0; |
|
245 | + $_SESSION['modx.mgr.session.cookie.lifetime'] = 0; |
|
246 | 246 | |
247 | - // Remove the Remember Me cookie |
|
248 | - setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL); |
|
247 | + // Remove the Remember Me cookie |
|
248 | + setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | // Check if user already has an active session, if not check if user pressed logout end of last session |
252 | 252 | $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'"); |
253 | 253 | $activeSession = $modx->db->getValue($rs); |
254 | 254 | if(!$activeSession) { |
255 | - $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8"); |
|
256 | - if($lastHit = $modx->db->getValue($rs)) { |
|
257 | - $_SESSION['show_logout_reminder'] = array( |
|
258 | - 'type' => 'logout_reminder', |
|
259 | - 'lastHit' => $lastHit |
|
260 | - ); |
|
261 | - } |
|
255 | + $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8"); |
|
256 | + if($lastHit = $modx->db->getValue($rs)) { |
|
257 | + $_SESSION['show_logout_reminder'] = array( |
|
258 | + 'type' => 'logout_reminder', |
|
259 | + 'lastHit' => $lastHit |
|
260 | + ); |
|
261 | + } |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | $log = new logHandler; |
@@ -266,109 +266,109 @@ discard block |
||
266 | 266 | |
267 | 267 | // invoke OnManagerLogin event |
268 | 268 | $modx->invokeEvent('OnManagerLogin', array( |
269 | - 'userid' => $internalKey, |
|
270 | - 'username' => $username, |
|
271 | - 'userpassword' => $givenPassword, |
|
272 | - 'rememberme' => $rememberme |
|
273 | - )); |
|
269 | + 'userid' => $internalKey, |
|
270 | + 'username' => $username, |
|
271 | + 'userpassword' => $givenPassword, |
|
272 | + 'rememberme' => $rememberme |
|
273 | + )); |
|
274 | 274 | |
275 | 275 | // check if we should redirect user to a web page |
276 | 276 | $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'"); |
277 | 277 | $id = intval($modx->db->getValue($rs)); |
278 | 278 | if($id > 0) { |
279 | - $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full'); |
|
280 | - if($_POST['ajax'] == 1) { |
|
281 | - echo $header; |
|
282 | - } else { |
|
283 | - header($header); |
|
284 | - } |
|
279 | + $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full'); |
|
280 | + if($_POST['ajax'] == 1) { |
|
281 | + echo $header; |
|
282 | + } else { |
|
283 | + header($header); |
|
284 | + } |
|
285 | 285 | } else { |
286 | - $header = 'Location: ' . MODX_MANAGER_URL; |
|
287 | - if($_POST['ajax'] == 1) { |
|
288 | - echo $header; |
|
289 | - } else { |
|
290 | - header($header); |
|
291 | - } |
|
286 | + $header = 'Location: ' . MODX_MANAGER_URL; |
|
287 | + if($_POST['ajax'] == 1) { |
|
288 | + echo $header; |
|
289 | + } else { |
|
290 | + header($header); |
|
291 | + } |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | // show javascript alert |
295 | 295 | function jsAlert($msg) { |
296 | - global $modx; |
|
297 | - if($_POST['ajax'] != 1) { |
|
298 | - echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>"; |
|
299 | - } else { |
|
300 | - echo $msg . "\n"; |
|
301 | - } |
|
296 | + global $modx; |
|
297 | + if($_POST['ajax'] != 1) { |
|
298 | + echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>"; |
|
299 | + } else { |
|
300 | + echo $msg . "\n"; |
|
301 | + } |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | function login($username, $givenPassword, $dbasePassword) { |
305 | - global $modx; |
|
306 | - return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); |
|
305 | + global $modx; |
|
306 | + return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { |
310 | - global $modx; |
|
310 | + global $modx; |
|
311 | 311 | |
312 | - $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); |
|
312 | + $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); |
|
313 | 313 | |
314 | - if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { |
|
315 | - $modx->config['pwd_hash_algo'] = 'UNCRYPT'; |
|
316 | - } |
|
314 | + if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { |
|
315 | + $modx->config['pwd_hash_algo'] = 'UNCRYPT'; |
|
316 | + } |
|
317 | 317 | |
318 | - if($user_algo !== $modx->config['pwd_hash_algo']) { |
|
319 | - $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; |
|
320 | - $modx->config['pwd_hash_algo'] = $user_algo; |
|
321 | - } |
|
318 | + if($user_algo !== $modx->config['pwd_hash_algo']) { |
|
319 | + $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; |
|
320 | + $modx->config['pwd_hash_algo'] = $user_algo; |
|
321 | + } |
|
322 | 322 | |
323 | - if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { |
|
324 | - return false; |
|
325 | - } |
|
323 | + if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { |
|
324 | + return false; |
|
325 | + } |
|
326 | 326 | |
327 | - updateNewHash($username, $givenPassword); |
|
327 | + updateNewHash($username, $givenPassword); |
|
328 | 328 | |
329 | - return true; |
|
329 | + return true; |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { |
333 | - global $modx; |
|
333 | + global $modx; |
|
334 | 334 | |
335 | - if($dbasePassword != md5($givenPassword)) { |
|
336 | - return false; |
|
337 | - } |
|
338 | - updateNewHash($username, $givenPassword); |
|
339 | - return true; |
|
335 | + if($dbasePassword != md5($givenPassword)) { |
|
336 | + return false; |
|
337 | + } |
|
338 | + updateNewHash($username, $givenPassword); |
|
339 | + return true; |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | function updateNewHash($username, $password) { |
343 | - global $modx; |
|
343 | + global $modx; |
|
344 | 344 | |
345 | - $field = array(); |
|
346 | - $field['password'] = $modx->phpass->HashPassword($password); |
|
347 | - $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); |
|
345 | + $field = array(); |
|
346 | + $field['password'] = $modx->phpass->HashPassword($password); |
|
347 | + $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { |
351 | - global $modx; |
|
352 | - |
|
353 | - $failedlogins += 1; |
|
354 | - |
|
355 | - $fields = array('failedlogincount' => $failedlogins); |
|
356 | - if($failedlogins >= $failed_allowed) //block user for too many fail attempts |
|
357 | - { |
|
358 | - $fields['blockeduntil'] = time() + ($blocked_minutes * 60); |
|
359 | - } |
|
360 | - |
|
361 | - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
|
362 | - |
|
363 | - if($failedlogins < $failed_allowed) { |
|
364 | - //sleep to help prevent brute force attacks |
|
365 | - $sleep = (int) $failedlogins / 2; |
|
366 | - if($sleep > 5) { |
|
367 | - $sleep = 5; |
|
368 | - } |
|
369 | - sleep($sleep); |
|
370 | - } |
|
371 | - @session_destroy(); |
|
372 | - session_unset(); |
|
373 | - return; |
|
351 | + global $modx; |
|
352 | + |
|
353 | + $failedlogins += 1; |
|
354 | + |
|
355 | + $fields = array('failedlogincount' => $failedlogins); |
|
356 | + if($failedlogins >= $failed_allowed) //block user for too many fail attempts |
|
357 | + { |
|
358 | + $fields['blockeduntil'] = time() + ($blocked_minutes * 60); |
|
359 | + } |
|
360 | + |
|
361 | + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
|
362 | + |
|
363 | + if($failedlogins < $failed_allowed) { |
|
364 | + //sleep to help prevent brute force attacks |
|
365 | + $sleep = (int) $failedlogins / 2; |
|
366 | + if($sleep > 5) { |
|
367 | + $sleep = 5; |
|
368 | + } |
|
369 | + sleep($sleep); |
|
370 | + } |
|
371 | + @session_destroy(); |
|
372 | + session_unset(); |
|
373 | + return; |
|
374 | 374 | } |
@@ -1,23 +1,23 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
2 | +if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
3 | 3 | header('HTTP/1.0 404 Not Found'); |
4 | 4 | exit('error'); |
5 | 5 | } |
6 | -define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through |
|
6 | +define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through |
|
7 | 7 | define('MODX_API_MODE', true); |
8 | -include_once(__DIR__ . '/../../index.php'); |
|
8 | +include_once(__DIR__.'/../../index.php'); |
|
9 | 9 | $modx->db->connect(); |
10 | 10 | $modx->getSettings(); |
11 | 11 | $modx->invokeEvent('OnManagerPageInit'); |
12 | 12 | $modx->loadExtension('ManagerAPI'); |
13 | 13 | $modx->loadExtension('phpass'); |
14 | 14 | |
15 | -$core_path = MODX_MANAGER_PATH . 'includes/'; |
|
15 | +$core_path = MODX_MANAGER_PATH.'includes/'; |
|
16 | 16 | // include_once the language file |
17 | 17 | $_lang = array(); |
18 | 18 | include_once("{$core_path}lang/english.inc.php"); |
19 | 19 | |
20 | -if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) { |
|
20 | +if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) { |
|
21 | 21 | include_once("{$core_path}lang/{$manager_language}.inc.php"); |
22 | 22 | } |
23 | 23 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | include_once("{$core_path}log.class.inc.php"); |
26 | 26 | |
27 | 27 | // Initialize System Alert Message Queque |
28 | -if(!isset($_SESSION['SystemAlertMsgQueque'])) { |
|
28 | +if (!isset($_SESSION['SystemAlertMsgQueque'])) { |
|
29 | 29 | $_SESSION['SystemAlertMsgQueque'] = array(); |
30 | 30 | } |
31 | 31 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $rs = $modx->db->select($fields, $from, $where); |
52 | 52 | $limit = $modx->db->getRecordCount($rs); |
53 | 53 | |
54 | -if($limit == 0 || $limit > 1) { |
|
54 | +if ($limit == 0 || $limit > 1) { |
|
55 | 55 | jsAlert($_lang['login_processor_unknown_user']); |
56 | 56 | return; |
57 | 57 | } |
@@ -73,32 +73,32 @@ discard block |
||
73 | 73 | |
74 | 74 | // get the user settings from the database |
75 | 75 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''"); |
76 | -while($row = $modx->db->getRow($rs)) { |
|
76 | +while ($row = $modx->db->getRow($rs)) { |
|
77 | 77 | extract($row); |
78 | 78 | ${$setting_name} = $setting_value; |
79 | 79 | } |
80 | 80 | |
81 | 81 | // blocked due to number of login errors. |
82 | -if($failedlogins >= $failed_allowed && $blockeduntildate > time()) { |
|
82 | +if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) { |
|
83 | 83 | @session_destroy(); |
84 | 84 | session_unset(); |
85 | - if($cip = getenv("HTTP_CLIENT_IP")) { |
|
85 | + if ($cip = getenv("HTTP_CLIENT_IP")) { |
|
86 | 86 | $ip = $cip; |
87 | - } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) { |
|
87 | + } elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) { |
|
88 | 88 | $ip = $cip; |
89 | - } elseif($cip = getenv("REMOTE_ADDR")) { |
|
89 | + } elseif ($cip = getenv("REMOTE_ADDR")) { |
|
90 | 90 | $ip = $cip; |
91 | 91 | } else { |
92 | 92 | $ip = "UNKNOWN"; |
93 | 93 | } |
94 | 94 | $log = new logHandler; |
95 | - $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip); |
|
95 | + $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip); |
|
96 | 96 | jsAlert($_lang['login_processor_many_failed_logins']); |
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
100 | 100 | // blocked due to number of login errors, but get to try again |
101 | -if($failedlogins >= $failed_allowed && $blockeduntildate < time()) { |
|
101 | +if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) { |
|
102 | 102 | $fields = array(); |
103 | 103 | $fields['failedlogincount'] = '0'; |
104 | 104 | $fields['blockeduntil'] = time() - 1; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | // this user has been blocked by an admin, so no way he's loggin in! |
109 | -if($blocked == '1') { |
|
109 | +if ($blocked == '1') { |
|
110 | 110 | @session_destroy(); |
111 | 111 | session_unset(); |
112 | 112 | jsAlert($_lang['login_processor_blocked1']); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | // blockuntil: this user has a block until date |
117 | -if($blockeduntildate > time()) { |
|
117 | +if ($blockeduntildate > time()) { |
|
118 | 118 | @session_destroy(); |
119 | 119 | session_unset(); |
120 | 120 | jsAlert($_lang['login_processor_blocked2']); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | // blockafter: this user has a block after date |
125 | -if($blockedafterdate > 0 && $blockedafterdate < time()) { |
|
125 | +if ($blockedafterdate > 0 && $blockedafterdate < time()) { |
|
126 | 126 | @session_destroy(); |
127 | 127 | session_unset(); |
128 | 128 | jsAlert($_lang['login_processor_blocked3']); |
@@ -130,24 +130,24 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | // allowed ip |
133 | -if($allowed_ip) { |
|
134 | - if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) { |
|
135 | - if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) { |
|
133 | +if ($allowed_ip) { |
|
134 | + if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) { |
|
135 | + if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) { |
|
136 | 136 | jsAlert($_lang['login_processor_remotehost_ip']); |
137 | 137 | return; |
138 | 138 | } |
139 | 139 | } |
140 | - if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) { |
|
140 | + if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) { |
|
141 | 141 | jsAlert($_lang['login_processor_remote_ip']); |
142 | 142 | return; |
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | 146 | // allowed days |
147 | -if($allowed_days) { |
|
147 | +if ($allowed_days) { |
|
148 | 148 | $date = getdate(); |
149 | 149 | $day = $date['wday'] + 1; |
150 | - if(strpos($allowed_days, $day) === false) { |
|
150 | + if (strpos($allowed_days, $day) === false) { |
|
151 | 151 | jsAlert($_lang['login_processor_date']); |
152 | 152 | return; |
153 | 153 | } |
@@ -164,33 +164,33 @@ discard block |
||
164 | 164 | |
165 | 165 | // check if plugin authenticated the user |
166 | 166 | $matchPassword = false; |
167 | -if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) { |
|
167 | +if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) { |
|
168 | 168 | // check user password - local authentication |
169 | 169 | $hashType = $modx->manager->getHashType($dbasePassword); |
170 | - if($hashType == 'phpass') { |
|
170 | + if ($hashType == 'phpass') { |
|
171 | 171 | $matchPassword = login($username, $_REQUEST['password'], $dbasePassword); |
172 | - } elseif($hashType == 'md5') { |
|
172 | + } elseif ($hashType == 'md5') { |
|
173 | 173 | $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username); |
174 | - } elseif($hashType == 'v1') { |
|
174 | + } elseif ($hashType == 'v1') { |
|
175 | 175 | $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username); |
176 | 176 | } else { |
177 | 177 | $matchPassword = false; |
178 | 178 | } |
179 | -} else if($rt === true || (is_array($rt) && in_array(true, $rt))) { |
|
179 | +} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) { |
|
180 | 180 | $matchPassword = true; |
181 | 181 | } |
182 | 182 | |
183 | -if(!$matchPassword) { |
|
183 | +if (!$matchPassword) { |
|
184 | 184 | jsAlert($_lang['login_processor_wrong_password']); |
185 | 185 | incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); |
186 | 186 | return; |
187 | 187 | } |
188 | 188 | |
189 | -if($modx->config['use_captcha'] == 1) { |
|
190 | - if(!isset ($_SESSION['veriword'])) { |
|
189 | +if ($modx->config['use_captcha'] == 1) { |
|
190 | + if (!isset ($_SESSION['veriword'])) { |
|
191 | 191 | jsAlert($_lang['login_processor_captcha_config']); |
192 | 192 | return; |
193 | - } elseif($_SESSION['veriword'] != $captcha_code) { |
|
193 | + } elseif ($_SESSION['veriword'] != $captcha_code) { |
|
194 | 194 | jsAlert($_lang['login_processor_bad_code']); |
195 | 195 | incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes); |
196 | 196 | return; |
@@ -218,17 +218,17 @@ discard block |
||
218 | 218 | $_SESSION['mgrPermissions'] = $modx->db->getRow($rs); |
219 | 219 | |
220 | 220 | // successful login so reset fail count and update key values |
221 | -$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
|
221 | +$modx->db->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
|
222 | 222 | |
223 | 223 | // get user's document groups |
224 | 224 | $i = 0; |
225 | -$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug |
|
226 | - INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'"); |
|
225 | +$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug |
|
226 | + INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'"); |
|
227 | 227 | $_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs); |
228 | 228 | |
229 | 229 | $_SESSION['mgrToken'] = md5($currentsessionid); |
230 | 230 | |
231 | -if($rememberme == '1') { |
|
231 | +if ($rememberme == '1') { |
|
232 | 232 | $_SESSION['modx.mgr.session.cookie.lifetime'] = intval($modx->config['session.cookie.lifetime']); |
233 | 233 | |
234 | 234 | // Set a cookie separate from the session cookie with the username in it. |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | global $https_port; |
237 | 237 | |
238 | 238 | $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); |
239 | - if(version_compare(PHP_VERSION, '5.2', '<')) { |
|
239 | + if (version_compare(PHP_VERSION, '5.2', '<')) { |
|
240 | 240 | setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure); |
241 | 241 | } else { |
242 | 242 | setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true); |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | // Check if user already has an active session, if not check if user pressed logout end of last session |
252 | 252 | $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'"); |
253 | 253 | $activeSession = $modx->db->getValue($rs); |
254 | -if(!$activeSession) { |
|
254 | +if (!$activeSession) { |
|
255 | 255 | $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8"); |
256 | - if($lastHit = $modx->db->getValue($rs)) { |
|
256 | + if ($lastHit = $modx->db->getValue($rs)) { |
|
257 | 257 | $_SESSION['show_logout_reminder'] = array( |
258 | 258 | 'type' => 'logout_reminder', |
259 | 259 | 'lastHit' => $lastHit |
@@ -275,16 +275,16 @@ discard block |
||
275 | 275 | // check if we should redirect user to a web page |
276 | 276 | $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'"); |
277 | 277 | $id = intval($modx->db->getValue($rs)); |
278 | -if($id > 0) { |
|
279 | - $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full'); |
|
280 | - if($_POST['ajax'] == 1) { |
|
278 | +if ($id > 0) { |
|
279 | + $header = 'Location: '.$modx->makeUrl($id, '', '', 'full'); |
|
280 | + if ($_POST['ajax'] == 1) { |
|
281 | 281 | echo $header; |
282 | 282 | } else { |
283 | 283 | header($header); |
284 | 284 | } |
285 | 285 | } else { |
286 | - $header = 'Location: ' . MODX_MANAGER_URL; |
|
287 | - if($_POST['ajax'] == 1) { |
|
286 | + $header = 'Location: '.MODX_MANAGER_URL; |
|
287 | + if ($_POST['ajax'] == 1) { |
|
288 | 288 | echo $header; |
289 | 289 | } else { |
290 | 290 | header($header); |
@@ -292,35 +292,35 @@ discard block |
||
292 | 292 | } |
293 | 293 | |
294 | 294 | // show javascript alert |
295 | -function jsAlert($msg) { |
|
295 | +function jsAlert($msg){ |
|
296 | 296 | global $modx; |
297 | - if($_POST['ajax'] != 1) { |
|
298 | - echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>"; |
|
297 | + if ($_POST['ajax'] != 1) { |
|
298 | + echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>"; |
|
299 | 299 | } else { |
300 | - echo $msg . "\n"; |
|
300 | + echo $msg."\n"; |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | |
304 | -function login($username, $givenPassword, $dbasePassword) { |
|
304 | +function login($username, $givenPassword, $dbasePassword){ |
|
305 | 305 | global $modx; |
306 | 306 | return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); |
307 | 307 | } |
308 | 308 | |
309 | -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { |
|
309 | +function loginV1($internalKey, $givenPassword, $dbasePassword, $username){ |
|
310 | 310 | global $modx; |
311 | 311 | |
312 | 312 | $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); |
313 | 313 | |
314 | - if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { |
|
314 | + if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { |
|
315 | 315 | $modx->config['pwd_hash_algo'] = 'UNCRYPT'; |
316 | 316 | } |
317 | 317 | |
318 | - if($user_algo !== $modx->config['pwd_hash_algo']) { |
|
318 | + if ($user_algo !== $modx->config['pwd_hash_algo']) { |
|
319 | 319 | $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; |
320 | 320 | $modx->config['pwd_hash_algo'] = $user_algo; |
321 | 321 | } |
322 | 322 | |
323 | - if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { |
|
323 | + if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { |
|
324 | 324 | return false; |
325 | 325 | } |
326 | 326 | |
@@ -329,17 +329,17 @@ discard block |
||
329 | 329 | return true; |
330 | 330 | } |
331 | 331 | |
332 | -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { |
|
332 | +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username){ |
|
333 | 333 | global $modx; |
334 | 334 | |
335 | - if($dbasePassword != md5($givenPassword)) { |
|
335 | + if ($dbasePassword != md5($givenPassword)) { |
|
336 | 336 | return false; |
337 | 337 | } |
338 | 338 | updateNewHash($username, $givenPassword); |
339 | 339 | return true; |
340 | 340 | } |
341 | 341 | |
342 | -function updateNewHash($username, $password) { |
|
342 | +function updateNewHash($username, $password){ |
|
343 | 343 | global $modx; |
344 | 344 | |
345 | 345 | $field = array(); |
@@ -347,23 +347,23 @@ discard block |
||
347 | 347 | $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); |
348 | 348 | } |
349 | 349 | |
350 | -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { |
|
350 | +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes){ |
|
351 | 351 | global $modx; |
352 | 352 | |
353 | 353 | $failedlogins += 1; |
354 | 354 | |
355 | 355 | $fields = array('failedlogincount' => $failedlogins); |
356 | - if($failedlogins >= $failed_allowed) //block user for too many fail attempts |
|
356 | + if ($failedlogins >= $failed_allowed) //block user for too many fail attempts |
|
357 | 357 | { |
358 | 358 | $fields['blockeduntil'] = time() + ($blocked_minutes * 60); |
359 | 359 | } |
360 | 360 | |
361 | 361 | $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
362 | 362 | |
363 | - if($failedlogins < $failed_allowed) { |
|
363 | + if ($failedlogins < $failed_allowed) { |
|
364 | 364 | //sleep to help prevent brute force attacks |
365 | 365 | $sleep = (int) $failedlogins / 2; |
366 | - if($sleep > 5) { |
|
366 | + if ($sleep > 5) { |
|
367 | 367 | $sleep = 5; |
368 | 368 | } |
369 | 369 | sleep($sleep); |
@@ -292,7 +292,8 @@ discard block |
||
292 | 292 | } |
293 | 293 | |
294 | 294 | // show javascript alert |
295 | -function jsAlert($msg) { |
|
295 | +function jsAlert($msg) |
|
296 | +{ |
|
296 | 297 | global $modx; |
297 | 298 | if($_POST['ajax'] != 1) { |
298 | 299 | echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>"; |
@@ -301,12 +302,14 @@ discard block |
||
301 | 302 | } |
302 | 303 | } |
303 | 304 | |
304 | -function login($username, $givenPassword, $dbasePassword) { |
|
305 | +function login($username, $givenPassword, $dbasePassword) |
|
306 | +{ |
|
305 | 307 | global $modx; |
306 | 308 | return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); |
307 | 309 | } |
308 | 310 | |
309 | -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { |
|
311 | +function loginV1($internalKey, $givenPassword, $dbasePassword, $username) |
|
312 | +{ |
|
310 | 313 | global $modx; |
311 | 314 | |
312 | 315 | $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); |
@@ -329,7 +332,8 @@ discard block |
||
329 | 332 | return true; |
330 | 333 | } |
331 | 334 | |
332 | -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { |
|
335 | +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) |
|
336 | +{ |
|
333 | 337 | global $modx; |
334 | 338 | |
335 | 339 | if($dbasePassword != md5($givenPassword)) { |
@@ -339,7 +343,8 @@ discard block |
||
339 | 343 | return true; |
340 | 344 | } |
341 | 345 | |
342 | -function updateNewHash($username, $password) { |
|
346 | +function updateNewHash($username, $password) |
|
347 | +{ |
|
343 | 348 | global $modx; |
344 | 349 | |
345 | 350 | $field = array(); |
@@ -347,16 +352,19 @@ discard block |
||
347 | 352 | $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); |
348 | 353 | } |
349 | 354 | |
350 | -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { |
|
355 | +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) |
|
356 | +{ |
|
351 | 357 | global $modx; |
352 | 358 | |
353 | 359 | $failedlogins += 1; |
354 | 360 | |
355 | 361 | $fields = array('failedlogincount' => $failedlogins); |
356 | - if($failedlogins >= $failed_allowed) //block user for too many fail attempts |
|
362 | + if($failedlogins >= $failed_allowed) { |
|
363 | + //block user for too many fail attempts |
|
357 | 364 | { |
358 | 365 | $fields['blockeduntil'] = time() + ($blocked_minutes * 60); |
359 | 366 | } |
367 | + } |
|
360 | 368 | |
361 | 369 | $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
362 | 370 |
@@ -239,7 +239,7 @@ |
||
239 | 239 | if(version_compare(PHP_VERSION, '5.2', '<')) { |
240 | 240 | setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure); |
241 | 241 | } else { |
242 | - setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true); |
|
242 | + setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, null, $secure, true); |
|
243 | 243 | } |
244 | 244 | } else { |
245 | 245 | $_SESSION['modx.mgr.session.cookie.lifetime'] = 0; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $parent = intval($_REQUEST['parent']); |
23 | 23 | $expandAll = intval($_REQUEST['expandAll']); |
24 | 24 | $output = ''; |
25 | -$theme = $manager_theme . "/"; |
|
25 | +$theme = $manager_theme."/"; |
|
26 | 26 | $hereid = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : ''; |
27 | 27 | |
28 | 28 | if (isset($_REQUEST['showonlyfolders'])) { |
@@ -236,9 +236,9 @@ |
||
236 | 236 | lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
237 | 237 | }; |
238 | 238 | <?php |
239 | - $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
|
240 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
241 | - ?> |
|
239 | + $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
|
240 | + echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
241 | + ?> |
|
242 | 242 | </script> |
243 | 243 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
244 | 244 | <?php if ($modx->config['show_picker'] != "0") { ?> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | if (isset($_COOKIE['MODX_themeColor'])) { |
50 | - $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
|
50 | + $body_class .= ' '.$_COOKIE['MODX_themeColor']; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if (isset($modx->pluginCache['ElementsInTree'])) { |
@@ -75,36 +75,36 @@ discard block |
||
75 | 75 | $user['which_browser'] = $modx->config['which_browser']; |
76 | 76 | } |
77 | 77 | |
78 | -$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
|
78 | +$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime; |
|
79 | 79 | |
80 | 80 | if ($modx->config['manager_theme'] == 'default') { |
81 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
82 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
81 | + if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) { |
|
82 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
83 | 83 | $minifier = new Formatter\CSSMinify(); |
84 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
85 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
86 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); |
|
87 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); |
|
88 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); |
|
89 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); |
|
90 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); |
|
91 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); |
|
92 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); |
|
93 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); |
|
94 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); |
|
84 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
85 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
86 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css'); |
|
87 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css'); |
|
88 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css'); |
|
89 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css'); |
|
90 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css'); |
|
91 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css'); |
|
92 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css'); |
|
93 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css'); |
|
94 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'); |
|
95 | 95 | $css = $minifier->minify(); |
96 | - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
|
96 | + file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css); |
|
97 | 97 | } |
98 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
99 | - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
|
98 | + if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
99 | + $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | -$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
103 | +$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
104 | 104 | |
105 | 105 | ?> |
106 | 106 | <!DOCTYPE html> |
107 | -<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>> |
|
107 | +<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>> |
|
108 | 108 | <head> |
109 | 109 | <title><?= $site_name ?>- (EVO CMS Manager)</title> |
110 | 110 | <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" /> |
@@ -135,20 +135,20 @@ discard block |
||
135 | 135 | MODX_SITE_URL: '<?= MODX_SITE_URL ?>', |
136 | 136 | MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>', |
137 | 137 | user: { |
138 | - role: <?= (int)$user['role'] ?>, |
|
138 | + role: <?= (int) $user['role'] ?>, |
|
139 | 139 | username: '<?= $user['username'] ?>' |
140 | 140 | }, |
141 | 141 | config: { |
142 | 142 | mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>, |
143 | - menu_height: <?= (int)$menu_height ?>, |
|
144 | - tree_width: <?= (int)$tree_width ?>, |
|
145 | - tree_min_width: <?= (int)$tree_min_width ?>, |
|
146 | - session_timeout: <?= (int)$modx->config['session_timeout'] ?>, |
|
147 | - site_start: <?= (int)$modx->config['site_start'] ?>, |
|
148 | - tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>, |
|
143 | + menu_height: <?= (int) $menu_height ?>, |
|
144 | + tree_width: <?= (int) $tree_width ?>, |
|
145 | + tree_min_width: <?= (int) $tree_min_width ?>, |
|
146 | + session_timeout: <?= (int) $modx->config['session_timeout'] ?>, |
|
147 | + site_start: <?= (int) $modx->config['site_start'] ?>, |
|
148 | + tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>, |
|
149 | 149 | theme: '<?= $modx->config['manager_theme'] ?>', |
150 | 150 | which_browser: '<?= $user['which_browser'] ?>', |
151 | - layout: <?= (int)$manager_layout ?>, |
|
151 | + layout: <?= (int) $manager_layout ?>, |
|
152 | 152 | textdir: '<?= $modx_textdir ?>', |
153 | 153 | global_tabs: <?= $modx->config['global_tabs'] ?> |
154 | 154 | |
@@ -233,11 +233,11 @@ discard block |
||
233 | 233 | delete a[b]; |
234 | 234 | }, |
235 | 235 | openedArray: [], |
236 | - lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
|
236 | + lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?> |
|
237 | 237 | }; |
238 | 238 | <?php |
239 | 239 | $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
240 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
240 | + echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n modx.openedArray[", $opened).'] = 1;')."\n"; |
|
241 | 241 | ?> |
242 | 242 | </script> |
243 | 243 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | <a href="javascript:;" class="dropdown-toggle" onclick="return false;"> |
367 | 367 | <span class="username"><?= $user['username'] ?></span> |
368 | 368 | <?php if ($user['photo']) { ?> |
369 | - <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span> |
|
369 | + <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span> |
|
370 | 370 | <?php } else { ?> |
371 | 371 | <span class="icon"><?= $_style['menu_user'] ?></span> |
372 | 372 | <?php } ?> |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $version = 'Evolution'; |
394 | 394 | ?> |
395 | 395 | <?php |
396 | - echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>' . $version . ' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
396 | + echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>'.$version.' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
397 | 397 | ?> |
398 | 398 | </ul> |
399 | 399 | </li> |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | <script type="text/javascript"> |
533 | 533 | |
534 | 534 | if (document.getElementById('treeMenu')) { |
535 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
535 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
536 | 536 | |
537 | 537 | document.getElementById('treeMenu_openelements').onclick = function(e) { |
538 | 538 | e.preventDefault(); |
@@ -550,12 +550,12 @@ discard block |
||
550 | 550 | } |
551 | 551 | }; |
552 | 552 | <?php } ?> |
553 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
553 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
554 | 554 | |
555 | 555 | document.getElementById('treeMenu_openimages').onclick = function(e) { |
556 | 556 | e.preventDefault(); |
557 | 557 | if (modx.config.global_tabs && !e.shiftKey) { |
558 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
558 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
559 | 559 | } else { |
560 | 560 | var randomNum = '<?= $_lang["files_files"] ?>'; |
561 | 561 | if (e.shiftKey) { |
@@ -568,12 +568,12 @@ discard block |
||
568 | 568 | } |
569 | 569 | }; |
570 | 570 | <?php } ?> |
571 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
571 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
572 | 572 | |
573 | 573 | document.getElementById('treeMenu_openfiles').onclick = function(e) { |
574 | 574 | e.preventDefault(); |
575 | 575 | if (modx.config.global_tabs && !e.shiftKey) { |
576 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
576 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
577 | 577 | } else { |
578 | 578 | var randomNum = '<?= $_lang["files_files"] ?>'; |
579 | 579 | if (e.shiftKey) { |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | |
628 | 628 | </div> |
629 | 629 | <?php if ($modx->config['show_picker'] != "0") { |
630 | - include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
|
630 | + include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php'); |
|
631 | 631 | } ?> |
632 | 632 | </body> |
633 | 633 | </html> |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (IN_MANAGER_MODE != "true") { |
|
3 | +if (IN_MANAGER_MODE != "true") { |
|
4 | 4 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
5 | 5 | } |
6 | 6 | header("X-XSS-Protection: 0"); |
@@ -12,22 +12,22 @@ discard block |
||
12 | 12 | |
13 | 13 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
14 | 14 | |
15 | -if (!isset($modx->config['manager_menu_height'])) { |
|
15 | +if (!isset($modx->config['manager_menu_height'])) { |
|
16 | 16 | $modx->config['manager_menu_height'] = 2.2; // rem |
17 | 17 | } |
18 | 18 | |
19 | -if (!isset($modx->config['manager_tree_width'])) { |
|
19 | +if (!isset($modx->config['manager_tree_width'])) { |
|
20 | 20 | $modx->config['manager_tree_width'] = 20; // rem |
21 | 21 | } |
22 | 22 | |
23 | -if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
23 | +if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
24 | 24 | $initMainframeAction = $_SESSION['onLoginForwardToAction']; |
25 | 25 | unset($_SESSION['onLoginForwardToAction']); |
26 | -} else { |
|
26 | +} else { |
|
27 | 27 | $initMainframeAction = 2; // welcome.static |
28 | 28 | } |
29 | 29 | |
30 | -if (!isset($_SESSION['tree_show_only_folders'])) { |
|
30 | +if (!isset($_SESSION['tree_show_only_folders'])) { |
|
31 | 31 | $_SESSION['tree_show_only_folders'] = 0; |
32 | 32 | } |
33 | 33 | |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | $tree_width = $modx->config['manager_tree_width']; |
37 | 37 | $tree_min_width = 0; |
38 | 38 | |
39 | -if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
39 | +if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
40 | 40 | $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar']; |
41 | -} else { |
|
41 | +} else { |
|
42 | 42 | $MODX_widthSideBar = $tree_width; |
43 | 43 | } |
44 | 44 | |
45 | -if (!$MODX_widthSideBar) { |
|
45 | +if (!$MODX_widthSideBar) { |
|
46 | 46 | $body_class .= 'sidebar-closed'; |
47 | 47 | } |
48 | 48 | |
49 | -if (isset($_COOKIE['MODX_themeColor'])) { |
|
49 | +if (isset($_COOKIE['MODX_themeColor'])) { |
|
50 | 50 | $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
51 | 51 | } |
52 | 52 | |
53 | -if (isset($modx->pluginCache['ElementsInTree'])) { |
|
53 | +if (isset($modx->pluginCache['ElementsInTree'])) { |
|
54 | 54 | $body_class .= ' ElementsInTree'; |
55 | 55 | } |
56 | 56 | |
@@ -66,19 +66,19 @@ discard block |
||
66 | 66 | 'type8' => $_lang["lock_element_type_8"] |
67 | 67 | ); |
68 | 68 | |
69 | -foreach ($unlockTranslations as $key => $value) { |
|
69 | +foreach ($unlockTranslations as $key => $value) { |
|
70 | 70 | $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
71 | 71 | } |
72 | 72 | |
73 | 73 | $user = $modx->getUserInfo($modx->getLoginUserID()); |
74 | -if ($user['which_browser'] == 'default') { |
|
74 | +if ($user['which_browser'] == 'default') { |
|
75 | 75 | $user['which_browser'] = $modx->config['which_browser']; |
76 | 76 | } |
77 | 77 | |
78 | 78 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
79 | 79 | |
80 | -if ($modx->config['manager_theme'] == 'default') { |
|
81 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
80 | +if ($modx->config['manager_theme'] == 'default') { |
|
81 | + if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
82 | 82 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
83 | 83 | $minifier = new Formatter\CSSMinify(); |
84 | 84 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $css = $minifier->minify(); |
96 | 96 | file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
97 | 97 | } |
98 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
98 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
99 | 99 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
100 | 100 | } |
101 | 101 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | <?php |
250 | 250 | // invoke OnManagerTopPrerender event |
251 | 251 | $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST); |
252 | - if (is_array($evtOut)) { |
|
252 | + if (is_array($evtOut)) { |
|
253 | 253 | echo implode("\n", $evtOut); |
254 | 254 | } |
255 | 255 | ?> |
@@ -420,9 +420,12 @@ discard block |
||
420 | 420 | <div id="evo-tab-page-home" class="evo-tab-page show"> |
421 | 421 | <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
422 | 422 | </div> |
423 | - <?php else: ?> |
|
423 | + <?php else { |
|
424 | + : ?> |
|
424 | 425 | <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
425 | - <?php endif; ?> |
|
426 | + <?php endif; |
|
427 | +} |
|
428 | +?> |
|
426 | 429 | <div id="mainloader"></div> |
427 | 430 | </div> |
428 | 431 | <div id="resizer"></div> |
@@ -435,11 +438,11 @@ discard block |
||
435 | 438 | 'tree_sortdir', |
436 | 439 | 'tree_nodename' |
437 | 440 | ); |
438 | - foreach ($sortParams as $param) { |
|
439 | - if (isset($_REQUEST[$param])) { |
|
441 | + foreach ($sortParams as $param) { |
|
442 | + if (isset($_REQUEST[$param])) { |
|
440 | 443 | $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]); |
441 | 444 | $_SESSION[$param] = $_REQUEST[$param]; |
442 | - } else if (!isset($_SESSION[$param])) { |
|
445 | + } else if (!isset($_SESSION[$param])) { |
|
443 | 446 | $_SESSION[$param] = $modx->manager->getLastUserSetting($param); |
444 | 447 | } |
445 | 448 | } |
@@ -519,9 +522,9 @@ discard block |
||
519 | 522 | </div> |
520 | 523 | |
521 | 524 | <?php |
522 | - function constructLink($action, $img, $text, $allowed) |
|
523 | - { |
|
524 | - if ($allowed == 1) { |
|
525 | + function constructLink($action, $img, $text, $allowed) |
|
526 | + { |
|
527 | + if ($allowed == 1) { |
|
525 | 528 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action); |
526 | 529 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text); |
527 | 530 | } |
@@ -626,7 +629,7 @@ discard block |
||
626 | 629 | ?> |
627 | 630 | |
628 | 631 | </div> |
629 | -<?php if ($modx->config['show_picker'] != "0") { |
|
632 | +<?php if ($modx->config['show_picker'] != "0") { |
|
630 | 633 | include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
631 | 634 | } ?> |
632 | 635 | </body> |
@@ -4,237 +4,237 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | $sitemenu['bars'] = array( |
7 | - 'bars', |
|
8 | - 'main', |
|
9 | - '<i class="fa fa-bars"></i>', |
|
10 | - 'javascript:;', |
|
11 | - $_lang['home'], |
|
12 | - 'modx.resizer.toggle(); return false;', |
|
13 | - ' return false;', |
|
14 | - '', |
|
15 | - 0, |
|
16 | - 10, |
|
17 | - '' |
|
7 | + 'bars', |
|
8 | + 'main', |
|
9 | + '<i class="fa fa-bars"></i>', |
|
10 | + 'javascript:;', |
|
11 | + $_lang['home'], |
|
12 | + 'modx.resizer.toggle(); return false;', |
|
13 | + ' return false;', |
|
14 | + '', |
|
15 | + 0, |
|
16 | + 10, |
|
17 | + '' |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | //mainMenu |
21 | 21 | $sitemenu['site'] = array( |
22 | - 'site', |
|
23 | - 'main', |
|
24 | - '<i class="fa fa-home"></i>' . $_lang['home'], |
|
25 | - 'index.php?a=2', |
|
26 | - $_lang['home'], |
|
27 | - '', |
|
28 | - '', |
|
29 | - 'main', |
|
30 | - 0, |
|
31 | - 10, |
|
32 | - 'active' |
|
22 | + 'site', |
|
23 | + 'main', |
|
24 | + '<i class="fa fa-home"></i>' . $_lang['home'], |
|
25 | + 'index.php?a=2', |
|
26 | + $_lang['home'], |
|
27 | + '', |
|
28 | + '', |
|
29 | + 'main', |
|
30 | + 0, |
|
31 | + 10, |
|
32 | + 'active' |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
36 | - $sitemenu['elements'] = array( |
|
37 | - 'elements', |
|
38 | - 'main', |
|
39 | - '<i class="fa fa-th"></i>' . $_lang['elements'], |
|
40 | - 'javascript:;', |
|
41 | - $_lang['elements'], |
|
42 | - ' return false;', |
|
43 | - '', |
|
44 | - '', |
|
45 | - 0, |
|
46 | - 20, |
|
47 | - '' |
|
48 | - ); |
|
36 | + $sitemenu['elements'] = array( |
|
37 | + 'elements', |
|
38 | + 'main', |
|
39 | + '<i class="fa fa-th"></i>' . $_lang['elements'], |
|
40 | + 'javascript:;', |
|
41 | + $_lang['elements'], |
|
42 | + ' return false;', |
|
43 | + '', |
|
44 | + '', |
|
45 | + 0, |
|
46 | + 20, |
|
47 | + '' |
|
48 | + ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if($modx->hasPermission('exec_module')) { |
52 | - $sitemenu['modules'] = array( |
|
53 | - 'modules', |
|
54 | - 'main', |
|
55 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['modules'], |
|
56 | - 'javascript:;', |
|
57 | - $_lang['modules'], |
|
58 | - ' return false;', |
|
59 | - '', |
|
60 | - '', |
|
61 | - 0, |
|
62 | - 30, |
|
63 | - '' |
|
64 | - ); |
|
52 | + $sitemenu['modules'] = array( |
|
53 | + 'modules', |
|
54 | + 'main', |
|
55 | + '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['modules'], |
|
56 | + 'javascript:;', |
|
57 | + $_lang['modules'], |
|
58 | + ' return false;', |
|
59 | + '', |
|
60 | + '', |
|
61 | + 0, |
|
62 | + 30, |
|
63 | + '' |
|
64 | + ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
68 | - $sitemenu['users'] = array( |
|
69 | - 'users', |
|
70 | - 'main', |
|
71 | - '<i class="fa fa-users"></i>' . $_lang['users'], |
|
72 | - 'javascript:;', |
|
73 | - $_lang['users'], |
|
74 | - ' return false;', |
|
75 | - 'edit_user', |
|
76 | - '', |
|
77 | - 0, |
|
78 | - 40, |
|
79 | - '' |
|
80 | - ); |
|
68 | + $sitemenu['users'] = array( |
|
69 | + 'users', |
|
70 | + 'main', |
|
71 | + '<i class="fa fa-users"></i>' . $_lang['users'], |
|
72 | + 'javascript:;', |
|
73 | + $_lang['users'], |
|
74 | + ' return false;', |
|
75 | + 'edit_user', |
|
76 | + '', |
|
77 | + 0, |
|
78 | + 40, |
|
79 | + '' |
|
80 | + ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
84 | - $sitemenu['tools'] = array( |
|
85 | - 'tools', |
|
86 | - 'main', |
|
87 | - '<i class="fa fa-wrench"></i>' . $_lang['tools'], |
|
88 | - 'javascript:;', |
|
89 | - $_lang['tools'], |
|
90 | - ' return false;', |
|
91 | - '', |
|
92 | - '', |
|
93 | - 0, |
|
94 | - 50, |
|
95 | - '' |
|
96 | - ); |
|
84 | + $sitemenu['tools'] = array( |
|
85 | + 'tools', |
|
86 | + 'main', |
|
87 | + '<i class="fa fa-wrench"></i>' . $_lang['tools'], |
|
88 | + 'javascript:;', |
|
89 | + $_lang['tools'], |
|
90 | + ' return false;', |
|
91 | + '', |
|
92 | + '', |
|
93 | + 0, |
|
94 | + 50, |
|
95 | + '' |
|
96 | + ); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | 100 | if($modx->hasPermission('edit_template')) { |
101 | - $sitemenu['element_templates'] = array( |
|
102 | - 'element_templates', |
|
103 | - 'elements', |
|
104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | - 'index.php?a=76&tab=' . $tab++, |
|
106 | - $_lang['manage_templates'], |
|
107 | - '', |
|
108 | - 'new_template,edit_template', |
|
109 | - 'main', |
|
110 | - 0, |
|
111 | - 10, |
|
112 | - 'dropdown-toggle' |
|
113 | - ); |
|
101 | + $sitemenu['element_templates'] = array( |
|
102 | + 'element_templates', |
|
103 | + 'elements', |
|
104 | + '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | + 'index.php?a=76&tab=' . $tab++, |
|
106 | + $_lang['manage_templates'], |
|
107 | + '', |
|
108 | + 'new_template,edit_template', |
|
109 | + 'main', |
|
110 | + 0, |
|
111 | + 10, |
|
112 | + 'dropdown-toggle' |
|
113 | + ); |
|
114 | 114 | } |
115 | 115 | if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
116 | - $sitemenu['element_tplvars'] = array( |
|
117 | - 'element_tplvars', |
|
118 | - 'elements', |
|
119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | - 'index.php?a=76&tab=' . $tab++, |
|
121 | - $_lang['tmplvars'], |
|
122 | - '', |
|
123 | - 'new_template,edit_template', |
|
124 | - 'main', |
|
125 | - 0, |
|
126 | - 20, |
|
127 | - 'dropdown-toggle' |
|
128 | - ); |
|
116 | + $sitemenu['element_tplvars'] = array( |
|
117 | + 'element_tplvars', |
|
118 | + 'elements', |
|
119 | + '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | + 'index.php?a=76&tab=' . $tab++, |
|
121 | + $_lang['tmplvars'], |
|
122 | + '', |
|
123 | + 'new_template,edit_template', |
|
124 | + 'main', |
|
125 | + 0, |
|
126 | + 20, |
|
127 | + 'dropdown-toggle' |
|
128 | + ); |
|
129 | 129 | } |
130 | 130 | if($modx->hasPermission('edit_chunk')) { |
131 | - $sitemenu['element_htmlsnippets'] = array( |
|
132 | - 'element_htmlsnippets', |
|
133 | - 'elements', |
|
134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | - 'index.php?a=76&tab=' . $tab++, |
|
136 | - $_lang['manage_htmlsnippets'], |
|
137 | - '', |
|
138 | - 'new_chunk,edit_chunk', |
|
139 | - 'main', |
|
140 | - 0, |
|
141 | - 30, |
|
142 | - 'dropdown-toggle' |
|
143 | - ); |
|
131 | + $sitemenu['element_htmlsnippets'] = array( |
|
132 | + 'element_htmlsnippets', |
|
133 | + 'elements', |
|
134 | + '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | + 'index.php?a=76&tab=' . $tab++, |
|
136 | + $_lang['manage_htmlsnippets'], |
|
137 | + '', |
|
138 | + 'new_chunk,edit_chunk', |
|
139 | + 'main', |
|
140 | + 0, |
|
141 | + 30, |
|
142 | + 'dropdown-toggle' |
|
143 | + ); |
|
144 | 144 | } |
145 | 145 | if($modx->hasPermission('edit_snippet')) { |
146 | - $sitemenu['element_snippets'] = array( |
|
147 | - 'element_snippets', |
|
148 | - 'elements', |
|
149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | - 'index.php?a=76&tab=' . $tab++, |
|
151 | - $_lang['manage_snippets'], |
|
152 | - '', |
|
153 | - 'new_snippet,edit_snippet', |
|
154 | - 'main', |
|
155 | - 0, |
|
156 | - 40, |
|
157 | - 'dropdown-toggle' |
|
158 | - ); |
|
146 | + $sitemenu['element_snippets'] = array( |
|
147 | + 'element_snippets', |
|
148 | + 'elements', |
|
149 | + '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | + 'index.php?a=76&tab=' . $tab++, |
|
151 | + $_lang['manage_snippets'], |
|
152 | + '', |
|
153 | + 'new_snippet,edit_snippet', |
|
154 | + 'main', |
|
155 | + 0, |
|
156 | + 40, |
|
157 | + 'dropdown-toggle' |
|
158 | + ); |
|
159 | 159 | } |
160 | 160 | if($modx->hasPermission('edit_plugin')) { |
161 | - $sitemenu['element_plugins'] = array( |
|
162 | - 'element_plugins', |
|
163 | - 'elements', |
|
164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | - 'index.php?a=76&tab=' . $tab++, |
|
166 | - $_lang['manage_plugins'], |
|
167 | - '', |
|
168 | - 'new_plugin,edit_plugin', |
|
169 | - 'main', |
|
170 | - 0, |
|
171 | - 50, |
|
172 | - 'dropdown-toggle' |
|
173 | - ); |
|
161 | + $sitemenu['element_plugins'] = array( |
|
162 | + 'element_plugins', |
|
163 | + 'elements', |
|
164 | + '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | + 'index.php?a=76&tab=' . $tab++, |
|
166 | + $_lang['manage_plugins'], |
|
167 | + '', |
|
168 | + 'new_plugin,edit_plugin', |
|
169 | + 'main', |
|
170 | + 0, |
|
171 | + 50, |
|
172 | + 'dropdown-toggle' |
|
173 | + ); |
|
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | 177 | if($modx->hasPermission('file_manager')) { |
178 | - $sitemenu['manage_files'] = array( |
|
179 | - 'manage_files', |
|
180 | - 'elements', |
|
181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | - 'index.php?a=31', |
|
183 | - $_lang['manage_files'], |
|
184 | - '', |
|
185 | - 'file_manager', |
|
186 | - 'main', |
|
187 | - 0, |
|
188 | - 70, |
|
189 | - '' |
|
190 | - ); |
|
178 | + $sitemenu['manage_files'] = array( |
|
179 | + 'manage_files', |
|
180 | + 'elements', |
|
181 | + '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | + 'index.php?a=31', |
|
183 | + $_lang['manage_files'], |
|
184 | + '', |
|
185 | + 'file_manager', |
|
186 | + 'main', |
|
187 | + 0, |
|
188 | + 70, |
|
189 | + '' |
|
190 | + ); |
|
191 | 191 | } |
192 | 192 | if($modx->hasPermission('category_manager')) { |
193 | - $sitemenu['manage_categories'] = array( |
|
194 | - 'manage_categories', |
|
195 | - 'elements', |
|
196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | - 'index.php?a=120', |
|
198 | - $_lang['manage_categories'], |
|
199 | - '', |
|
200 | - 'category_manager', |
|
201 | - 'main', |
|
202 | - 0, |
|
203 | - 80, |
|
204 | - '' |
|
205 | - ); |
|
193 | + $sitemenu['manage_categories'] = array( |
|
194 | + 'manage_categories', |
|
195 | + 'elements', |
|
196 | + '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | + 'index.php?a=120', |
|
198 | + $_lang['manage_categories'], |
|
199 | + '', |
|
200 | + 'category_manager', |
|
201 | + 'main', |
|
202 | + 0, |
|
203 | + 80, |
|
204 | + '' |
|
205 | + ); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | 209 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
210 | - $sitemenu['new_module'] = array( |
|
211 | - 'new_module', |
|
212 | - 'modules', |
|
213 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | - 'index.php?a=106', |
|
215 | - $_lang['module_management'], |
|
216 | - '', |
|
217 | - 'new_module,edit_module', |
|
218 | - 'main', |
|
219 | - 1, |
|
220 | - 0, |
|
221 | - '' |
|
222 | - ); |
|
210 | + $sitemenu['new_module'] = array( |
|
211 | + 'new_module', |
|
212 | + 'modules', |
|
213 | + '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | + 'index.php?a=106', |
|
215 | + $_lang['module_management'], |
|
216 | + '', |
|
217 | + 'new_module,edit_module', |
|
218 | + 'main', |
|
219 | + 1, |
|
220 | + 0, |
|
221 | + '' |
|
222 | + ); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | if($modx->hasPermission('exec_module')) { |
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | - $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | + $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
234 | - $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | - } |
|
236 | - if($modx->db->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->db->getRow($rs)) { |
|
233 | + } else { |
|
234 | + $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | + } |
|
236 | + if($modx->db->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->db->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -255,83 +255,83 @@ discard block |
||
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | 257 | if($modx->hasPermission('edit_user')) { |
258 | - $sitemenu['user_management_title'] = array( |
|
259 | - 'user_management_title', |
|
260 | - 'users', |
|
261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | - 'index.php?a=75', |
|
263 | - $_lang['user_management_title'], |
|
264 | - '', |
|
265 | - 'edit_user', |
|
266 | - 'main', |
|
267 | - 0, |
|
268 | - 10, |
|
269 | - 'dropdown-toggle' |
|
270 | - ); |
|
258 | + $sitemenu['user_management_title'] = array( |
|
259 | + 'user_management_title', |
|
260 | + 'users', |
|
261 | + '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | + 'index.php?a=75', |
|
263 | + $_lang['user_management_title'], |
|
264 | + '', |
|
265 | + 'edit_user', |
|
266 | + 'main', |
|
267 | + 0, |
|
268 | + 10, |
|
269 | + 'dropdown-toggle' |
|
270 | + ); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | if($modx->hasPermission('edit_web_user')) { |
274 | - $sitemenu['web_user_management_title'] = array( |
|
275 | - 'web_user_management_title', |
|
276 | - 'users', |
|
277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | - 'index.php?a=99', |
|
279 | - $_lang['web_user_management_title'], |
|
280 | - '', |
|
281 | - 'edit_web_user', |
|
282 | - 'main', |
|
283 | - 0, |
|
284 | - 20, |
|
285 | - 'dropdown-toggle' |
|
286 | - ); |
|
274 | + $sitemenu['web_user_management_title'] = array( |
|
275 | + 'web_user_management_title', |
|
276 | + 'users', |
|
277 | + '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | + 'index.php?a=99', |
|
279 | + $_lang['web_user_management_title'], |
|
280 | + '', |
|
281 | + 'edit_web_user', |
|
282 | + 'main', |
|
283 | + 0, |
|
284 | + 20, |
|
285 | + 'dropdown-toggle' |
|
286 | + ); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | if($modx->hasPermission('edit_role')) { |
290 | - $sitemenu['role_management_title'] = array( |
|
291 | - 'role_management_title', |
|
292 | - 'users', |
|
293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | - 'index.php?a=86', |
|
295 | - $_lang['role_management_title'], |
|
296 | - '', |
|
297 | - 'new_role,edit_role,delete_role', |
|
298 | - 'main', |
|
299 | - 0, |
|
300 | - 30, |
|
301 | - '' |
|
302 | - ); |
|
290 | + $sitemenu['role_management_title'] = array( |
|
291 | + 'role_management_title', |
|
292 | + 'users', |
|
293 | + '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | + 'index.php?a=86', |
|
295 | + $_lang['role_management_title'], |
|
296 | + '', |
|
297 | + 'new_role,edit_role,delete_role', |
|
298 | + 'main', |
|
299 | + 0, |
|
300 | + 30, |
|
301 | + '' |
|
302 | + ); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | if($modx->hasPermission('access_permissions')) { |
306 | - $sitemenu['manager_permissions'] = array( |
|
307 | - 'manager_permissions', |
|
308 | - 'users', |
|
309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | - 'index.php?a=40', |
|
311 | - $_lang['manager_permissions'], |
|
312 | - '', |
|
313 | - 'access_permissions', |
|
314 | - 'main', |
|
315 | - 0, |
|
316 | - 40, |
|
317 | - '' |
|
318 | - ); |
|
306 | + $sitemenu['manager_permissions'] = array( |
|
307 | + 'manager_permissions', |
|
308 | + 'users', |
|
309 | + '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | + 'index.php?a=40', |
|
311 | + $_lang['manager_permissions'], |
|
312 | + '', |
|
313 | + 'access_permissions', |
|
314 | + 'main', |
|
315 | + 0, |
|
316 | + 40, |
|
317 | + '' |
|
318 | + ); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | if($modx->hasPermission('web_access_permissions')) { |
322 | - $sitemenu['web_permissions'] = array( |
|
323 | - 'web_permissions', |
|
324 | - 'users', |
|
325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | - 'index.php?a=91', |
|
327 | - $_lang['web_permissions'], |
|
328 | - '', |
|
329 | - 'web_access_permissions', |
|
330 | - 'main', |
|
331 | - 0, |
|
332 | - 50, |
|
333 | - '' |
|
334 | - ); |
|
322 | + $sitemenu['web_permissions'] = array( |
|
323 | + 'web_permissions', |
|
324 | + 'users', |
|
325 | + '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | + 'index.php?a=91', |
|
327 | + $_lang['web_permissions'], |
|
328 | + '', |
|
329 | + 'web_access_permissions', |
|
330 | + 'main', |
|
331 | + 0, |
|
332 | + 50, |
|
333 | + '' |
|
334 | + ); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | // Tools Menu |
@@ -361,104 +361,104 @@ discard block |
||
361 | 361 | ); |
362 | 362 | |
363 | 363 | $sitemenu['search'] = array( |
364 | - 'search', |
|
365 | - 'tools', |
|
366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | - 'index.php?a=71', |
|
368 | - $_lang['search'], |
|
369 | - '', |
|
370 | - '', |
|
371 | - 'main', |
|
372 | - 1, |
|
373 | - 9, |
|
374 | - '' |
|
364 | + 'search', |
|
365 | + 'tools', |
|
366 | + '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | + 'index.php?a=71', |
|
368 | + $_lang['search'], |
|
369 | + '', |
|
370 | + '', |
|
371 | + 'main', |
|
372 | + 1, |
|
373 | + 9, |
|
374 | + '' |
|
375 | 375 | ); |
376 | 376 | |
377 | 377 | if($modx->hasPermission('bk_manager')) { |
378 | - $sitemenu['bk_manager'] = array( |
|
379 | - 'bk_manager', |
|
380 | - 'tools', |
|
381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | - 'index.php?a=93', |
|
383 | - $_lang['bk_manager'], |
|
384 | - '', |
|
385 | - 'bk_manager', |
|
386 | - 'main', |
|
387 | - 0, |
|
388 | - 10, |
|
389 | - '' |
|
390 | - ); |
|
378 | + $sitemenu['bk_manager'] = array( |
|
379 | + 'bk_manager', |
|
380 | + 'tools', |
|
381 | + '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | + 'index.php?a=93', |
|
383 | + $_lang['bk_manager'], |
|
384 | + '', |
|
385 | + 'bk_manager', |
|
386 | + 'main', |
|
387 | + 0, |
|
388 | + 10, |
|
389 | + '' |
|
390 | + ); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | if($modx->hasPermission('remove_locks')) { |
394 | - $sitemenu['remove_locks'] = array( |
|
395 | - 'remove_locks', |
|
396 | - 'tools', |
|
397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | - 'javascript:modx.removeLocks();', |
|
399 | - $_lang['remove_locks'], |
|
400 | - '', |
|
401 | - 'remove_locks', |
|
402 | - '', |
|
403 | - 0, |
|
404 | - 20, |
|
405 | - '' |
|
406 | - ); |
|
394 | + $sitemenu['remove_locks'] = array( |
|
395 | + 'remove_locks', |
|
396 | + 'tools', |
|
397 | + '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | + 'javascript:modx.removeLocks();', |
|
399 | + $_lang['remove_locks'], |
|
400 | + '', |
|
401 | + 'remove_locks', |
|
402 | + '', |
|
403 | + 0, |
|
404 | + 20, |
|
405 | + '' |
|
406 | + ); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if($modx->hasPermission('import_static')) { |
410 | - $sitemenu['import_site'] = array( |
|
411 | - 'import_site', |
|
412 | - 'tools', |
|
413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | - 'index.php?a=95', |
|
415 | - $_lang['import_site'], |
|
416 | - '', |
|
417 | - 'import_static', |
|
418 | - 'main', |
|
419 | - 0, |
|
420 | - 30, |
|
421 | - '' |
|
422 | - ); |
|
410 | + $sitemenu['import_site'] = array( |
|
411 | + 'import_site', |
|
412 | + 'tools', |
|
413 | + '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | + 'index.php?a=95', |
|
415 | + $_lang['import_site'], |
|
416 | + '', |
|
417 | + 'import_static', |
|
418 | + 'main', |
|
419 | + 0, |
|
420 | + 30, |
|
421 | + '' |
|
422 | + ); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | if($modx->hasPermission('export_static')) { |
426 | - $sitemenu['export_site'] = array( |
|
427 | - 'export_site', |
|
428 | - 'tools', |
|
429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | - 'index.php?a=83', |
|
431 | - $_lang['export_site'], |
|
432 | - '', |
|
433 | - 'export_static', |
|
434 | - 'main', |
|
435 | - 1, |
|
436 | - 40, |
|
437 | - '' |
|
438 | - ); |
|
426 | + $sitemenu['export_site'] = array( |
|
427 | + 'export_site', |
|
428 | + 'tools', |
|
429 | + '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | + 'index.php?a=83', |
|
431 | + $_lang['export_site'], |
|
432 | + '', |
|
433 | + 'export_static', |
|
434 | + 'main', |
|
435 | + 1, |
|
436 | + 40, |
|
437 | + '' |
|
438 | + ); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | 442 | if(is_array($menu)) { |
443 | - $newmenu = array(); |
|
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
446 | - $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | - } |
|
448 | - } |
|
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
443 | + $newmenu = array(); |
|
444 | + foreach($menu as $item){ |
|
445 | + if(is_array(unserialize($item))){ |
|
446 | + $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | + } |
|
448 | + } |
|
449 | + if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
453 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
453 | + include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
454 | 454 | } else { |
455 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
455 | + include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
456 | 456 | } |
457 | 457 | $menu = new EVOmenu(); |
458 | 458 | $menu->Build($sitemenu, array( |
459 | - 'outerClass' => 'nav', |
|
460 | - 'innerClass' => 'dropdown-menu', |
|
461 | - 'parentClass' => 'dropdown', |
|
459 | + 'outerClass' => 'nav', |
|
460 | + 'innerClass' => 'dropdown-menu', |
|
461 | + 'parentClass' => 'dropdown', |
|
462 | 462 | 'parentLinkClass' => 'dropdown-toggle', |
463 | 463 | 'parentLinkAttr' => '', |
464 | 464 | 'parentLinkIn' => '' |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $sitemenu['site'] = array( |
22 | 22 | 'site', |
23 | 23 | 'main', |
24 | - '<i class="fa fa-home"></i>' . $_lang['home'], |
|
24 | + '<i class="fa fa-home"></i>'.$_lang['home'], |
|
25 | 25 | 'index.php?a=2', |
26 | 26 | $_lang['home'], |
27 | 27 | '', |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | 'active' |
33 | 33 | ); |
34 | 34 | |
35 | -if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
35 | +if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
36 | 36 | $sitemenu['elements'] = array( |
37 | 37 | 'elements', |
38 | 38 | 'main', |
39 | - '<i class="fa fa-th"></i>' . $_lang['elements'], |
|
39 | + '<i class="fa fa-th"></i>'.$_lang['elements'], |
|
40 | 40 | 'javascript:;', |
41 | 41 | $_lang['elements'], |
42 | 42 | ' return false;', |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | -if($modx->hasPermission('exec_module')) { |
|
51 | +if ($modx->hasPermission('exec_module')) { |
|
52 | 52 | $sitemenu['modules'] = array( |
53 | 53 | 'modules', |
54 | 54 | 'main', |
55 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['modules'], |
|
55 | + '<i class="'.$_style['icons_modules'].'"></i>'.$_lang['modules'], |
|
56 | 56 | 'javascript:;', |
57 | 57 | $_lang['modules'], |
58 | 58 | ' return false;', |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | -if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
67 | +if ($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
68 | 68 | $sitemenu['users'] = array( |
69 | 69 | 'users', |
70 | 70 | 'main', |
71 | - '<i class="fa fa-users"></i>' . $_lang['users'], |
|
71 | + '<i class="fa fa-users"></i>'.$_lang['users'], |
|
72 | 72 | 'javascript:;', |
73 | 73 | $_lang['users'], |
74 | 74 | ' return false;', |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | |
83 | -if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
83 | +if ($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
84 | 84 | $sitemenu['tools'] = array( |
85 | 85 | 'tools', |
86 | 86 | 'main', |
87 | - '<i class="fa fa-wrench"></i>' . $_lang['tools'], |
|
87 | + '<i class="fa fa-wrench"></i>'.$_lang['tools'], |
|
88 | 88 | 'javascript:;', |
89 | 89 | $_lang['tools'], |
90 | 90 | ' return false;', |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | -if($modx->hasPermission('edit_template')) { |
|
100 | +if ($modx->hasPermission('edit_template')) { |
|
101 | 101 | $sitemenu['element_templates'] = array( |
102 | 102 | 'element_templates', |
103 | 103 | 'elements', |
104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | - 'index.php?a=76&tab=' . $tab++, |
|
104 | + '<i class="fa fa-newspaper-o"></i>'.$_lang['manage_templates'].'<i class="fa fa-angle-right toggle"></i>', |
|
105 | + 'index.php?a=76&tab='.$tab++, |
|
106 | 106 | $_lang['manage_templates'], |
107 | 107 | '', |
108 | 108 | 'new_template,edit_template', |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | 'dropdown-toggle' |
113 | 113 | ); |
114 | 114 | } |
115 | -if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
115 | +if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
116 | 116 | $sitemenu['element_tplvars'] = array( |
117 | 117 | 'element_tplvars', |
118 | 118 | 'elements', |
119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | - 'index.php?a=76&tab=' . $tab++, |
|
119 | + '<i class="fa fa-list-alt"></i>'.$_lang['tmplvars'].'<i class="fa fa-angle-right toggle"></i>', |
|
120 | + 'index.php?a=76&tab='.$tab++, |
|
121 | 121 | $_lang['tmplvars'], |
122 | 122 | '', |
123 | 123 | 'new_template,edit_template', |
@@ -127,12 +127,12 @@ discard block |
||
127 | 127 | 'dropdown-toggle' |
128 | 128 | ); |
129 | 129 | } |
130 | -if($modx->hasPermission('edit_chunk')) { |
|
130 | +if ($modx->hasPermission('edit_chunk')) { |
|
131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
132 | 132 | 'element_htmlsnippets', |
133 | 133 | 'elements', |
134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | - 'index.php?a=76&tab=' . $tab++, |
|
134 | + '<i class="fa fa-th-large"></i>'.$_lang['manage_htmlsnippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
135 | + 'index.php?a=76&tab='.$tab++, |
|
136 | 136 | $_lang['manage_htmlsnippets'], |
137 | 137 | '', |
138 | 138 | 'new_chunk,edit_chunk', |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | 'dropdown-toggle' |
143 | 143 | ); |
144 | 144 | } |
145 | -if($modx->hasPermission('edit_snippet')) { |
|
145 | +if ($modx->hasPermission('edit_snippet')) { |
|
146 | 146 | $sitemenu['element_snippets'] = array( |
147 | 147 | 'element_snippets', |
148 | 148 | 'elements', |
149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | - 'index.php?a=76&tab=' . $tab++, |
|
149 | + '<i class="fa fa-code"></i>'.$_lang['manage_snippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
150 | + 'index.php?a=76&tab='.$tab++, |
|
151 | 151 | $_lang['manage_snippets'], |
152 | 152 | '', |
153 | 153 | 'new_snippet,edit_snippet', |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | 'dropdown-toggle' |
158 | 158 | ); |
159 | 159 | } |
160 | -if($modx->hasPermission('edit_plugin')) { |
|
160 | +if ($modx->hasPermission('edit_plugin')) { |
|
161 | 161 | $sitemenu['element_plugins'] = array( |
162 | 162 | 'element_plugins', |
163 | 163 | 'elements', |
164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | - 'index.php?a=76&tab=' . $tab++, |
|
164 | + '<i class="fa fa-plug"></i>'.$_lang['manage_plugins'].'<i class="fa fa-angle-right toggle"></i>', |
|
165 | + 'index.php?a=76&tab='.$tab++, |
|
166 | 166 | $_lang['manage_plugins'], |
167 | 167 | '', |
168 | 168 | 'new_plugin,edit_plugin', |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | -if($modx->hasPermission('file_manager')) { |
|
177 | +if ($modx->hasPermission('file_manager')) { |
|
178 | 178 | $sitemenu['manage_files'] = array( |
179 | 179 | 'manage_files', |
180 | 180 | 'elements', |
181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
181 | + '<i class="fa fa-folder-open-o"></i>'.$_lang['manage_files'], |
|
182 | 182 | 'index.php?a=31', |
183 | 183 | $_lang['manage_files'], |
184 | 184 | '', |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | '' |
190 | 190 | ); |
191 | 191 | } |
192 | -if($modx->hasPermission('category_manager')) { |
|
192 | +if ($modx->hasPermission('category_manager')) { |
|
193 | 193 | $sitemenu['manage_categories'] = array( |
194 | 194 | 'manage_categories', |
195 | 195 | 'elements', |
196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
196 | + '<i class="fa fa-object-group"></i>'.$_lang['manage_categories'], |
|
197 | 197 | 'index.php?a=120', |
198 | 198 | $_lang['manage_categories'], |
199 | 199 | '', |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
209 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
210 | 210 | $sitemenu['new_module'] = array( |
211 | 211 | 'new_module', |
212 | 212 | 'modules', |
213 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
213 | + '<i class="'.$_style['icons_modules'].'"></i>'.$_lang['module_management'], |
|
214 | 214 | 'index.php?a=106', |
215 | 215 | $_lang['module_management'], |
216 | 216 | '', |
@@ -222,24 +222,24 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | -if($modx->hasPermission('exec_module')) { |
|
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
225 | +if ($modx->hasPermission('exec_module')) { |
|
226 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | 227 | $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | - FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
|
229 | - LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
|
230 | - LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
|
231 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
228 | + FROM ' . $modx->getFullTableName('site_modules').' AS sm |
|
229 | + LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id |
|
230 | + LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group |
|
231 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
232 | 232 | ORDER BY sm.name'); |
233 | 233 | } else { |
234 | 234 | $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->db->getRecordCount($rs)) { |
|
236 | + if ($modx->db->getRecordCount($rs)) { |
|
237 | 237 | while ($row = $modx->db->getRow($rs)) { |
238 | - $sitemenu['module' . $row['id']] = array( |
|
239 | - 'module' . $row['id'], |
|
238 | + $sitemenu['module'.$row['id']] = array( |
|
239 | + 'module'.$row['id'], |
|
240 | 240 | 'modules', |
241 | - ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>') . $row['name'], |
|
242 | - 'index.php?a=112&id=' . $row['id'], |
|
241 | + ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>').$row['name'], |
|
242 | + 'index.php?a=112&id='.$row['id'], |
|
243 | 243 | $row['name'], |
244 | 244 | '', |
245 | 245 | '', |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | |
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | -if($modx->hasPermission('edit_user')) { |
|
257 | +if ($modx->hasPermission('edit_user')) { |
|
258 | 258 | $sitemenu['user_management_title'] = array( |
259 | 259 | 'user_management_title', |
260 | 260 | 'users', |
261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
261 | + '<i class="fa fa fa-user"></i>'.$_lang['user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
262 | 262 | 'index.php?a=75', |
263 | 263 | $_lang['user_management_title'], |
264 | 264 | '', |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
273 | -if($modx->hasPermission('edit_web_user')) { |
|
273 | +if ($modx->hasPermission('edit_web_user')) { |
|
274 | 274 | $sitemenu['web_user_management_title'] = array( |
275 | 275 | 'web_user_management_title', |
276 | 276 | 'users', |
277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
277 | + '<i class="fa fa-users"></i>'.$_lang['web_user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
278 | 278 | 'index.php?a=99', |
279 | 279 | $_lang['web_user_management_title'], |
280 | 280 | '', |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
289 | -if($modx->hasPermission('edit_role')) { |
|
289 | +if ($modx->hasPermission('edit_role')) { |
|
290 | 290 | $sitemenu['role_management_title'] = array( |
291 | 291 | 'role_management_title', |
292 | 292 | 'users', |
293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
293 | + '<i class="fa fa-legal"></i>'.$_lang['role_management_title'], |
|
294 | 294 | 'index.php?a=86', |
295 | 295 | $_lang['role_management_title'], |
296 | 296 | '', |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
305 | -if($modx->hasPermission('access_permissions')) { |
|
305 | +if ($modx->hasPermission('access_permissions')) { |
|
306 | 306 | $sitemenu['manager_permissions'] = array( |
307 | 307 | 'manager_permissions', |
308 | 308 | 'users', |
309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
309 | + '<i class="fa fa-male"></i>'.$_lang['manager_permissions'], |
|
310 | 310 | 'index.php?a=40', |
311 | 311 | $_lang['manager_permissions'], |
312 | 312 | '', |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | ); |
319 | 319 | } |
320 | 320 | |
321 | -if($modx->hasPermission('web_access_permissions')) { |
|
321 | +if ($modx->hasPermission('web_access_permissions')) { |
|
322 | 322 | $sitemenu['web_permissions'] = array( |
323 | 323 | 'web_permissions', |
324 | 324 | 'users', |
325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
325 | + '<i class="fa fa-universal-access"></i>'.$_lang['web_permissions'], |
|
326 | 326 | 'index.php?a=91', |
327 | 327 | $_lang['web_permissions'], |
328 | 328 | '', |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $sitemenu['refresh_site'] = array( |
340 | 340 | 'refresh_site', |
341 | 341 | 'tools', |
342 | - '<i class="fa fa-recycle"></i>' . $_lang['refresh_site'], |
|
342 | + '<i class="fa fa-recycle"></i>'.$_lang['refresh_site'], |
|
343 | 343 | 'index.php?a=26', |
344 | 344 | $_lang['refresh_site'], |
345 | 345 | '', |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | 'a', // tag |
354 | 354 | 'javascript:;', // href |
355 | 355 | 'btn btn-secondary', // class or btn-success |
356 | - 'modx.popup({url:\'index.php?a=26\', title:\'' . $_lang['refresh_site'] . '\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick |
|
356 | + 'modx.popup({url:\'index.php?a=26\', title:\''.$_lang['refresh_site'].'\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick |
|
357 | 357 | $_lang['refresh_site'], // title |
358 | 358 | '<i class="fa fa-recycle"></i>' // innerHTML |
359 | 359 | ) |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $sitemenu['search'] = array( |
364 | 364 | 'search', |
365 | 365 | 'tools', |
366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
366 | + '<i class="fa fa-search"></i>'.$_lang['search'], |
|
367 | 367 | 'index.php?a=71', |
368 | 368 | $_lang['search'], |
369 | 369 | '', |
@@ -374,11 +374,11 @@ discard block |
||
374 | 374 | '' |
375 | 375 | ); |
376 | 376 | |
377 | -if($modx->hasPermission('bk_manager')) { |
|
377 | +if ($modx->hasPermission('bk_manager')) { |
|
378 | 378 | $sitemenu['bk_manager'] = array( |
379 | 379 | 'bk_manager', |
380 | 380 | 'tools', |
381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
381 | + '<i class="fa fa-database"></i>'.$_lang['bk_manager'], |
|
382 | 382 | 'index.php?a=93', |
383 | 383 | $_lang['bk_manager'], |
384 | 384 | '', |
@@ -390,11 +390,11 @@ discard block |
||
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
393 | -if($modx->hasPermission('remove_locks')) { |
|
393 | +if ($modx->hasPermission('remove_locks')) { |
|
394 | 394 | $sitemenu['remove_locks'] = array( |
395 | 395 | 'remove_locks', |
396 | 396 | 'tools', |
397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
397 | + '<i class="fa fa-hourglass"></i>'.$_lang['remove_locks'], |
|
398 | 398 | 'javascript:modx.removeLocks();', |
399 | 399 | $_lang['remove_locks'], |
400 | 400 | '', |
@@ -406,11 +406,11 @@ discard block |
||
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
409 | -if($modx->hasPermission('import_static')) { |
|
409 | +if ($modx->hasPermission('import_static')) { |
|
410 | 410 | $sitemenu['import_site'] = array( |
411 | 411 | 'import_site', |
412 | 412 | 'tools', |
413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
413 | + '<i class="fa fa-upload"></i>'.$_lang['import_site'], |
|
414 | 414 | 'index.php?a=95', |
415 | 415 | $_lang['import_site'], |
416 | 416 | '', |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } |
424 | 424 | |
425 | -if($modx->hasPermission('export_static')) { |
|
425 | +if ($modx->hasPermission('export_static')) { |
|
426 | 426 | $sitemenu['export_site'] = array( |
427 | 427 | 'export_site', |
428 | 428 | 'tools', |
429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
429 | + '<i class="fa fa-download"></i>'.$_lang['export_site'], |
|
430 | 430 | 'index.php?a=83', |
431 | 431 | $_lang['export_site'], |
432 | 432 | '', |
@@ -439,20 +439,20 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | -if(is_array($menu)) { |
|
442 | +if (is_array($menu)) { |
|
443 | 443 | $newmenu = array(); |
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
444 | + foreach ($menu as $item) { |
|
445 | + if (is_array(unserialize($item))) { |
|
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
449 | + if (count($newmenu) > 0) $sitemenu = $newmenu; |
|
450 | 450 | } |
451 | 451 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
452 | +if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php')) { |
|
453 | + include_once(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php'); |
|
454 | 454 | } else { |
455 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
455 | + include_once(MODX_MANAGER_PATH.'includes/menu.class.inc.php'); |
|
456 | 456 | } |
457 | 457 | $menu = new EVOmenu(); |
458 | 458 | $menu->Build($sitemenu, array( |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | 'active' |
33 | 33 | ); |
34 | 34 | |
35 | -if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
35 | +if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
36 | 36 | $sitemenu['elements'] = array( |
37 | 37 | 'elements', |
38 | 38 | 'main', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | -if($modx->hasPermission('exec_module')) { |
|
51 | +if($modx->hasPermission('exec_module')) { |
|
52 | 52 | $sitemenu['modules'] = array( |
53 | 53 | 'modules', |
54 | 54 | 'main', |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | -if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
67 | +if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
68 | 68 | $sitemenu['users'] = array( |
69 | 69 | 'users', |
70 | 70 | 'main', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | |
83 | -if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
83 | +if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
84 | 84 | $sitemenu['tools'] = array( |
85 | 85 | 'tools', |
86 | 86 | 'main', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | -if($modx->hasPermission('edit_template')) { |
|
100 | +if($modx->hasPermission('edit_template')) { |
|
101 | 101 | $sitemenu['element_templates'] = array( |
102 | 102 | 'element_templates', |
103 | 103 | 'elements', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'dropdown-toggle' |
113 | 113 | ); |
114 | 114 | } |
115 | -if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
115 | +if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
116 | 116 | $sitemenu['element_tplvars'] = array( |
117 | 117 | 'element_tplvars', |
118 | 118 | 'elements', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | 'dropdown-toggle' |
128 | 128 | ); |
129 | 129 | } |
130 | -if($modx->hasPermission('edit_chunk')) { |
|
130 | +if($modx->hasPermission('edit_chunk')) { |
|
131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
132 | 132 | 'element_htmlsnippets', |
133 | 133 | 'elements', |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'dropdown-toggle' |
143 | 143 | ); |
144 | 144 | } |
145 | -if($modx->hasPermission('edit_snippet')) { |
|
145 | +if($modx->hasPermission('edit_snippet')) { |
|
146 | 146 | $sitemenu['element_snippets'] = array( |
147 | 147 | 'element_snippets', |
148 | 148 | 'elements', |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'dropdown-toggle' |
158 | 158 | ); |
159 | 159 | } |
160 | -if($modx->hasPermission('edit_plugin')) { |
|
160 | +if($modx->hasPermission('edit_plugin')) { |
|
161 | 161 | $sitemenu['element_plugins'] = array( |
162 | 162 | 'element_plugins', |
163 | 163 | 'elements', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | -if($modx->hasPermission('file_manager')) { |
|
177 | +if($modx->hasPermission('file_manager')) { |
|
178 | 178 | $sitemenu['manage_files'] = array( |
179 | 179 | 'manage_files', |
180 | 180 | 'elements', |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | '' |
190 | 190 | ); |
191 | 191 | } |
192 | -if($modx->hasPermission('category_manager')) { |
|
192 | +if($modx->hasPermission('category_manager')) { |
|
193 | 193 | $sitemenu['manage_categories'] = array( |
194 | 194 | 'manage_categories', |
195 | 195 | 'elements', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
209 | +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
210 | 210 | $sitemenu['new_module'] = array( |
211 | 211 | 'new_module', |
212 | 212 | 'modules', |
@@ -222,19 +222,19 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | -if($modx->hasPermission('exec_module')) { |
|
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
225 | +if($modx->hasPermission('exec_module')) { |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | 227 | $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
233 | + } else { |
|
234 | 234 | $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->db->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->db->getRow($rs)) { |
|
236 | + if($modx->db->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->db->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | -if($modx->hasPermission('edit_user')) { |
|
257 | +if($modx->hasPermission('edit_user')) { |
|
258 | 258 | $sitemenu['user_management_title'] = array( |
259 | 259 | 'user_management_title', |
260 | 260 | 'users', |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
273 | -if($modx->hasPermission('edit_web_user')) { |
|
273 | +if($modx->hasPermission('edit_web_user')) { |
|
274 | 274 | $sitemenu['web_user_management_title'] = array( |
275 | 275 | 'web_user_management_title', |
276 | 276 | 'users', |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
289 | -if($modx->hasPermission('edit_role')) { |
|
289 | +if($modx->hasPermission('edit_role')) { |
|
290 | 290 | $sitemenu['role_management_title'] = array( |
291 | 291 | 'role_management_title', |
292 | 292 | 'users', |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
305 | -if($modx->hasPermission('access_permissions')) { |
|
305 | +if($modx->hasPermission('access_permissions')) { |
|
306 | 306 | $sitemenu['manager_permissions'] = array( |
307 | 307 | 'manager_permissions', |
308 | 308 | 'users', |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ); |
319 | 319 | } |
320 | 320 | |
321 | -if($modx->hasPermission('web_access_permissions')) { |
|
321 | +if($modx->hasPermission('web_access_permissions')) { |
|
322 | 322 | $sitemenu['web_permissions'] = array( |
323 | 323 | 'web_permissions', |
324 | 324 | 'users', |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | '' |
375 | 375 | ); |
376 | 376 | |
377 | -if($modx->hasPermission('bk_manager')) { |
|
377 | +if($modx->hasPermission('bk_manager')) { |
|
378 | 378 | $sitemenu['bk_manager'] = array( |
379 | 379 | 'bk_manager', |
380 | 380 | 'tools', |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
393 | -if($modx->hasPermission('remove_locks')) { |
|
393 | +if($modx->hasPermission('remove_locks')) { |
|
394 | 394 | $sitemenu['remove_locks'] = array( |
395 | 395 | 'remove_locks', |
396 | 396 | 'tools', |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
409 | -if($modx->hasPermission('import_static')) { |
|
409 | +if($modx->hasPermission('import_static')) { |
|
410 | 410 | $sitemenu['import_site'] = array( |
411 | 411 | 'import_site', |
412 | 412 | 'tools', |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } |
424 | 424 | |
425 | -if($modx->hasPermission('export_static')) { |
|
425 | +if($modx->hasPermission('export_static')) { |
|
426 | 426 | $sitemenu['export_site'] = array( |
427 | 427 | 'export_site', |
428 | 428 | 'tools', |
@@ -439,19 +439,21 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | -if(is_array($menu)) { |
|
442 | +if(is_array($menu)) { |
|
443 | 443 | $newmenu = array(); |
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
444 | + foreach($menu as $item) { |
|
445 | + if(is_array(unserialize($item))) { |
|
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | -} |
|
449 | + if(count($newmenu)> 0) { |
|
450 | + $sitemenu = $newmenu; |
|
451 | + } |
|
452 | + } |
|
451 | 453 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
454 | +if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | 455 | include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
454 | -} else { |
|
456 | +} else { |
|
455 | 457 | include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
456 | 458 | } |
457 | 459 | $menu = new EVOmenu(); |
@@ -1,12 +1,12 @@ 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 | |
6 | 6 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | 8 | if(is_array($evtOut)) { |
9 | - echo implode("\n", $evtOut); |
|
9 | + echo implode("\n", $evtOut); |
|
10 | 10 | } |
11 | 11 | ?> |
12 | 12 | |
@@ -52,23 +52,23 @@ discard block |
||
52 | 52 | |
53 | 53 | <div id="treeHolder"> |
54 | 54 | <?php |
55 | - // invoke OnManagerTreePrerender event |
|
56 | - $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); |
|
57 | - if(is_array($evtOut)) { |
|
58 | - echo implode("\n", $evtOut); |
|
59 | - } |
|
60 | - ?> |
|
55 | + // invoke OnManagerTreePrerender event |
|
56 | + $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); |
|
57 | + if(is_array($evtOut)) { |
|
58 | + echo implode("\n", $evtOut); |
|
59 | + } |
|
60 | + ?> |
|
61 | 61 | <div id="node0" class="rootNode"><a class="node" onclick="modx.tree.treeAction(event, 0)" data-id="0" data-title-esc="<?php $site_name = htmlspecialchars($site_name, ENT_QUOTES, $modx->config['modx_charset']); |
62 | - echo $site_name; ?>"><span class="icon"><?php echo $_style['tree_showtree']; ?></span><span class="title"><?php echo $site_name; ?></span></a> |
|
62 | + echo $site_name; ?>"><span class="icon"><?php echo $_style['tree_showtree']; ?></span><span class="title"><?php echo $site_name; ?></span></a> |
|
63 | 63 | <div id="treeloader"><i class="fa fa-cog fa-spin fa-3x fa-fw"></i></div> |
64 | 64 | </div> |
65 | 65 | <div id="treeRoot"></div> |
66 | 66 | <?php |
67 | - // invoke OnManagerTreeRender event |
|
68 | - $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); |
|
69 | - if(is_array($evtOut)) { |
|
70 | - echo implode("\n", $evtOut); |
|
71 | - } |
|
72 | - ?> |
|
67 | + // invoke OnManagerTreeRender event |
|
68 | + $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); |
|
69 | + if(is_array($evtOut)) { |
|
70 | + echo implode("\n", $evtOut); |
|
71 | + } |
|
72 | + ?> |
|
73 | 73 | </div> |
74 | 74 | </div> |
@@ -1,11 +1,11 @@ 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 | |
6 | 6 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | -if(is_array($evtOut)) { |
|
8 | +if (is_array($evtOut)) { |
|
9 | 9 | echo implode("\n", $evtOut); |
10 | 10 | } |
11 | 11 | ?> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | <a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><?php echo $_style['collapse_tree']; ?></a> |
19 | 19 | |
20 | - <?php if($modx->hasPermission('new_document')) { ?> |
|
20 | + <?php if ($modx->hasPermission('new_document')) { ?> |
|
21 | 21 | <a class="treeButton" id="treeMenu_addresource" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=4', title: '<?php echo $_lang['add_resource']; ?>'});" title="<?php echo $_lang['add_resource']; ?>"><?php echo $_style['add_doc_tree']; ?></a> |
22 | 22 | <a class="treeButton" id="treeMenu_addweblink" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=72', title: '<?php echo $_lang['add_weblink']; ?>'});" title="<?php echo $_lang['add_weblink']; ?>"><?php echo $_style['add_weblink_tree']; ?></a> |
23 | 23 | <?php } ?> |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | |
27 | 27 | <a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><?php echo $_style['sort_tree']; ?></a> |
28 | 28 | |
29 | - <?php if($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
29 | + <?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
30 | 30 | <a class="treeButton" id="treeMenu_sortingindex" onclick="modx.tabs({url: '<?= MODX_MANAGER_URL ?>?a=56&id=0', title: '<?php echo $_lang['sort_menuindex']; ?>'});" title="<?php echo $_lang['sort_menuindex']; ?>"><?php echo $_style['sort_menuindex']; ?></a> |
31 | 31 | <?php } ?> |
32 | 32 | |
33 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | - <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
33 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | + <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
35 | 35 | <?php } ?> |
36 | 36 | |
37 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | - <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
37 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | + <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
39 | 39 | <?php } ?> |
40 | 40 | |
41 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | - <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
41 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | + <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
43 | 43 | <?php } ?> |
44 | 44 | |
45 | - <?php if($modx->hasPermission('empty_trash')) { ?> |
|
45 | + <?php if ($modx->hasPermission('empty_trash')) { ?> |
|
46 | 46 | <a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><?php echo $_style['empty_recycle_bin_empty']; ?></a> |
47 | 47 | <?php } ?> |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <?php |
55 | 55 | // invoke OnManagerTreePrerender event |
56 | 56 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); |
57 | - if(is_array($evtOut)) { |
|
57 | + if (is_array($evtOut)) { |
|
58 | 58 | echo implode("\n", $evtOut); |
59 | 59 | } |
60 | 60 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <?php |
67 | 67 | // invoke OnManagerTreeRender event |
68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); |
69 | - if(is_array($evtOut)) { |
|
69 | + if (is_array($evtOut)) { |
|
70 | 70 | echo implode("\n", $evtOut); |
71 | 71 | } |
72 | 72 | ?> |
@@ -1,11 +1,11 @@ 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 | |
6 | 6 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | -if(is_array($evtOut)) { |
|
8 | +if(is_array($evtOut)) { |
|
9 | 9 | echo implode("\n", $evtOut); |
10 | 10 | } |
11 | 11 | ?> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <?php |
55 | 55 | // invoke OnManagerTreePrerender event |
56 | 56 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); |
57 | - if(is_array($evtOut)) { |
|
57 | + if(is_array($evtOut)) { |
|
58 | 58 | echo implode("\n", $evtOut); |
59 | 59 | } |
60 | 60 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <?php |
67 | 67 | // invoke OnManagerTreeRender event |
68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); |
69 | - if(is_array($evtOut)) { |
|
69 | + if(is_array($evtOut)) { |
|
70 | 70 | echo implode("\n", $evtOut); |
71 | 71 | } |
72 | 72 | ?> |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | class DATEPICKER { |
4 | - function __construct() { |
|
5 | - } |
|
4 | + function __construct() { |
|
5 | + } |
|
6 | 6 | |
7 | - function getDP() { |
|
8 | - global $modx, $_lang; |
|
7 | + function getDP() { |
|
8 | + global $modx, $_lang; |
|
9 | 9 | |
10 | - $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
11 | - return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | - } |
|
10 | + $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
11 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | + } |
|
13 | 13 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER { |
|
4 | - function __construct() { |
|
3 | +class DATEPICKER{ |
|
4 | + function __construct(){ |
|
5 | 5 | } |
6 | 6 | |
7 | - function getDP() { |
|
7 | + function getDP(){ |
|
8 | 8 | global $modx, $_lang; |
9 | 9 | |
10 | - $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
10 | + $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
|
11 | 11 | return $modx->parseText($tpl, $_lang, '[%', '%]'); |
12 | 12 | } |
13 | 13 | } |
@@ -1,10 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER { |
|
4 | - function __construct() { |
|
3 | +class DATEPICKER |
|
4 | +{ |
|
5 | + function __construct() |
|
6 | + { |
|
5 | 7 | } |
6 | 8 | |
7 | - function getDP() { |
|
9 | + function getDP() |
|
10 | + { |
|
8 | 11 | global $modx, $_lang; |
9 | 12 | |
10 | 13 | $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc Image detection class |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.54 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010-2014 KCFinder Project |
|
10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | - * @link http://kcfinder.sunhater.com |
|
13 | - */ |
|
4 | + * |
|
5 | + * @desc Image detection class |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.54 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010-2014 KCFinder Project |
|
10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | + * @link http://kcfinder.sunhater.com |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class type_img { |
16 | 16 |
@@ -12,9 +12,9 @@ |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class type_img { |
|
15 | +class type_img{ |
|
16 | 16 | |
17 | - public function checkFile($file, array $config) { |
|
17 | + public function checkFile($file, array $config){ |
|
18 | 18 | |
19 | 19 | $driver = isset($config['imageDriversPriority']) |
20 | 20 | ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd"; |
@@ -12,17 +12,20 @@ |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class type_img { |
|
15 | +class type_img |
|
16 | +{ |
|
16 | 17 | |
17 | - public function checkFile($file, array $config) { |
|
18 | + public function checkFile($file, array $config) |
|
19 | + { |
|
18 | 20 | |
19 | 21 | $driver = isset($config['imageDriversPriority']) |
20 | 22 | ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd"; |
21 | 23 | |
22 | 24 | $img = image::factory($driver, $file); |
23 | 25 | |
24 | - if ($img->initError) |
|
25 | - return "Unknown image format/encoding."; |
|
26 | + if ($img->initError) { |
|
27 | + return "Unknown image format/encoding."; |
|
28 | + } |
|
26 | 29 | |
27 | 30 | return true; |
28 | 31 | } |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc MIME type detection class |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.54 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010-2014 KCFinder Project |
|
10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | - * @link http://kcfinder.sunhater.com |
|
13 | - */ |
|
4 | + * |
|
5 | + * @desc MIME type detection class |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.54 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010-2014 KCFinder Project |
|
10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | + * @link http://kcfinder.sunhater.com |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class type_mime { |
16 | 16 |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class type_mime { |
|
15 | +class type_mime{ |
|
16 | 16 | |
17 | - public function checkFile($file, array $config) { |
|
17 | + public function checkFile($file, array $config){ |
|
18 | 18 | if (!class_exists("finfo")) |
19 | 19 | return "Fileinfo PECL extension is missing."; |
20 | 20 | |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | $mimes = $config['params']; |
34 | 34 | if (substr($mimes, 0, 1) == "!") { |
35 | 35 | $mimes = trim(substr($mimes, 1)); |
36 | - return in_array($type , explode(" ", $mimes)) |
|
36 | + return in_array($type, explode(" ", $mimes)) |
|
37 | 37 | ? "You can't upload such files." |
38 | 38 | : true; |
39 | 39 | } |
40 | 40 | |
41 | - return !in_array($type , explode(" ", $mimes)) |
|
41 | + return !in_array($type, explode(" ", $mimes)) |
|
42 | 42 | ? "You can't upload such files." |
43 | 43 | : true; |
44 | 44 | } |
@@ -12,20 +12,25 @@ |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class type_mime { |
|
15 | +class type_mime |
|
16 | +{ |
|
16 | 17 | |
17 | - public function checkFile($file, array $config) { |
|
18 | - if (!class_exists("finfo")) |
|
19 | - return "Fileinfo PECL extension is missing."; |
|
18 | + public function checkFile($file, array $config) |
|
19 | + { |
|
20 | + if (!class_exists("finfo")) { |
|
21 | + return "Fileinfo PECL extension is missing."; |
|
22 | + } |
|
20 | 23 | |
21 | - if (!isset($config['params'])) |
|
22 | - return "Undefined MIME types."; |
|
24 | + if (!isset($config['params'])) { |
|
25 | + return "Undefined MIME types."; |
|
26 | + } |
|
23 | 27 | |
24 | 28 | $finfo = strlen($config['mime_magic']) |
25 | 29 | ? new finfo(FILEINFO_MIME, $config['mime_magic']) |
26 | 30 | : new finfo(FILEINFO_MIME); |
27 | - if (!$finfo) |
|
28 | - return "Opening fileinfo database failed."; |
|
31 | + if (!$finfo) { |
|
32 | + return "Opening fileinfo database failed."; |
|
33 | + } |
|
29 | 34 | |
30 | 35 | $type = $finfo->file($file); |
31 | 36 | $type = substr($type, 0, strrpos($type, ";")); |