@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER |
|
4 | -{ |
|
5 | - public function __construct() |
|
6 | - { |
|
3 | +class DATEPICKER |
|
4 | +{ |
|
5 | + public function __construct() |
|
6 | + { |
|
7 | 7 | } |
8 | 8 | |
9 | - public function getDP() |
|
10 | - { |
|
9 | + public function getDP() |
|
10 | + { |
|
11 | 11 | $modx = evolutionCMS(); |
12 | 12 | global $_lang; |
13 | 13 |
@@ -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 | $helpBasePath = "actions/help/"; |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | </script> |
17 | 17 | |
18 | 18 | <?php |
19 | - if ($handle = opendir('actions/help')) { |
|
20 | - while (false !== ($file = readdir($handle))) { |
|
21 | - if ($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { |
|
19 | + if ($handle = opendir('actions/help')) { |
|
20 | + while (false !== ($file = readdir($handle))) { |
|
21 | + if ($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { |
|
22 | 22 | $help[] = $file; |
23 | 23 | } |
24 | 24 | } |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | |
28 | 28 | natcasesort($help); |
29 | 29 | |
30 | - foreach ($help as $k => $v) { |
|
30 | + foreach ($help as $k => $v) { |
|
31 | 31 | $helpname = substr($v, 0, strrpos($v, '.')); |
32 | 32 | |
33 | 33 | $prefix = substr($helpname, 0, 2); |
34 | - if (is_numeric($prefix)) { |
|
34 | + if (is_numeric($prefix)) { |
|
35 | 35 | $helpname = substr($helpname, 2, strlen($helpname) - 1); |
36 | 36 | } |
37 | 37 |
@@ -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('view_eventlog')) { |
|
5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | $modx->manager->initPageViewState(); |
16 | 16 | |
17 | 17 | // get and save search string |
18 | -if ($_REQUEST['op'] == 'reset') { |
|
18 | +if ($_REQUEST['op'] == 'reset') { |
|
19 | 19 | $sqlQuery = $query = ''; |
20 | 20 | $_PAGE['vs']['search'] = ''; |
21 | -} else { |
|
21 | +} else { |
|
22 | 22 | $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
23 | - if (!is_numeric($sqlQuery)) { |
|
23 | + if (!is_numeric($sqlQuery)) { |
|
24 | 24 | $sqlQuery = $modx->db->escape($query); |
25 | 25 | } |
26 | 26 | $_PAGE['vs']['search'] = $query; |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | $grd->colWidths = "1%,,1%,1%,1%"; |
144 | 144 | $grd->colAligns = "center,,,center,center"; |
145 | 145 | $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
146 | - if ($listmode == '1') { |
|
146 | + if ($listmode == '1') { |
|
147 | 147 | $grd->pageSize = 0; |
148 | 148 | } |
149 | - if ($_REQUEST['op'] == 'reset') { |
|
149 | + if ($_REQUEST['op'] == 'reset') { |
|
150 | 150 | $grd->pageNumber = 1; |
151 | 151 | } |
152 | 152 | // render grid |
@@ -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 />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if (!$modx->hasPermission('settings')) { |
|
5 | +if (!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | // check to see the edit settings page isn't locked |
12 | 12 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
13 | -if ($username = $modx->db->getValue($rs)) { |
|
13 | +if ($username = $modx->db->getValue($rs)) { |
|
14 | 14 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
15 | 15 | } |
16 | 16 | // end check for lock |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $settings = array(); |
21 | 21 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
22 | 22 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings'); |
23 | -while ($row = $modx->db->getRow($rs)) { |
|
23 | +while ($row = $modx->db->getRow($rs)) { |
|
24 | 24 | $settings[$row['setting_name']] = $row['setting_value']; |
25 | 25 | } |
26 | 26 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | // load languages and keys |
32 | 32 | $lang_keys = array(); |
33 | 33 | $dir = dir('includes/lang'); |
34 | -while ($file = $dir->read()) { |
|
35 | - if (strpos($file, '.inc.php') > 0) { |
|
34 | +while ($file = $dir->read()) { |
|
35 | + if (strpos($file, '.inc.php') > 0) { |
|
36 | 36 | $endpos = strpos($file, '.'); |
37 | 37 | $languagename = substr($file, 0, $endpos); |
38 | 38 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" /> |
70 | 70 | <input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" /> |
71 | 71 | <!-- this field is used to check site settings have been entered/ updated after install or upgrade --> |
72 | - <?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { |
|
72 | + <?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { |
|
73 | 73 | ?> |
74 | 74 | <div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div> |
75 | 75 | <?php |
@@ -133,6 +133,6 @@ discard block |
||
133 | 133 | }); |
134 | 134 | </script> |
135 | 135 | <?php |
136 | -if (is_numeric($_GET['tab'])) { |
|
136 | +if (is_numeric($_GET['tab'])) { |
|
137 | 137 | echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
138 | 138 | } |
@@ -1,8 +1,8 @@ |
||
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('change_password')) { |
|
5 | +if (!$modx->hasPermission('change_password')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | ?> |
@@ -1,16 +1,16 @@ 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 | -switch ($modx->manager->action) { |
|
6 | +switch ($modx->manager->action) { |
|
7 | 7 | case 88: |
8 | - if (!$modx->hasPermission('edit_web_user')) { |
|
8 | + if (!$modx->hasPermission('edit_web_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 87: |
13 | - if (!$modx->hasPermission('new_web_user')) { |
|
13 | + if (!$modx->hasPermission('new_web_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -23,23 +23,23 @@ discard block |
||
23 | 23 | |
24 | 24 | // check to see the snippet editor isn't locked |
25 | 25 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
26 | -if ($username = $modx->db->getValue($rs)) { |
|
26 | +if ($username = $modx->db->getValue($rs)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
31 | -if ($modx->manager->action == '88') { |
|
31 | +if ($modx->manager->action == '88') { |
|
32 | 32 | // get user attributes |
33 | 33 | $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
34 | 34 | $userdata = $modx->db->getRow($rs); |
35 | - if (!$userdata) { |
|
35 | + if (!$userdata) { |
|
36 | 36 | $modx->webAlertAndQuit("No user returned!"); |
37 | 37 | } |
38 | 38 | |
39 | 39 | // get user settings |
40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while ($row = $modx->db->getRow($rs)) { |
|
42 | + while ($row = $modx->db->getRow($rs)) { |
|
43 | 43 | $usersettings[$row['setting_name']] = $row['setting_value']; |
44 | 44 | } |
45 | 45 | extract($usersettings, EXTR_OVERWRITE); |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | // get user name |
48 | 48 | $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); |
49 | 49 | $usernamedata = $modx->db->getRow($rs); |
50 | - if (!$usernamedata) { |
|
50 | + if (!$usernamedata) { |
|
51 | 51 | $modx->webAlertAndQuit("No user returned while getting username!"); |
52 | 52 | } |
53 | 53 | $_SESSION['itemname'] = $usernamedata['username']; |
54 | -} else { |
|
54 | +} else { |
|
55 | 55 | $userdata = array(); |
56 | 56 | $usersettings = array(); |
57 | 57 | $usernamedata = array(); |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | // avoid doubling htmlspecialchars (already encoded in DB) |
62 | -foreach ($userdata as $key => $val) { |
|
62 | +foreach ($userdata as $key => $val) { |
|
63 | 63 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 64 | }; |
65 | 65 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
66 | 66 | |
67 | 67 | // restore saved form |
68 | 68 | $formRestored = false; |
69 | -if ($modx->manager->hasFormValues()) { |
|
69 | +if ($modx->manager->hasFormValues()) { |
|
70 | 70 | $modx->manager->loadFormValues(); |
71 | 71 | // restore post values |
72 | 72 | $userdata = array_merge($userdata, $_POST); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | |
81 | 81 | // include the country list language file |
82 | 82 | $_country_lang = array(); |
83 | -if ($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
83 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
84 | 84 | include_once "lang/country/" . $manager_language . "_country.inc.php"; |
85 | -} else { |
|
85 | +} else { |
|
86 | 86 | include_once "lang/country/english_country.inc.php"; |
87 | 87 | } |
88 | 88 | asort($_country_lang); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | <?php |
194 | 194 | // invoke OnWUsrFormPrerender event |
195 | 195 | $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
196 | - if (is_array($evtOut)) { |
|
196 | + if (is_array($evtOut)) { |
|
197 | 197 | echo implode("", $evtOut); |
198 | 198 | } |
199 | 199 | ?> |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
221 | 221 | <tr> |
222 | 222 | <td colspan="3"><span id="blocked" class="warning"> |
223 | - <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { |
|
223 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { |
|
224 | 224 | ?> |
225 | 225 | <b><?php echo $_lang['user_is_blocked']; ?></b> |
226 | 226 | <?php |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | </span> |
229 | 229 | <br /></td> |
230 | 230 | </tr> |
231 | - <?php if (!empty($userdata['id'])) { |
|
231 | + <?php if (!empty($userdata['id'])) { |
|
232 | 232 | ?> |
233 | 233 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '88' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
234 | 234 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
331 | 331 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
332 | 332 | <?php |
333 | - foreach ($_country_lang as $key => $country) { |
|
333 | + foreach ($_country_lang as $key => $country) { |
|
334 | 334 | echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
335 | 335 | } |
336 | 336 | ?> |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | <td> </td> |
358 | 358 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td> |
359 | 359 | </tr> |
360 | - <?php if ($modx->manager->action == '88') { |
|
360 | + <?php if ($modx->manager->action == '88') { |
|
361 | 361 | ?> |
362 | 362 | <tr> |
363 | 363 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
@@ -503,16 +503,17 @@ discard block |
||
503 | 503 | </table> |
504 | 504 | </div> |
505 | 505 | <?php |
506 | - if ($use_udperms == 1) { |
|
506 | + if ($use_udperms == 1) { |
|
507 | 507 | $groupsarray = array(); |
508 | 508 | |
509 | - if ($modx->manager->action == '88') { // only do this bit if the user is being edited |
|
509 | + if ($modx->manager->action == '88') { |
|
510 | +// only do this bit if the user is being edited |
|
510 | 511 | $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); |
511 | 512 | $groupsarray = $modx->db->getColumn('webgroup', $rs); |
512 | 513 | } |
513 | 514 | // retain selected user groups between post |
514 | - if (is_array($_POST['user_groups'])) { |
|
515 | - foreach ($_POST['user_groups'] as $n => $v) { |
|
515 | + if (is_array($_POST['user_groups'])) { |
|
516 | + foreach ($_POST['user_groups'] as $n => $v) { |
|
516 | 517 | $groupsarray[] = $v; |
517 | 518 | } |
518 | 519 | } ?> |
@@ -522,7 +523,7 @@ discard block |
||
522 | 523 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
523 | 524 | <?php |
524 | 525 | $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); |
525 | - while ($row = $modx->db->getRow($rs)) { |
|
526 | + while ($row = $modx->db->getRow($rs)) { |
|
526 | 527 | echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
527 | 528 | } |
528 | 529 | } |
@@ -533,7 +534,7 @@ discard block |
||
533 | 534 | $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
534 | 535 | "id" => $user |
535 | 536 | )); |
536 | - if (is_array($evtOut)) { |
|
537 | + if (is_array($evtOut)) { |
|
537 | 538 | echo implode("", $evtOut); |
538 | 539 | } |
539 | 540 | ?> |
@@ -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('logs')) { |
|
5 | +if (!$modx->hasPermission('logs')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | * @param string $checkKey |
12 | 12 | * @return array |
13 | 13 | */ |
14 | -function array_unique_multi($array, $checkKey) |
|
15 | -{ |
|
14 | +function array_unique_multi($array, $checkKey) |
|
15 | +{ |
|
16 | 16 | // Use the builtin if we're not a multi-dimensional array |
17 | - if (!is_array(current($array)) || empty($checkKey)) { |
|
17 | + if (!is_array(current($array)) || empty($checkKey)) { |
|
18 | 18 | return array_unique($array); |
19 | 19 | } |
20 | 20 | |
21 | 21 | $ret = array(); |
22 | 22 | $checkValues = array(); // contains the unique key Values |
23 | - foreach ($array as $key => $current) { |
|
24 | - if (in_array($current[$checkKey], $checkValues)) { |
|
23 | + foreach ($array as $key => $current) { |
|
24 | + if (in_array($current[$checkKey], $checkValues)) { |
|
25 | 25 | continue; |
26 | 26 | } // duplicate |
27 | 27 | |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | * @param string $key |
37 | 37 | * @return array |
38 | 38 | */ |
39 | -function record_sort($array, $key) |
|
40 | -{ |
|
39 | +function record_sort($array, $key) |
|
40 | +{ |
|
41 | 41 | $hash = array(); |
42 | - foreach ($array as $k => $v) { |
|
42 | + foreach ($array as $k => $v) { |
|
43 | 43 | $hash[$k] = $v[$key]; |
44 | 44 | } |
45 | 45 | |
46 | 46 | natsort($hash); |
47 | 47 | |
48 | 48 | $records = array(); |
49 | - foreach ($hash as $k => $row) { |
|
49 | + foreach ($hash as $k => $row) { |
|
50 | 50 | $records[$k] = $array[$k]; |
51 | 51 | } |
52 | 52 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | <?php |
74 | 74 | // get all users currently in the log |
75 | 75 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
76 | - foreach ($logs_user as $row) { |
|
76 | + foreach ($logs_user as $row) { |
|
77 | 77 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
78 | 78 | echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
79 | 79 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | // get all available actions in the log |
91 | 91 | include_once "actionlist.inc.php"; |
92 | 92 | $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action'); |
93 | - foreach ($logs_actions as $row) { |
|
93 | + foreach ($logs_actions as $row) { |
|
94 | 94 | $action = getAction($row['action']); |
95 | - if ($action == 'Idle') { |
|
95 | + if ($action == 'Idle') { |
|
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | <?php |
111 | 111 | // get all itemid currently in logging |
112 | 112 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
113 | - foreach ($logs_items as $row) { |
|
113 | + foreach ($logs_items as $row) { |
|
114 | 114 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
115 | 115 | echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
116 | 116 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <?php |
127 | 127 | // get all itemname currently in logging |
128 | 128 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
129 | - foreach ($logs_names as $row) { |
|
129 | + foreach ($logs_names as $row) { |
|
130 | 130 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
131 | 131 | echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
132 | 132 | } |
@@ -182,36 +182,36 @@ discard block |
||
182 | 182 | <div class="container container-body"> |
183 | 183 | |
184 | 184 | <?php |
185 | -if (isset($_REQUEST['log_submit'])) { |
|
185 | +if (isset($_REQUEST['log_submit'])) { |
|
186 | 186 | // get the selections the user made. |
187 | 187 | $sqladd = array(); |
188 | - if ($_REQUEST['searchuser'] != 0) { |
|
188 | + if ($_REQUEST['searchuser'] != 0) { |
|
189 | 189 | $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; |
190 | 190 | } |
191 | - if ($_REQUEST['action'] != 0) { |
|
191 | + if ($_REQUEST['action'] != 0) { |
|
192 | 192 | $sqladd[] = "action=" . (int)$_REQUEST['action']; |
193 | 193 | } |
194 | - if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
194 | + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
195 | 195 | $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
196 | 196 | } |
197 | - if ($_REQUEST['itemname'] != '0') { |
|
197 | + if ($_REQUEST['itemname'] != '0') { |
|
198 | 198 | $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
199 | 199 | } |
200 | - if ($_REQUEST['message'] != "") { |
|
200 | + if ($_REQUEST['message'] != "") { |
|
201 | 201 | $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
202 | 202 | } |
203 | 203 | // date stuff |
204 | - if ($_REQUEST['datefrom'] != "") { |
|
204 | + if ($_REQUEST['datefrom'] != "") { |
|
205 | 205 | $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
206 | 206 | } |
207 | - if ($_REQUEST['dateto'] != "") { |
|
207 | + if ($_REQUEST['dateto'] != "") { |
|
208 | 208 | $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
209 | 209 | } |
210 | 210 | |
211 | 211 | // If current position is not set, set it to zero |
212 | - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
212 | + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
213 | 213 | $int_cur_position = 0; |
214 | - } else { |
|
214 | + } else { |
|
215 | 215 | $int_cur_position = $_REQUEST['int_cur_position']; |
216 | 216 | } |
217 | 217 | |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | |
226 | 226 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); |
227 | 227 | |
228 | - if ($limit < 1) { |
|
228 | + if ($limit < 1) { |
|
229 | 229 | echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
230 | - } else { |
|
230 | + } else { |
|
231 | 231 | echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>'; |
232 | 232 | |
233 | 233 | include_once "paginate.inc.php"; |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
247 | 247 | $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
248 | 248 | $pagesfound = sizeof($array_row_paging); |
249 | - if ($pagesfound > 6) { |
|
249 | + if ($pagesfound > 6) { |
|
250 | 250 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
251 | 251 | $paging .= $array_row_paging[$current_row - 1]; // ." "; |
252 | 252 | $paging .= $array_row_paging[$current_row]; // ." "; |
253 | 253 | $paging .= $array_row_paging[$current_row + 1]; // ." "; |
254 | 254 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
255 | - } else { |
|
256 | - for ($i = 0; $i < $pagesfound; $i++) { |
|
255 | + } else { |
|
256 | + for ($i = 0; $i < $pagesfound; $i++) { |
|
257 | 257 | $paging .= $array_row_paging[$i] . " "; |
258 | 258 | } |
259 | 259 | } |
@@ -290,12 +290,12 @@ discard block |
||
290 | 290 | // grab the entire log file... |
291 | 291 | $logentries = array(); |
292 | 292 | $i = 0; |
293 | - while ($logentry = $modx->db->getRow($rs)) { |
|
294 | - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
293 | + while ($logentry = $modx->db->getRow($rs)) { |
|
294 | + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
295 | 295 | $item = '<div style="text-align:center;">-</div>'; |
296 | - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
296 | + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
297 | 297 | $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
298 | - } else { |
|
298 | + } else { |
|
299 | 299 | $item = $logentry['itemname']; |
300 | 300 | } |
301 | 301 | //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' |
@@ -329,6 +329,6 @@ discard block |
||
329 | 329 | // @see index.php @ 915 |
330 | 330 | global $action; |
331 | 331 | $action = 1; |
332 | - } else { |
|
332 | + } else { |
|
333 | 333 | echo $_lang["mgrlog_noquery"]; |
334 | 334 | } |
@@ -1,15 +1,15 @@ 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 | -switch ($modx->manager->action) { |
|
5 | +switch ($modx->manager->action) { |
|
6 | 6 | case 107: |
7 | - if (!$modx->hasPermission('new_module')) { |
|
7 | + if (!$modx->hasPermission('new_module')) { |
|
8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
9 | 9 | } |
10 | 10 | break; |
11 | 11 | case 108: |
12 | - if (!$modx->hasPermission('edit_module')) { |
|
12 | + if (!$modx->hasPermission('edit_module')) { |
|
13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
14 | 14 | } |
15 | 15 | break; |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @return string |
35 | 35 | */ |
36 | -function createGUID() |
|
37 | -{ |
|
36 | +function createGUID() |
|
37 | +{ |
|
38 | 38 | srand((double) microtime() * 1000000); |
39 | 39 | $r = rand(); |
40 | 40 | $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | // check to see the module editor isn't locked |
46 | -if ($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
46 | +if ($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
47 | 47 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
48 | 48 | } |
49 | 49 | // end check for lock |
@@ -51,22 +51,22 @@ discard block |
||
51 | 51 | // Lock snippet for other users to edit |
52 | 52 | $modx->lockElement(6, $id); |
53 | 53 | |
54 | -if (isset($_GET['id'])) { |
|
54 | +if (isset($_GET['id'])) { |
|
55 | 55 | $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
56 | 56 | $content = $modx->db->getRow($rs); |
57 | - if (!$content) { |
|
57 | + if (!$content) { |
|
58 | 58 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
59 | 59 | } |
60 | 60 | $content['properties'] = str_replace("&", "&", $content['properties']); |
61 | 61 | $_SESSION['itemname'] = $content['name']; |
62 | - if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
62 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
63 | 63 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
64 | 64 | } |
65 | -} else { |
|
65 | +} else { |
|
66 | 66 | $_SESSION['itemname'] = $_lang["new_module"]; |
67 | 67 | $content['wrap'] = '1'; |
68 | 68 | } |
69 | -if ($modx->manager->hasFormValues()) { |
|
69 | +if ($modx->manager->hasFormValues()) { |
|
70 | 70 | $modx->manager->loadFormValues(); |
71 | 71 | } |
72 | 72 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | <?php |
441 | 441 | // invoke OnModFormPrerender event |
442 | 442 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
443 | - if (is_array($evtOut)) { |
|
443 | + if (is_array($evtOut)) { |
|
444 | 444 | echo implode('', $evtOut); |
445 | 445 | } |
446 | 446 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | <option> </option> |
504 | 504 | <?php |
505 | 505 | include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
506 | - foreach (getCategories() as $n => $v) { |
|
506 | + foreach (getCategories() as $n => $v) { |
|
507 | 507 | echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
508 | 508 | } |
509 | 509 | ?> |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
656 | 656 | $groupsarray = $modx->db->getColumn('usergroup', $rs); |
657 | 657 | |
658 | - if ($modx->hasPermission('access_permissions')) { |
|
658 | + if ($modx->hasPermission('access_permissions')) { |
|
659 | 659 | ?> |
660 | 660 | <!-- User Group Access Permissions --> |
661 | 661 | <script type="text/javascript"> |
@@ -683,21 +683,21 @@ discard block |
||
683 | 683 | } |
684 | 684 | $chk = ''; |
685 | 685 | $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
686 | - while ($row = $modx->db->getRow($rs)) { |
|
686 | + while ($row = $modx->db->getRow($rs)) { |
|
687 | 687 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
688 | 688 | $checked = in_array($row['id'], $groupsarray); |
689 | - if ($modx->hasPermission('access_permissions')) { |
|
690 | - if ($checked) { |
|
689 | + if ($modx->hasPermission('access_permissions')) { |
|
690 | + if ($checked) { |
|
691 | 691 | $notPublic = true; |
692 | 692 | } |
693 | 693 | $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
694 | - } else { |
|
695 | - if ($checked) { |
|
694 | + } else { |
|
695 | + if ($checked) { |
|
696 | 696 | $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
697 | 697 | } |
698 | 698 | } |
699 | 699 | } |
700 | - if ($modx->hasPermission('access_permissions')) { |
|
700 | + if ($modx->hasPermission('access_permissions')) { |
|
701 | 701 | $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
702 | 702 | } |
703 | 703 | echo $chks; |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | <?php |
720 | 720 | // invoke OnModFormRender event |
721 | 721 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
722 | - if (is_array($evtOut)) { |
|
722 | + if (is_array($evtOut)) { |
|
723 | 723 | echo implode('', $evtOut); |
724 | 724 | } |
725 | 725 | ?> |
@@ -113,7 +113,7 @@ |
||
113 | 113 | <?php |
114 | 114 | // invoke OnMiscSettingsRender event |
115 | 115 | $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender'); |
116 | - if (is_array($evtOut)) { |
|
116 | + if (is_array($evtOut)) { |
|
117 | 117 | echo implode("", $evtOut); |
118 | 118 | } |
119 | 119 | ?> |