@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4 |
3 | - if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) { |
|
3 | + if (empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) { |
|
4 | 4 | $valid_hostnames = $_SERVER['HTTP_HOST']; |
5 | 5 | } else { |
6 | 6 | $valid_hostnames = $MODX_SITE_HOSTNAMES; |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | <tr> |
16 | 16 | <th><?php echo $_lang['allow_eval_title']; ?><br><small>[(allow_eval)]</small></th> |
17 | 17 | <td> |
18 | -<?php echo wrap_label($_lang['allow_eval_with_scan'] , form_radio('allow_eval','with_scan'));?><br /> |
|
19 | -<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'] , form_radio('allow_eval','with_scan_at_post'));?><br /> |
|
20 | -<?php echo wrap_label($_lang['allow_eval_everytime_eval'] , form_radio('allow_eval','everytime_eval'));?><br /> |
|
21 | -<?php echo wrap_label($_lang['allow_eval_dont_eval'] , form_radio('allow_eval','dont_eval'));?> |
|
18 | +<?php echo wrap_label($_lang['allow_eval_with_scan'], form_radio('allow_eval', 'with_scan')); ?><br /> |
|
19 | +<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'], form_radio('allow_eval', 'with_scan_at_post')); ?><br /> |
|
20 | +<?php echo wrap_label($_lang['allow_eval_everytime_eval'], form_radio('allow_eval', 'everytime_eval')); ?><br /> |
|
21 | +<?php echo wrap_label($_lang['allow_eval_dont_eval'], form_radio('allow_eval', 'dont_eval')); ?> |
|
22 | 22 | <div class="comment"> |
23 | 23 | <?php echo $_lang['allow_eval_msg'] ?> |
24 | 24 | </div> |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | <tr> |
44 | 44 | <th><?php echo $_lang['check_files_onlogin_title'] ?><br><small>[(check_files_onlogin)]</small></th> |
45 | 45 | <td> |
46 | - <textarea name="check_files_onlogin"><?php echo $check_files_onlogin;?></textarea><br /> |
|
46 | + <textarea name="check_files_onlogin"><?php echo $check_files_onlogin; ?></textarea><br /> |
|
47 | 47 | |
48 | 48 | </td> |
49 | 49 | </tr> |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | <tr> |
54 | 54 | <td nowrap class="warning"><?php echo $_lang['validate_referer_title'] ?><br><small>[(validate_referer)]</small></td> |
55 | 55 | <td> |
56 | - <?php echo wrap_label($_lang['yes'],form_radio('validate_referer', 1));?><br /> |
|
57 | - <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0));?> |
|
56 | + <?php echo wrap_label($_lang['yes'], form_radio('validate_referer', 1)); ?><br /> |
|
57 | + <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0)); ?> |
|
58 | 58 | </td> |
59 | 59 | </tr> |
60 | 60 | <tr> |
@@ -89,25 +89,25 @@ discard block |
||
89 | 89 | <tr> |
90 | 90 | <th><?php echo $_lang['a17_error_reporting_title']; ?><br><small>[(error_reporting)]</small></th> |
91 | 91 | <td> |
92 | -<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting','0'));?><br /> |
|
93 | -<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting','1'));?><br /> |
|
94 | -<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting','2'));?><br /> |
|
95 | -<?php echo wrap_label($_lang['a17_error_reporting_opt99'],form_radio('error_reporting','99'));?> |
|
92 | +<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting', '0')); ?><br /> |
|
93 | +<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting', '1')); ?><br /> |
|
94 | +<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting', '2')); ?><br /> |
|
95 | +<?php echo wrap_label($_lang['a17_error_reporting_opt99'], form_radio('error_reporting', '99')); ?> |
|
96 | 96 | </td> |
97 | 97 | </tr> |
98 | 98 | <tr> |
99 | 99 | <td width="200"> </td> |
100 | - <td class="comment"> <?php echo $_lang['a17_error_reporting_msg'];?></td> |
|
100 | + <td class="comment"> <?php echo $_lang['a17_error_reporting_msg']; ?></td> |
|
101 | 101 | </tr> |
102 | 102 | <tr><td colspan="2"><div class="split"></div></td></tr> |
103 | 103 | <tr> |
104 | 104 | <th><?php echo $_lang['mutate_settings.dynamic.php6']; ?><br><small>[(send_errormail)]</small></th> |
105 | 105 | <td> |
106 | -<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'],form_radio('send_errormail','0'));?><br /> |
|
107 | -<?php echo wrap_label('error',form_radio('send_errormail','3'));?><br /> |
|
108 | -<?php echo wrap_label('error + warning',form_radio('send_errormail','2'));?><br /> |
|
109 | -<?php echo wrap_label('error + warning + information',form_radio('send_errormail','1'));?><br /> |
|
110 | -<?php echo parseText($_lang['mutate_settings.dynamic.php8'],array('emailsender'=>$modx->config['emailsender']));?></td> |
|
106 | +<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'], form_radio('send_errormail', '0')); ?><br /> |
|
107 | +<?php echo wrap_label('error', form_radio('send_errormail', '3')); ?><br /> |
|
108 | +<?php echo wrap_label('error + warning', form_radio('send_errormail', '2')); ?><br /> |
|
109 | +<?php echo wrap_label('error + warning + information', form_radio('send_errormail', '1')); ?><br /> |
|
110 | +<?php echo parseText($_lang['mutate_settings.dynamic.php8'], array('emailsender'=>$modx->config['emailsender'])); ?></td> |
|
111 | 111 | </tr> |
112 | 112 | <tr> |
113 | 113 | <td colspan="2"><div class="split"></div></td> |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | <tr> |
116 | 116 | <th><?php echo $_lang['enable_bindings_title'] ?><br><small>[(enable_bindings)]</small></th> |
117 | 117 | <td> |
118 | -<?php echo wrap_label($_lang['yes'],form_radio('enable_bindings','1'));?><br /> |
|
119 | -<?php echo wrap_label($_lang['no'], form_radio('enable_bindings','0'));?> |
|
118 | +<?php echo wrap_label($_lang['yes'], form_radio('enable_bindings', '1')); ?><br /> |
|
119 | +<?php echo wrap_label($_lang['no'], form_radio('enable_bindings', '0')); ?> |
|
120 | 120 | |
121 | 121 | </td> |
122 | 122 | </tr> |
@@ -157,20 +157,20 @@ discard block |
||
157 | 157 | <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th> |
158 | 158 | <td> |
159 | 159 | <?php |
160 | -if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
161 | -$phm['e']['BLOWFISH_Y'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_Y') ? 0:1; |
|
162 | -$phm['e']['BLOWFISH_A'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_A') ? 0:1; |
|
163 | -$phm['e']['SHA512'] = $modx->getManagerApi()->checkHashAlgorithm('SHA512') ? 0:1; |
|
164 | -$phm['e']['SHA256'] = $modx->getManagerApi()->checkHashAlgorithm('SHA256') ? 0:1; |
|
165 | -$phm['e']['MD5'] = $modx->getManagerApi()->checkHashAlgorithm('MD5') ? 0:1; |
|
166 | -$phm['e']['UNCRYPT'] = $modx->getManagerApi()->checkHashAlgorithm('UNCRYPT') ? 0:1; |
|
160 | +if (empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
161 | +$phm['e']['BLOWFISH_Y'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_Y') ? 0 : 1; |
|
162 | +$phm['e']['BLOWFISH_A'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_A') ? 0 : 1; |
|
163 | +$phm['e']['SHA512'] = $modx->getManagerApi()->checkHashAlgorithm('SHA512') ? 0 : 1; |
|
164 | +$phm['e']['SHA256'] = $modx->getManagerApi()->checkHashAlgorithm('SHA256') ? 0 : 1; |
|
165 | +$phm['e']['MD5'] = $modx->getManagerApi()->checkHashAlgorithm('MD5') ? 0 : 1; |
|
166 | +$phm['e']['UNCRYPT'] = $modx->getManagerApi()->checkHashAlgorithm('UNCRYPT') ? 0 : 1; |
|
167 | 167 | ?> |
168 | -<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y']));?><br /> |
|
169 | -<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_A', '', $phm['e']['BLOWFISH_A']));?><br /> |
|
170 | -<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)' ,form_radio('pwd_hash_algo','SHA512' , '', $phm['e']['SHA512']));?><br /> |
|
171 | -<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)' ,form_radio('pwd_hash_algo','SHA256' , '', $phm['e']['SHA256']));?><br /> |
|
172 | -<?php echo wrap_label('CRYPT_MD5 (salt & stretch)' ,form_radio('pwd_hash_algo','MD5' , '', $phm['e']['MD5']));?><br /> |
|
173 | -<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)' ,form_radio('pwd_hash_algo','UNCRYPT' , '', $phm['e']['UNCRYPT']));?> |
|
168 | +<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y'])); ?><br /> |
|
169 | +<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_A', '', $phm['e']['BLOWFISH_A'])); ?><br /> |
|
170 | +<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA512', '', $phm['e']['SHA512'])); ?><br /> |
|
171 | +<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA256', '', $phm['e']['SHA256'])); ?><br /> |
|
172 | +<?php echo wrap_label('CRYPT_MD5 (salt & stretch)', form_radio('pwd_hash_algo', 'MD5', '', $phm['e']['MD5'])); ?><br /> |
|
173 | +<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)', form_radio('pwd_hash_algo', 'UNCRYPT', '', $phm['e']['UNCRYPT'])); ?> |
|
174 | 174 | </td> |
175 | 175 | </tr> |
176 | 176 | <tr> |
@@ -186,13 +186,13 @@ discard block |
||
186 | 186 | ?> |
187 | 187 | <?php |
188 | 188 | $gdAvailable = extension_loaded('gd'); |
189 | -if(!$gdAvailable) $use_captcha = 0; |
|
189 | +if (!$gdAvailable) $use_captcha = 0; |
|
190 | 190 | ?> |
191 | 191 | <tr> |
192 | 192 | <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td> |
193 | - <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha==1) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> /> |
|
193 | + <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha == 1) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> |
|
194 | 194 | <?php echo $_lang['yes']?></label><br /> |
195 | - <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha==0) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : '';?> /> |
|
195 | + <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha == 0) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> |
|
196 | 196 | <?php echo $_lang['no']?></label> </td> |
197 | 197 | </tr> |
198 | 198 | <tr> |
@@ -202,23 +202,23 @@ discard block |
||
202 | 202 | <tr> |
203 | 203 | <td colspan="2"><div class="split"></div></td> |
204 | 204 | </tr> |
205 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
205 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
206 | 206 | <td nowrap class="warning"><?php echo $_lang['captcha_words_title'] ?><br><small>[(captcha_words)]</small> |
207 | 207 | <br /> |
208 | 208 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
209 | 209 | <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');"> |
210 | -<?php echo get_lang_options('captcha_words_default');?> |
|
210 | +<?php echo get_lang_options('captcha_words_default'); ?> |
|
211 | 211 | </select> |
212 | 212 | </td> |
213 | 213 | <td><input type="text" id="captcha_words_input" name="captcha_words" style="width:250px" value="<?php echo $captcha_words; ?>" /> |
214 | - <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']);?>" /> |
|
214 | + <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']); ?>" /> |
|
215 | 215 | </td> |
216 | 216 | </tr> |
217 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
217 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
218 | 218 | <td width="200"> </td> |
219 | 219 | <td class="comment"><?php echo $_lang['captcha_words_message'] ?></td> |
220 | 220 | </tr> |
221 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
221 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
222 | 222 | <td colspan="2"><div class="split"></div></td> |
223 | 223 | </tr> |
224 | 224 | <tr> |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | <?php |
227 | 227 | // invoke OnMiscSettingsRender event |
228 | 228 | $evtOut = $modx->invokeEvent('OnSecuritySettingsRender'); |
229 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
229 | + if (is_array($evtOut)) echo implode("", $evtOut); |
|
230 | 230 | ?> |
231 | 231 | </td> |
232 | 232 | </tr> |
@@ -1,8 +1,8 @@ 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('web_access_permissions')) { |
|
5 | +if (!$modx->hasPermission('web_access_permissions')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | switch ($operation) { |
23 | 23 | case "add_user_group" : |
24 | 24 | $newgroup = $_REQUEST['newusergroup']; |
25 | - if(empty($newgroup)) { |
|
25 | + if (empty($newgroup)) { |
|
26 | 26 | $modx->webAlertAndQuit("No group name specified."); |
27 | 27 | } else { |
28 | 28 | $id = $modx->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_webgroup_names); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | break; |
37 | 37 | case "add_document_group" : |
38 | 38 | $newgroup = $_REQUEST['newdocgroup']; |
39 | - if(empty($newgroup)) { |
|
39 | + if (empty($newgroup)) { |
|
40 | 40 | $modx->webAlertAndQuit("No group name specified."); |
41 | 41 | } else { |
42 | 42 | $id = $modx->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_documentgroup_names); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | break; |
51 | 51 | case "delete_user_group" : |
52 | 52 | $updategroupaccess = true; |
53 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
54 | - if(empty($usergroup)) { |
|
53 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
54 | + if (empty($usergroup)) { |
|
55 | 55 | $modx->webAlertAndQuit("No user group id specified for deletion."); |
56 | 56 | } else { |
57 | 57 | $modx->getDatabase()->delete($tbl_webgroup_names, "id='{$usergroup}'"); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | } |
63 | 63 | break; |
64 | 64 | case "delete_document_group" : |
65 | - $group = (int)$_REQUEST['documentgroup']; |
|
66 | - if(empty($group)) { |
|
65 | + $group = (int) $_REQUEST['documentgroup']; |
|
66 | + if (empty($group)) { |
|
67 | 67 | $modx->webAlertAndQuit("No document group id specified for deletion."); |
68 | 68 | } else { |
69 | 69 | $modx->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'"); |
@@ -75,33 +75,33 @@ discard block |
||
75 | 75 | break; |
76 | 76 | case "rename_user_group" : |
77 | 77 | $newgroupname = $_REQUEST['newgroupname']; |
78 | - if(empty($newgroupname)) { |
|
78 | + if (empty($newgroupname)) { |
|
79 | 79 | $modx->webAlertAndQuit("No group name specified."); |
80 | 80 | } |
81 | - $groupid = (int)$_REQUEST['groupid']; |
|
82 | - if(empty($groupid)) { |
|
81 | + $groupid = (int) $_REQUEST['groupid']; |
|
82 | + if (empty($groupid)) { |
|
83 | 83 | $modx->webAlertAndQuit("No user group id specified for rename."); |
84 | 84 | } |
85 | 85 | $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
86 | 86 | break; |
87 | 87 | case "rename_document_group" : |
88 | 88 | $newgroupname = $_REQUEST['newgroupname']; |
89 | - if(empty($newgroupname)) { |
|
89 | + if (empty($newgroupname)) { |
|
90 | 90 | $modx->webAlertAndQuit("No group name specified."); |
91 | 91 | } |
92 | - $groupid = (int)$_REQUEST['groupid']; |
|
93 | - if(empty($groupid)) { |
|
92 | + $groupid = (int) $_REQUEST['groupid']; |
|
93 | + if (empty($groupid)) { |
|
94 | 94 | $modx->webAlertAndQuit("No document group id specified for rename."); |
95 | 95 | } |
96 | 96 | $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
97 | 97 | break; |
98 | 98 | case "add_document_group_to_user_group" : |
99 | 99 | $updategroupaccess = true; |
100 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
101 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
100 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
101 | + $docgroup = (int) $_REQUEST['docgroup']; |
|
102 | 102 | $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
103 | 103 | $limit = $modx->getDatabase()->getValue($rs); |
104 | - if($limit<=0) { |
|
104 | + if ($limit <= 0) { |
|
105 | 105 | $modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
106 | 106 | } else { |
107 | 107 | //alert user that coupling already exists? |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | break; |
110 | 110 | case "remove_document_group_from_user_group" : |
111 | 111 | $updategroupaccess = true; |
112 | - $coupling = (int)$_REQUEST['coupling']; |
|
112 | + $coupling = (int) $_REQUEST['coupling']; |
|
113 | 113 | $modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'"); |
114 | 114 | break; |
115 | 115 | default : |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | // secure web documents - flag as private |
120 | -if($updategroupaccess==true){ |
|
120 | +if ($updategroupaccess == true) { |
|
121 | 121 | include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
122 | 122 | secureWebDocument(); |
123 | 123 |
@@ -1,12 +1,12 @@ 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 | if (!$modx->hasPermission('save_plugin')) { |
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | -$id = (int)$_POST['id']; |
|
9 | +$id = (int) $_POST['id']; |
|
10 | 10 | $name = $modx->getDatabase()->escape(trim($_POST['name'])); |
11 | 11 | $description = $modx->getDatabase()->escape($_POST['description']); |
12 | 12 | $locked = $_POST['locked'] == 'on' ? '1' : '0'; |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | |
21 | 21 | //Kyle Jaebker - added category support |
22 | 22 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
23 | - $categoryid = (int)$_POST['categoryid']; |
|
23 | + $categoryid = (int) $_POST['categoryid']; |
|
24 | 24 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
25 | 25 | $categoryid = 0; |
26 | 26 | } else { |
27 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
27 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
28 | 28 | $categoryid = getCategory($_POST['newcategory']); |
29 | 29 | } |
30 | 30 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid; |
41 | 41 | |
42 | 42 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
43 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
43 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
44 | 44 | if ($version) { |
45 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
45 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
46 | 46 | } |
47 | 47 | if (isset($parsed['modx_category'])) { |
48 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
48 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
49 | 49 | $categoryid = getCategory($parsed['modx_category']); |
50 | 50 | } |
51 | 51 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // finished emptying cache - redirect |
104 | 104 | if ($_POST['stay'] != '') { |
105 | 105 | $a = ($_POST['stay'] == '2') ? "102&id=$newid" : '101'; |
106 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
106 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
107 | 107 | header($header); |
108 | 108 | } else { |
109 | 109 | $header = 'Location: index.php?a=76&r=2'; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // finished emptying cache - redirect |
159 | 159 | if ($_POST['stay'] != '') { |
160 | 160 | $a = ($_POST['stay'] == '2') ? "102&id=$id" : '101'; |
161 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
161 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
162 | 162 | header($header); |
163 | 163 | } else { |
164 | 164 | $modx->unlockElement(5, $id); |
@@ -1,9 +1,9 @@ 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 | exit(); |
4 | 4 | } |
5 | 5 | |
6 | -if(!$modx->hasPermission('delete_plugin')) { |
|
6 | +if (!$modx->hasPermission('delete_plugin')) { |
|
7 | 7 | $e->setError(3); |
8 | 8 | $e->dumpError(); |
9 | 9 | } |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | // Get unique list of latest added plugins by highest sql-id |
15 | 15 | $rs = $modx->getDatabase()->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); |
16 | 16 | $latestIds = array(); |
17 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
17 | +while ($row = $modx->getDatabase()->getRow($rs)) { |
|
18 | 18 | $latestIds[] = $row['id']; |
19 | 19 | } |
20 | 20 | |
21 | 21 | // Get list of plugins with disabled and enabled versions |
22 | 22 | $rs = $modx->getDatabase()->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); |
23 | 23 | |
24 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
24 | +while ($row = $modx->getDatabase()->getRow($rs)) { |
|
25 | 25 | |
26 | 26 | $id = $row['id']; |
27 | 27 | |
28 | - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins |
|
28 | + if (in_array($id, $latestIds)) continue; // Keep latest version of disabled plugins |
|
29 | 29 | |
30 | 30 | // invoke OnBeforePluginFormDelete event |
31 | 31 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -1,27 +1,27 @@ 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 | if (!$modx->hasPermission('save_template')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = (int)$_POST['id']; |
|
9 | +$id = (int) $_POST['id']; |
|
10 | 10 | $template = $modx->getDatabase()->escape($_POST['post']); |
11 | 11 | $templatename = $modx->getDatabase()->escape(trim($_POST['templatename'])); |
12 | 12 | $description = $modx->getDatabase()->escape($_POST['description']); |
13 | 13 | $locked = $_POST['locked'] == 'on' ? 1 : 0; |
14 | -$selectable = $id == $modx->config['default_template'] ? 1 : // Force selectable |
|
14 | +$selectable = $id == $modx->config['default_template'] ? 1 : // Force selectable |
|
15 | 15 | $_POST['selectable'] == 'on' ? 1 : 0; |
16 | 16 | $currentdate = time() + $modx->config['server_offset_time']; |
17 | 17 | |
18 | 18 | //Kyle Jaebker - added category support |
19 | 19 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
20 | - $categoryid = (int)$_POST['categoryid']; |
|
20 | + $categoryid = (int) $_POST['categoryid']; |
|
21 | 21 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
22 | 22 | $categoryid = 0; |
23 | 23 | } else { |
24 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
24 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
25 | 25 | $categoryid = checkCategory($_POST['newcategory']); |
26 | 26 | if (!$categoryid) { |
27 | 27 | $categoryid = newCategory($_POST['newcategory']); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | // finished emptying cache - redirect |
79 | 79 | if ($_POST['stay'] != '') { |
80 | 80 | $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19"; |
81 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
81 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
82 | 82 | header($header); |
83 | 83 | } else { |
84 | 84 | $header = "Location: index.php?a=76&r=2"; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | // finished emptying cache - redirect |
131 | 131 | if ($_POST['stay'] != '') { |
132 | 132 | $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19"; |
133 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
133 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
134 | 134 | header($header); |
135 | 135 | } else { |
136 | 136 | $modx->unlockElement(1, $id); |
@@ -1,8 +1,8 @@ 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('save_user')) { |
|
5 | +if (!$modx->hasPermission('save_user')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $input = $_POST; |
14 | 14 | |
15 | -$id = (int)$input['id']; |
|
15 | +$id = (int) $input['id']; |
|
16 | 16 | $oldusername = $input['oldusername']; |
17 | 17 | $newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; |
18 | 18 | $fullname = $input['fullname']; |
@@ -42,56 +42,56 @@ discard block |
||
42 | 42 | $user_groups = $input['user_groups']; |
43 | 43 | |
44 | 44 | // verify password |
45 | -if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { |
|
45 | +if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { |
|
46 | 46 | webAlertAndQuit("Password typed is mismatched", 12); |
47 | 47 | } |
48 | 48 | |
49 | 49 | // verify email |
50 | -if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { |
|
50 | +if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { |
|
51 | 51 | webAlertAndQuit("E-mail address doesn't seem to be valid!", 12); |
52 | 52 | } |
53 | 53 | |
54 | 54 | // verify admin security |
55 | -if($_SESSION['mgrRole'] != 1) { |
|
55 | +if ($_SESSION['mgrRole'] != 1) { |
|
56 | 56 | // Check to see if user tried to spoof a "1" (admin) role |
57 | - if(!$modx->hasPermission('save_user')) { |
|
57 | + if (!$modx->hasPermission('save_user')) { |
|
58 | 58 | webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!", 12); |
59 | 59 | } |
60 | 60 | // Verify that the user being edited wasn't an admin and the user ID got spoofed |
61 | 61 | $rs = $modx->getDatabase()->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); |
62 | 62 | $limit = $modx->getDatabase()->getValue($rs); |
63 | - if($limit > 0) { |
|
63 | + if ($limit > 0) { |
|
64 | 64 | webAlertAndQuit("You cannot alter an administrative user.", 12); |
65 | 65 | } |
66 | 66 | |
67 | 67 | } |
68 | 68 | |
69 | -switch($input['mode']) { |
|
69 | +switch ($input['mode']) { |
|
70 | 70 | case '11' : // new user |
71 | 71 | // check if this user name already exist |
72 | 72 | $rs = $modx->getDatabase()->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->getDatabase()->escape($newusername))); |
73 | 73 | $limit = $modx->getDatabase()->getValue($rs); |
74 | - if($limit > 0) { |
|
74 | + if ($limit > 0) { |
|
75 | 75 | webAlertAndQuit("User name is already in use!", 12); |
76 | 76 | } |
77 | 77 | |
78 | 78 | // check if the email address already exist |
79 | 79 | $rs = $modx->getDatabase()->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->getDatabase()->escape($email), $id)); |
80 | 80 | $limit = $modx->getDatabase()->getValue($rs); |
81 | - if($limit > 0) { |
|
81 | + if ($limit > 0) { |
|
82 | 82 | webAlertAndQuit("Email is already in use!", 12); |
83 | 83 | } |
84 | 84 | |
85 | 85 | // generate a new password for this user |
86 | - if($specifiedpassword != "" && $passwordgenmethod == "spec") { |
|
87 | - if(strlen($specifiedpassword) < 6) { |
|
86 | + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { |
|
87 | + if (strlen($specifiedpassword) < 6) { |
|
88 | 88 | webAlertAndQuit("Password is too short!", 12); |
89 | 89 | } else { |
90 | 90 | $newpassword = $specifiedpassword; |
91 | 91 | } |
92 | - } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { |
|
92 | + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { |
|
93 | 93 | webAlertAndQuit("You didn't specify a password for this user!", 12); |
94 | - } elseif($passwordgenmethod == 'g') { |
|
94 | + } elseif ($passwordgenmethod == 'g') { |
|
95 | 95 | $newpassword = generate_password(8); |
96 | 96 | } else { |
97 | 97 | webAlertAndQuit("No password generation method specified!", 12); |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | /*******************************************************************************/ |
140 | 140 | // put the user in the user_groups he/ she should be in |
141 | 141 | // first, check that up_perms are switched on! |
142 | - if($use_udperms == 1) { |
|
143 | - if(!empty($user_groups)) { |
|
144 | - for($i = 0; $i < count($user_groups); $i++) { |
|
142 | + if ($use_udperms == 1) { |
|
143 | + if (!empty($user_groups)) { |
|
144 | + for ($i = 0; $i < count($user_groups); $i++) { |
|
145 | 145 | $f = array(); |
146 | - $f['user_group'] = (int)$user_groups[$i]; |
|
146 | + $f['user_group'] = (int) $user_groups[$i]; |
|
147 | 147 | $f['member'] = $internalKey; |
148 | 148 | $modx->getDatabase()->insert($f, $tbl_member_groups); |
149 | 149 | } |
@@ -151,20 +151,20 @@ discard block |
||
151 | 151 | } |
152 | 152 | // end of user_groups stuff! |
153 | 153 | |
154 | - if($passwordnotifymethod == 'e') { |
|
154 | + if ($passwordnotifymethod == 'e') { |
|
155 | 155 | sendMailMessageForUser($email, $newusername, $newpassword, $fullname, $signupemail_message, MODX_MANAGER_URL); |
156 | - if($input['stay'] != '') { |
|
156 | + if ($input['stay'] != '') { |
|
157 | 157 | $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; |
158 | - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; |
|
158 | + $header = "Location: index.php?a={$a}&r=2&stay=".$input['stay']; |
|
159 | 159 | header($header); |
160 | 160 | } else { |
161 | 161 | $header = "Location: index.php?a=75&r=2"; |
162 | 162 | header($header); |
163 | 163 | } |
164 | 164 | } else { |
165 | - if($input['stay'] != '') { |
|
165 | + if ($input['stay'] != '') { |
|
166 | 166 | $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; |
167 | - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; |
|
167 | + $stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay']; |
|
168 | 168 | } else { |
169 | 169 | $stayUrl = "index.php?a=75&r=2"; |
170 | 170 | } |
@@ -197,36 +197,36 @@ discard block |
||
197 | 197 | break; |
198 | 198 | case '12' : // edit user |
199 | 199 | // generate a new password for this user |
200 | - if($genpassword == 1) { |
|
201 | - if($specifiedpassword != "" && $passwordgenmethod == "spec") { |
|
202 | - if(strlen($specifiedpassword) < 6) { |
|
200 | + if ($genpassword == 1) { |
|
201 | + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { |
|
202 | + if (strlen($specifiedpassword) < 6) { |
|
203 | 203 | webAlertAndQuit("Password is too short!", 12); |
204 | 204 | } else { |
205 | 205 | $newpassword = $specifiedpassword; |
206 | 206 | } |
207 | - } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { |
|
207 | + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { |
|
208 | 208 | webAlertAndQuit("You didn't specify a password for this user!", 12); |
209 | - } elseif($passwordgenmethod == 'g') { |
|
209 | + } elseif ($passwordgenmethod == 'g') { |
|
210 | 210 | $newpassword = generate_password(8); |
211 | 211 | } else { |
212 | 212 | webAlertAndQuit("No password generation method specified!", 12); |
213 | 213 | } |
214 | 214 | } |
215 | - if($passwordnotifymethod == 'e') { |
|
215 | + if ($passwordnotifymethod == 'e') { |
|
216 | 216 | sendMailMessageForUser($email, $newusername, $newpassword, $fullname, $signupemail_message, MODX_MANAGER_URL); |
217 | 217 | } |
218 | 218 | |
219 | 219 | // check if the username already exist |
220 | 220 | $rs = $modx->getDatabase()->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->getDatabase()->escape($newusername), $id)); |
221 | 221 | $limit = $modx->getDatabase()->getValue($rs); |
222 | - if($limit > 0) { |
|
222 | + if ($limit > 0) { |
|
223 | 223 | webAlertAndQuit("User name is already in use!", 12); |
224 | 224 | } |
225 | 225 | |
226 | 226 | // check if the email address already exists |
227 | 227 | $rs = $modx->getDatabase()->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->getDatabase()->escape($email), $id)); |
228 | 228 | $limit = $modx->getDatabase()->getValue($rs); |
229 | - if($limit > 0) { |
|
229 | + if ($limit > 0) { |
|
230 | 230 | webAlertAndQuit("Email is already in use!", 12); |
231 | 231 | } |
232 | 232 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | // update user name and password |
240 | 240 | $field = array(); |
241 | 241 | $field['username'] = $modx->getDatabase()->escape($newusername); |
242 | - if($genpassword == 1) { |
|
242 | + if ($genpassword == 1) { |
|
243 | 243 | $field['password'] = $modx->getPasswordHash()->HashPassword($newpassword); |
244 | 244 | } |
245 | 245 | $modx->getDatabase()->update($field, $tbl_manager_users, "id='{$id}'"); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | )); |
268 | 268 | |
269 | 269 | // invoke OnManagerChangePassword event |
270 | - if($genpassword == 1) { |
|
270 | + if ($genpassword == 1) { |
|
271 | 271 | $modx->invokeEvent("OnManagerChangePassword", array( |
272 | 272 | "userid" => $id, |
273 | 273 | "username" => $newusername, |
@@ -284,13 +284,13 @@ discard block |
||
284 | 284 | /*******************************************************************************/ |
285 | 285 | // put the user in the user_groups he/ she should be in |
286 | 286 | // first, check that up_perms are switched on! |
287 | - if($use_udperms == 1) { |
|
287 | + if ($use_udperms == 1) { |
|
288 | 288 | // as this is an existing user, delete his/ her entries in the groups before saving the new groups |
289 | 289 | $modx->getDatabase()->delete($tbl_member_groups, "member='{$id}'"); |
290 | - if(!empty($user_groups)) { |
|
291 | - for($i = 0; $i < count($user_groups); $i++) { |
|
290 | + if (!empty($user_groups)) { |
|
291 | + for ($i = 0; $i < count($user_groups); $i++) { |
|
292 | 292 | $field = array(); |
293 | - $field['user_group'] = (int)$user_groups[$i]; |
|
293 | + $field['user_group'] = (int) $user_groups[$i]; |
|
294 | 294 | $field['member'] = $id; |
295 | 295 | $modx->getDatabase()->insert($field, $tbl_member_groups); |
296 | 296 | } |
@@ -298,13 +298,13 @@ discard block |
||
298 | 298 | } |
299 | 299 | // end of user_groups stuff! |
300 | 300 | /*******************************************************************************/ |
301 | - if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { |
|
301 | + if ($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { |
|
302 | 302 | $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); |
303 | 303 | } |
304 | - if($genpassword == 1 && $passwordnotifymethod == 's') { |
|
305 | - if($input['stay'] != '') { |
|
304 | + if ($genpassword == 1 && $passwordnotifymethod == 's') { |
|
305 | + if ($input['stay'] != '') { |
|
306 | 306 | $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; |
307 | - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; |
|
307 | + $stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay']; |
|
308 | 308 | } else { |
309 | 309 | $stayUrl = "index.php?a=75&r=2"; |
310 | 310 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | <div class="sectionHeader"><?php echo $_lang['user_title']; ?></div> |
325 | 325 | <div class="sectionBody"> |
326 | 326 | <div id="disp"> |
327 | - <p><?php echo sprintf($_lang["password_msg"], $modx->getPhpCompat()->htmlspecialchars($newusername), $modx->getPhpCompat()->htmlspecialchars($newpassword)) . (($id == $modx->getLoginUserID()) ? ' ' . $_lang['user_changeddata'] : ''); ?></p> |
|
327 | + <p><?php echo sprintf($_lang["password_msg"], $modx->getPhpCompat()->htmlspecialchars($newusername), $modx->getPhpCompat()->htmlspecialchars($newpassword)).(($id == $modx->getLoginUserID()) ? ' '.$_lang['user_changeddata'] : ''); ?></p> |
|
328 | 328 | </div> |
329 | 329 | </div> |
330 | 330 | </div> |
@@ -332,9 +332,9 @@ discard block |
||
332 | 332 | |
333 | 333 | include_once "footer.inc.php"; |
334 | 334 | } else { |
335 | - if($input['stay'] != '') { |
|
335 | + if ($input['stay'] != '') { |
|
336 | 336 | $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; |
337 | - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; |
|
337 | + $header = "Location: index.php?a={$a}&r=2&stay=".$input['stay']; |
|
338 | 338 | header($header); |
339 | 339 | } else { |
340 | 340 | $header = "Location: index.php?a=75&r=2"; |
@@ -1,8 +1,8 @@ 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('export_static')) { |
|
5 | +if (!$modx->hasPermission('export_static')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,15 +10,15 @@ discard block |
||
10 | 10 | @set_time_limit($maxtime); |
11 | 11 | |
12 | 12 | |
13 | -if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
14 | -elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
13 | +if (is_dir(MODX_BASE_PATH.'temp')) $export_dir = MODX_BASE_PATH.'temp/export'; |
|
14 | +elseif (is_dir(MODX_BASE_PATH.'assets')) $export_dir = MODX_BASE_PATH.'assets/export'; |
|
15 | 15 | $modx->getExportSite()->targetDir = $export_dir; |
16 | 16 | |
17 | -if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
|
17 | +if (strpos($modx->config['base_path'], "{$export_dir}/") === 0 && 0 <= strlen(str_replace("{$export_dir}/", '', $modx->config['base_path']))) |
|
18 | 18 | return $_lang['export_site.static.php6']; |
19 | -elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
|
20 | - return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
21 | -elseif(!is_writable($export_dir)) |
|
19 | +elseif ($modx->config['rb_base_dir'] === $export_dir.'/') |
|
20 | + return $modx->parsePlaceholder($_lang['export_site.static.php7'], 'rb_base_url='.$modx->config['base_url'].$modx->config['rb_base_url']); |
|
21 | +elseif (!is_writable($export_dir)) |
|
22 | 22 | return $_lang['export_site_target_unwritable']; |
23 | 23 | |
24 | 24 | $modx->getExportSite()->generate_mode = $_POST['generate_mode']; |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | $repl_after = $_POST['repl_after']; |
32 | 32 | $includenoncache = $_POST['includenoncache']; |
33 | 33 | |
34 | -if($ignore_ids!==$_POST['ignore_ids'] |
|
35 | - ||$includenoncache!==$_POST['includenoncache'] |
|
36 | - ||$repl_before!==$_POST['repl_before'] |
|
37 | - ||$repl_after !==$_POST['repl_after']) { |
|
34 | +if ($ignore_ids !== $_POST['ignore_ids'] |
|
35 | + ||$includenoncache !== $_POST['includenoncache'] |
|
36 | + ||$repl_before !== $_POST['repl_before'] |
|
37 | + ||$repl_after !== $_POST['repl_after']) { |
|
38 | 38 | $modx->clearCache('full'); |
39 | 39 | } |
40 | 40 | |
@@ -50,5 +50,5 @@ discard block |
||
50 | 50 | |
51 | 51 | $exportend = $modx->getExportSite()->get_mtime(); |
52 | 52 | $totaltime = ($exportend - $modx->getExportSite()->exportstart); |
53 | -$output .= sprintf ('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3)); |
|
53 | +$output .= sprintf('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3)); |
|
54 | 54 | return $output; |
@@ -1,12 +1,12 @@ 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 | if (!$modx->hasPermission('save_module')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = (int)$_POST['id']; |
|
9 | +$id = (int) $_POST['id']; |
|
10 | 10 | $name = $modx->getDatabase()->escape(trim($_POST['name'])); |
11 | 11 | $description = $modx->getDatabase()->escape($_POST['description']); |
12 | 12 | $resourcefile = $modx->getDatabase()->escape($_POST['resourcefile']); |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | |
26 | 26 | //Kyle Jaebker - added category support |
27 | 27 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
28 | - $categoryid = (int)$_POST['categoryid']; |
|
28 | + $categoryid = (int) $_POST['categoryid']; |
|
29 | 29 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
30 | 30 | $categoryid = 0; |
31 | 31 | } else { |
32 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
32 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
33 | 33 | $categoryid = checkCategory($_POST['newcategory']); |
34 | 34 | if (!$categoryid) { |
35 | 35 | $categoryid = newCategory($_POST['newcategory']); |
@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | $name = isset($parsed['name']) ? $parsed['name'] : $name; |
46 | 46 | $properties = isset($parsed['properties']) ? $parsed['properties'] : $properties; |
47 | 47 | $guid = isset($parsed['guid']) ? $parsed['guid'] : $guid; |
48 | - $enable_sharedparams = isset($parsed['shareparams']) ? (int)$parsed['shareparams'] : $enable_sharedparams; |
|
48 | + $enable_sharedparams = isset($parsed['shareparams']) ? (int) $parsed['shareparams'] : $enable_sharedparams; |
|
49 | 49 | |
50 | 50 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
51 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
51 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
52 | 52 | if ($version) { |
53 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
53 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
54 | 54 | } |
55 | 55 | if (isset($parsed['modx_category'])) { |
56 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
56 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
57 | 57 | $categoryid = getCategory($parsed['modx_category']); |
58 | 58 | } |
59 | 59 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // finished emptying cache - redirect |
112 | 112 | if ($_POST['stay'] != '') { |
113 | 113 | $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107"; |
114 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
114 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
115 | 115 | header($header); |
116 | 116 | } else { |
117 | 117 | $header = "Location: index.php?a=106&r=2"; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | // finished emptying cache - redirect |
169 | 169 | if ($_POST['stay'] != '') { |
170 | 170 | $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107"; |
171 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
171 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
172 | 172 | header($header); |
173 | 173 | } else { |
174 | 174 | $modx->unlockElement(6, $id); |
@@ -1,8 +1,8 @@ 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('access_permissions')) { |
|
5 | +if (!$modx->hasPermission('access_permissions')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | switch ($operation) { |
23 | 23 | case "add_user_group" : |
24 | 24 | $newgroup = $_REQUEST['newusergroup']; |
25 | - if(empty($newgroup)) { |
|
25 | + if (empty($newgroup)) { |
|
26 | 26 | $modx->webAlertAndQuit("No group name specified."); |
27 | 27 | } else { |
28 | 28 | $id = $modx->getDatabase()->insert(array('name' => $modx->getDatabase()->escape($newgroup)), $tbl_membergroup_names); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | break; |
37 | 37 | case "add_document_group" : |
38 | 38 | $newgroup = $_REQUEST['newdocgroup']; |
39 | - if(empty($newgroup)) { |
|
39 | + if (empty($newgroup)) { |
|
40 | 40 | $modx->webAlertAndQuit("No group name specified."); |
41 | 41 | } else { |
42 | 42 | $id = $modx->getDatabase()->insert(array('name' => $modx->getDatabase()->escape($newgroup)), $tbl_documentgroup_names); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | break; |
51 | 51 | case "delete_user_group" : |
52 | 52 | $updategroupaccess = true; |
53 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
54 | - if(empty($usergroup)) { |
|
53 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
54 | + if (empty($usergroup)) { |
|
55 | 55 | $modx->webAlertAndQuit("No user group id specified for deletion."); |
56 | 56 | } else { |
57 | 57 | $modx->getDatabase()->delete($tbl_membergroup_names, "id='{$usergroup}'"); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | } |
63 | 63 | break; |
64 | 64 | case "delete_document_group" : |
65 | - $group = (int)$_REQUEST['documentgroup']; |
|
66 | - if(empty($group)) { |
|
65 | + $group = (int) $_REQUEST['documentgroup']; |
|
66 | + if (empty($group)) { |
|
67 | 67 | $modx->webAlertAndQuit("No document group id specified for deletion."); |
68 | 68 | } else { |
69 | 69 | $modx->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'"); |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | break; |
76 | 76 | case "rename_user_group" : |
77 | 77 | $newgroupname = $_REQUEST['newgroupname']; |
78 | - if(empty($newgroupname)) { |
|
78 | + if (empty($newgroupname)) { |
|
79 | 79 | $modx->webAlertAndQuit("No group name specified."); |
80 | 80 | } |
81 | - $groupid = (int)$_REQUEST['groupid']; |
|
82 | - if(empty($groupid)) { |
|
81 | + $groupid = (int) $_REQUEST['groupid']; |
|
82 | + if (empty($groupid)) { |
|
83 | 83 | $modx->webAlertAndQuit("No group id specified for rename."); |
84 | 84 | } |
85 | 85 | |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | break; |
88 | 88 | case "rename_document_group" : |
89 | 89 | $newgroupname = $_REQUEST['newgroupname']; |
90 | - if(empty($newgroupname)) { |
|
90 | + if (empty($newgroupname)) { |
|
91 | 91 | $modx->webAlertAndQuit("No group name specified."); |
92 | 92 | } |
93 | - $groupid = (int)$_REQUEST['groupid']; |
|
94 | - if(empty($groupid)) { |
|
93 | + $groupid = (int) $_REQUEST['groupid']; |
|
94 | + if (empty($groupid)) { |
|
95 | 95 | $modx->webAlertAndQuit("No group id specified for rename."); |
96 | 96 | } |
97 | 97 | |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | break; |
100 | 100 | case "add_document_group_to_user_group" : |
101 | 101 | $updategroupaccess = true; |
102 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
103 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
102 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
103 | + $docgroup = (int) $_REQUEST['docgroup']; |
|
104 | 104 | $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
105 | 105 | $limit = $modx->getDatabase()->getValue($rs); |
106 | - if($limit<=0) { |
|
106 | + if ($limit <= 0) { |
|
107 | 107 | $modx->getDatabase()->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access); |
108 | 108 | } else { |
109 | 109 | //alert user that coupling already exists? |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | break; |
112 | 112 | case "remove_document_group_from_user_group" : |
113 | 113 | $updategroupaccess = true; |
114 | - $coupling = (int)$_REQUEST['coupling']; |
|
114 | + $coupling = (int) $_REQUEST['coupling']; |
|
115 | 115 | $modx->getDatabase()->delete($tbl_membergroup_access, "id='{$coupling}'"); |
116 | 116 | break; |
117 | 117 | default : |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | // secure manager documents - flag as private |
122 | -if($updategroupaccess==true){ |
|
122 | +if ($updategroupaccess == true) { |
|
123 | 123 | include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
124 | 124 | secureMgrDocument(); |
125 | 125 |