@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | * EVO Installer |
4 | 4 | */ |
5 | 5 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); |
6 | -$base_path = dirname(__DIR__) . '/'; |
|
6 | +$base_path = dirname(__DIR__).'/'; |
|
7 | 7 | |
8 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
9 | - include_once $base_path . 'assets/cache/siteManager.php'; |
|
8 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
9 | + include_once $base_path.'assets/cache/siteManager.php'; |
|
10 | 10 | } |
11 | -if (! defined('MGR_DIR')) { |
|
12 | - if (is_dir($base_path . 'manager')) { |
|
11 | +if (!defined('MGR_DIR')) { |
|
12 | + if (is_dir($base_path.'manager')) { |
|
13 | 13 | define('MGR_DIR', 'manager'); |
14 | 14 | } else { |
15 | 15 | die('MGR_DIR is not defined'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | require_once 'src/functions.php'; |
20 | 20 | |
21 | 21 | if (empty($_GET['self'])) { |
22 | - require_once '../' . MGR_DIR . '/includes/version.inc.php'; |
|
22 | + require_once '../'.MGR_DIR.'/includes/version.inc.php'; |
|
23 | 23 | |
24 | 24 | // start session |
25 | 25 | session_start(); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | install_sessionCheck(); |
28 | 28 | |
29 | 29 | $moduleName = 'EVO'; |
30 | - $moduleVersion = $modx_branch . ' ' . $modx_version; |
|
30 | + $moduleVersion = $modx_branch.' '.$modx_version; |
|
31 | 31 | $moduleRelease = $modx_release_date; |
32 | 32 | $moduleSQLBaseFile = 'stubs/sql/setup.sql'; |
33 | 33 | $moduleSQLDataFile = 'stubs/sql/setup.data.sql'; |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | $action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; |
69 | 69 | str_replace('.', '', $action); |
70 | 70 | |
71 | - $controller = 'src/controllers/' . $action . '.php'; |
|
72 | - if (! file_exists($controller)) { |
|
71 | + $controller = 'src/controllers/'.$action.'.php'; |
|
72 | + if (!file_exists($controller)) { |
|
73 | 73 | die("Invalid install action attempted. [action={$action}]"); |
74 | 74 | } |
75 | 75 | require $controller; |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | } else { |
82 | 82 | $action = isset($_GET['action']) && is_scalar($_GET['action']) ? trim($_GET['action']) : 'language'; |
83 | 83 | str_replace('.', '', $action); |
84 | - $controller = 'src/controllers/' . $action . '.php'; |
|
85 | - if (! file_exists($controller)) { |
|
84 | + $controller = 'src/controllers/'.$action.'.php'; |
|
85 | + if (!file_exists($controller)) { |
|
86 | 86 | die("Invalid install action attempted. [action={$action}]"); |
87 | 87 | } |
88 | 88 | require $controller; |
@@ -1,75 +1,75 @@ |
||
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 | -if($modx->getManagerApi()->action!='8' && isset($_SESSION['mgrValidated'])){ |
|
6 | +if ($modx->getManagerApi()->action != '8' && isset($_SESSION['mgrValidated'])) { |
|
7 | 7 | |
8 | - $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); |
|
8 | + $homeurl = $modx->makeUrl($manager_login_startup > 0 ? $manager_login_startup : $site_start); |
|
9 | 9 | $logouturl = MODX_MANAGER_URL.'index.php?a=8'; |
10 | 10 | |
11 | - $modx->setPlaceholder('modx_charset',$modx_manager_charset); |
|
12 | - $modx->setPlaceholder('theme',$manager_theme); |
|
11 | + $modx->setPlaceholder('modx_charset', $modx_manager_charset); |
|
12 | + $modx->setPlaceholder('theme', $manager_theme); |
|
13 | 13 | |
14 | - $modx->setPlaceholder('site_name',$site_name); |
|
15 | - $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); |
|
16 | - $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]); |
|
14 | + $modx->setPlaceholder('site_name', $site_name); |
|
15 | + $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); |
|
16 | + $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]); |
|
17 | 17 | |
18 | - $modx->setPlaceholder('home',$_lang["home"]); |
|
19 | - $modx->setPlaceholder('homeurl',$homeurl); |
|
20 | - $modx->setPlaceholder('logout',$_lang["logout"]); |
|
21 | - $modx->setPlaceholder('logouturl',$logouturl); |
|
22 | - $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); |
|
23 | - $modx->setPlaceholder('year',date('Y')); |
|
18 | + $modx->setPlaceholder('home', $_lang["home"]); |
|
19 | + $modx->setPlaceholder('homeurl', $homeurl); |
|
20 | + $modx->setPlaceholder('logout', $_lang["logout"]); |
|
21 | + $modx->setPlaceholder('logouturl', $logouturl); |
|
22 | + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/'); |
|
23 | + $modx->setPlaceholder('year', date('Y')); |
|
24 | 24 | |
25 | 25 | // load template |
26 | - if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { |
|
27 | - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
26 | + if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { |
|
27 | + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $target = $modx->config['manager_lockout_tpl']; |
31 | 31 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
32 | 32 | $target = $modx->mergeSettingsContent($target); |
33 | 33 | |
34 | - if(substr($target,0,1)==='@') { |
|
35 | - if(substr($target,0,6)==='@CHUNK') { |
|
36 | - $target = trim(substr($target,7)); |
|
34 | + if (substr($target, 0, 1) === '@') { |
|
35 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
36 | + $target = trim(substr($target, 7)); |
|
37 | 37 | $lockout_tpl = $modx->getChunk($target); |
38 | 38 | } |
39 | - elseif(substr($target,0,5)==='@FILE') { |
|
40 | - $target = trim(substr($target,6)); |
|
39 | + elseif (substr($target, 0, 5) === '@FILE') { |
|
40 | + $target = trim(substr($target, 6)); |
|
41 | 41 | $lockout_tpl = file_get_contents($target); |
42 | 42 | } |
43 | 43 | } else { |
44 | 44 | $chunk = $modx->getChunk($target); |
45 | - if($chunk!==false && !empty($chunk)) { |
|
45 | + if ($chunk !== false && !empty($chunk)) { |
|
46 | 46 | $lockout_tpl = $chunk; |
47 | 47 | } |
48 | - elseif(is_file(MODX_BASE_PATH . $target)) { |
|
49 | - $target = MODX_BASE_PATH . $target; |
|
48 | + elseif (is_file(MODX_BASE_PATH.$target)) { |
|
49 | + $target = MODX_BASE_PATH.$target; |
|
50 | 50 | $lockout_tpl = file_get_contents($target); |
51 | 51 | } |
52 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
53 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
|
52 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl')) { |
|
53 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl'; |
|
54 | 54 | $lockout_tpl = file_get_contents($target); |
55 | 55 | } |
56 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
57 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
|
56 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl')) { |
|
57 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl'; |
|
58 | 58 | $login_tpl = file_get_contents($target); |
59 | 59 | } |
60 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
61 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
|
60 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html')) { // ClipperCMS compatible |
|
61 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html'; |
|
62 | 62 | $lockout_tpl = file_get_contents($target); |
63 | 63 | } |
64 | 64 | else { |
65 | - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
65 | + $target = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl'; |
|
66 | 66 | $lockout_tpl = file_get_contents($target); |
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | 70 | // merge placeholders |
71 | 71 | $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); |
72 | - $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
72 | + $regx = strpos($lockout_tpl, '[[+') !== false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
73 | 73 | $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup |
74 | 74 | |
75 | 75 | echo $lockout_tpl; |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | 6 | // PROCESSOR FIRST |
7 | -if($_SESSION['mgrRole'] == 1) { |
|
8 | - if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
7 | +if ($_SESSION['mgrRole'] == 1) { |
|
8 | + if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
9 | 9 | $current = $modx->getManagerApi()->getSystemChecksum($modx->config['check_files_onlogin']); |
10 | - if(!empty($current)) { |
|
10 | + if (!empty($current)) { |
|
11 | 11 | $modx->getManagerApi()->setSystemChecksum($current); |
12 | 12 | $modx->clearCache('full'); |
13 | 13 | $modx->config['sys_files_checksum'] = $current; |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | $warningspresent = 0; |
20 | 20 | |
21 | 21 | $sysfiles_check = $modx->getManagerApi()->checkSystemChecksum(); |
22 | -if ($sysfiles_check!=='0'){ |
|
22 | +if ($sysfiles_check !== '0') { |
|
23 | 23 | $warningspresent = 1; |
24 | 24 | $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
25 | 25 | } |
26 | 26 | |
27 | -if (is_writable("includes/config.inc.php")){ |
|
27 | +if (is_writable("includes/config.inc.php")) { |
|
28 | 28 | // Warn if world writable |
29 | - if(@fileperms('includes/config.inc.php') & 0x0002) { |
|
29 | + if (@fileperms('includes/config.inc.php') & 0x0002) { |
|
30 | 30 | $warningspresent = 1; |
31 | 31 | $warnings[] = array($_lang['configcheck_configinc']); |
32 | 32 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | $warnings[] = array($_lang['configcheck_php_gdzip']); |
43 | 43 | } |
44 | 44 | |
45 | -if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') { |
|
46 | - if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') { |
|
45 | +if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') { |
|
46 | + if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') { |
|
47 | 47 | if ($modx->getDatabase()->getValue($modx->getDatabase()->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) { |
48 | 48 | $warningspresent = 1; |
49 | 49 | $warnings[] = array($_lang['configcheck_validate_referer']); |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // check for Template Switcher plugin |
55 | -if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') { |
|
56 | - if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') { |
|
55 | +if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') { |
|
56 | + if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') { |
|
57 | 57 | $rs = $modx->getDatabase()->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'"); |
58 | 58 | $row = $modx->getDatabase()->getRow($rs); |
59 | - if($row && $row['disabled'] == 0) { |
|
59 | + if ($row && $row['disabled'] == 0) { |
|
60 | 60 | $warningspresent = 1; |
61 | 61 | $warnings[] = array($_lang['configcheck_templateswitcher_present']); |
62 | 62 | $tplName = $row['name']; |
@@ -120,36 +120,36 @@ discard block |
||
120 | 120 | /** |
121 | 121 | * @return bool |
122 | 122 | */ |
123 | - function checkSiteCache() { |
|
123 | + function checkSiteCache(){ |
|
124 | 124 | $modx = evolutionCMS(); |
125 | - $checked= true; |
|
126 | - if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) { |
|
127 | - $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php'); |
|
125 | + $checked = true; |
|
126 | + if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) { |
|
127 | + $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php'); |
|
128 | 128 | } |
129 | 129 | return $checked; |
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | -if (!is_writable(MODX_BASE_PATH . "assets/cache/")) { |
|
133 | +if (!is_writable(MODX_BASE_PATH."assets/cache/")) { |
|
134 | 134 | $warningspresent = 1; |
135 | 135 | $warnings[] = array($_lang['configcheck_cache']); |
136 | 136 | } |
137 | 137 | |
138 | 138 | if (!checkSiteCache()) { |
139 | 139 | $warningspresent = 1; |
140 | - $warnings[]= array($lang['configcheck_sitecache_integrity']); |
|
140 | + $warnings[] = array($lang['configcheck_sitecache_integrity']); |
|
141 | 141 | } |
142 | 142 | |
143 | -if (!is_writable(MODX_BASE_PATH . "assets/images/")) { |
|
143 | +if (!is_writable(MODX_BASE_PATH."assets/images/")) { |
|
144 | 144 | $warningspresent = 1; |
145 | 145 | $warnings[] = array($_lang['configcheck_images']); |
146 | 146 | } |
147 | 147 | |
148 | -if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) { |
|
148 | +if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) { |
|
149 | 149 | $warningspresent = 1; |
150 | 150 | $warnings[] = array($_lang['configcheck_rb_base_dir']); |
151 | 151 | } |
152 | -if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) { |
|
152 | +if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) { |
|
153 | 153 | $warningspresent = 1; |
154 | 154 | $warnings[] = array($_lang['configcheck_filemanager_path']); |
155 | 155 | } |
@@ -157,36 +157,36 @@ discard block |
||
157 | 157 | // clear file info cache |
158 | 158 | clearstatcache(); |
159 | 159 | |
160 | -if ($warningspresent==1) { |
|
160 | +if ($warningspresent == 1) { |
|
161 | 161 | |
162 | -if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3'; |
|
162 | +if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3'; |
|
163 | 163 | $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>"; |
164 | 164 | |
165 | -for ($i=0;$i<count($warnings);$i++) { |
|
165 | +for ($i = 0; $i < count($warnings); $i++) { |
|
166 | 166 | switch ($warnings[$i][0]) { |
167 | 167 | case $_lang['configcheck_configinc']; |
168 | 168 | $warnings[$i][1] = $_lang['configcheck_configinc_msg']; |
169 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']); |
|
169 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']); |
|
170 | 170 | break; |
171 | 171 | case $_lang['configcheck_installer'] : |
172 | 172 | $warnings[$i][1] = $_lang['configcheck_installer_msg']; |
173 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']); |
|
173 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']); |
|
174 | 174 | break; |
175 | 175 | case $_lang['configcheck_cache'] : |
176 | 176 | $warnings[$i][1] = $_lang['configcheck_cache_msg']; |
177 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']); |
|
177 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']); |
|
178 | 178 | break; |
179 | 179 | case $_lang['configcheck_images'] : |
180 | 180 | $warnings[$i][1] = $_lang['configcheck_images_msg']; |
181 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']); |
|
181 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']); |
|
182 | 182 | break; |
183 | 183 | case $_lang['configcheck_sysfiles_mod']: |
184 | 184 | $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; |
185 | - $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>'; |
|
186 | - if($modx->hasPermission('settings')) { |
|
187 | - $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
|
185 | + $warnings[$i][2] = '<ul><li>'.implode('</li><li>', $sysfiles_check).'</li></ul>'; |
|
186 | + if ($modx->hasPermission('settings')) { |
|
187 | + $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>'; |
|
188 | 188 | } |
189 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); |
|
189 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".implode(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']); |
|
190 | 190 | break; |
191 | 191 | case $_lang['configcheck_lang_difference'] : |
192 | 192 | $warnings[$i][1] = $_lang['configcheck_lang_difference_msg']; |
@@ -208,18 +208,18 @@ discard block |
||
208 | 208 | break; |
209 | 209 | case $_lang['configcheck_validate_referer'] : |
210 | 210 | $msg = $_lang['configcheck_validate_referer_msg']; |
211 | - $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer'); |
|
211 | + $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer'); |
|
212 | 212 | $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n"; |
213 | 213 | break; |
214 | 214 | case $_lang['configcheck_templateswitcher_present'] : |
215 | 215 | $msg = $_lang["configcheck_templateswitcher_present_msg"]; |
216 | - if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') { |
|
217 | - $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"]; |
|
216 | + if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') { |
|
217 | + $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"]; |
|
218 | 218 | } |
219 | - if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') { |
|
220 | - $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"]; |
|
219 | + if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') { |
|
220 | + $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"]; |
|
221 | 221 | } |
222 | - $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present'); |
|
222 | + $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present'); |
|
223 | 223 | $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n"; |
224 | 224 | break; |
225 | 225 | case $_lang['configcheck_rb_base_dir'] : |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $warnings[$i][1] = $_lang['configcheck_default_msg']; |
233 | 233 | } |
234 | 234 | |
235 | - $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ; |
|
235 | + $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : ""; |
|
236 | 236 | $config_check_results .= " |
237 | 237 | <fieldset> |
238 | 238 | <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p> |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')." |
242 | 242 | </fieldset> |
243 | 243 | "; |
244 | - if ($i!=count($warnings)-1) { |
|
244 | + if ($i != count($warnings) - 1) { |
|
245 | 245 | $config_check_results .= "<br />"; |
246 | 246 | } |
247 | 247 | } |
248 | - $_SESSION["mgrConfigCheck"]=true; |
|
248 | + $_SESSION["mgrConfigCheck"] = true; |
|
249 | 249 | } else { |
250 | 250 | $config_check_results = $_lang['configcheck_ok']; |
251 | 251 | } |
@@ -20,14 +20,14 @@ |
||
20 | 20 | ($docid > 0 ? "id='$docid'" : "privatemgr = 1")); |
21 | 21 | $rs = $modx->getDatabase()->select( |
22 | 22 | 'DISTINCT sc.id', |
23 | - $modx->getFullTableName("site_content") . " sc |
|
24 | - LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id |
|
25 | - LEFT JOIN " . $modx->getFullTableName("membergroup_access") . " mga ON mga.documentgroup = dg.document_group", |
|
26 | - ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "mga.id>0" |
|
23 | + $modx->getFullTableName("site_content")." sc |
|
24 | + LEFT JOIN " . $modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
|
25 | + LEFT JOIN " . $modx->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group", |
|
26 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."mga.id>0" |
|
27 | 27 | ); |
28 | 28 | $ids = $modx->getDatabase()->getColumn("id", $rs); |
29 | 29 | if (count($ids) > 0) { |
30 | 30 | $modx->getDatabase()->update('privatemgr = 1', $modx->getFullTableName("site_content"), |
31 | - "id IN (" . implode(", ", $ids) . ")"); |
|
31 | + "id IN (".implode(", ", $ids).")"); |
|
32 | 32 | } |
33 | 33 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | if (!empty($user_id)) { |
15 | 15 | // Raymond: grab the user settings from the database. |
16 | 16 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getFullTableName('user_settings'), |
17 | - "user=" . $modx->getLoginUserID()); |
|
17 | + "user=".$modx->getLoginUserID()); |
|
18 | 18 | |
19 | 19 | $which_browser_default = $which_browser; |
20 | 20 | while ($row = $modx->getDatabase()->getRow($rs)) { |
@@ -20,14 +20,14 @@ |
||
20 | 20 | ($docid > 0 ? "id='$docid'" : "privateweb = 1")); |
21 | 21 | $rs = $modx->getDatabase()->select( |
22 | 22 | 'DISTINCT sc.id', |
23 | - $modx->getFullTableName("site_content") . " sc |
|
24 | - LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id |
|
25 | - LEFT JOIN " . $modx->getFullTableName("webgroup_access") . " wga ON wga.documentgroup = dg.document_group", |
|
26 | - ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "wga.id>0" |
|
23 | + $modx->getFullTableName("site_content")." sc |
|
24 | + LEFT JOIN " . $modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
|
25 | + LEFT JOIN " . $modx->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group", |
|
26 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."wga.id>0" |
|
27 | 27 | ); |
28 | 28 | $ids = $modx->getDatabase()->getColumn("id", $rs); |
29 | 29 | if (count($ids) > 0) { |
30 | 30 | $modx->getDatabase()->update('privateweb = 1', $modx->getFullTableName("site_content"), |
31 | - "id IN (" . implode(", ", $ids) . ")"); |
|
31 | + "id IN (".implode(", ", $ids).")"); |
|
32 | 32 | } |
33 | 33 | } |
@@ -1,10 +1,10 @@ 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 | global $SystemAlertMsgQueque; |
6 | 6 | // display system alert window if messages are available |
7 | -if(count($SystemAlertMsgQueque) > 0) { |
|
7 | +if (count($SystemAlertMsgQueque) > 0) { |
|
8 | 8 | include "sysalert.display.inc.php"; |
9 | 9 | } |
10 | 10 | ?> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | }); |
19 | 19 | </script> |
20 | 20 | <?php |
21 | -if(in_array($modx->getManagerApi()->action, array( |
|
21 | +if (in_array($modx->getManagerApi()->action, array( |
|
22 | 22 | 85, |
23 | 23 | 27, |
24 | 24 | 4, |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $sysMsgs = ""; |
14 | 14 | $limit = count($SystemAlertMsgQueque); |
15 | - for($i=0;$i<$limit;$i++) { |
|
15 | + for ($i = 0; $i < $limit; $i++) { |
|
16 | 16 | $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
17 | 17 | } |
18 | 18 | // reset message queque |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $_SESSION['SystemAlertMsgQueque'] = array(); |
21 | 21 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
22 | 22 | |
23 | - if($sysMsgs!="") { |
|
23 | + if ($sysMsgs != "") { |
|
24 | 24 | ?> |
25 | 25 | |
26 | 26 | <?php // fetch the styles |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | var sysAlert = new Element('div').setProperties({ |
33 | 33 | 'class': 'sysAlert' |
34 | 34 | }); |
35 | - sysAlert.innerHTML = '<?php echo $modx->getDatabase()->escape($sysMsgs);?>'; |
|
35 | + sysAlert.innerHTML = '<?php echo $modx->getDatabase()->escape($sysMsgs); ?>'; |
|
36 | 36 | var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, { |
37 | 37 | buttons: 1, |
38 | 38 | button1: 'Ok', |
@@ -146,33 +146,33 @@ discard block |
||
146 | 146 | $algorithm = 'UNCRYPT'; |
147 | 147 | } |
148 | 148 | |
149 | - $salt = md5($password . $seed); |
|
149 | + $salt = md5($password.$seed); |
|
150 | 150 | |
151 | 151 | switch ($algorithm) { |
152 | 152 | case 'BLOWFISH_Y': |
153 | - $salt = '$2y$07$' . substr($salt, 0, 22); |
|
153 | + $salt = '$2y$07$'.substr($salt, 0, 22); |
|
154 | 154 | break; |
155 | 155 | case 'BLOWFISH_A': |
156 | - $salt = '$2a$07$' . substr($salt, 0, 22); |
|
156 | + $salt = '$2a$07$'.substr($salt, 0, 22); |
|
157 | 157 | break; |
158 | 158 | case 'SHA512': |
159 | - $salt = '$6$' . substr($salt, 0, 16); |
|
159 | + $salt = '$6$'.substr($salt, 0, 16); |
|
160 | 160 | break; |
161 | 161 | case 'SHA256': |
162 | - $salt = '$5$' . substr($salt, 0, 16); |
|
162 | + $salt = '$5$'.substr($salt, 0, 16); |
|
163 | 163 | break; |
164 | 164 | case 'MD5': |
165 | - $salt = '$1$' . substr($salt, 0, 8); |
|
165 | + $salt = '$1$'.substr($salt, 0, 8); |
|
166 | 166 | break; |
167 | 167 | } |
168 | 168 | |
169 | 169 | if ($algorithm !== 'UNCRYPT') { |
170 | - $password = sha1($password) . crypt($password, $salt); |
|
170 | + $password = sha1($password).crypt($password, $salt); |
|
171 | 171 | } else { |
172 | - $password = sha1($salt . $password); |
|
172 | + $password = sha1($salt.$password); |
|
173 | 173 | } |
174 | 174 | |
175 | - $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8); |
|
175 | + $result = strtolower($algorithm).'>'.md5($salt.$password).substr(md5($salt), 0, 8); |
|
176 | 176 | |
177 | 177 | return $result; |
178 | 178 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $check_files = explode("\n", $check_files); |
255 | 255 | foreach ($check_files as $file) { |
256 | 256 | $file = trim($file); |
257 | - $file = MODX_BASE_PATH . $file; |
|
257 | + $file = MODX_BASE_PATH.$file; |
|
258 | 258 | if (!is_file($file)) { |
259 | 259 | continue; |
260 | 260 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $checksum = unserialize($checksum); |
278 | 278 | foreach ($check_files as $file) { |
279 | 279 | $file = trim($file); |
280 | - $filePath = MODX_BASE_PATH . $file; |
|
280 | + $filePath = MODX_BASE_PATH.$file; |
|
281 | 281 | if (!is_file($filePath)) { |
282 | 282 | continue; |
283 | 283 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | { |
297 | 297 | $modx = evolutionCMS(); |
298 | 298 | $tbl_system_settings = $modx->getFullTableName('system_settings'); |
299 | - $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->getDatabase()->escape($checksum) . "')"; |
|
299 | + $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','".$modx->getDatabase()->escape($checksum)."')"; |
|
300 | 300 | $modx->getDatabase()->query($sql); |
301 | 301 | } |
302 | 302 | |
@@ -373,10 +373,10 @@ discard block |
||
373 | 373 | foreach ($settings as $key => $val) { |
374 | 374 | $f = array(); |
375 | 375 | $f['user'] = $_SESSION['mgrInternalKey']; |
376 | - $f['setting_name'] = '_LAST_' . $key; |
|
376 | + $f['setting_name'] = '_LAST_'.$key; |
|
377 | 377 | $f['setting_value'] = $val; |
378 | 378 | $f = $modx->getDatabase()->escape($f); |
379 | - $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')"; |
|
379 | + $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')"; |
|
380 | 380 | $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)"; |
381 | 381 | $modx->getDatabase()->insert($f, $modx->getFullTableName('user_settings')); |
382 | 382 | } |