@@ -170,70 +170,70 @@ |
||
170 | 170 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
171 | 171 | ); |
172 | 172 | } |
173 | - if (intval($params['shareparams']) || !empty($params['dependencies'])) { |
|
174 | - $dependencies = explode(',', $params['dependencies']); |
|
175 | - foreach ($dependencies as $dependency) { |
|
176 | - $dependency = explode(':', $dependency); |
|
177 | - switch (trim($dependency[0])) { |
|
178 | - case 'template': |
|
179 | - $mdp[] = array( |
|
180 | - 'module' => $params['name'], |
|
181 | - 'table' => 'templates', |
|
182 | - 'column' => 'templatename', |
|
183 | - 'type' => 50, |
|
184 | - 'name' => trim($dependency[1]) |
|
185 | - ); |
|
186 | - break; |
|
187 | - case 'tv': |
|
188 | - case 'tmplvar': |
|
189 | - $mdp[] = array( |
|
190 | - 'module' => $params['name'], |
|
191 | - 'table' => 'tmplvars', |
|
192 | - 'column' => 'name', |
|
193 | - 'type' => 60, |
|
194 | - 'name' => trim($dependency[1]) |
|
195 | - ); |
|
196 | - break; |
|
197 | - case 'chunk': |
|
198 | - case 'htmlsnippet': |
|
199 | - $mdp[] = array( |
|
200 | - 'module' => $params['name'], |
|
201 | - 'table' => 'htmlsnippets', |
|
202 | - 'column' => 'name', |
|
203 | - 'type' => 10, |
|
204 | - 'name' => trim($dependency[1]) |
|
205 | - ); |
|
206 | - break; |
|
207 | - case 'snippet': |
|
208 | - $mdp[] = array( |
|
209 | - 'module' => $params['name'], |
|
210 | - 'table' => 'snippets', |
|
211 | - 'column' => 'name', |
|
212 | - 'type' => 40, |
|
213 | - 'name' => trim($dependency[1]) |
|
214 | - ); |
|
215 | - break; |
|
216 | - case 'plugin': |
|
217 | - $mdp[] = array( |
|
218 | - 'module' => $params['name'], |
|
219 | - 'table' => 'plugins', |
|
220 | - 'column' => 'name', |
|
221 | - 'type' => 30, |
|
222 | - 'name' => trim($dependency[1]) |
|
223 | - ); |
|
224 | - break; |
|
225 | - case 'resource': |
|
226 | - $mdp[] = array( |
|
227 | - 'module' => $params['name'], |
|
228 | - 'table' => 'content', |
|
229 | - 'column' => 'pagetitle', |
|
230 | - 'type' => 20, |
|
231 | - 'name' => trim($dependency[1]) |
|
232 | - ); |
|
233 | - break; |
|
234 | - } |
|
235 | - } |
|
236 | - } |
|
173 | + if (intval($params['shareparams']) || !empty($params['dependencies'])) { |
|
174 | + $dependencies = explode(',', $params['dependencies']); |
|
175 | + foreach ($dependencies as $dependency) { |
|
176 | + $dependency = explode(':', $dependency); |
|
177 | + switch (trim($dependency[0])) { |
|
178 | + case 'template': |
|
179 | + $mdp[] = array( |
|
180 | + 'module' => $params['name'], |
|
181 | + 'table' => 'templates', |
|
182 | + 'column' => 'templatename', |
|
183 | + 'type' => 50, |
|
184 | + 'name' => trim($dependency[1]) |
|
185 | + ); |
|
186 | + break; |
|
187 | + case 'tv': |
|
188 | + case 'tmplvar': |
|
189 | + $mdp[] = array( |
|
190 | + 'module' => $params['name'], |
|
191 | + 'table' => 'tmplvars', |
|
192 | + 'column' => 'name', |
|
193 | + 'type' => 60, |
|
194 | + 'name' => trim($dependency[1]) |
|
195 | + ); |
|
196 | + break; |
|
197 | + case 'chunk': |
|
198 | + case 'htmlsnippet': |
|
199 | + $mdp[] = array( |
|
200 | + 'module' => $params['name'], |
|
201 | + 'table' => 'htmlsnippets', |
|
202 | + 'column' => 'name', |
|
203 | + 'type' => 10, |
|
204 | + 'name' => trim($dependency[1]) |
|
205 | + ); |
|
206 | + break; |
|
207 | + case 'snippet': |
|
208 | + $mdp[] = array( |
|
209 | + 'module' => $params['name'], |
|
210 | + 'table' => 'snippets', |
|
211 | + 'column' => 'name', |
|
212 | + 'type' => 40, |
|
213 | + 'name' => trim($dependency[1]) |
|
214 | + ); |
|
215 | + break; |
|
216 | + case 'plugin': |
|
217 | + $mdp[] = array( |
|
218 | + 'module' => $params['name'], |
|
219 | + 'table' => 'plugins', |
|
220 | + 'column' => 'name', |
|
221 | + 'type' => 30, |
|
222 | + 'name' => trim($dependency[1]) |
|
223 | + ); |
|
224 | + break; |
|
225 | + case 'resource': |
|
226 | + $mdp[] = array( |
|
227 | + 'module' => $params['name'], |
|
228 | + 'table' => 'content', |
|
229 | + 'column' => 'pagetitle', |
|
230 | + 'type' => 20, |
|
231 | + 'name' => trim($dependency[1]) |
|
232 | + ); |
|
233 | + break; |
|
234 | + } |
|
235 | + } |
|
236 | + } |
|
237 | 237 | } |
238 | 238 | $d->close(); |
239 | 239 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | <form name="install" id="install_form" action="index.php?action=options" method="post"> |
21 | 21 | <?php |
22 | 22 | if ($errors == 0) { |
23 | - // check if install folder is removeable |
|
23 | + // check if install folder is removeable |
|
24 | 24 | if (is_writable("../install")) { ?> |
25 | 25 | <span id="removeinstall" style="float:left;cursor:pointer;color:#505050;line-height:18px;" onclick="var chk=document.install.rminstaller; if(chk) chk.checked=!chk.checked;"><input type="checkbox" name="rminstaller" onclick="event.cancelBubble=true;" <?php echo (empty ($errors) ? 'checked="checked"' : '') ?> style="cursor:default;" /><?php echo $_lang['remove_install_folder_auto'] ?></span> |
26 | 26 | <?php |
@@ -8,10 +8,10 @@ |
||
8 | 8 | $self = 'install/connection.databasetest.php'; |
9 | 9 | $base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
10 | 10 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
11 | - include_once("{$base_path}assets/cache/siteManager.php"); |
|
11 | + include_once("{$base_path}assets/cache/siteManager.php"); |
|
12 | 12 | } |
13 | 13 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
14 | - define('MGR_DIR','manager'); |
|
14 | + define('MGR_DIR','manager'); |
|
15 | 15 | } |
16 | 16 | require_once("lang.php"); |
17 | 17 |
@@ -16,10 +16,10 @@ |
||
16 | 16 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); |
17 | 17 | |
18 | 18 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
19 | - include_once("{$base_path}assets/cache/siteManager.php"); |
|
19 | + include_once("{$base_path}assets/cache/siteManager.php"); |
|
20 | 20 | } |
21 | 21 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
22 | - define('MGR_DIR', 'manager'); |
|
22 | + define('MGR_DIR', 'manager'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 |
@@ -177,9 +177,9 @@ |
||
177 | 177 | <td colspan="2"><div class="split"></div></td> |
178 | 178 | </tr> |
179 | 179 | <?php |
180 | - // Check for GD before allowing captcha to be enabled |
|
181 | - $gdAvailable = extension_loaded('gd'); |
|
182 | - ?> |
|
180 | + // Check for GD before allowing captcha to be enabled |
|
181 | + $gdAvailable = extension_loaded('gd'); |
|
182 | + ?> |
|
183 | 183 | <?php |
184 | 184 | $gdAvailable = extension_loaded('gd'); |
185 | 185 | if(!$gdAvailable) $use_captcha = 0; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default']; |
|
2 | + $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default']; |
|
3 | 3 | ?> |
4 | 4 | <style> |
5 | 5 | table.sysSettings > tbody td, table.sysSettings > tbody th {border-bottom:1px dotted #ccc;padding:10px;} |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | <?php |
136 | 136 | // Check if PHX is enabled |
137 | 137 | $count = $modx->db->getRecordCount( |
138 | - $modx->db->select('id', '[+prefix+]site_plugins', |
|
139 | - "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
|
138 | + $modx->db->select('id', '[+prefix+]site_plugins', |
|
139 | + "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
|
140 | 140 | ); |
141 | 141 | if($count) { |
142 | 142 | $disabledFilters = 1; |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th> |
260 | 260 | <td> <select name="server_offset_time" size="1" class="inputBox"> |
261 | 261 | <?php |
262 | - for($i=-24; $i<25; $i++) { |
|
263 | - $seconds = $i*60*60; |
|
264 | - $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
265 | - ?> |
|
262 | + for($i=-24; $i<25; $i++) { |
|
263 | + $seconds = $i*60*60; |
|
264 | + $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
265 | + ?> |
|
266 | 266 | <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option> |
267 | 267 | <?php |
268 | - } |
|
269 | - ?> |
|
268 | + } |
|
269 | + ?> |
|
270 | 270 | </select> |
271 | 271 | <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div> |
272 | 272 | </td> |
@@ -68,12 +68,12 @@ |
||
68 | 68 | $var = ${$name}; |
69 | 69 | $checked = ($var==$value) ? ' checked="checked"' : ''; |
70 | 70 | if($disabled) $disabled = ' disabled'; else $disabled = ''; |
71 | - if($add) $add = ' ' . $add; |
|
72 | - return sprintf('<input onchange="documentDirty=true;" type="radio" name="%s" value="%s" %s %s %s />', $name, $value, $checked, $disabled, $add); |
|
71 | + if($add) $add = ' ' . $add; |
|
72 | + return sprintf('<input onchange="documentDirty=true;" type="radio" name="%s" value="%s" %s %s %s />', $name, $value, $checked, $disabled, $add); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | function wrap_label($str='',$object) { |
76 | - return "<label>{$object}\n{$str}</label>"; |
|
76 | + return "<label>{$object}\n{$str}</label>"; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | function parseText($tpl='', $ph=array()) { |
@@ -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 | } |