@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | { |
7 | 7 | public $db = ''; |
8 | 8 | public $db_tbl = array(); |
9 | - public $elements = array( 'templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules' ); |
|
9 | + public $elements = array('templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules'); |
|
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | $this->db = & $modx->db; |
16 | 16 | $this->db_tbl['categories'] = $modx->getFullTableName('categories'); |
17 | 17 | |
18 | - foreach( $this->elements as $element ) |
|
18 | + foreach ($this->elements as $element) |
|
19 | 19 | { |
20 | - $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); |
|
20 | + $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element); |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
@@ -37,54 +37,54 @@ discard block |
||
37 | 37 | ) |
38 | 38 | ); |
39 | 39 | |
40 | - if( !empty( $categories ) ) |
|
40 | + if (!empty($categories)) |
|
41 | 41 | { |
42 | 42 | return $categories; |
43 | 43 | } |
44 | 44 | return false; |
45 | 45 | } |
46 | 46 | |
47 | - public function getCategory( $search, $where = 'category' ) |
|
47 | + public function getCategory($search, $where = 'category') |
|
48 | 48 | { |
49 | 49 | $category = $this->db->getRow( |
50 | 50 | $this->db->select( |
51 | 51 | '*', |
52 | 52 | $this->db_tbl['categories'], |
53 | - "`" . $where . "` = '" . $search . "'" |
|
53 | + "`".$where."` = '".$search."'" |
|
54 | 54 | ) |
55 | 55 | ); |
56 | 56 | return $category; |
57 | 57 | } |
58 | 58 | |
59 | - public function getCategoryValue( $value, $search, $where = 'category' ) |
|
59 | + public function getCategoryValue($value, $search, $where = 'category') |
|
60 | 60 | { |
61 | 61 | $_value = $this->db->getValue( |
62 | 62 | $this->db->select( |
63 | - '`' . $value . '`', |
|
63 | + '`'.$value.'`', |
|
64 | 64 | $this->db_tbl['categories'], |
65 | - "`" . $where . "` = '" . $search . "'" |
|
65 | + "`".$where."` = '".$search."'" |
|
66 | 66 | ) |
67 | 67 | ); |
68 | 68 | return $_value; |
69 | 69 | } |
70 | 70 | |
71 | - public function getAssignedElements( $category_id, $element ) |
|
71 | + public function getAssignedElements($category_id, $element) |
|
72 | 72 | { |
73 | - if( in_array( $element, $this->elements, true ) ) |
|
73 | + if (in_array($element, $this->elements, true)) |
|
74 | 74 | { |
75 | 75 | $elements = $this->db->makeArray( |
76 | 76 | $this->db->select( |
77 | 77 | '*', |
78 | 78 | $this->db_tbl[$element], |
79 | - "`category` = '" . $category_id . "'" |
|
79 | + "`category` = '".$category_id."'" |
|
80 | 80 | ) |
81 | 81 | ); |
82 | 82 | |
83 | 83 | // correct the name of templates |
84 | - if( $element === 'templates' ) |
|
84 | + if ($element === 'templates') |
|
85 | 85 | { |
86 | 86 | $_elements_count = count($elements); |
87 | - for( $i=0; $i < $_elements_count; $i++ ) |
|
87 | + for ($i = 0; $i < $_elements_count; $i++) |
|
88 | 88 | { |
89 | 89 | $elements[$i]['name'] = $elements[$i]['templatename']; |
90 | 90 | } |
@@ -94,56 +94,56 @@ discard block |
||
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | |
97 | - public function getAllAssignedElements( $category_id ) |
|
97 | + public function getAllAssignedElements($category_id) |
|
98 | 98 | { |
99 | 99 | $elements = array(); |
100 | - foreach( $this->elements as $element ) |
|
100 | + foreach ($this->elements as $element) |
|
101 | 101 | { |
102 | - $elements[$element] = $this->getAssignedElements( $category_id, $element ); |
|
102 | + $elements[$element] = $this->getAssignedElements($category_id, $element); |
|
103 | 103 | } |
104 | 104 | return $elements; |
105 | 105 | } |
106 | 106 | |
107 | - public function deleteCategory( $category_id ) |
|
107 | + public function deleteCategory($category_id) |
|
108 | 108 | { |
109 | 109 | $_update = array('category' => 0); |
110 | - foreach( $this->elements as $element ) |
|
110 | + foreach ($this->elements as $element) |
|
111 | 111 | { |
112 | 112 | $this->db->update( |
113 | 113 | $_update, |
114 | 114 | $this->db_tbl[$element], |
115 | - "`category` = '" . $category_id . "'" |
|
115 | + "`category` = '".$category_id."'" |
|
116 | 116 | ); |
117 | 117 | } |
118 | 118 | |
119 | 119 | $this->db->delete( |
120 | 120 | $this->db_tbl['categories'], |
121 | - "`id` = '" . $category_id . "'" |
|
121 | + "`id` = '".$category_id."'" |
|
122 | 122 | ); |
123 | 123 | |
124 | 124 | return $this->db->getAffectedRows() === 1; |
125 | 125 | } |
126 | 126 | |
127 | - public function updateCategory( $category_id, $data = array() ) |
|
127 | + public function updateCategory($category_id, $data = array()) |
|
128 | 128 | { |
129 | - if( empty( $data ) |
|
130 | - || empty( $category_id ) ) |
|
129 | + if (empty($data) |
|
130 | + || empty($category_id)) |
|
131 | 131 | { |
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | |
135 | 135 | $_update = array( |
136 | - 'category' => $this->db->escape( $data['category'] ), |
|
137 | - 'rank' => (int)$data['rank'] |
|
136 | + 'category' => $this->db->escape($data['category']), |
|
137 | + 'rank' => (int) $data['rank'] |
|
138 | 138 | ); |
139 | 139 | |
140 | 140 | $this->db->update( |
141 | 141 | $_update, |
142 | 142 | $this->db_tbl['categories'], |
143 | - "`id` = '" . (int)$category_id . "'" |
|
143 | + "`id` = '".(int) $category_id."'" |
|
144 | 144 | ); |
145 | 145 | |
146 | - if( $this->db->getAffectedRows() === 1 ) |
|
146 | + if ($this->db->getAffectedRows() === 1) |
|
147 | 147 | { |
148 | 148 | return true; |
149 | 149 | } |
@@ -151,16 +151,16 @@ discard block |
||
151 | 151 | return false; |
152 | 152 | } |
153 | 153 | |
154 | - public function addCategory( $category_name, $category_rank ) |
|
154 | + public function addCategory($category_name, $category_rank) |
|
155 | 155 | { |
156 | - if( $this->isCategoryExists( $category_name ) ) |
|
156 | + if ($this->isCategoryExists($category_name)) |
|
157 | 157 | { |
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | |
161 | 161 | $_insert = array( |
162 | - 'category' => $this->db->escape( $category_name ), |
|
163 | - 'rank' => (int)$category_rank |
|
162 | + 'category' => $this->db->escape($category_name), |
|
163 | + 'rank' => (int) $category_rank |
|
164 | 164 | ); |
165 | 165 | |
166 | 166 | $this->db->insert( |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $this->db_tbl['categories'] |
169 | 169 | ); |
170 | 170 | |
171 | - if( $this->db->getAffectedRows() === 1 ) |
|
171 | + if ($this->db->getAffectedRows() === 1) |
|
172 | 172 | { |
173 | 173 | return $this->db->getInsertId(); |
174 | 174 | } |
@@ -176,19 +176,19 @@ discard block |
||
176 | 176 | return false; |
177 | 177 | } |
178 | 178 | |
179 | - public function isCategoryExists( $category_name ) |
|
179 | + public function isCategoryExists($category_name) |
|
180 | 180 | { |
181 | - $category = $this->db->escape( $category_name ); |
|
181 | + $category = $this->db->escape($category_name); |
|
182 | 182 | |
183 | 183 | $category_id = $this->db->getValue( |
184 | 184 | $this->db->select( |
185 | 185 | '`id`', |
186 | 186 | $this->db_tbl['categories'], |
187 | - "`category` = '" . $category . "'" |
|
187 | + "`category` = '".$category."'" |
|
188 | 188 | ) |
189 | 189 | ); |
190 | 190 | |
191 | - if( $this->db->getAffectedRows() === 1 ) |
|
191 | + if ($this->db->getAffectedRows() === 1) |
|
192 | 192 | { |
193 | 193 | return $category_id; |
194 | 194 | } |
@@ -1,17 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('view_eventlog')) { |
|
5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // get id |
10 | 10 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
11 | 11 | |
12 | -$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log") . " el |
|
13 | - LEFT JOIN " . $modx->getFullTableName("manager_users") . " mu ON mu.id=el.user AND el.usertype=0 |
|
14 | - LEFT JOIN " . $modx->getFullTableName("web_users") . " wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
12 | +$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log")." el |
|
13 | + LEFT JOIN " . $modx->getFullTableName("manager_users")." mu ON mu.id=el.user AND el.usertype=0 |
|
14 | + LEFT JOIN " . $modx->getFullTableName("web_users")." wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
15 | 15 | $content = $modx->db->getRow($ds); |
16 | 16 | |
17 | 17 | ?> |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | <div class="container container-body"> |
43 | 43 | <?php |
44 | 44 | $date = $modx->toDateFormat($content["createdon"]); |
45 | - if($content["type"] == 1) { |
|
46 | - $icon = $_style['actions_info'] . ' text-info'; |
|
45 | + if ($content["type"] == 1) { |
|
46 | + $icon = $_style['actions_info'].' text-info'; |
|
47 | 47 | $msgtype = $_lang["information"]; |
48 | - } else if($content["type"] == 2) { |
|
49 | - $icon = $_style['actions_triangle'] . ' text-warning'; |
|
48 | + } else if ($content["type"] == 2) { |
|
49 | + $icon = $_style['actions_triangle'].' text-warning'; |
|
50 | 50 | $msgtype = $_lang["warning"]; |
51 | - } else if($content["type"] == 3) { |
|
52 | - $icon = $_style['actions_error'] . ' text-danger'; |
|
51 | + } else if ($content["type"] == 3) { |
|
52 | + $icon = $_style['actions_error'].' text-danger'; |
|
53 | 53 | $msgtype = $_lang["error"]; |
54 | 54 | } |
55 | 55 | ?> |
56 | - <p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p> |
|
56 | + <p><b><?= $content['source']." - ".$_lang['eventlog_viewer'] ?></b></p> |
|
57 | 57 | <p> |
58 | 58 | <i class="<?= $icon ?>"></i> <?= $msgtype ?> |
59 | 59 | </p> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || 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 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | '999' => 'Viewing test page', |
135 | 135 | ); |
136 | 136 | |
137 | -function getAction($actionId, $itemid='') { |
|
137 | +function getAction($actionId, $itemid = ''){ |
|
138 | 138 | global $action_list; |
139 | 139 | |
140 | 140 | $ret = sprintf($action_list[$actionId], $itemid); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { |
|
2 | +if ((!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited."); |
4 | 4 | } |
5 | 5 | $tmpArray = array(); |
@@ -1,43 +1,43 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $this->old = new OldFunctions(); |
3 | -class OldFunctions { |
|
3 | +class OldFunctions{ |
|
4 | 4 | |
5 | - function dbConnect() {global $modx; $modx->db->connect();$modx->rs = $modx->db->conn;} |
|
6 | - function dbQuery($sql) {global $modx;return $modx->db->query($sql);} |
|
7 | - function recordCount($rs) {global $modx;return $modx->db->getRecordCount($rs);} |
|
8 | - function fetchRow($rs,$mode='assoc') {global $modx;return $modx->db->getRow($rs, $mode);} |
|
9 | - function affectedRows($rs) {global $modx;return $modx->db->getAffectedRows($rs);} |
|
10 | - function insertId($rs) {global $modx;return $modx->db->getInsertId($rs);} |
|
11 | - function dbClose() {global $modx; $modx->db->disconnect();} |
|
5 | + function dbConnect(){global $modx; $modx->db->connect(); $modx->rs = $modx->db->conn; } |
|
6 | + function dbQuery($sql){global $modx; return $modx->db->query($sql); } |
|
7 | + function recordCount($rs){global $modx; return $modx->db->getRecordCount($rs); } |
|
8 | + function fetchRow($rs, $mode = 'assoc'){global $modx; return $modx->db->getRow($rs, $mode); } |
|
9 | + function affectedRows($rs){global $modx; return $modx->db->getAffectedRows($rs); } |
|
10 | + function insertId($rs){global $modx; return $modx->db->getInsertId($rs); } |
|
11 | + function dbClose(){global $modx; $modx->db->disconnect(); } |
|
12 | 12 | |
13 | - function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) { |
|
13 | + function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = '', $ordered = false, $tablevel = 0){ |
|
14 | 14 | // first find out whether the value passed is an array |
15 | 15 | if (!is_array($array)) { |
16 | 16 | return "<ul><li>Bad list</li></ul>"; |
17 | 17 | } |
18 | 18 | if (!empty ($type)) { |
19 | - $typestr= " style='list-style-type: $type'"; |
|
19 | + $typestr = " style='list-style-type: $type'"; |
|
20 | 20 | } else { |
21 | - $typestr= ""; |
|
21 | + $typestr = ""; |
|
22 | 22 | } |
23 | - $tabs= ""; |
|
24 | - for ($i= 0; $i < $tablevel; $i++) { |
|
23 | + $tabs = ""; |
|
24 | + for ($i = 0; $i < $tablevel; $i++) { |
|
25 | 25 | $tabs .= "\t"; |
26 | 26 | } |
27 | - $listhtml= $ordered == true ? $tabs . "<ol class='$ulroot'$typestr>\n" : $tabs . "<ul class='$ulroot'$typestr>\n"; |
|
27 | + $listhtml = $ordered == true ? $tabs."<ol class='$ulroot'$typestr>\n" : $tabs."<ul class='$ulroot'$typestr>\n"; |
|
28 | 28 | foreach ($array as $key => $value) { |
29 | 29 | if (is_array($value)) { |
30 | - $listhtml .= $tabs . "\t<li>" . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, $type, $ordered, $tablevel +2) . $tabs . "\t</li>\n"; |
|
30 | + $listhtml .= $tabs."\t<li>".$key."\n".$this->makeList($value, $ulprefix.$ulroot, $ulprefix, $type, $ordered, $tablevel + 2).$tabs."\t</li>\n"; |
|
31 | 31 | } else { |
32 | - $listhtml .= $tabs . "\t<li>" . $value . "</li>\n"; |
|
32 | + $listhtml .= $tabs."\t<li>".$value."</li>\n"; |
|
33 | 33 | } |
34 | 34 | } |
35 | - $listhtml .= $ordered == true ? $tabs . "</ol>\n" : $tabs . "</ul>\n"; |
|
35 | + $listhtml .= $ordered == true ? $tabs."</ol>\n" : $tabs."</ul>\n"; |
|
36 | 36 | return $listhtml; |
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | - function getUserData() { |
|
40 | + function getUserData(){ |
|
41 | 41 | $client['ip'] = $_SERVER['REMOTE_ADDR']; |
42 | 42 | $client['ua'] = $_SERVER['HTTP_USER_AGENT']; |
43 | 43 | return $client; |
@@ -45,80 +45,80 @@ discard block |
||
45 | 45 | |
46 | 46 | # Returns true, install or interact when inside manager |
47 | 47 | // deprecated |
48 | - function insideManager() { |
|
49 | - $m= false; |
|
50 | - if( defined('IN_MANAGER_MODE') && IN_MANAGER_MODE === true) { |
|
51 | - $m= true; |
|
48 | + function insideManager(){ |
|
49 | + $m = false; |
|
50 | + if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE === true) { |
|
51 | + $m = true; |
|
52 | 52 | if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true') |
53 | - $m= "interact"; |
|
53 | + $m = "interact"; |
|
54 | 54 | else |
55 | 55 | if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true') |
56 | - $m= "install"; |
|
56 | + $m = "install"; |
|
57 | 57 | } |
58 | 58 | return $m; |
59 | 59 | } |
60 | 60 | |
61 | 61 | // deprecated |
62 | - function putChunk($chunkName) { // alias name >.< |
|
62 | + function putChunk($chunkName){ // alias name >.< |
|
63 | 63 | global $modx; |
64 | 64 | return $modx->getChunk($chunkName); |
65 | 65 | } |
66 | 66 | |
67 | - function getDocGroups() { |
|
67 | + function getDocGroups(){ |
|
68 | 68 | global $modx; |
69 | 69 | return $modx->getUserDocGroups(); |
70 | 70 | } // deprecated |
71 | 71 | |
72 | - function changePassword($o, $n) { |
|
72 | + function changePassword($o, $n){ |
|
73 | 73 | return changeWebUserPassword($o, $n); |
74 | 74 | } // deprecated |
75 | 75 | |
76 | - function userLoggedIn() { |
|
76 | + function userLoggedIn(){ |
|
77 | 77 | global $modx; |
78 | - $userdetails= array (); |
|
78 | + $userdetails = array(); |
|
79 | 79 | if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { |
80 | 80 | // web user |
81 | - $userdetails['loggedIn']= true; |
|
82 | - $userdetails['id']= $_SESSION['webInternalKey']; |
|
83 | - $userdetails['username']= $_SESSION['webShortname']; |
|
84 | - $userdetails['usertype']= 'web'; // added by Raymond |
|
81 | + $userdetails['loggedIn'] = true; |
|
82 | + $userdetails['id'] = $_SESSION['webInternalKey']; |
|
83 | + $userdetails['username'] = $_SESSION['webShortname']; |
|
84 | + $userdetails['usertype'] = 'web'; // added by Raymond |
|
85 | 85 | return $userdetails; |
86 | 86 | } else |
87 | 87 | if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { |
88 | 88 | // manager user |
89 | - $userdetails['loggedIn']= true; |
|
90 | - $userdetails['id']= $_SESSION['mgrInternalKey']; |
|
91 | - $userdetails['username']= $_SESSION['mgrShortname']; |
|
92 | - $userdetails['usertype']= 'manager'; // added by Raymond |
|
89 | + $userdetails['loggedIn'] = true; |
|
90 | + $userdetails['id'] = $_SESSION['mgrInternalKey']; |
|
91 | + $userdetails['username'] = $_SESSION['mgrShortname']; |
|
92 | + $userdetails['usertype'] = 'manager'; // added by Raymond |
|
93 | 93 | return $userdetails; |
94 | 94 | } else { |
95 | 95 | return false; |
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | - function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { |
|
99 | + function getFormVars($method = "", $prefix = "", $trim = "", $REQUEST_METHOD){ |
|
100 | 100 | // function to retrieve form results into an associative array |
101 | 101 | global $modx; |
102 | - $results= array (); |
|
103 | - $method= strtoupper($method); |
|
102 | + $results = array(); |
|
103 | + $method = strtoupper($method); |
|
104 | 104 | if ($method == "") |
105 | - $method= $REQUEST_METHOD; |
|
105 | + $method = $REQUEST_METHOD; |
|
106 | 106 | if ($method == "POST") |
107 | - $method= & $_POST; |
|
108 | - elseif ($method == "GET") $method= & $_GET; |
|
107 | + $method = & $_POST; |
|
108 | + elseif ($method == "GET") $method = & $_GET; |
|
109 | 109 | else |
110 | 110 | return false; |
111 | 111 | reset($method); |
112 | 112 | foreach ($method as $key => $value) { |
113 | 113 | if (($prefix != "") && (substr($key, 0, strlen($prefix)) == $prefix)) { |
114 | 114 | if ($trim) { |
115 | - $pieces= explode($prefix, $key, 2); |
|
116 | - $key= $pieces[1]; |
|
117 | - $results[$key]= $value; |
|
115 | + $pieces = explode($prefix, $key, 2); |
|
116 | + $key = $pieces[1]; |
|
117 | + $results[$key] = $value; |
|
118 | 118 | } else |
119 | - $results[$key]= $value; |
|
119 | + $results[$key] = $value; |
|
120 | 120 | } |
121 | - elseif ($prefix == "") $results[$key]= $value; |
|
121 | + elseif ($prefix == "") $results[$key] = $value; |
|
122 | 122 | } |
123 | 123 | return $results; |
124 | 124 | } |
@@ -129,16 +129,16 @@ discard block |
||
129 | 129 | * @param string $msg Message to show |
130 | 130 | * @param string $url URL to redirect to |
131 | 131 | */ |
132 | - function webAlert($msg, $url= "") { |
|
132 | + function webAlert($msg, $url = ""){ |
|
133 | 133 | global $modx; |
134 | - $msg= addslashes($modx->db->escape($msg)); |
|
134 | + $msg = addslashes($modx->db->escape($msg)); |
|
135 | 135 | if (substr(strtolower($url), 0, 11) == "javascript:") { |
136 | - $act= "__WebAlert();"; |
|
137 | - $fnc= "function __WebAlert(){" . substr($url, 11) . "};"; |
|
136 | + $act = "__WebAlert();"; |
|
137 | + $fnc = "function __WebAlert(){".substr($url, 11)."};"; |
|
138 | 138 | } else { |
139 | - $act= ($url ? "window.location.href='" . addslashes($url) . "';" : ""); |
|
139 | + $act = ($url ? "window.location.href='".addslashes($url)."';" : ""); |
|
140 | 140 | } |
141 | - $html= "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>"; |
|
141 | + $html = "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>"; |
|
142 | 142 | if ($modx->isFrontend()) |
143 | 143 | $modx->regClientScript($html); |
144 | 144 | else { |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Message Quit Template |
4 | 4 | * |
5 | 5 | */ |
6 | -if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { |
|
6 | +if ((!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE != "true") { |
|
7 | 7 | die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited."); |
8 | 8 | } |
9 | 9 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | </script> |
21 | 21 | </head><body> |
22 | 22 | "; |
23 | -if($is_error) { |
|
23 | +if ($is_error) { |
|
24 | 24 | $parsedMessageString .= "<h3 style='color:red;background:#e0e0e0;padding:2px;'> MODX Parse Error </h3> |
25 | 25 | <table border='0' cellpadding='1' cellspacing='0'> |
26 | 26 | <tr><td colspan='3'>MODX encountered the following error while attempting to parse the requested resource:</td></tr> |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | <tr><td colspan='3'><b style='color:#003399;'>« $msg »</b></td></tr>"; |
33 | 33 | } |
34 | 34 | |
35 | -if(!empty($query)) { |
|
35 | +if (!empty($query)) { |
|
36 | 36 | $parsedMessageString .= "<tr><td colspan='3'><hr size='1' width='98%' style='color:#e0e0e0'/><b style='color:#999;font-size: 9px;border-left:1px solid #c0c0c0; margin-left:10px;'> SQL: <span id='sqlHolder'>$query</span></b><hr size='1' width='98%' style='color:#e0e0e0'/> |
37 | 37 | <a href='javascript:copyToClip();' style='color:#821517;font-size: 9px; text-decoration: none'>[Copy SQL to ClipBoard]</a><textarea id='holdtext' style='display:none;'></textarea></td></tr>"; |
38 | 38 | } |
39 | 39 | |
40 | -if($text!='') { |
|
40 | +if ($text != '') { |
|
41 | 41 | |
42 | - $errortype = array ( |
|
42 | + $errortype = array( |
|
43 | 43 | E_ERROR => "Error", |
44 | 44 | E_WARNING => "Warning", |
45 | 45 | E_PARSE => "Parsing Error", |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $parsedMessageString .= "<tr><td> Line: </td>"; |
71 | 71 | $parsedMessageString .= "<td colspan='2'>$line</td><td> </td>"; |
72 | 72 | $parsedMessageString .= "</tr>"; |
73 | - if($source!='') { |
|
73 | + if ($source != '') { |
|
74 | 74 | $parsedMessageString .= "<tr><td valign='top'> Line $line source: </td>"; |
75 | 75 | $parsedMessageString .= "<td colspan='2'>$source</td><td> </td>"; |
76 | 76 | $parsedMessageString .= "</tr>"; |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | use PHPMailer\PHPMailer\PHPMailer; |
12 | 12 | use PHPMailer\PHPMailer\Exception; |
13 | 13 | |
14 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php'; |
|
15 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php'; |
|
16 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/SMTP.php'; |
|
14 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/Exception.php'; |
|
15 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/PHPMailer.php'; |
|
16 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/SMTP.php'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Class MODxMailer |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function init(\DocumentParser $modx) |
32 | 32 | { |
33 | 33 | $this->modx = $modx; |
34 | - $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/'; |
|
34 | + $this->PluginDir = MODX_MANAGER_PATH.'includes/controls/phpmailer/'; |
|
35 | 35 | |
36 | 36 | switch ($modx->config['email_method']) { |
37 | 37 | case 'smtp': |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | mb_language($this->mb_language); |
96 | 96 | mb_internal_encoding($modx->config['modx_charset']); |
97 | 97 | } |
98 | - $exconf = MODX_MANAGER_PATH . 'includes/controls/phpmailer/config.inc.php'; |
|
98 | + $exconf = MODX_MANAGER_PATH.'includes/controls/phpmailer/config.inc.php'; |
|
99 | 99 | if (is_file($exconf)) { |
100 | 100 | include($exconf); |
101 | 101 | } |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | if ($this->modx->debug) { |
166 | - $debug_info = 'CharSet = ' . $this->CharSet . "\n"; |
|
167 | - $debug_info .= 'Encoding = ' . $this->Encoding . "\n"; |
|
168 | - $debug_info .= 'mb_language = ' . $this->mb_language . "\n"; |
|
169 | - $debug_info .= 'encode_header_method = ' . $this->encode_header_method . "\n"; |
|
166 | + $debug_info = 'CharSet = '.$this->CharSet."\n"; |
|
167 | + $debug_info .= 'Encoding = '.$this->Encoding."\n"; |
|
168 | + $debug_info .= 'mb_language = '.$this->mb_language."\n"; |
|
169 | + $debug_info .= 'encode_header_method = '.$this->encode_header_method."\n"; |
|
170 | 170 | $debug_info .= "send_mode = {$mode}\n"; |
171 | - $debug_info .= 'Subject = ' . $this->Subject . "\n"; |
|
171 | + $debug_info .= 'Subject = '.$this->Subject."\n"; |
|
172 | 172 | $log = "<pre>{$debug_info}\n{$header}\n{$org_body}</pre>"; |
173 | 173 | $this->modx->logEvent(1, 1, $log, 'MODxMailer debug information'); |
174 | 174 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | ini_set('sendmail_from', $old_from); |
233 | 233 | } |
234 | 234 | if (!$rt) { |
235 | - $msg = $this->Lang('instantiate') . "<br />\n"; |
|
235 | + $msg = $this->Lang('instantiate')."<br />\n"; |
|
236 | 236 | $msg .= "{$this->Subject}<br />\n"; |
237 | 237 | $msg .= "{$this->FromName}<{$this->From}><br />\n"; |
238 | 238 | $msg .= mb_convert_encoding($body, $this->modx->config['modx_charset'], $this->CharSet); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function SetError($msg) |
253 | 253 | { |
254 | - $msg .= '<pre>' . print_r(get_object_vars($this), true) . '</pre>'; |
|
254 | + $msg .= '<pre>'.print_r(get_object_vars($this), true).'</pre>'; |
|
255 | 255 | $this->modx->config['send_errormail'] = '0'; |
256 | 256 | $this->modx->logEvent(0, 3, $msg, 'phpmailer'); |
257 | 257 | |
@@ -280,14 +280,14 @@ discard block |
||
280 | 280 | /** |
281 | 281 | * @return string |
282 | 282 | */ |
283 | - public function getMIMEHeader() { |
|
283 | + public function getMIMEHeader(){ |
|
284 | 284 | return $this->MIMEHeader; |
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
288 | 288 | * @return string |
289 | 289 | */ |
290 | - public function getMIMEBody() { |
|
290 | + public function getMIMEBody(){ |
|
291 | 291 | return $this->MIMEBody; |
292 | 292 | } |
293 | 293 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * |
297 | 297 | * @return $this |
298 | 298 | */ |
299 | - public function setMIMEHeader($header = '') { |
|
299 | + public function setMIMEHeader($header = ''){ |
|
300 | 300 | $this->MIMEHeader = $header; |
301 | 301 | |
302 | 302 | return $this; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * |
308 | 308 | * @return $this |
309 | 309 | */ |
310 | - public function setMIMEBody($body = '') { |
|
310 | + public function setMIMEBody($body = ''){ |
|
311 | 311 | $this->MIMEBody = $body; |
312 | 312 | |
313 | 313 | return $this; |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * |
319 | 319 | * @return $this |
320 | 320 | */ |
321 | - public function setMailHeader($header = '') { |
|
321 | + public function setMailHeader($header = ''){ |
|
322 | 322 | $this->mailHeader = $header; |
323 | 323 | |
324 | 324 | return $this; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | /** |
328 | 328 | * @return string |
329 | 329 | */ |
330 | - public function getMessageID() { |
|
331 | - return trim($this->lastMessageID,'<>'); |
|
330 | + public function getMessageID(){ |
|
331 | + return trim($this->lastMessageID, '<>'); |
|
332 | 332 | } |
333 | 333 | } |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | * mutate_settings.ajax.php |
4 | 4 | * |
5 | 5 | */ |
6 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
6 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
7 | 7 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
8 | 8 | } |
9 | 9 | |
10 | -require_once(dirname(__FILE__) . '/protect.inc.php'); |
|
10 | +require_once(dirname(__FILE__).'/protect.inc.php'); |
|
11 | 11 | |
12 | 12 | $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']); |
13 | 13 | $lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']); |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | $str = ''; |
23 | 23 | $emptyCache = false; |
24 | 24 | |
25 | -switch(true){ |
|
26 | - case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{ |
|
27 | - include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php'); |
|
28 | - $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ; |
|
25 | +switch (true) { |
|
26 | + case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/', $lang) && file_exists(dirname(__FILE__).'/lang/'.$lang.'.inc.php')):{ |
|
27 | + include(dirname(__FILE__).'/lang/'.$lang.'.inc.php'); |
|
28 | + $str = isset($key, $_lang, $_lang[$key]) ? $_lang[$key] : ""; |
|
29 | 29 | break; |
30 | 30 | } |
31 | 31 | case ($action == 'setsetting' && !empty($key) && !empty($value)):{ |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | -if($emptyCache) { |
|
55 | +if ($emptyCache) { |
|
56 | 56 | $modx->clearCache('full'); |
57 | 57 | } |
58 | 58 |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || 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 | // PROCESSOR FIRST |
7 | -if($_SESSION['mgrRole'] == 1) { |
|
8 | - if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
7 | +if ($_SESSION['mgrRole'] == 1) { |
|
8 | + if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
9 | 9 | $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']); |
10 | - if(!empty($current)) { |
|
10 | + if (!empty($current)) { |
|
11 | 11 | $modx->manager->setSystemChecksum($current); |
12 | 12 | $modx->clearCache('full'); |
13 | 13 | $modx->config['sys_files_checksum'] = $current; |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | $warningspresent = 0; |
20 | 20 | |
21 | 21 | $sysfiles_check = $modx->manager->checkSystemChecksum(); |
22 | -if ($sysfiles_check!=='0'){ |
|
22 | +if ($sysfiles_check !== '0') { |
|
23 | 23 | $warningspresent = 1; |
24 | 24 | $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
25 | 25 | } |
26 | 26 | |
27 | -if (is_writable("includes/config.inc.php")){ |
|
27 | +if (is_writable("includes/config.inc.php")) { |
|
28 | 28 | // Warn if world writable |
29 | - if(@fileperms('includes/config.inc.php') & 0x0002) { |
|
29 | + if (@fileperms('includes/config.inc.php') & 0x0002) { |
|
30 | 30 | $warningspresent = 1; |
31 | 31 | $warnings[] = array($_lang['configcheck_configinc']); |
32 | 32 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | $warnings[] = array($_lang['configcheck_php_gdzip']); |
43 | 43 | } |
44 | 44 | |
45 | -if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') { |
|
46 | - if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') { |
|
45 | +if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') { |
|
46 | + if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') { |
|
47 | 47 | if ($modx->db->getValue($modx->db->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) { |
48 | 48 | $warningspresent = 1; |
49 | 49 | $warnings[] = array($_lang['configcheck_validate_referer']); |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // check for Template Switcher plugin |
55 | -if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') { |
|
56 | - if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') { |
|
55 | +if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') { |
|
56 | + if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') { |
|
57 | 57 | $rs = $modx->db->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'"); |
58 | 58 | $row = $modx->db->getRow($rs); |
59 | - if($row && $row['disabled'] == 0) { |
|
59 | + if ($row && $row['disabled'] == 0) { |
|
60 | 60 | $warningspresent = 1; |
61 | 61 | $warnings[] = array($_lang['configcheck_templateswitcher_present']); |
62 | 62 | $tplName = $row['name']; |
@@ -117,36 +117,36 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | if (!function_exists('checkSiteCache')) { |
120 | - function checkSiteCache() { |
|
120 | + function checkSiteCache(){ |
|
121 | 121 | global $modx; |
122 | - $checked= true; |
|
123 | - if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) { |
|
124 | - $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php'); |
|
122 | + $checked = true; |
|
123 | + if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) { |
|
124 | + $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php'); |
|
125 | 125 | } |
126 | 126 | return $checked; |
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | -if (!is_writable(MODX_BASE_PATH . "assets/cache/")) { |
|
130 | +if (!is_writable(MODX_BASE_PATH."assets/cache/")) { |
|
131 | 131 | $warningspresent = 1; |
132 | 132 | $warnings[] = array($_lang['configcheck_cache']); |
133 | 133 | } |
134 | 134 | |
135 | 135 | if (!checkSiteCache()) { |
136 | 136 | $warningspresent = 1; |
137 | - $warnings[]= array($lang['configcheck_sitecache_integrity']); |
|
137 | + $warnings[] = array($lang['configcheck_sitecache_integrity']); |
|
138 | 138 | } |
139 | 139 | |
140 | -if (!is_writable(MODX_BASE_PATH . "assets/images/")) { |
|
140 | +if (!is_writable(MODX_BASE_PATH."assets/images/")) { |
|
141 | 141 | $warningspresent = 1; |
142 | 142 | $warnings[] = array($_lang['configcheck_images']); |
143 | 143 | } |
144 | 144 | |
145 | -if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) { |
|
145 | +if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) { |
|
146 | 146 | $warningspresent = 1; |
147 | 147 | $warnings[] = array($_lang['configcheck_rb_base_dir']); |
148 | 148 | } |
149 | -if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) { |
|
149 | +if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) { |
|
150 | 150 | $warningspresent = 1; |
151 | 151 | $warnings[] = array($_lang['configcheck_filemanager_path']); |
152 | 152 | } |
@@ -154,36 +154,36 @@ discard block |
||
154 | 154 | // clear file info cache |
155 | 155 | clearstatcache(); |
156 | 156 | |
157 | -if ($warningspresent==1) { |
|
157 | +if ($warningspresent == 1) { |
|
158 | 158 | |
159 | -if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3'; |
|
159 | +if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3'; |
|
160 | 160 | $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>"; |
161 | 161 | |
162 | -for ($i=0;$i<count($warnings);$i++) { |
|
162 | +for ($i = 0; $i < count($warnings); $i++) { |
|
163 | 163 | switch ($warnings[$i][0]) { |
164 | 164 | case $_lang['configcheck_configinc']; |
165 | 165 | $warnings[$i][1] = $_lang['configcheck_configinc_msg']; |
166 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']); |
|
166 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']); |
|
167 | 167 | break; |
168 | 168 | case $_lang['configcheck_installer'] : |
169 | 169 | $warnings[$i][1] = $_lang['configcheck_installer_msg']; |
170 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']); |
|
170 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']); |
|
171 | 171 | break; |
172 | 172 | case $_lang['configcheck_cache'] : |
173 | 173 | $warnings[$i][1] = $_lang['configcheck_cache_msg']; |
174 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']); |
|
174 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']); |
|
175 | 175 | break; |
176 | 176 | case $_lang['configcheck_images'] : |
177 | 177 | $warnings[$i][1] = $_lang['configcheck_images_msg']; |
178 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']); |
|
178 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']); |
|
179 | 179 | break; |
180 | 180 | case $_lang['configcheck_sysfiles_mod']: |
181 | 181 | $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; |
182 | - $warnings[$i][2] = '<ul><li>'. join('</li><li>', $sysfiles_check) .'</li></ul>'; |
|
183 | - if($modx->hasPermission('settings')) { |
|
184 | - $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
|
182 | + $warnings[$i][2] = '<ul><li>'.join('</li><li>', $sysfiles_check).'</li></ul>'; |
|
183 | + if ($modx->hasPermission('settings')) { |
|
184 | + $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>'; |
|
185 | 185 | } |
186 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".join(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); |
|
186 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".join(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']); |
|
187 | 187 | break; |
188 | 188 | case $_lang['configcheck_lang_difference'] : |
189 | 189 | $warnings[$i][1] = $_lang['configcheck_lang_difference_msg']; |
@@ -205,18 +205,18 @@ discard block |
||
205 | 205 | break; |
206 | 206 | case $_lang['configcheck_validate_referer'] : |
207 | 207 | $msg = $_lang['configcheck_validate_referer_msg']; |
208 | - $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer'); |
|
208 | + $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer'); |
|
209 | 209 | $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n"; |
210 | 210 | break; |
211 | 211 | case $_lang['configcheck_templateswitcher_present'] : |
212 | 212 | $msg = $_lang["configcheck_templateswitcher_present_msg"]; |
213 | - if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') { |
|
214 | - $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"]; |
|
213 | + if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') { |
|
214 | + $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"]; |
|
215 | 215 | } |
216 | - if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') { |
|
217 | - $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"]; |
|
216 | + if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') { |
|
217 | + $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"]; |
|
218 | 218 | } |
219 | - $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present'); |
|
219 | + $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present'); |
|
220 | 220 | $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n"; |
221 | 221 | break; |
222 | 222 | case $_lang['configcheck_rb_base_dir'] : |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $warnings[$i][1] = $_lang['configcheck_default_msg']; |
230 | 230 | } |
231 | 231 | |
232 | - $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ; |
|
232 | + $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : ""; |
|
233 | 233 | $config_check_results .= " |
234 | 234 | <fieldset> |
235 | 235 | <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p> |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')." |
239 | 239 | </fieldset> |
240 | 240 | "; |
241 | - if ($i!=count($warnings)-1) { |
|
241 | + if ($i != count($warnings) - 1) { |
|
242 | 242 | $config_check_results .= "<br />"; |
243 | 243 | } |
244 | 244 | } |
245 | - $_SESSION["mgrConfigCheck"]=true; |
|
245 | + $_SESSION["mgrConfigCheck"] = true; |
|
246 | 246 | } else { |
247 | 247 | $config_check_results = $_lang['configcheck_ok']; |
248 | 248 | } |