@@ -7,10 +7,10 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | // invoke OnBeforeManagerLogout event |
| 9 | 9 | $modx->invokeEvent("OnBeforeManagerLogout", |
| 10 | - array( |
|
| 11 | - "userid" => $internalKey, |
|
| 12 | - "username" => $username |
|
| 13 | - )); |
|
| 10 | + array( |
|
| 11 | + "userid" => $internalKey, |
|
| 12 | + "username" => $username |
|
| 13 | + )); |
|
| 14 | 14 | |
| 15 | 15 | //// Unset all of the session variables. |
| 16 | 16 | //$_SESSION = array(); |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | // invoke OnManagerLogout event |
| 35 | 35 | $modx->invokeEvent("OnManagerLogout", |
| 36 | - array( |
|
| 37 | - "userid" => $internalKey, |
|
| 38 | - "username" => $username |
|
| 39 | - )); |
|
| 36 | + array( |
|
| 37 | + "userid" => $internalKey, |
|
| 38 | + "username" => $username |
|
| 39 | + )); |
|
| 40 | 40 | |
| 41 | 41 | // show login screen |
| 42 | 42 | header('Location: ' . MODX_MANAGER_URL); |
@@ -2,43 +2,43 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | class udperms{ |
| 4 | 4 | |
| 5 | - var $user; |
|
| 6 | - var $document; |
|
| 7 | - var $role; |
|
| 8 | - var $duplicateDoc = false; |
|
| 5 | + var $user; |
|
| 6 | + var $document; |
|
| 7 | + var $role; |
|
| 8 | + var $duplicateDoc = false; |
|
| 9 | 9 | |
| 10 | - function checkPermissions() { |
|
| 10 | + function checkPermissions() { |
|
| 11 | 11 | |
| 12 | - global $udperms_allowroot; |
|
| 13 | - global $modx; |
|
| 12 | + global $udperms_allowroot; |
|
| 13 | + global $modx; |
|
| 14 | 14 | |
| 15 | - $tblsc = $modx->getFullTableName('site_content'); |
|
| 16 | - $tbldg = $modx->getFullTableName('document_groups'); |
|
| 17 | - $tbldgn = $modx->getFullTableName('documentgroup_names'); |
|
| 15 | + $tblsc = $modx->getFullTableName('site_content'); |
|
| 16 | + $tbldg = $modx->getFullTableName('document_groups'); |
|
| 17 | + $tbldgn = $modx->getFullTableName('documentgroup_names'); |
|
| 18 | 18 | |
| 19 | - $document = $this->document; |
|
| 20 | - $role = $this->role; |
|
| 19 | + $document = $this->document; |
|
| 20 | + $role = $this->role; |
|
| 21 | 21 | |
| 22 | - if($role==1) { |
|
| 23 | - return true; // administrator - grant all document permissions |
|
| 24 | - } |
|
| 22 | + if($role==1) { |
|
| 23 | + return true; // administrator - grant all document permissions |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - if($modx->config['use_udperms']==0 || $modx->config['use_udperms']=="" || !isset($modx->config['use_udperms'])) { |
|
| 27 | - return true; // permissions aren't in use |
|
| 28 | - } |
|
| 26 | + if($modx->config['use_udperms']==0 || $modx->config['use_udperms']=="" || !isset($modx->config['use_udperms'])) { |
|
| 27 | + return true; // permissions aren't in use |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - $parent = $modx->db->getValue($modx->db->select('parent', $tblsc, "id='{$this->document}'")); |
|
| 31 | - if($document == 0 && $parent == NULL && $udperms_allowroot == 1) return true; // User is allowed to create new document in root |
|
| 32 | - if (($this->duplicateDoc==true || $document==0) && $parent==0 && $udperms_allowroot==0) { |
|
| 33 | - return false; // deny duplicate || create new document at root if Allow Root is No |
|
| 34 | - } |
|
| 30 | + $parent = $modx->db->getValue($modx->db->select('parent', $tblsc, "id='{$this->document}'")); |
|
| 31 | + if($document == 0 && $parent == NULL && $udperms_allowroot == 1) return true; // User is allowed to create new document in root |
|
| 32 | + if (($this->duplicateDoc==true || $document==0) && $parent==0 && $udperms_allowroot==0) { |
|
| 33 | + return false; // deny duplicate || create new document at root if Allow Root is No |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - // get document groups for current user |
|
| 37 | - if($_SESSION['mgrDocgroups']) { |
|
| 38 | - $docgrp = implode(" || dg.document_group = ",$_SESSION['mgrDocgroups']); |
|
| 39 | - } |
|
| 36 | + // get document groups for current user |
|
| 37 | + if($_SESSION['mgrDocgroups']) { |
|
| 38 | + $docgrp = implode(" || dg.document_group = ",$_SESSION['mgrDocgroups']); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /* Note: |
|
| 41 | + /* Note: |
|
| 42 | 42 | A document is flagged as private whenever the document group that it |
| 43 | 43 | belongs to is assigned or links to a user group. In other words if |
| 44 | 44 | the document is assigned to a document group that is not yet linked |
@@ -46,18 +46,18 @@ discard block |
||
| 46 | 46 | are private to the manager users will not be private to web users if the |
| 47 | 47 | document group is not assigned to a web user group and visa versa. |
| 48 | 48 | */ |
| 49 | - $permissionsok = false; // set permissions to false |
|
| 49 | + $permissionsok = false; // set permissions to false |
|
| 50 | 50 | |
| 51 | - $rs = $modx->db->select( |
|
| 52 | - 'count(DISTINCT sc.id)', |
|
| 53 | - "{$tblsc} AS sc |
|
| 51 | + $rs = $modx->db->select( |
|
| 52 | + 'count(DISTINCT sc.id)', |
|
| 53 | + "{$tblsc} AS sc |
|
| 54 | 54 | LEFT JOIN {$tbldg} AS dg on dg.document = sc.id |
| 55 | 55 | LEFT JOIN {$tbldgn} dgn ON dgn.id = dg.document_group", |
| 56 | - "sc.id='{$this->document}' AND (". ( (!$docgrp) ? null : "dg.document_group = ".$docgrp." ||" ) . " sc.privatemgr = 0)" |
|
| 57 | - ); |
|
| 58 | - $limit = $modx->db->getValue($rs); |
|
| 59 | - if($limit==1) $permissionsok = true; |
|
| 56 | + "sc.id='{$this->document}' AND (". ( (!$docgrp) ? null : "dg.document_group = ".$docgrp." ||" ) . " sc.privatemgr = 0)" |
|
| 57 | + ); |
|
| 58 | + $limit = $modx->db->getValue($rs); |
|
| 59 | + if($limit==1) $permissionsok = true; |
|
| 60 | 60 | |
| 61 | - return $permissionsok; |
|
| 62 | - } |
|
| 61 | + return $permissionsok; |
|
| 62 | + } |
|
| 63 | 63 | } |
@@ -16,24 +16,24 @@ |
||
| 16 | 16 | $pth = dirname(dirname(dirname(__FILE__)))."/install/"; |
| 17 | 17 | $pth = str_replace("\\","/",$pth); |
| 18 | 18 | if(isset($_GET["rminstall"])) { |
| 19 | - if(is_dir($pth)) { |
|
| 20 | - if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; |
|
| 21 | - } |
|
| 19 | + if(is_dir($pth)) { |
|
| 20 | + if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | if($msg) echo "<script>alert('".addslashes($msg)."');</script>"; |
| 24 | 24 | echo "<script>window.location='../index.php?a=2';</script>"; |
| 25 | 25 | |
| 26 | 26 | // rmdirRecursive - detects symbollic links on unix |
| 27 | 27 | function rmdirRecursive($path,$followLinks=false) { |
| 28 | - $dir = opendir($path) ; |
|
| 29 | - while ($entry = readdir($dir)) { |
|
| 30 | - if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { |
|
| 31 | - @unlink( "$path/$entry" ); |
|
| 32 | - } |
|
| 33 | - elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { |
|
| 34 | - rmdirRecursive("$path/$entry"); // recursive |
|
| 35 | - } |
|
| 36 | - } |
|
| 37 | - closedir($dir); |
|
| 38 | - return @rmdir($path); |
|
| 28 | + $dir = opendir($path) ; |
|
| 29 | + while ($entry = readdir($dir)) { |
|
| 30 | + if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { |
|
| 31 | + @unlink( "$path/$entry" ); |
|
| 32 | + } |
|
| 33 | + elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { |
|
| 34 | + rmdirRecursive("$path/$entry"); // recursive |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | + closedir($dir); |
|
| 38 | + return @rmdir($path); |
|
| 39 | 39 | } |
@@ -491,7 +491,7 @@ |
||
| 491 | 491 | }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
| 492 | 492 | $publishedon = $pub_date; |
| 493 | 493 | $publishedby = $modx->getLoginUserID(); |
| 494 | - }elseif ($was_published && !$published) { |
|
| 494 | + }elseif ($was_published && !$published) { |
|
| 495 | 495 | $publishedon = 0; |
| 496 | 496 | $publishedby = 0; |
| 497 | 497 | } else { |
@@ -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 | } |
@@ -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") { ?>
|
@@ -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' => '' |
@@ -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,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 | |