@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate htmlsnippet |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -10,11 +10,11 @@ |
||
| 10 | 10 | $pass1 = $_POST['pass1']; |
| 11 | 11 | $pass2 = $_POST['pass2']; |
| 12 | 12 | |
| 13 | -if($pass1!=$pass2){ |
|
| 13 | +if($pass1!=$pass2) { |
|
| 14 | 14 | $modx->webAlertAndQuit("Passwords don't match!"); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -if(strlen($pass1)<6){ |
|
| 17 | +if(strlen($pass1)<6) { |
|
| 18 | 18 | $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('templatename', $modx->getFullTableName('site_templates'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('templatename', $modx->getFullTableName('site_templates'), "templatename LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate template |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -10,9 +10,13 @@ |
||
| 10 | 10 | $userid = $_REQUEST['user']; |
| 11 | 11 | $groupid = $_REQUEST['group']; |
| 12 | 12 | $subject = $modx->db->escape($_REQUEST['messagesubject']); |
| 13 | -if($subject=="") $subject="(no subject)"; |
|
| 13 | +if($subject=="") { |
|
| 14 | + $subject="(no subject)"; |
|
| 15 | +} |
|
| 14 | 16 | $message = $modx->db->escape($_REQUEST['messagebody']); |
| 15 | -if($message=="") $message="(no message)"; |
|
| 17 | +if($message=="") { |
|
| 18 | + $message="(no message)"; |
|
| 19 | +} |
|
| 16 | 20 | $postdate = time(); |
| 17 | 21 | |
| 18 | 22 | if($sendto=='u') { |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // secure manager documents - flag as private |
| 122 | -if($updategroupaccess==true){ |
|
| 122 | +if($updategroupaccess==true) { |
|
| 123 | 123 | include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
| 124 | 124 | secureMgrDocument(); |
| 125 | 125 | |
@@ -61,9 +61,13 @@ discard block |
||
| 61 | 61 | $mgr_dir = substr($self_dir,strrpos($self_dir,'/')+1); |
| 62 | 62 | $base_path = str_replace($mgr_dir . '/index.php','',$self); |
| 63 | 63 | $site_mgr_path = $base_path . 'assets/cache/siteManager.php'; |
| 64 | -if(is_file($site_mgr_path)) include_once($site_mgr_path); |
|
| 64 | +if(is_file($site_mgr_path)) { |
|
| 65 | + include_once($site_mgr_path); |
|
| 66 | +} |
|
| 65 | 67 | $site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php'; |
| 66 | -if(is_file($site_hostnames_path)) include_once($site_hostnames_path); |
|
| 68 | +if(is_file($site_hostnames_path)) { |
|
| 69 | + include_once($site_hostnames_path); |
|
| 70 | +} |
|
| 67 | 71 | if(!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) { |
| 68 | 72 | $src = "<?php\n"; |
| 69 | 73 | $src .= "define('MGR_DIR', '{$mgr_dir}');\n"; |
@@ -117,9 +121,15 @@ discard block |
||
| 117 | 121 | $incPath = str_replace("\\","/",dirname(__FILE__)."/includes/"); // Mod by Raymond |
| 118 | 122 | set_include_path(get_include_path() . PATH_SEPARATOR . $incPath); |
| 119 | 123 | |
| 120 | -if (!defined('ENT_COMPAT')) define('ENT_COMPAT', 2); |
|
| 121 | -if (!defined('ENT_NOQUOTES')) define('ENT_NOQUOTES', 0); |
|
| 122 | -if (!defined('ENT_QUOTES')) define('ENT_QUOTES', 3); |
|
| 124 | +if (!defined('ENT_COMPAT')) { |
|
| 125 | + define('ENT_COMPAT', 2); |
|
| 126 | +} |
|
| 127 | +if (!defined('ENT_NOQUOTES')) { |
|
| 128 | + define('ENT_NOQUOTES', 0); |
|
| 129 | +} |
|
| 130 | +if (!defined('ENT_QUOTES')) { |
|
| 131 | + define('ENT_QUOTES', 3); |
|
| 132 | +} |
|
| 123 | 133 | |
| 124 | 134 | // set the document_root :| |
| 125 | 135 | if(!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) { |
@@ -182,10 +192,11 @@ discard block |
||
| 182 | 192 | |
| 183 | 193 | $s = array('[+MGR_DIR+]'); |
| 184 | 194 | $r = array(MGR_DIR); |
| 185 | -foreach($_lang as $k=>$v) |
|
| 186 | -{ |
|
| 187 | - if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); |
|
| 188 | -} |
|
| 195 | +foreach($_lang as $k=>$v) { |
|
| 196 | + if(strpos($v,'[+')!==false) { |
|
| 197 | + $_lang[$k] = str_replace($s, $r, $v); |
|
| 198 | + } |
|
| 199 | + } |
|
| 189 | 200 | |
| 190 | 201 | // send the charset header |
| 191 | 202 | header('Content-Type: text/html; charset='.$modx_manager_charset); |
@@ -198,7 +209,7 @@ discard block |
||
| 198 | 209 | include_once "accesscontrol.inc.php"; |
| 199 | 210 | |
| 200 | 211 | // double check the session |
| 201 | -if(!isset($_SESSION['mgrValidated'])){ |
|
| 212 | +if(!isset($_SESSION['mgrValidated'])) { |
|
| 202 | 213 | echo "Not Logged In!"; |
| 203 | 214 | exit; |
| 204 | 215 | } |
@@ -215,7 +226,9 @@ discard block |
||
| 215 | 226 | } |
| 216 | 227 | |
| 217 | 228 | // Initialize System Alert Message Queque |
| 218 | -if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 229 | +if (!isset($_SESSION['SystemAlertMsgQueque'])) { |
|
| 230 | + $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 231 | +} |
|
| 219 | 232 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
| 220 | 233 | |
| 221 | 234 | // first we check to see if this is a frameset request |
@@ -223,7 +236,7 @@ discard block |
||
| 223 | 236 | // this looks to be a top-level frameset request, so let's serve up a frameset |
| 224 | 237 | if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { |
| 225 | 238 | include_once "media/style/".$manager_theme."/frames/1.php"; |
| 226 | - }else{ |
|
| 239 | + } else { |
|
| 227 | 240 | include_once "frames/1.php"; |
| 228 | 241 | } |
| 229 | 242 | exit; |
@@ -231,10 +244,15 @@ discard block |
||
| 231 | 244 | |
| 232 | 245 | // OK, let's retrieve the action directive from the request |
| 233 | 246 | $option = array('min_range'=>1,'max_range'=>2000); |
| 234 | -if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']); |
|
| 235 | -elseif(isset($_GET['a'])) $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); |
|
| 236 | -elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); |
|
| 237 | -else $action = null; |
|
| 247 | +if(isset($_GET['a']) && isset($_POST['a'])) { |
|
| 248 | + $modx->webAlertAndQuit($_lang['error_double_action']); |
|
| 249 | +} elseif(isset($_GET['a'])) { |
|
| 250 | + $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); |
|
| 251 | +} elseif(isset($_POST['a'])) { |
|
| 252 | + $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); |
|
| 253 | +} else { |
|
| 254 | + $action = null; |
|
| 255 | +} |
|
| 238 | 256 | |
| 239 | 257 | if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) { |
| 240 | 258 | include_once 'messageCount.inc.php'; |
@@ -264,11 +282,12 @@ discard block |
||
| 264 | 282 | $modx->invokeEvent("OnManagerPageInit", array("action" => $action)); |
| 265 | 283 | |
| 266 | 284 | // return element filepath |
| 267 | -function includeFileProcessor ($filepath,$manager_theme) { |
|
| 285 | +function includeFileProcessor ($filepath,$manager_theme) |
|
| 286 | +{ |
|
| 268 | 287 | $element = ""; |
| 269 | 288 | if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { |
| 270 | 289 | $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; |
| 271 | - }else{ |
|
| 290 | + } else { |
|
| 272 | 291 | $element = $filepath; |
| 273 | 292 | } |
| 274 | 293 | return $element; |
@@ -1,11 +1,11 @@ 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 | // invoke OnManagerTreeInit event |
| 7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST);
|
| 8 | -if(is_array($evtOut)) {
|
|
| 8 | +if(is_array($evtOut)) { |
|
| 9 | 9 | echo implode("\n", $evtOut);
|
| 10 | 10 | } |
| 11 | 11 | ?> |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | <?php |
| 55 | 55 | // invoke OnManagerTreePrerender event |
| 56 | 56 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST));
|
| 57 | - if(is_array($evtOut)) {
|
|
| 57 | + if(is_array($evtOut)) { |
|
| 58 | 58 | echo implode("\n", $evtOut);
|
| 59 | 59 | } |
| 60 | 60 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | <?php |
| 67 | 67 | // invoke OnManagerTreeRender event |
| 68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST));
|
| 69 | - if(is_array($evtOut)) {
|
|
| 69 | + if(is_array($evtOut)) { |
|
| 70 | 70 | echo implode("\n", $evtOut);
|
| 71 | 71 | } |
| 72 | 72 | ?> |
@@ -3,7 +3,8 @@ discard block |
||
| 3 | 3 | // MySQL Dump Parser |
| 4 | 4 | // SNUFFKIN/ Alex 2004 |
| 5 | 5 | |
| 6 | -class SqlParser { |
|
| 6 | +class SqlParser |
|
| 7 | +{ |
|
| 7 | 8 | public $host; |
| 8 | 9 | public $dbname; |
| 9 | 10 | public $prefix; |
@@ -28,7 +29,8 @@ discard block |
||
| 28 | 29 | public $ignoreDuplicateErrors; |
| 29 | 30 | public $autoTemplateLogic; |
| 30 | 31 | |
| 31 | - public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { |
|
| 32 | + public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') |
|
| 33 | + { |
|
| 32 | 34 | $this->host = $host; |
| 33 | 35 | $this->dbname = $db; |
| 34 | 36 | $this->prefix = $prefix; |
@@ -44,10 +46,13 @@ discard block |
||
| 44 | 46 | $this->autoTemplateLogic = $auto_template_logic; |
| 45 | 47 | } |
| 46 | 48 | |
| 47 | - public function connect() { |
|
| 49 | + public function connect() |
|
| 50 | + { |
|
| 48 | 51 | $this->conn = mysqli_connect($this->host, $this->user, $this->password); |
| 49 | 52 | mysqli_select_db($this->conn, $this->dbname); |
| 50 | - if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset); |
|
| 53 | + if (function_exists('mysqli_set_charset')) { |
|
| 54 | + mysqli_set_charset($this->conn, $this->connection_charset); |
|
| 55 | + } |
|
| 51 | 56 | |
| 52 | 57 | $this->dbVersion = 3.23; // assume version 3.23 |
| 53 | 58 | if(function_exists("mysqli_get_server_info")) { |
@@ -59,7 +64,8 @@ discard block |
||
| 59 | 64 | mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}"); |
| 60 | 65 | } |
| 61 | 66 | |
| 62 | - public function process($filename) { |
|
| 67 | + public function process($filename) |
|
| 68 | + { |
|
| 63 | 69 | global $custom_placeholders; |
| 64 | 70 | |
| 65 | 71 | // check to make sure file exists |
@@ -114,7 +120,9 @@ discard block |
||
| 114 | 120 | foreach($sql_array as $sql_entry) { |
| 115 | 121 | $sql_do = trim($sql_entry, "\r\n; "); |
| 116 | 122 | |
| 117 | - if (preg_match('/^\#/', $sql_do)) continue; |
|
| 123 | + if (preg_match('/^\#/', $sql_do)) { |
|
| 124 | + continue; |
|
| 125 | + } |
|
| 118 | 126 | |
| 119 | 127 | // strip out comments and \n for mysql 3.x |
| 120 | 128 | if ($this->dbVersion <4.0) { |
@@ -125,11 +133,15 @@ discard block |
||
| 125 | 133 | |
| 126 | 134 | |
| 127 | 135 | $num = $num + 1; |
| 128 | - if ($sql_do) mysqli_query($this->conn, $sql_do); |
|
| 136 | + if ($sql_do) { |
|
| 137 | + mysqli_query($this->conn, $sql_do); |
|
| 138 | + } |
|
| 129 | 139 | if(mysqli_error($this->conn)) { |
| 130 | 140 | // Ignore duplicate and drop errors - Raymond |
| 131 | - if ($this->ignoreDuplicateErrors){ |
|
| 132 | - if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue; |
|
| 141 | + if ($this->ignoreDuplicateErrors) { |
|
| 142 | + if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) { |
|
| 143 | + continue; |
|
| 144 | + } |
|
| 133 | 145 | } |
| 134 | 146 | // End Ignore duplicate |
| 135 | 147 | $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do); |
@@ -138,7 +150,8 @@ discard block |
||
| 138 | 150 | } |
| 139 | 151 | } |
| 140 | 152 | |
| 141 | - public function close() { |
|
| 153 | + public function close() |
|
| 154 | + { |
|
| 142 | 155 | mysqli_close($this->conn); |
| 143 | 156 | } |
| 144 | 157 | } |
@@ -597,7 +597,9 @@ |
||
| 597 | 597 | $insertdump = $lf; |
| 598 | 598 | $insertdump .= "INSERT INTO `{$tblval}` VALUES ("; |
| 599 | 599 | $arr = $this->object2Array($row); |
| 600 | - if( ! is_array($arr)) $arr = array(); |
|
| 600 | + if( ! is_array($arr)) { |
|
| 601 | + $arr = array(); |
|
| 602 | + } |
|
| 601 | 603 | foreach ($arr as $key => $value) { |
| 602 | 604 | if (is_null($value)) { |
| 603 | 605 | $value = 'NULL'; |