@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if (file_exists(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php")) { |
|
3 | - include_once(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php"); |
|
2 | +if (file_exists(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php")) { |
|
3 | + include_once(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php"); |
|
4 | 4 | } else { |
5 | 5 | define('MGR_DIR', 'manager'); |
6 | 6 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | // set timout limit |
26 | 26 | @ set_time_limit(120); // used @ to prevent warning when using safe mode? |
27 | 27 | |
28 | -$installMode = (int)$_POST['installmode']; |
|
29 | -$installData = (int)!empty($_POST['installdata']); |
|
28 | +$installMode = (int) $_POST['installmode']; |
|
29 | +$installData = (int) !empty($_POST['installdata']); |
|
30 | 30 | |
31 | 31 | // get db info from post |
32 | 32 | $database_server = $_POST['databasehost']; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
37 | 37 | $database_connection_charset = $_POST['database_connection_charset']; |
38 | 38 | $database_connection_method = $_POST['database_connection_method']; |
39 | -$dbase = "`" . $_POST['database_name'] . "`"; |
|
39 | +$dbase = "`".$_POST['database_name']."`"; |
|
40 | 40 | $table_prefix = $_POST['tableprefix']; |
41 | 41 | $adminname = $_POST['cmsadmin']; |
42 | 42 | $adminemail = $_POST['cmsadminemail']; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | // set session name variable |
48 | 48 | if (!isset ($site_sessionname)) { |
49 | - $site_sessionname = 'SN' . uniqid(''); |
|
49 | + $site_sessionname = 'SN'.uniqid(''); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // get base path and url |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | } |
63 | 63 | $pth = implode('install', $a); |
64 | 64 | unset ($a); |
65 | -$base_url = $url . (substr($url, -1) != '/' ? '/' : ''); |
|
66 | -$base_path = $pth . (substr($pth, -1) != '/' ? '/' : ''); |
|
65 | +$base_url = $url.(substr($url, -1) != '/' ? '/' : ''); |
|
66 | +$base_path = $pth.(substr($pth, -1) != '/' ? '/' : ''); |
|
67 | 67 | |
68 | 68 | // connect to the database |
69 | 69 | $conn = @mysqli_connect($database_server, $database_user, $database_password); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if ($installLevel === 1) { |
93 | 93 | // check table prefix |
94 | 94 | if ($installMode === 0) { |
95 | - $query = "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`"; |
|
95 | + $query = "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`"; |
|
96 | 96 | if (@mysqli_query($conn, $query)) { |
97 | 97 | $errors += 1; |
98 | 98 | } else { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | // check status of Inherit Parent Template plugin |
108 | 108 | $auto_template_logic = 'parent'; |
109 | 109 | if ($installMode !== 0) { |
110 | - $query = "SELECT properties, disabled FROM " . $dbase . ".`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'"; |
|
110 | + $query = "SELECT properties, disabled FROM ".$dbase.".`".$table_prefix."site_plugins` WHERE name='Inherit Parent Template'"; |
|
111 | 111 | $rs = mysqli_query($conn, $query); |
112 | 112 | $row = mysqli_fetch_row($rs); |
113 | 113 | if (!$row) { |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | // open db connection |
133 | - include dirname(__DIR__) . '/processor/result.php'; |
|
134 | - include_once dirname(__DIR__) . '/sqlParser.class.php'; |
|
133 | + include dirname(__DIR__).'/processor/result.php'; |
|
134 | + include_once dirname(__DIR__).'/sqlParser.class.php'; |
|
135 | 135 | $sqlParser = new SqlParser( |
136 | 136 | $database_server, |
137 | 137 | $database_user, |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | $confph['lastInstallTime'] = time(); |
178 | 178 | $confph['site_sessionname'] = $site_sessionname; |
179 | 179 | |
180 | - $configString = file_get_contents(dirname(dirname(__DIR__)) . '/stubs/config.tpl'); |
|
180 | + $configString = file_get_contents(dirname(dirname(__DIR__)).'/stubs/config.tpl'); |
|
181 | 181 | $configString = parse($configString, $confph); |
182 | 182 | |
183 | - $filename = dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config.inc.php'; |
|
183 | + $filename = dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config.inc.php'; |
|
184 | 184 | $configFileFailed = false; |
185 | 185 | if (@ !$handle = fopen($filename, 'w')) { |
186 | 186 | $configFileFailed = true; |
@@ -208,13 +208,13 @@ discard block |
||
208 | 208 | $siteid = uniqid(''); |
209 | 209 | mysqli_query( |
210 | 210 | $sqlParser->conn, |
211 | - "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')" |
|
211 | + "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')" |
|
212 | 212 | ); |
213 | 213 | } else { |
214 | 214 | // update site_id if missing |
215 | 215 | $ds = mysqli_query( |
216 | 216 | $sqlParser->conn, |
217 | - "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'" |
|
217 | + "SELECT setting_name,setting_value FROM $dbase.`".$table_prefix."system_settings` WHERE setting_name='site_id'" |
|
218 | 218 | ); |
219 | 219 | if ($ds) { |
220 | 220 | $r = mysqli_fetch_assoc($ds); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $siteid = uniqid(''); |
224 | 224 | mysqli_query( |
225 | 225 | $sqlParser->conn, |
226 | - "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')" |
|
226 | + "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')" |
|
227 | 227 | ); |
228 | 228 | } |
229 | 229 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | if ($installLevel === 5 && (isset ($_POST['template']) || $installData)) { |
250 | 250 | $selTemplates = $_POST['template']; |
251 | 251 | foreach ($moduleTemplates as $k => $moduleTemplate) { |
252 | - if (! is_array($moduleTemplate)) { |
|
252 | + if (!is_array($moduleTemplate)) { |
|
253 | 253 | continue; |
254 | 254 | } |
255 | 255 | $installDataLevel['templates'][$moduleTemplate[0]] = array( |
@@ -287,12 +287,12 @@ discard block |
||
287 | 287 | $template = mysqli_real_escape_string($conn, $template); |
288 | 288 | |
289 | 289 | // See if the template already exists |
290 | - $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name'"; |
|
290 | + $query = "SELECT * FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name'"; |
|
291 | 291 | $rs = mysqli_query($sqlParser->conn, $query); |
292 | 292 | |
293 | 293 | if (mysqli_num_rows($rs)) { |
294 | 294 | $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'update'; |
295 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;"; |
|
295 | + $query = "UPDATE $dbase.`".$table_prefix."site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name' LIMIT 1;"; |
|
296 | 296 | if (!mysqli_query($sqlParser->conn, $query)) { |
297 | 297 | $errors += 1; |
298 | 298 | $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array( |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | if (!is_null($save_sql_id_as)) { |
306 | 306 | $sql_id = @mysqli_insert_id($sqlParser->conn); |
307 | 307 | if (!$sql_id) { |
308 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name' LIMIT 1;"; |
|
308 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name' LIMIT 1;"; |
|
309 | 309 | $idQuery = mysqli_fetch_assoc(mysqli_query($sqlParser->conn, $query)); |
310 | 310 | $sql_id = $idQuery['id']; |
311 | 311 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | } else { |
315 | 315 | $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'create'; |
316 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');"; |
|
316 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');"; |
|
317 | 317 | if (!@mysqli_query($sqlParser->conn, $query)) { |
318 | 318 | $errors += 1; |
319 | 319 | $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array( |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | // Create the category if it does not already exist |
379 | 379 | $category = getCreateDbCategory($category, $sqlParser); |
380 | 380 | |
381 | - $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'"; |
|
382 | - $rs = mysqli_query($sqlParser->conn,$query); |
|
381 | + $query = "SELECT * FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name'"; |
|
382 | + $rs = mysqli_query($sqlParser->conn, $query); |
|
383 | 383 | if (mysqli_num_rows($rs)) { |
384 | 384 | $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'update'; |
385 | 385 | while ($row = mysqli_fetch_assoc($rs)) { |
386 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};"; |
|
386 | + $query = "UPDATE $dbase.`".$table_prefix."site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};"; |
|
387 | 387 | if (!mysqli_query($sqlParser->conn, $query)) { |
388 | 388 | $installDataLevel['tvs'][$moduleTV[0]]['error'] = array( |
389 | 389 | 'type' => 'sql', |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | } |
397 | 397 | } else { |
398 | 398 | $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'create'; |
399 | - $q = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; |
|
399 | + $q = "INSERT INTO $dbase.`".$table_prefix."site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; |
|
400 | 400 | if (!mysqli_query($sqlParser->conn, $q)) { |
401 | 401 | $installDataLevel['tvs'][$moduleTV[0]]['error'] = array( |
402 | 402 | 'type' => 'sql', |
@@ -413,23 +413,23 @@ discard block |
||
413 | 413 | if (count($assignments) > 0) { |
414 | 414 | |
415 | 415 | // remove existing tv -> template assignments |
416 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name' AND description='$desc';"; |
|
416 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';"; |
|
417 | 417 | $ds = mysqli_query($sqlParser->conn, $query); |
418 | 418 | $row = mysqli_fetch_assoc($ds); |
419 | 419 | $id = $row["id"]; |
420 | - $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_tmplvar_templates` WHERE tmplvarid = \'' . $id . '\''; |
|
420 | + $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_tmplvar_templates` WHERE tmplvarid = \''.$id.'\''; |
|
421 | 421 | mysqli_query($sqlParser->conn, $query); |
422 | 422 | |
423 | 423 | // add tv -> template assignments |
424 | 424 | foreach ($assignments as $assignment) { |
425 | 425 | $template = mysqli_real_escape_string($conn, $assignment); |
426 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';"; |
|
426 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$template';"; |
|
427 | 427 | $ts = mysqli_query($sqlParser->conn, $query); |
428 | 428 | if ($ds && $ts) { |
429 | 429 | $tRow = mysqli_fetch_assoc($ts); |
430 | 430 | $templateId = $tRow['id']; |
431 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"; |
|
432 | - mysqli_query($sqlParser->conn,$query); |
|
431 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"; |
|
432 | + mysqli_query($sqlParser->conn, $query); |
|
433 | 433 | } |
434 | 434 | } |
435 | 435 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['chunk']) || $installData)) { |
442 | 442 | $selChunks = $_POST['chunk']; |
443 | 443 | foreach ($moduleChunks as $k => $moduleChunk) { |
444 | - if (! is_array($moduleChunk)) { |
|
444 | + if (!is_array($moduleChunk)) { |
|
445 | 445 | continue; |
446 | 446 | } |
447 | 447 | $installDataLevel['chunks'][$moduleChunk[0]] = array( |
@@ -479,14 +479,14 @@ discard block |
||
479 | 479 | $chunk = mysqli_real_escape_string($conn, $chunk); |
480 | 480 | $rs = mysqli_query( |
481 | 481 | $sqlParser->conn, |
482 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'" |
|
482 | + "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$name'" |
|
483 | 483 | ); |
484 | 484 | $count_original_name = mysqli_num_rows($rs); |
485 | 485 | if ($overwrite == 'false') { |
486 | - $newname = $name . '-' . str_replace('.', '_', $modx_version); |
|
486 | + $newname = $name.'-'.str_replace('.', '_', $modx_version); |
|
487 | 487 | $rs = mysqli_query( |
488 | 488 | $sqlParser->conn, |
489 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'" |
|
489 | + "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$newname'" |
|
490 | 490 | ); |
491 | 491 | $count_new_name = mysqli_num_rows($rs); |
492 | 492 | } |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | if ($update) { |
495 | 495 | $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'update'; |
496 | 496 | if (!mysqli_query($sqlParser->conn, |
497 | - "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
497 | + "UPDATE $dbase.`".$table_prefix."site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|
498 | 498 | $errors += 1; |
499 | 499 | $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array( |
500 | 500 | 'type' => 'sql', |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | } else { |
512 | 512 | $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'create'; |
513 | 513 | } |
514 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);"; |
|
514 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);"; |
|
515 | 515 | if (!mysqli_query($sqlParser->conn, $query)) { |
516 | 516 | $errors += 1; |
517 | 517 | $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array( |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['module']) || $installData)) { |
535 | 535 | $selModules = $_POST['module']; |
536 | 536 | foreach ($moduleModules as $k => $moduleModule) { |
537 | - if (! is_array($moduleModule)) { |
|
537 | + if (!is_array($moduleModule)) { |
|
538 | 538 | continue; |
539 | 539 | } |
540 | 540 | $installDataLevel['modules'][$moduleModule[0]] = array( |
@@ -573,13 +573,13 @@ discard block |
||
573 | 573 | // $module = removeDocblock($module, 'module'); // Modules have no fileBinding, keep docblock for info-tab |
574 | 574 | $module = mysqli_real_escape_string($conn, $module); |
575 | 575 | $rs = mysqli_query($sqlParser->conn, |
576 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_modules` WHERE name='$name'"); |
|
576 | + "SELECT * FROM $dbase.`".$table_prefix."site_modules` WHERE name='$name'"); |
|
577 | 577 | if (mysqli_num_rows($rs)) { |
578 | 578 | $installDataLevel['modules'][$moduleModule[0]]['type'] = 'update'; |
579 | 579 | $row = mysqli_fetch_assoc($rs); |
580 | 580 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
581 | 581 | if (!mysqli_query($sqlParser->conn, |
582 | - "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
582 | + "UPDATE $dbase.`".$table_prefix."site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { |
|
583 | 583 | $installDataLevel['modules'][$moduleModule[0]]['error'] = array( |
584 | 584 | 'type' => 'sql', |
585 | 585 | 'content' => mysqli_error($sqlParser->conn) |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | $installDataLevel['modules'][$moduleModule[0]]['type'] = 'create'; |
592 | 592 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
593 | 593 | if (!mysqli_query($sqlParser->conn, |
594 | - "INSERT INTO $dbase.`" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { |
|
594 | + "INSERT INTO $dbase.`".$table_prefix."site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { |
|
595 | 595 | $installDataLevel['modules'][$moduleModule[0]]['error'] = array( |
596 | 596 | 'type' => 'sql', |
597 | 597 | 'content' => mysqli_error($sqlParser->conn) |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['plugin']) || $installData)) { |
612 | 612 | $selPlugs = $_POST['plugin']; |
613 | 613 | foreach ($modulePlugins as $k => $modulePlugin) { |
614 | - if (! is_array($modulePlugin)) { |
|
614 | + if (!is_array($modulePlugin)) { |
|
615 | 615 | continue; |
616 | 616 | } |
617 | 617 | $installDataLevel['plugins'][$modulePlugin[0]] = array( |
@@ -645,12 +645,12 @@ discard block |
||
645 | 645 | $disabled = $modulePlugin[9]; |
646 | 646 | if (array_key_exists(7, $modulePlugin)) { |
647 | 647 | // parse comma-separated legacy names and prepare them for sql IN clause |
648 | - $leg_names = "'" . implode( |
|
648 | + $leg_names = "'".implode( |
|
649 | 649 | "','", |
650 | 650 | preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7])) |
651 | - ) . "'"; |
|
651 | + )."'"; |
|
652 | 652 | } |
653 | - if (! file_exists($filecontent)) { |
|
653 | + if (!file_exists($filecontent)) { |
|
654 | 654 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
655 | 655 | 'type' => 'file_not_found' |
656 | 656 | ); |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | |
659 | 659 | // disable legacy versions based on legacy_names provided |
660 | 660 | if (!empty($leg_names)) { |
661 | - $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
661 | + $update_query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; |
|
662 | 662 | $rs = mysqli_query($sqlParser->conn, $update_query); |
663 | 663 | } |
664 | 664 | |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | $plugin = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2)); |
669 | 669 | $plugin = removeDocblock($plugin, 'plugin'); |
670 | 670 | $plugin = mysqli_real_escape_string($conn, $plugin); |
671 | - $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name'"; |
|
671 | + $query = "SELECT * FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name'"; |
|
672 | 672 | $rs = mysqli_query($sqlParser->conn, $query); |
673 | 673 | if (mysqli_num_rows($rs)) { |
674 | 674 | $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'update'; |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | while ($row = mysqli_fetch_assoc($rs)) { |
677 | 677 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
678 | 678 | if ($row['description'] == $desc) { |
679 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};"; |
|
679 | + $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};"; |
|
680 | 680 | if (!mysqli_query($sqlParser->conn, $query)) { |
681 | 681 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
682 | 682 | 'type' => 'sql', |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | } |
688 | 688 | $insert = false; |
689 | 689 | } else { |
690 | - $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};"; |
|
690 | + $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE id={$row['id']};"; |
|
691 | 691 | if (!mysqli_query($sqlParser->conn, $query)) { |
692 | 692 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
693 | 693 | 'type' => 'sql', |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | } |
701 | 701 | if ($insert === true) { |
702 | 702 | $properties = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
703 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);"; |
|
703 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);"; |
|
704 | 704 | if (!mysqli_query($sqlParser->conn, $query)) { |
705 | 705 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
706 | 706 | 'type' => 'sql', |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | } else { |
714 | 714 | $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'create'; |
715 | 715 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
716 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);"; |
|
716 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);"; |
|
717 | 717 | if (!mysqli_query($sqlParser->conn, $query)) { |
718 | 718 | $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array( |
719 | 719 | 'type' => 'sql', |
@@ -725,17 +725,17 @@ discard block |
||
725 | 725 | } |
726 | 726 | // add system events |
727 | 727 | if (count($events) > 0) { |
728 | - $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name' AND description='$desc';"; |
|
728 | + $query = "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';"; |
|
729 | 729 | $ds = mysqli_query($sqlParser->conn, $query); |
730 | 730 | if ($ds) { |
731 | 731 | $row = mysqli_fetch_assoc($ds); |
732 | 732 | $id = $row["id"]; |
733 | 733 | // remove existing events |
734 | - $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''; |
|
734 | + $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_plugin_events` WHERE pluginid = \''.$id.'\''; |
|
735 | 735 | mysqli_query($sqlParser->conn, $query); |
736 | 736 | // add new events |
737 | - $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", $events) . "')"; |
|
738 | - mysqli_query($sqlParser->conn,$query); |
|
737 | + $query = "INSERT INTO $dbase.`".$table_prefix."site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`".$table_prefix."system_eventnames` se WHERE name IN ('".implode("','", $events)."')"; |
|
738 | + mysqli_query($sqlParser->conn, $query); |
|
739 | 739 | } |
740 | 740 | } |
741 | 741 | } |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | if ($installLevel === 5 && $errorData === false && (isset ($_POST['snippet']) || $installData)) { |
750 | 750 | $selSnips = $_POST['snippet']; |
751 | 751 | foreach ($moduleSnippets as $k => $moduleSnippet) { |
752 | - if (! is_array($moduleSnippet)) { |
|
752 | + if (!is_array($moduleSnippet)) { |
|
753 | 753 | continue; |
754 | 754 | } |
755 | 755 | $installDataLevel['snippets'][$moduleSnippet[0]] = array( |
@@ -784,13 +784,13 @@ discard block |
||
784 | 784 | $snippet = removeDocblock($snippet, 'snippet'); |
785 | 785 | $snippet = mysqli_real_escape_string($conn, $snippet); |
786 | 786 | $rs = mysqli_query($sqlParser->conn, |
787 | - "SELECT * FROM $dbase.`" . $table_prefix . "site_snippets` WHERE name='$name'"); |
|
787 | + "SELECT * FROM $dbase.`".$table_prefix."site_snippets` WHERE name='$name'"); |
|
788 | 788 | if (mysqli_num_rows($rs)) { |
789 | 789 | $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'update'; |
790 | 790 | $row = mysqli_fetch_assoc($rs); |
791 | 791 | $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties'])); |
792 | 792 | if (!mysqli_query($sqlParser->conn, |
793 | - "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
793 | + "UPDATE $dbase.`".$table_prefix."site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { |
|
794 | 794 | $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array( |
795 | 795 | 'type' => 'sql', |
796 | 796 | 'content' => mysqli_error($sqlParser->conn) |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'create'; |
803 | 803 | $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); |
804 | 804 | if (!mysqli_query($sqlParser->conn, |
805 | - "INSERT INTO $dbase.`" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { |
|
805 | + "INSERT INTO $dbase.`".$table_prefix."site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { |
|
806 | 806 | $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array( |
807 | 807 | 'type' => 'sql', |
808 | 808 | 'content' => mysqli_error($sqlParser->conn) |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | 'content' => '' //dependency name or error message |
870 | 870 | )*/ |
871 | 871 | ); |
872 | - $query = 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"'; |
|
872 | + $query = 'SELECT id, guid FROM '.$dbase.'`'.$sqlParser->prefix.'site_modules` WHERE name="'.$dependency['module'].'"'; |
|
873 | 873 | $ds = mysqli_query($sqlParser->conn, $query); |
874 | 874 | if (!$ds) { |
875 | 875 | $installDependencyLevel[$dependency['module']]['error'] = array( |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | $moduleGuid = $row["guid"]; |
885 | 885 | } |
886 | 886 | // get extra id |
887 | - $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"'; |
|
887 | + $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE '.$dependency['column'].'="'.$dependency['name'].'"'; |
|
888 | 888 | $ds = mysqli_query($sqlParser->conn, $query); |
889 | 889 | if (!$ds) { |
890 | 890 | $installDependencyLevel[$dependency['module']]['error'] = array( |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | $extraId = $row["id"]; |
899 | 899 | } |
900 | 900 | // setup extra as module dependency |
901 | - $query = 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1'; |
|
901 | + $query = 'SELECT module FROM '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'].' LIMIT 1'; |
|
902 | 902 | $ds = mysqli_query($sqlParser->conn, $query); |
903 | 903 | if (!$ds) { |
904 | 904 | $installDependencyLevel[$dependency['module']]['error'] = array( |
@@ -909,17 +909,17 @@ discard block |
||
909 | 909 | break; |
910 | 910 | } else { |
911 | 911 | if (mysqli_num_rows($ds) === 0) { |
912 | - $query = 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')'; |
|
912 | + $query = 'INSERT INTO '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` (module, resource, type) VALUES('.$moduleId.','.$extraId.','.$dependency['type'].')'; |
|
913 | 913 | mysqli_query($sqlParser->conn, $query); |
914 | 914 | $installDependencyLevel[$dependency['module']]['type'] = 'create'; |
915 | 915 | } else { |
916 | - $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']; |
|
916 | + $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` SET module = '.$moduleId.', resource = '.$extraId.', type = '.$dependency['type'].' WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type']; |
|
917 | 917 | mysqli_query($sqlParser->conn, $query); |
918 | 918 | $installDependencyLevel[$dependency['module']]['type'] = 'update'; |
919 | 919 | } |
920 | 920 | if ($dependency['type'] == 30 || $dependency['type'] == 40) { |
921 | 921 | // set extra guid for plugins and snippets |
922 | - $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1'; |
|
922 | + $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE id='.$extraId.' LIMIT 1'; |
|
923 | 923 | $ds = mysqli_query($sqlParser->conn, $query); |
924 | 924 | if (!$ds) { |
925 | 925 | $installDependencyLevel[$dependency['module']]['extra'] = array( |
@@ -930,8 +930,8 @@ discard block |
||
930 | 930 | break; |
931 | 931 | } else { |
932 | 932 | if (mysqli_num_rows($ds) != 0) { |
933 | - $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId; |
|
934 | - $ds= mysqli_query($sqlParser->conn, $query); |
|
933 | + $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` SET moduleguid = '.$moduleGuid.' WHERE id='.$extraId; |
|
934 | + $ds = mysqli_query($sqlParser->conn, $query); |
|
935 | 935 | $installDependencyLevel[$dependency['module']]['extra'] = array( |
936 | 936 | 'type' => 'done', |
937 | 937 | 'content' => $dependency['name'] |
@@ -953,48 +953,48 @@ discard block |
||
953 | 953 | } |
954 | 954 | |
955 | 955 | // Setup the MODX API -- needed for the cache processor |
956 | - if (file_exists(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php')) { |
|
957 | - require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php'; |
|
956 | + if (file_exists(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php')) { |
|
957 | + require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php'; |
|
958 | 958 | } |
959 | 959 | define('MODX_API_MODE', true); |
960 | 960 | if (!defined('MODX_BASE_PATH')) { |
961 | 961 | define('MODX_BASE_PATH', $base_path); |
962 | 962 | } |
963 | 963 | if (!defined('MODX_MANAGER_PATH')) { |
964 | - define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/'); |
|
964 | + define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/'); |
|
965 | 965 | } |
966 | 966 | $database_type = 'mysqli'; |
967 | 967 | // initiate a new document parser |
968 | 968 | if (!defined('EVO_BOOTSTRAP_FILE')) { |
969 | 969 | define('EVO_BOOTSTRAP_FILE', |
970 | - dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php'); |
|
971 | - require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php'; |
|
970 | + dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php'); |
|
971 | + require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php'; |
|
972 | 972 | } |
973 | 973 | |
974 | - include_once(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/document.parser.class.inc.php'); |
|
974 | + include_once(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/document.parser.class.inc.php'); |
|
975 | 975 | $modx = new DocumentParser; |
976 | 976 | $modx->db->connect(); |
977 | 977 | // always empty cache after install |
978 | 978 | $sync = new EvolutionCMS\Cache(); |
979 | - $sync->setCachepath(dirname(dirname(dirname(__DIR__))) . '/assets/cache/'); |
|
979 | + $sync->setCachepath(dirname(dirname(dirname(__DIR__))).'/assets/cache/'); |
|
980 | 980 | $sync->setReport(false); |
981 | 981 | $sync->emptyCache(); // first empty the cache |
982 | 982 | |
983 | 983 | // try to chmod the cache go-rwx (for suexeced php) |
984 | - @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/siteCache.idx.php', 0600); |
|
985 | - @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/sitePublishing.idx.php', 0600); |
|
984 | + @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/siteCache.idx.php', 0600); |
|
985 | + @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/sitePublishing.idx.php', 0600); |
|
986 | 986 | |
987 | 987 | // remove any locks on the manager functions so initial manager login is not blocked |
988 | - mysqli_query($conn, "TRUNCATE TABLE `" . $table_prefix . "active_users`"); |
|
988 | + mysqli_query($conn, "TRUNCATE TABLE `".$table_prefix."active_users`"); |
|
989 | 989 | |
990 | 990 | // close db connection |
991 | 991 | $sqlParser->close(); |
992 | 992 | |
993 | 993 | // andrazk 20070416 - release manager access |
994 | - if (file_exists(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php')) { |
|
995 | - @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php', 0755); |
|
996 | - unlink(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php'); |
|
994 | + if (file_exists(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php')) { |
|
995 | + @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php', 0755); |
|
996 | + unlink(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php'); |
|
997 | 997 | } |
998 | 998 | } |
999 | 999 | } |
1000 | -include_once dirname(__DIR__) . '/template/actions/install.php'; |
|
1000 | +include_once dirname(__DIR__).'/template/actions/install.php'; |
@@ -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', |