Completed
Pull Request — develop (#534)
by Agel_Nash
05:08
created
manager/includes/log.class.inc.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@  discard block
 block discarded – undo
12 12
 
13 13
 */
14 14
 
15
-class logHandler {
15
+class logHandler{
16 16
     // Single variable for a log entry
17 17
     var $entry = array();
18 18
 
19
-    function initAndWriteLog($msg="", $internalKey="", $username="", $action="", $itemid="", $itemname="") {
19
+    function initAndWriteLog($msg = "", $internalKey = "", $username = "", $action = "", $itemid = "", $itemname = ""){
20 20
         global $modx;
21 21
         $this->entry['msg'] = $msg; // writes testmessage to the object
22
-        $this->entry['action'] = empty($action)? $modx->manager->action : $action;    // writes the action to the object
22
+        $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object
23 23
 
24 24
         // User Credentials
25 25
         $this->entry['internalKey'] = $internalKey == "" ? $modx->getLoginUserID() : $internalKey;
26 26
         $this->entry['username'] = $username == "" ? $modx->getLoginUserName() : $username;
27 27
 
28
-        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int)$_REQUEST['id'] : $itemid;  // writes the id to the object
29
-        if($this->entry['itemId'] == 0) $this->entry['itemId'] = "-"; // to stop items having id 0
28
+        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int) $_REQUEST['id'] : $itemid; // writes the id to the object
29
+        if ($this->entry['itemId'] == 0) $this->entry['itemId'] = "-"; // to stop items having id 0
30 30
 
31
-        $this->entry['itemName'] = ($itemname == "" && isset($_SESSION['itemname']))? $_SESSION['itemname'] : $itemname; // writes the id to the object
32
-        if($this->entry['itemName'] == "") $this->entry['itemName'] = "-"; // to stop item name being empty
31
+        $this->entry['itemName'] = ($itemname == "" && isset($_SESSION['itemname'])) ? $_SESSION['itemname'] : $itemname; // writes the id to the object
32
+        if ($this->entry['itemName'] == "") $this->entry['itemName'] = "-"; // to stop item name being empty
33 33
 
34 34
         $this->writeToLog();
35 35
         return;
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
     // function to write to the log
39 39
     // collects all required info, and
40 40
     // writes it to the logging table
41
-    function writeToLog() {
41
+    function writeToLog(){
42 42
         global $modx;
43 43
         $tbl_manager_log = $modx->getFullTableName('manager_log');
44 44
 
45
-        if($this->entry['internalKey'] == "") {
45
+        if ($this->entry['internalKey'] == "") {
46 46
             $modx->webAlertAndQuit("Logging error: internalKey not set.");
47 47
         }
48
-        if(empty($this->entry['action'])) {
48
+        if (empty($this->entry['action'])) {
49 49
             $modx->webAlertAndQuit("Logging error: action not set.");
50 50
         }
51
-        if($this->entry['msg'] == "") {
51
+        if ($this->entry['msg'] == "") {
52 52
             include_once "actionlist.inc.php";
53 53
             $this->entry['msg'] = getAction($this->entry['action'], $this->entry['itemId']);
54
-            if($this->entry['msg'] == "") {
54
+            if ($this->entry['msg'] == "") {
55 55
                 $modx->webAlertAndQuit("Logging error: couldn't find message to write to log.");
56 56
             }
57 57
         }
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
         $fields['itemid']      = $this->entry['itemId'];
64 64
         $fields['itemname']    = $modx->db->escape($this->entry['itemName']);
65 65
         $fields['message']     = $modx->db->escape($this->entry['msg']);
66
-        $insert_id = $modx->db->insert($fields,$tbl_manager_log);
67
-        if(!$insert_id) {
66
+        $insert_id = $modx->db->insert($fields, $tbl_manager_log);
67
+        if (!$insert_id) {
68 68
             $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->db->getLastError());
69 69
         } else {
70
-            $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->config['manager_log_limit'] : 3000;
71
-            $trim  = (isset($modx->config['manager_log_trim']))  ? (int)$modx->config['manager_log_trim'] : 100;
72
-            if(($insert_id % $trim) === 0) {
73
-                $modx->rotate_log('manager_log',$limit,$trim);
70
+            $limit = (isset($modx->config['manager_log_limit'])) ? (int) $modx->config['manager_log_limit'] : 3000;
71
+            $trim  = (isset($modx->config['manager_log_trim'])) ? (int) $modx->config['manager_log_trim'] : 100;
72
+            if (($insert_id % $trim) === 0) {
73
+                $modx->rotate_log('manager_log', $limit, $trim);
74 74
             }
75 75
         }
76 76
     }
Please login to merge, or discard this patch.
manager/includes/menu.class.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
                 $countChild++;
68 68
                 $id = $value[0];
69 69
                 $ph['id'] = $id;
70
-                $ph['li_class'] = $this->get_li_class($id) . $value[10];
70
+                $ph['li_class'] = $this->get_li_class($id).$value[10];
71 71
                 $ph['href'] = $value[3];
72 72
                 $ph['alt'] = $value[4];
73 73
                 $ph['target'] = $value[7];
74 74
                 $ph['onclick'] = $value[5];
75 75
                 $ph['a_class'] = $this->get_a_class($id);
76 76
                 $ph['LinkAttr'] = $this->getLinkAttr($id);
77
-                $ph['itemName'] = $value[2] . $this->getItemName($id);
77
+                $ph['itemName'] = $value[2].$this->getItemName($id);
78 78
 
79 79
                 $ph['DrawSub'] = '';
80 80
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     public function get_li_class($id)
114 114
     {
115 115
         if (isset($this->menu[$id])) {
116
-            return $this->defaults['parentClass'] . ' ';
116
+            return $this->defaults['parentClass'].' ';
117 117
         } else {
118 118
             return '';
119 119
         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     public function get_a_class($id)
123 123
     {
124 124
         if (isset($this->menu[$id])) {
125
-            return ' class="' . $this->defaults['parentLinkClass'] . '"';
125
+            return ' class="'.$this->defaults['parentLinkClass'].'"';
126 126
         } else {
127 127
             return '';
128 128
         }
Please login to merge, or discard this patch.
manager/includes/tmplvars.commands.inc.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * Created by Raymond Irving Feb, 2005
5 5
  */
6 6
 global $BINDINGS; // Array of supported bindings. must be upper case
7
-$BINDINGS = array (
7
+$BINDINGS = array(
8 8
     'FILE',
9 9
     'CHUNK',
10 10
     'DOCUMENT',
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
     'DIRECTORY'
15 15
 );
16 16
 
17
-function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) {
17
+function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()){
18 18
     global $modx;
19
-    $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
19
+    $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
20 20
     $nvalue = trim($value);
21 21
     if (substr($nvalue, 0, 1) != '@')
22 22
         return $value;
23
-    elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') {
23
+    elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings'] != 1 && $src === 'docform') {
24 24
         return '@Bindings is disabled.';
25 25
     }
26 26
     else {
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
                 break;
47 47
 
48 48
             case "SELECT" : // selects a record from the cms database
49
-                $rt = array ();
50
-                $replacementVars = array (
49
+                $rt = array();
50
+                $replacementVars = array(
51 51
                     'DBASE' => $modx->db->config['dbase'],
52 52
                     'PREFIX' => $modx->db->config['table_prefix']
53 53
                 );
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
                 break;
89 89
 
90 90
             case 'DIRECTORY' :
91
-                $files = array ();
92
-                $path = $modx->config['base_path'] . $param;
91
+                $files = array();
92
+                $path = $modx->config['base_path'].$param;
93 93
                 if (substr($path, -1, 1) != '/') {
94 94
                     $path .= '/';
95 95
                 }
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
     }
118 118
 }
119 119
 
120
-function ProcessFile($file) {
120
+function ProcessFile($file){
121 121
     // get the file
122 122
 	$buffer = @file_get_contents($file);
123
-	if ($buffer===false) $buffer = " Could not retrieve document '$file'.";
123
+	if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
124 124
     return $buffer;
125 125
 }
126 126
 
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 {
130 130
     global $BINDINGS;
131 131
     $binding_array = array();
132
-    foreach($BINDINGS as $cmd)
132
+    foreach ($BINDINGS as $cmd)
133 133
     {
134
-        if(strpos($binding_string,'@'.$cmd)===0)
134
+        if (strpos($binding_string, '@'.$cmd) === 0)
135 135
         {
136
-            $code = substr($binding_string,strlen($cmd)+1);
137
-            $binding_array = array($cmd,trim($code));
136
+            $code = substr($binding_string, strlen($cmd) + 1);
137
+            $binding_array = array($cmd, trim($code));
138 138
             break;
139 139
         }
140 140
     }
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
 	if (strpos($param, '[*') !== false) {
150 150
 		$matches = $modx->getTagsFromContent($param, '[*', '*]');
151 151
 		foreach ($matches[0] as $i=>$match) {
152
-			if(isset($tvsArray[ $matches[1][$i] ])) {
153
-				if(is_array($tvsArray[ $matches[1][$i] ])) {
152
+			if (isset($tvsArray[$matches[1][$i]])) {
153
+				if (is_array($tvsArray[$matches[1][$i]])) {
154 154
 					$value = $tvsArray[$matches[1][$i]]['value'];
155 155
 					$value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value;
156 156
 				} else {
157
-					$value = $tvsArray[ $matches[1][$i] ];
157
+					$value = $tvsArray[$matches[1][$i]];
158 158
 				}
159 159
 				$param = str_replace($match, $value, $param);
160 160
 			}
Please login to merge, or discard this patch.
manager/includes/rss.inc.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -29,34 +29,34 @@  discard block
 block discarded – undo
29 29
 // include MagPieRSS
30 30
 require_once(MODX_MANAGER_PATH.'media/rss/rss_fetch.inc');
31 31
 // Convert relative path into absolute url
32
-function rel2abs( $rel, $base ) {
32
+function rel2abs($rel, $base){
33 33
 	// parse base URL  and convert to local variables: $scheme, $host,  $path
34
-    $tmp = parse_url( $base );
35
-    extract( $tmp );
36
-	if ( strpos( $rel,"//" ) === 0 ) {
37
-		return $scheme . ':' . $rel;
34
+    $tmp = parse_url($base);
35
+    extract($tmp);
36
+	if (strpos($rel, "//") === 0) {
37
+		return $scheme.':'.$rel;
38 38
 	}
39 39
 	// return if already absolute URL
40
-	if ( parse_url( $rel, PHP_URL_SCHEME ) != '' ) {
40
+	if (parse_url($rel, PHP_URL_SCHEME) != '') {
41 41
 		return $rel;
42 42
 	}
43 43
 	// queries and anchors
44
-	if ( $rel[0] == '#' || $rel[0] == '?' ) {
45
-		return $base . $rel;
44
+	if ($rel[0] == '#' || $rel[0] == '?') {
45
+		return $base.$rel;
46 46
 	}
47 47
 	// remove non-directory element from path
48
-	$path = preg_replace( '#/[^/]*$#', '', $path );
48
+	$path = preg_replace('#/[^/]*$#', '', $path);
49 49
 	// destroy path if relative url points to root
50
-	if ( $rel[0] ==  '/' ) {
50
+	if ($rel[0] == '/') {
51 51
 		$path = '';
52 52
 	}
53 53
 	// dirty absolute URL
54
-	$abs = $host . $path . "/" . $rel;
54
+	$abs = $host.$path."/".$rel;
55 55
 	// replace '//' or  '/./' or '/foo/../' with '/'
56
-	$abs = preg_replace( "/(\/\.?\/)/", "/", $abs );
57
-	$abs = preg_replace( "/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs );
56
+	$abs = preg_replace("/(\/\.?\/)/", "/", $abs);
57
+	$abs = preg_replace("/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs);
58 58
 	// absolute URL is ready!
59
-	return $scheme . '://' . $abs;
59
+	return $scheme.'://'.$abs;
60 60
 }
61 61
 $feedData = array();
62 62
 
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
 foreach ($urls as $section=>$url) {
65 65
 	$output = '';
66 66
     $rss = @fetch_rss($url);
67
-    if( !$rss ){
68
-    	$feedData[$section] = 'Failed to retrieve ' . $url;
67
+    if (!$rss) {
68
+    	$feedData[$section] = 'Failed to retrieve '.$url;
69 69
     	continue;
70 70
 	}
71 71
     $output .= '<ul>';
72 72
 
73 73
     $items = array_slice($rss->items, 0, $itemsNumber);
74 74
     foreach ($items as $item) {
75
-        $href = rel2abs($item['link'],'https://github.com');
75
+        $href = rel2abs($item['link'], 'https://github.com');
76 76
         $title = $item['title'];
77 77
         $pubdate = $item['pubdate'];
78 78
         $pubdate = $modx->toDateFormat(strtotime($pubdate));
Please login to merge, or discard this patch.
manager/includes/tmplvars.format.inc.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -5,38 +5,38 @@  discard block
 block discarded – undo
5 5
  */
6 6
 
7 7
 // Added by Raymond 20-Jan-2005
8
-function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') {
8
+function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = ''){
9 9
 
10 10
 	global $modx;
11 11
     $o = '';
12 12
 
13 13
     // process any TV commands in value
14
-	$docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
14
+	$docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
15 15
 	$value = ProcessTVCommand($value, $name, $docid);
16 16
 
17 17
 	$params = array();
18
-	if($paramstring) {
18
+	if ($paramstring) {
19 19
 		$cp = explode("&", $paramstring);
20
-		foreach($cp as $p => $v) {
20
+		foreach ($cp as $p => $v) {
21 21
 			$v = trim($v); // trim
22 22
 			$ar = explode("=", $v);
23
-			if(is_array($ar) && count($ar) == 2) {
23
+			if (is_array($ar) && count($ar) == 2) {
24 24
 				$params[$ar[0]] = decodeParamValue($ar[1]);
25 25
 			}
26 26
 		}
27 27
 	}
28 28
 
29 29
 	$id = "tv$name";
30
-	switch($format) {
30
+	switch ($format) {
31 31
 		case 'image':
32 32
 			$images = parseInput($value, '||', 'array');
33
-			foreach($images as $image) {
34
-				if(!is_array($image)) {
33
+			foreach ($images as $image) {
34
+				if (!is_array($image)) {
35 35
 					$image = explode('==', $image);
36 36
 				}
37 37
 				$src = $image[0];
38 38
 
39
-				if($src) {
39
+				if ($src) {
40 40
 					// We have a valid source
41 41
 					$attributes = '';
42 42
 					$attr = array(
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 						'alt' => $modx->htmlspecialchars($params['alttext']),
47 47
 						'style' => $params['style']
48 48
 					);
49
-					if(isset($params['align']) && $params['align'] != 'none') {
49
+					if (isset($params['align']) && $params['align'] != 'none') {
50 50
 						$attr['align'] = $params['align'];
51 51
 					}
52
-					foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
53
-					$attributes .= ' ' . $params['attrib'];
52
+					foreach ($attr as $k => $v) $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
53
+					$attributes .= ' '.$params['attrib'];
54 54
 
55 55
 					// Output the image with attributes
56
-					$o .= '<img' . rtrim($attributes) . ' />';
56
+					$o .= '<img'.rtrim($attributes).' />';
57 57
 				}
58 58
 			}
59 59
 			break;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		case "delim":    // display as delimitted list
62 62
 			$value = parseInput($value, "||");
63 63
 			$p = $params['format'] ? $params['format'] : " ";
64
-			if($p == "\\n") {
64
+			if ($p == "\\n") {
65 65
 				$p = "\n";
66 66
 			}
67 67
 			$o = str_replace("||", $p, $value);
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 		case "string":
71 71
 			$value = parseInput($value);
72 72
 			$format = strtolower($params['format']);
73
-			if($format == 'upper case') {
73
+			if ($format == 'upper case') {
74 74
 				$o = strtoupper($value);
75
-			} else if($format == 'lower case') {
75
+			} else if ($format == 'lower case') {
76 76
 				$o = strtolower($value);
77
-			} else if($format == 'sentence case') {
77
+			} else if ($format == 'sentence case') {
78 78
 				$o = ucfirst($value);
79
-			} else if($format == 'capitalize') {
79
+			} else if ($format == 'capitalize') {
80 80
 				$o = ucwords($value);
81 81
 			} else {
82 82
 				$o = $value;
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 			break;
85 85
 
86 86
 		case "date":
87
-			if($value != '' || $params['default'] == 'Yes') {
88
-				if(empty($value)) {
87
+			if ($value != '' || $params['default'] == 'Yes') {
88
+				if (empty($value)) {
89 89
 					$value = 'now';
90 90
 				}
91 91
 				$timestamp = getUnixtimeFromDateString($value);
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 			$value = parseInput($value, "||", "array");
101 101
 			$o = '';
102 102
 			$countValue = count($value);
103
-			for($i = 0; $i < $countValue; $i++) {
103
+			for ($i = 0; $i < $countValue; $i++) {
104 104
 				list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]);
105
-				if(!$url) {
105
+				if (!$url) {
106 106
 					$url = $name;
107 107
 				}
108
-				if($url) {
109
-					if($o) {
108
+				if ($url) {
109
+					if ($o) {
110 110
 						$o .= '<br />';
111 111
 					}
112 112
 					$attributes = '';
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 						'style' => $params['style'],
119 119
 						'target' => $params['target'],
120 120
 					);
121
-					foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
122
-					$attributes .= ' ' . $params['attrib']; // add extra
121
+					foreach ($attr as $k => $v) $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
122
+					$attributes .= ' '.$params['attrib']; // add extra
123 123
 
124 124
 					// Output the link
125
-					$o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . '</a>';
125
+					$o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->htmlspecialchars($params['text']) : $name).'</a>';
126 126
 				}
127 127
 			}
128 128
 			break;
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 			$o = '';
135 135
 			// Loop through a list of tags
136 136
             $countValue = count($value);
137
-			for($i = 0; $i < $countValue; $i++) {
137
+			for ($i = 0; $i < $countValue; $i++) {
138 138
 				$tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i];
139
-				if(!$tagvalue) {
139
+				if (!$tagvalue) {
140 140
 					continue;
141 141
 				}
142 142
 
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
 					'class' => $params['class'],
148 148
 					'style' => $params['style'],
149 149
 				);
150
-				foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
151
-				$attributes .= ' ' . $params['attrib']; // add extra
150
+				foreach ($attr as $k => $v) $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
151
+				$attributes .= ' '.$params['attrib']; // add extra
152 152
 
153 153
 				// Output the HTML Tag
154
-				$o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>';
154
+				$o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>';
155 155
 			}
156 156
 			break;
157 157
 
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
 			$w = $params['w'] ? $params['w'] : '100%';
161 161
 			$h = $params['h'] ? $params['h'] : '400px';
162 162
 			$richtexteditor = $params['edt'] ? $params['edt'] : "";
163
-			$o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">';
163
+			$o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">';
164 164
 			$o .= $modx->htmlspecialchars($value);
165 165
 			$o .= '</textarea></div>';
166 166
 			$replace_richtext = array($id);
167 167
 			// setup editors
168
-			if(!empty($replace_richtext) && !empty($richtexteditor)) {
168
+			if (!empty($replace_richtext) && !empty($richtexteditor)) {
169 169
 				// invoke OnRichTextEditorInit event
170 170
 				$evtOut = $modx->invokeEvent("OnRichTextEditorInit", array(
171 171
 					'editor' => $richtexteditor,
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 					'width' => $w,
175 175
 					'height' => $h
176 176
 				));
177
-				if(is_array($evtOut)) {
177
+				if (is_array($evtOut)) {
178 178
 					$o .= implode("", $evtOut);
179 179
 				}
180 180
 			}
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 
188 188
 		case "viewport":
189 189
 			$value = parseInput($value);
190
-			$id = '_' . time();
191
-			if(!$params['vpid']) {
190
+			$id = '_'.time();
191
+			if (!$params['vpid']) {
192 192
 				$params['vpid'] = $id;
193 193
 			}
194 194
 			$sTag = "<iframe";
@@ -196,42 +196,42 @@  discard block
 block discarded – undo
196 196
 			$autoMode = "0";
197 197
 			$w = $params['width'];
198 198
 			$h = $params['height'];
199
-			if($params['stretch'] == 'Yes') {
199
+			if ($params['stretch'] == 'Yes') {
200 200
 				$w = "100%";
201 201
 				$h = "100%";
202 202
 			}
203
-			if($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) {
204
-				$autoMode = "3";  //both
205
-			} else if($params['awidth'] == 'Yes') {
203
+			if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) {
204
+				$autoMode = "3"; //both
205
+			} else if ($params['awidth'] == 'Yes') {
206 206
 				$autoMode = "1"; //width only
207
-			} else if($params['aheight'] == 'Yes') {
208
-				$autoMode = "2";    //height only
207
+			} else if ($params['aheight'] == 'Yes') {
208
+				$autoMode = "2"; //height only
209 209
 			}
210 210
 
211
-			$modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array(
211
+			$modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array(
212 212
 				'name' => 'viewport',
213 213
 				'version' => '0',
214 214
 				'plaintext' => false
215 215
 			));
216
-			$o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' ";
217
-			if($params['class']) {
218
-				$o .= " class='" . $params['class'] . "' ";
216
+			$o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' ";
217
+			if ($params['class']) {
218
+				$o .= " class='".$params['class']."' ";
219 219
 			}
220
-			if($params['style']) {
221
-				$o .= " style='" . $params['style'] . "' ";
220
+			if ($params['style']) {
221
+				$o .= " style='".$params['style']."' ";
222 222
 			}
223
-			if($params['attrib']) {
224
-				$o .= $params['attrib'] . " ";
223
+			if ($params['attrib']) {
224
+				$o .= $params['attrib']." ";
225 225
 			}
226
-			$o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' ";
227
-			$o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' ";
228
-			$o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' ";
226
+			$o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' ";
227
+			$o .= "src='".$value."' frameborder='".$params['borsize']."' ";
228
+			$o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' ";
229 229
 			$o .= ">";
230 230
 			$o .= $eTag;
231 231
 			break;
232 232
 
233 233
 		case "datagrid":
234
-			include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
234
+			include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
235 235
 			$grd = new DataGrid('', $value);
236 236
 
237 237
 			$grd->noRecordMsg = $params['egmsg'];
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
 		case 'htmlentities':
268 268
 			$value = parseInput($value);
269
-			if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') {
269
+			if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') {
270 270
 				// remove delimiter from checkbox and listbox-multiple TVs
271 271
 				$value = str_replace('||', '', $value);
272 272
 			}
@@ -277,33 +277,33 @@  discard block
 block discarded – undo
277 277
 			$widget_output = '';
278 278
 			$o = '';
279 279
 			/* If we are loading a file */
280
-			if(substr($params['output'], 0, 5) == "@FILE") {
281
-				$file_name = MODX_BASE_PATH . trim(substr($params['output'], 6));
282
-				if(!file_exists($file_name)) {
283
-					$widget_output = $file_name . ' does not exist';
280
+			if (substr($params['output'], 0, 5) == "@FILE") {
281
+				$file_name = MODX_BASE_PATH.trim(substr($params['output'], 6));
282
+				if (!file_exists($file_name)) {
283
+					$widget_output = $file_name.' does not exist';
284 284
 				} else {
285 285
 					$widget_output = file_get_contents($file_name);
286 286
 				}
287
-			} elseif(substr($params['output'], 0, 8) == '@INCLUDE') {
288
-				$file_name = MODX_BASE_PATH . trim(substr($params['output'], 9));
289
-				if(!file_exists($file_name)) {
290
-					$widget_output = $file_name . ' does not exist';
287
+			} elseif (substr($params['output'], 0, 8) == '@INCLUDE') {
288
+				$file_name = MODX_BASE_PATH.trim(substr($params['output'], 9));
289
+				if (!file_exists($file_name)) {
290
+					$widget_output = $file_name.' does not exist';
291 291
 				} else {
292 292
 					/* The included file needs to set $widget_output. Can be string, array, object */
293 293
 					include $file_name;
294 294
 				}
295
-			} elseif(substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') {
295
+			} elseif (substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') {
296 296
 				$chunk_name = trim(substr($params['output'], 7));
297 297
 				$widget_output = $modx->getChunk($chunk_name);
298
-			} elseif(substr($params['output'], 0, 5) == '@EVAL' && $value !== '') {
298
+			} elseif (substr($params['output'], 0, 5) == '@EVAL' && $value !== '') {
299 299
 				$eval_str = trim(substr($params['output'], 6));
300 300
 				$widget_output = eval($eval_str);
301
-			} elseif($value !== '') {
301
+			} elseif ($value !== '') {
302 302
 				$widget_output = $params['output'];
303 303
 			} else {
304 304
 				$widget_output = '';
305 305
 			}
306
-			if(is_string($widget_output)) {
306
+			if (is_string($widget_output)) {
307 307
 				$_ = $modx->config['enable_filter'];
308 308
 				$modx->config['enable_filter'] = 1;
309 309
 				$widget_output = $modx->parseText($widget_output, array('value' => $value));
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 
317 317
 		default:
318 318
 			$value = parseInput($value);
319
-			if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') {
319
+			if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') {
320 320
 				// add separator
321 321
 				$value = explode('||', $value);
322 322
 				$value = implode($sep, $value);
@@ -327,23 +327,23 @@  discard block
 block discarded – undo
327 327
 	return $o;
328 328
 }
329 329
 
330
-function decodeParamValue($s) {
330
+function decodeParamValue($s){
331 331
 	$s = str_replace("%3D", '=', $s); // =
332 332
 	$s = str_replace("%26", '&', $s); // &
333 333
 	return $s;
334 334
 }
335 335
 
336 336
 // returns an array if a delimiter is present. returns array is a recordset is present
337
-function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array
337
+function parseInput($src, $delim = "||", $type = "string", $columns = true){ // type can be: string, array
338 338
 	global $modx;
339
-	if($modx->db->isResult($src)) {
339
+	if ($modx->db->isResult($src)) {
340 340
 		// must be a recordset
341 341
 		$rows = array();
342
-		while($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols);
342
+		while ($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols);
343 343
 		return ($type == "array") ? $rows : implode($delim, $rows);
344 344
 	} else {
345 345
 		// must be a text
346
-		if($type == "array") {
346
+		if ($type == "array") {
347 347
 			return explode($delim, $src);
348 348
 		} else {
349 349
 			return $src;
@@ -351,21 +351,21 @@  discard block
 block discarded – undo
351 351
 	}
352 352
 }
353 353
 
354
-function getUnixtimeFromDateString($value) {
354
+function getUnixtimeFromDateString($value){
355 355
 	$timestamp = false;
356 356
 	// Check for MySQL or legacy style date
357 357
 	$date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/';
358 358
 	$date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/';
359 359
 	$matches = array();
360
-	if(strpos($value, '-') !== false) {
361
-		if(preg_match($date_match_1, $value, $matches)) {
360
+	if (strpos($value, '-') !== false) {
361
+		if (preg_match($date_match_1, $value, $matches)) {
362 362
 			$timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]);
363
-		} elseif(preg_match($date_match_2, $value, $matches)) {
363
+		} elseif (preg_match($date_match_2, $value, $matches)) {
364 364
 			$timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
365 365
 		}
366 366
 	}
367 367
 	// If those didn't work, use strtotime to figure out the date
368
-	if($timestamp === false || $timestamp === -1) {
368
+	if ($timestamp === false || $timestamp === -1) {
369 369
 		$timestamp = strtotime($value);
370 370
 	}
371 371
 	return $timestamp;
Please login to merge, or discard this patch.
manager/media/script/air-datepicker/datepicker.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2
-class DATEPICKER {
3
-    public function getDP() {
2
+class DATEPICKER{
3
+    public function getDP(){
4 4
         global $modx;
5 5
 
6 6
         $load_script = file_get_contents(dirname(__FILE__).'/datepicker.tpl');
7
-        if(!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode();
7
+        if (!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode();
8 8
 		$modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy';
9 9
         return $modx->mergeSettingsContent($load_script);
10 10
     }
11
-    public function getLangCode() {
11
+    public function getLangCode(){
12 12
         global $modx, $modx_lang_attribute;
13 13
 
14
-        if(!$modx_lang_attribute) return 'en';
14
+        if (!$modx_lang_attribute) return 'en';
15 15
 
16 16
         $lc = $modx_lang_attribute;
17
-        if($lc === 'uk') return 'ru';
18
-        $dp_path = str_replace('\\','/',dirname(__FILE__));
17
+        if ($lc === 'uk') return 'ru';
18
+        $dp_path = str_replace('\\', '/', dirname(__FILE__));
19 19
 
20 20
         return (is_file("{$dp_path}/i18n/datepicker.{$lc}.js")) ? $modx_lang_attribute : 'en';
21 21
     }
Please login to merge, or discard this patch.
manager/index.php 1 patch
Spacing   +270 added lines, -270 removed lines patch added patch discarded remove patch
@@ -54,32 +54,32 @@  discard block
 block discarded – undo
54 54
 }
55 55
 
56 56
 // get start time
57
-$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
57
+$mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
58 58
 $mstart = memory_get_usage();
59
-$self      = str_replace('\\','/',__FILE__);
60
-$self_dir  = str_replace('/index.php','',$self);
61
-$mgr_dir   = substr($self_dir,strrpos($self_dir,'/')+1);
62
-$base_path = str_replace($mgr_dir . '/index.php','',$self);
63
-$site_mgr_path = $base_path . 'assets/cache/siteManager.php';
64
-if(is_file($site_mgr_path)) include_once($site_mgr_path);
65
-$site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php';
66
-if(is_file($site_hostnames_path)) include_once($site_hostnames_path);
67
-if(!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) {
59
+$self      = str_replace('\\', '/', __FILE__);
60
+$self_dir  = str_replace('/index.php', '', $self);
61
+$mgr_dir   = substr($self_dir, strrpos($self_dir, '/') + 1);
62
+$base_path = str_replace($mgr_dir.'/index.php', '', $self);
63
+$site_mgr_path = $base_path.'assets/cache/siteManager.php';
64
+if (is_file($site_mgr_path)) include_once($site_mgr_path);
65
+$site_hostnames_path = $base_path.'assets/cache/siteHostnames.php';
66
+if (is_file($site_hostnames_path)) include_once($site_hostnames_path);
67
+if (!defined('MGR_DIR') || MGR_DIR !== $mgr_dir) {
68 68
 	$src = "<?php\n";
69 69
 	$src .= "define('MGR_DIR', '{$mgr_dir}');\n";
70
-	$rs = file_put_contents($site_mgr_path,$src);
71
-	if(!$rs) {
70
+	$rs = file_put_contents($site_mgr_path, $src);
71
+	if (!$rs) {
72 72
 		echo 'siteManager.php write error';
73 73
 		exit;
74 74
 	}
75 75
 	sleep(1);
76
-	header('Location:' . $_SERVER['REQUEST_URI']);
76
+	header('Location:'.$_SERVER['REQUEST_URI']);
77 77
 	exit;
78 78
 }
79 79
 
80 80
 // we use this to make sure files are accessed through
81 81
 // the manager instead of seperately.
82
-if ( ! defined('IN_MANAGER_MODE')) {
82
+if (!defined('IN_MANAGER_MODE')) {
83 83
 	define('IN_MANAGER_MODE', true);
84 84
 }
85 85
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
 // send anti caching headers
90 90
 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
91
-header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
91
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
92 92
 header("Cache-Control: no-store, no-cache, must-revalidate");
93 93
 header("Cache-Control: post-check=0, pre-check=0", false);
94 94
 header("Pragma: no-cache");
@@ -100,29 +100,29 @@  discard block
 block discarded – undo
100 100
 include_once "includes/lang/english.inc.php";
101 101
 
102 102
 // check PHP version. EVO is compatible with php 5 (5.0.0+)
103
-$php_ver_comp =  version_compare(phpversion(), "5.0.0");
103
+$php_ver_comp = version_compare(phpversion(), "5.0.0");
104 104
 		// -1 if left is less, 0 if equal, +1 if left is higher
105
-if($php_ver_comp < 0) {
105
+if ($php_ver_comp < 0) {
106 106
 	echo sprintf($_lang['php_version_check'], phpversion());
107 107
 	exit;
108 108
 }
109 109
 
110 110
 // check if iconv is installed
111
-if(!function_exists('iconv')) {
111
+if (!function_exists('iconv')) {
112 112
 	echo $_lang['iconv_not_available'];
113 113
 	exit;
114 114
 }
115 115
 
116 116
 // set some runtime options
117
-$incPath = str_replace("\\","/",dirname(__FILE__)."/includes/"); // Mod by Raymond
118
-set_include_path(get_include_path() . PATH_SEPARATOR . $incPath);
117
+$incPath = str_replace("\\", "/", dirname(__FILE__)."/includes/"); // Mod by Raymond
118
+set_include_path(get_include_path().PATH_SEPARATOR.$incPath);
119 119
 
120 120
 if (!defined('ENT_COMPAT')) define('ENT_COMPAT', 2);
121 121
 if (!defined('ENT_NOQUOTES')) define('ENT_NOQUOTES', 0);
122 122
 if (!defined('ENT_QUOTES')) define('ENT_QUOTES', 3);
123 123
 
124 124
 // set the document_root :|
125
-if(!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) {
125
+if (!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) {
126 126
 	$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/";
127 127
 }
128 128
 
@@ -161,30 +161,30 @@  discard block
 block discarded – undo
161 161
 // Now that session is given get user settings and merge into $modx->config
162 162
 $usersettings = $modx->getUserSettings();
163 163
 
164
-$settings =& $modx->config;
164
+$settings = & $modx->config;
165 165
 extract($modx->config, EXTR_OVERWRITE);
166 166
 
167 167
 // now include_once different language file as english
168
-if(!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
168
+if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
169 169
 	$manager_language = "english"; // if not set, get the english language file.
170 170
 }
171 171
 
172 172
 // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer)
173 173
 
174
-if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
174
+if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
175 175
 	include_once "lang/".$manager_language.".inc.php";
176 176
 }
177 177
 
178 178
 // allow custom language overrides not altered by future EVO-updates
179
-if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) {
179
+if (file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) {
180 180
 	include_once "lang/override/".$manager_language.".inc.php";
181 181
 }
182 182
 
183 183
 $s = array('[+MGR_DIR+]');
184 184
 $r = array(MGR_DIR);
185
-foreach($_lang as $k=>$v)
185
+foreach ($_lang as $k=>$v)
186 186
 {
187
-	if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v);
187
+	if (strpos($v, '[+') !== false) $_lang[$k] = str_replace($s, $r, $v);
188 188
 }
189 189
 
190 190
 // send the charset header
@@ -198,19 +198,19 @@  discard block
 block discarded – undo
198 198
 include_once "accesscontrol.inc.php";
199 199
 
200 200
 // double check the session
201
-if(!isset($_SESSION['mgrValidated'])){
201
+if (!isset($_SESSION['mgrValidated'])) {
202 202
 	echo "Not Logged In!";
203 203
 	exit;
204 204
 }
205 205
 
206 206
 // include_once the style variables file
207
-if(isset($manager_theme) && !isset($_style)) {
207
+if (isset($manager_theme) && !isset($_style)) {
208 208
 	$_style = array();
209 209
 	include_once "media/style/".$manager_theme."/style.php";
210 210
 }
211 211
 
212 212
 // check if user is allowed to access manager interface
213
-if(isset($allow_manager_access) && $allow_manager_access==0) {
213
+if (isset($allow_manager_access) && $allow_manager_access == 0) {
214 214
 	include_once "manager.lockout.inc.php";
215 215
 }
216 216
 
@@ -219,21 +219,21 @@  discard block
 block discarded – undo
219 219
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
220 220
 
221 221
 // first we check to see if this is a frameset request
222
-if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) {
222
+if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) {
223 223
 	// this looks to be a top-level frameset request, so let's serve up a frameset
224
-	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) {
224
+	if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) {
225 225
 		include_once "media/style/".$manager_theme."/frames/1.php";
226
-	}else{
226
+	} else {
227 227
 		include_once "frames/1.php";
228 228
 	}
229 229
 	exit;
230 230
 }
231 231
 
232 232
 // OK, let's retrieve the action directive from the request
233
-$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);
233
+$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 237
 else                       $action = null;
238 238
 
239 239
 if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) {
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 $modx->manager->action = $action;
245 245
 
246 246
 // attempt to foil some simple types of CSRF attacks
247
-if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) {
247
+if (isset($modx->config['validate_referer']) && (int) $modx->config['validate_referer']) {
248 248
 	if (isset($_SERVER['HTTP_REFERER'])) {
249 249
 		$referer = $_SERVER['HTTP_REFERER'];
250 250
 
@@ -264,11 +264,11 @@  discard block
 block discarded – undo
264 264
 $modx->invokeEvent("OnManagerPageInit", array("action" => $action));
265 265
 
266 266
 // return element filepath
267
-function includeFileProcessor ($filepath,$manager_theme) {
267
+function includeFileProcessor($filepath, $manager_theme){
268 268
 	$element = "";
269
-	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) {
269
+	if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) {
270 270
 		$element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath;
271
-	}else{
271
+	} else {
272 272
 		$element = $filepath;
273 273
 	}
274 274
 	return $element;
@@ -281,341 +281,341 @@  discard block
 block discarded – undo
281 281
 /********************************************************************/
282 282
 	case 1 :
283 283
 		// get the requested frame
284
-		$frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']);
285
-		if($frame>9) {
286
-			$enable_debug=false;    // this is to stop the debug thingy being attached to the framesets
284
+		$frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']);
285
+		if ($frame > 9) {
286
+			$enable_debug = false; // this is to stop the debug thingy being attached to the framesets
287 287
 		}
288
-		include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme));
288
+		include_once(includeFileProcessor("frames/".$frame.".php", $manager_theme));
289 289
 	break;
290 290
 /********************************************************************/
291 291
 /* show the homepage                                                */
292 292
 /********************************************************************/
293 293
 	case 2:
294 294
 		// get the home page
295
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
296
-		include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme));
297
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
295
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
296
+		include_once(includeFileProcessor("actions/welcome.static.php", $manager_theme));
297
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
298 298
 	break;
299 299
 /********************************************************************/
300 300
 /* document data                                                    */
301 301
 /********************************************************************/
302 302
 	case 3:
303 303
 		// get the page to show document's data
304
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
305
-		include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme));
306
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
304
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
305
+		include_once(includeFileProcessor("actions/document_data.static.php", $manager_theme));
306
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
307 307
 	break;
308 308
 /********************************************************************/
309 309
 /* content management                                               */
310 310
 /********************************************************************/
311 311
 	case 85:
312 312
 		// get the mutate page for adding a folder
313
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
314
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
315
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
313
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
314
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
315
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
316 316
 	break;
317 317
 	case 27:
318 318
 		// get the mutate page for changing content
319
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
320
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
321
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
319
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
320
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
321
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
322 322
 	break;
323 323
 	case 4:
324 324
 		// get the mutate page for adding content
325
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
326
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
327
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
325
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
326
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
327
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
328 328
 	break;
329 329
 	case 5:
330 330
 		// get the save processor
331
-		include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme));
331
+		include_once(includeFileProcessor("processors/save_content.processor.php", $manager_theme));
332 332
 	break;
333 333
 	case 6:
334 334
 		// get the delete processor
335
-		include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme));
335
+		include_once(includeFileProcessor("processors/delete_content.processor.php", $manager_theme));
336 336
 	break;
337 337
 	case 63:
338 338
 		// get the undelete processor
339
-		include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme));
339
+		include_once(includeFileProcessor("processors/undelete_content.processor.php", $manager_theme));
340 340
 	break;
341 341
 	case 51:
342 342
 		// get the move action
343
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
344
-		include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme));
345
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
343
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
344
+		include_once(includeFileProcessor("actions/move_document.dynamic.php", $manager_theme));
345
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
346 346
 	break;
347 347
 	case 52:
348 348
 		// get the move document processor
349
-		include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme));
349
+		include_once(includeFileProcessor("processors/move_document.processor.php", $manager_theme));
350 350
 	break;
351 351
 	case 61:
352 352
 		// get the processor for publishing content
353
-		include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme));
353
+		include_once(includeFileProcessor("processors/publish_content.processor.php", $manager_theme));
354 354
 	break;
355 355
 	case 62:
356 356
 		// get the processor for publishing content
357
-		include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme));
357
+		include_once(includeFileProcessor("processors/unpublish_content.processor.php", $manager_theme));
358 358
 	break;
359 359
 	case 56:
360 360
 		// get the sort menuindex action
361
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
362
-		include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme));
363
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
361
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
362
+		include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php", $manager_theme));
363
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
364 364
 		break;
365 365
 /********************************************************************/
366 366
 /* show the wait page - gives the tree time to refresh (hopefully)  */
367 367
 /********************************************************************/
368 368
 	case 7:
369 369
 		// get the wait page (so the tree can reload)
370
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
371
-		include_once(includeFileProcessor("actions/wait.static.php",$manager_theme));
372
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
370
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
371
+		include_once(includeFileProcessor("actions/wait.static.php", $manager_theme));
372
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
373 373
 	break;
374 374
 /********************************************************************/
375 375
 /* let the user log out                                             */
376 376
 /********************************************************************/
377 377
 	case 8:
378 378
 		// get the logout processor
379
-		include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme));
379
+		include_once(includeFileProcessor("processors/logout.processor.php", $manager_theme));
380 380
 	break;
381 381
 /********************************************************************/
382 382
 /* user management                                                  */
383 383
 /********************************************************************/
384 384
 	case 87:
385 385
 		// get the new web user page
386
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
387
-		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
388
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
386
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
387
+		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme));
388
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
389 389
 	break;
390 390
 	case 88:
391 391
 		// get the edit web user page
392
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
393
-		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
394
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
392
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
393
+		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme));
394
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
395 395
 	break;
396 396
 	case 89:
397 397
 		// get the save web user processor
398
-		include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme));
398
+		include_once(includeFileProcessor("processors/save_web_user.processor.php", $manager_theme));
399 399
 	break;
400 400
 	case 90:
401 401
 		// get the delete web user page
402
-		include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme));
402
+		include_once(includeFileProcessor("processors/delete_web_user.processor.php", $manager_theme));
403 403
 	break;
404 404
 	case 11:
405 405
 		// get the new user page
406
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
407
-		include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
408
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
406
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
407
+		include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme));
408
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
409 409
 	break;
410 410
 	case 12:
411 411
 		// get the edit user page
412
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
413
-		include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
414
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
412
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
413
+		include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme));
414
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
415 415
 	break;
416 416
 	case 32:
417 417
 		// get the save user processor
418
-		include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme));
418
+		include_once(includeFileProcessor("processors/save_user.processor.php", $manager_theme));
419 419
 	break;
420 420
 	case 28:
421 421
 		// get the change password page
422
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
423
-		include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme));
424
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
422
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
423
+		include_once(includeFileProcessor("actions/mutate_password.dynamic.php", $manager_theme));
424
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
425 425
 	break;
426 426
 	case 34:
427 427
 		// get the save new password page
428
-		include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme));
428
+		include_once(includeFileProcessor("processors/save_password.processor.php", $manager_theme));
429 429
 	break;
430 430
 	case 33:
431 431
 		// get the delete user page
432
-		include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme));
432
+		include_once(includeFileProcessor("processors/delete_user.processor.php", $manager_theme));
433 433
 	break;
434 434
 /********************************************************************/
435 435
 /* role management                                                  */
436 436
 /********************************************************************/
437 437
 	case 38:
438 438
 		// get the new role page
439
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
440
-		include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
441
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
439
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
440
+		include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme));
441
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
442 442
 	break;
443 443
 	case 35:
444 444
 		// get the edit role page
445
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
446
-		include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
447
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
445
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
446
+		include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme));
447
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
448 448
 	break;
449 449
 	case 36:
450 450
 		// get the save role page
451
-		include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme));
451
+		include_once(includeFileProcessor("processors/save_role.processor.php", $manager_theme));
452 452
 	break;
453 453
 	case 37:
454 454
 		// get the delete role page
455
-		include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme));
455
+		include_once(includeFileProcessor("processors/delete_role.processor.php", $manager_theme));
456 456
 	break;
457 457
 /********************************************************************/
458 458
 /* category management                                               */
459 459
 /********************************************************************/
460 460
 	case 120:
461 461
 		// get the edit category page
462
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
463
-		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
464
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
462
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
463
+		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme));
464
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
465 465
 	break;
466 466
 	case 121:
467 467
 		// for ajax-requests
468
-		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
468
+		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme));
469 469
 	break;
470 470
 /********************************************************************/
471 471
 /* template management                                              */
472 472
 /********************************************************************/
473 473
 	case 16:
474 474
 		// get the edit template action
475
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
476
-		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
477
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
475
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
476
+		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme));
477
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
478 478
 	break;
479 479
 	case 19:
480 480
 		// get the new template action
481
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
482
-		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
483
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
481
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
482
+		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme));
483
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
484 484
 	break;
485 485
 	case 20:
486 486
 		// get the save processor
487
-		include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme));
487
+		include_once(includeFileProcessor("processors/save_template.processor.php", $manager_theme));
488 488
 	break;
489 489
 	case 21:
490 490
 		// get the delete processor
491
-		include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme));
491
+		include_once(includeFileProcessor("processors/delete_template.processor.php", $manager_theme));
492 492
 	break;
493 493
 	case 96:
494 494
 		// get the duplicate template processor
495
-		include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme));
495
+		include_once(includeFileProcessor("processors/duplicate_template.processor.php", $manager_theme));
496 496
 	break;
497 497
 	case 117:
498 498
 		// change the tv rank for selected template
499
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
500
-		include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme));
501
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
499
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
500
+		include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php", $manager_theme));
501
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
502 502
 		break;
503 503
 /********************************************************************/
504 504
 /* snippet management                                               */
505 505
 /********************************************************************/
506 506
 	case 22:
507 507
 		// get the edit snippet action
508
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
509
-		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
510
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
508
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
509
+		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme));
510
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
511 511
 	break;
512 512
 	case 23:
513 513
 		// get the new snippet action
514
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
515
-		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
516
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
514
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
515
+		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme));
516
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
517 517
 	break;
518 518
 	case 24:
519 519
 		// get the save processor
520
-		include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme));
520
+		include_once(includeFileProcessor("processors/save_snippet.processor.php", $manager_theme));
521 521
 	break;
522 522
 	case 25:
523 523
 		// get the delete processor
524
-		include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme));
524
+		include_once(includeFileProcessor("processors/delete_snippet.processor.php", $manager_theme));
525 525
 	break;
526 526
 	case 98:
527 527
 		// get the duplicate processor
528
-		include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme));
528
+		include_once(includeFileProcessor("processors/duplicate_snippet.processor.php", $manager_theme));
529 529
 	break;
530 530
 /********************************************************************/
531 531
 /* htmlsnippet management                                               */
532 532
 /********************************************************************/
533 533
 	case 78:
534 534
 		// get the edit snippet action
535
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
536
-		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
537
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
535
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
536
+		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme));
537
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
538 538
 	break;
539 539
 	case 77:
540 540
 		// get the new snippet action
541
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
542
-		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
543
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
541
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
542
+		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme));
543
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
544 544
 	break;
545 545
 	case 79:
546 546
 		// get the save processor
547
-		include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme));
547
+		include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php", $manager_theme));
548 548
 	break;
549 549
 	case 80:
550 550
 		// get the delete processor
551
-		include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme));
551
+		include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php", $manager_theme));
552 552
 	break;
553 553
 	case 97:
554 554
 		// get the duplicate processor
555
-		include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme));
555
+		include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php", $manager_theme));
556 556
 	break;
557 557
 /********************************************************************/
558 558
 /* show the credits page                                            */
559 559
 /********************************************************************/
560 560
 	case 18:
561 561
 		// get the credits page
562
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
563
-		include_once(includeFileProcessor("actions/credits.static.php",$manager_theme));
564
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
562
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
563
+		include_once(includeFileProcessor("actions/credits.static.php", $manager_theme));
564
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
565 565
 	break;
566 566
 /********************************************************************/
567 567
 /* empty cache & synchronisation                                    */
568 568
 /********************************************************************/
569 569
 	case 26:
570 570
 		// get the cache emptying processor
571
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
572
-		include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme));
573
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
571
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
572
+		include_once(includeFileProcessor("actions/refresh_site.dynamic.php", $manager_theme));
573
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
574 574
 	break;
575 575
 /********************************************************************/
576 576
 /* Module management                                                */
577 577
 /********************************************************************/
578 578
 	case 106:
579 579
 		// get module management
580
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
581
-		include_once(includeFileProcessor("actions/modules.static.php",$manager_theme));
582
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
580
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
581
+		include_once(includeFileProcessor("actions/modules.static.php", $manager_theme));
582
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
583 583
 	break;
584 584
 	case 107:
585 585
 		// get the new module action
586
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
587
-		include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
588
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
586
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
587
+		include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme));
588
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
589 589
 	break;
590 590
 	case 108:
591 591
 		// get the edit module action
592
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
593
-		include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
594
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
592
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
593
+		include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme));
594
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
595 595
 	break;
596 596
 	case 109:
597 597
 		// get the save processor
598
-		include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme));
598
+		include_once(includeFileProcessor("processors/save_module.processor.php", $manager_theme));
599 599
 	break;
600 600
 	case 110:
601 601
 		// get the delete processor
602
-		include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme));
602
+		include_once(includeFileProcessor("processors/delete_module.processor.php", $manager_theme));
603 603
 	break;
604 604
 	case 111:
605 605
 		// get the duplicate processor
606
-		include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme));
606
+		include_once(includeFileProcessor("processors/duplicate_module.processor.php", $manager_theme));
607 607
 	break;
608 608
 	case 112:
609 609
 		// execute/run the module
610 610
 		//include_once "header.inc.php";
611
-		include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme));
611
+		include_once(includeFileProcessor("processors/execute_module.processor.php", $manager_theme));
612 612
 		//include_once "footer.inc.php";
613 613
 		break;
614 614
 	case 113:
615 615
 		// get the module resources (dependencies) action
616
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
617
-		include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme));
618
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
616
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
617
+		include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php", $manager_theme));
618
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
619 619
 	break;
620 620
 /********************************************************************/
621 621
 /* plugin management                                                */
@@ -623,46 +623,46 @@  discard block
 block discarded – undo
623 623
 	case 100:
624 624
 		// change the plugin priority
625 625
 		//include_once "header.inc.php"; - in action file
626
-		include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme));
627
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
626
+		include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php", $manager_theme));
627
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
628 628
 	break;
629 629
 	case 101:
630 630
 		// get the new plugin action
631
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
632
-		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
633
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
631
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
632
+		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme));
633
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
634 634
 	break;
635 635
 	case 102:
636 636
 		// get the edit plugin action
637
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
638
-		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
639
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
637
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
638
+		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme));
639
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
640 640
 	break;
641 641
 	case 103:
642 642
 		// get the save processor
643
-		include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme));
643
+		include_once(includeFileProcessor("processors/save_plugin.processor.php", $manager_theme));
644 644
 	break;
645 645
 	case 104:
646 646
 		// get the delete processor
647
-		include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme));
647
+		include_once(includeFileProcessor("processors/delete_plugin.processor.php", $manager_theme));
648 648
 	break;
649 649
 	case 105:
650 650
 		// get the duplicate processor
651
-		include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme));
651
+		include_once(includeFileProcessor("processors/duplicate_plugin.processor.php", $manager_theme));
652 652
 	break;
653 653
 	case 119:
654 654
 		// get the purge processor
655
-		include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme));
655
+		include_once(includeFileProcessor("processors/purge_plugin.processor.php", $manager_theme));
656 656
 	break;
657 657
 /********************************************************************/
658 658
 /* view phpinfo                                                     */
659 659
 /********************************************************************/
660 660
 	case 200:
661 661
 		// show phpInfo
662
-		if($modx->hasPermission('logs')) {
663
-			include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
664
-			include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme));
665
-			include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
662
+		if ($modx->hasPermission('logs')) {
663
+			include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
664
+			include_once(includeFileProcessor("actions/phpinfo.static.php", $manager_theme));
665
+			include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
666 666
 		}
667 667
 	break;
668 668
 /********************************************************************/
@@ -670,320 +670,320 @@  discard block
 block discarded – undo
670 670
 /********************************************************************/
671 671
 	case 29:
672 672
 		// get the error page
673
-		include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme));
673
+		include_once(includeFileProcessor("actions/error_dialog.static.php", $manager_theme));
674 674
 	break;
675 675
 /********************************************************************/
676 676
 /* file manager                                                     */
677 677
 /********************************************************************/
678 678
 	case 31:
679 679
 		// get the page to manage files
680
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
681
-		include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme));
682
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
680
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
681
+		include_once(includeFileProcessor("actions/files.dynamic.php", $manager_theme));
682
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
683 683
 	break;
684 684
 /********************************************************************/
685 685
 /* access permissions                                               */
686 686
 /********************************************************************/
687 687
 	case 40:
688
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
689
-		include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme));
690
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
688
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
689
+		include_once(includeFileProcessor("actions/access_permissions.dynamic.php", $manager_theme));
690
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
691 691
 	break;
692 692
 	case 91:
693
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
694
-		include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme));
695
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
693
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
694
+		include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php", $manager_theme));
695
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
696 696
 	break;
697 697
 /********************************************************************/
698 698
 /* access groups processor                                          */
699 699
 /********************************************************************/
700 700
 	case 41:
701
-		include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme));
701
+		include_once(includeFileProcessor("processors/access_groups.processor.php", $manager_theme));
702 702
 	break;
703 703
 	case 92:
704
-		include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme));
704
+		include_once(includeFileProcessor("processors/web_access_groups.processor.php", $manager_theme));
705 705
 	break;
706 706
 /********************************************************************/
707 707
 /* settings editor                                                  */
708 708
 /********************************************************************/
709 709
 	case 17:
710 710
 		// get the settings editor
711
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
712
-		include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme));
713
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
711
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
712
+		include_once(includeFileProcessor("actions/mutate_settings.dynamic.php", $manager_theme));
713
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
714 714
 	break;
715 715
 	case 118:
716 716
 		// call settings ajax include
717 717
 		ob_clean();
718
-		include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme));
718
+		include_once(includeFileProcessor("includes/mutate_settings.ajax.php", $manager_theme));
719 719
 	break;
720 720
 /********************************************************************/
721 721
 /* save settings                                                    */
722 722
 /********************************************************************/
723 723
 	case 30:
724 724
 		// get the save settings processor
725
-		include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme));
725
+		include_once(includeFileProcessor("processors/save_settings.processor.php", $manager_theme));
726 726
 	break;
727 727
 /********************************************************************/
728 728
 /* system information                                               */
729 729
 /********************************************************************/
730 730
 	case 53:
731 731
 		// get the settings editor
732
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
733
-		include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme));
734
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
732
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
733
+		include_once(includeFileProcessor("actions/sysinfo.static.php", $manager_theme));
734
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
735 735
 	break;
736 736
 /********************************************************************/
737 737
 /* optimise table                                               */
738 738
 /********************************************************************/
739 739
 	case 54:
740 740
 		// get the table optimizer/truncate processor
741
-		include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme));
741
+		include_once(includeFileProcessor("processors/optimize_table.processor.php", $manager_theme));
742 742
 	break;
743 743
 /********************************************************************/
744 744
 /* view logging                                                     */
745 745
 /********************************************************************/
746 746
 	case 13:
747 747
 		// view logging
748
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
749
-		include_once(includeFileProcessor("actions/logging.static.php",$manager_theme));
750
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
748
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
749
+		include_once(includeFileProcessor("actions/logging.static.php", $manager_theme));
750
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
751 751
 	break;
752 752
 /********************************************************************/
753 753
 /* empty logs                                                       */
754 754
 /********************************************************************/
755 755
 	case 55:
756 756
 		// get the settings editor
757
-		include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme));
757
+		include_once(includeFileProcessor("processors/empty_table.processor.php", $manager_theme));
758 758
 	break;
759 759
 /********************************************************************/
760 760
 /* calls test page                                                      */
761 761
 /********************************************************************/
762 762
 	case 999:
763 763
 		// get the test page
764
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
765
-		include_once(includeFileProcessor("test_page.php",$manager_theme));
766
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
764
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
765
+		include_once(includeFileProcessor("test_page.php", $manager_theme));
766
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
767 767
 	break;
768 768
 /********************************************************************/
769 769
 /* Empty recycle bin                                                */
770 770
 /********************************************************************/
771 771
 	case 64:
772 772
 		// get the Recycle bin emptier
773
-		include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme));
773
+		include_once(includeFileProcessor("processors/remove_content.processor.php", $manager_theme));
774 774
 	break;
775 775
 /********************************************************************/
776 776
 /* Messages                                                     */
777 777
 /********************************************************************/
778 778
 	case 10:
779 779
 		// get the messages page
780
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
781
-		include_once(includeFileProcessor("actions/messages.static.php",$manager_theme));
782
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
780
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
781
+		include_once(includeFileProcessor("actions/messages.static.php", $manager_theme));
782
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
783 783
 	break;
784 784
 /********************************************************************/
785 785
 /* Delete a message                                                 */
786 786
 /********************************************************************/
787 787
 	case 65:
788 788
 		// get the message deleter
789
-		include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme));
789
+		include_once(includeFileProcessor("processors/delete_message.processor.php", $manager_theme));
790 790
 	break;
791 791
 /********************************************************************/
792 792
 /* Send a message                                                   */
793 793
 /********************************************************************/
794 794
 	case 66:
795 795
 		// get the message deleter
796
-		include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme));
796
+		include_once(includeFileProcessor("processors/send_message.processor.php", $manager_theme));
797 797
 	break;
798 798
 /********************************************************************/
799 799
 /* Remove locks                                                 */
800 800
 /********************************************************************/
801 801
 	case 67:
802 802
 		// get the lock remover
803
-		include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme));
803
+		include_once(includeFileProcessor("processors/remove_locks.processor.php", $manager_theme));
804 804
 	break;
805 805
 /********************************************************************/
806 806
 /* Site schedule                                                    */
807 807
 /********************************************************************/
808 808
 	case 70:
809 809
 		// get the schedule page
810
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
811
-		include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme));
812
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
810
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
811
+		include_once(includeFileProcessor("actions/site_schedule.static.php", $manager_theme));
812
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
813 813
 	break;
814 814
 /********************************************************************/
815 815
 /* Search                                                           */
816 816
 /********************************************************************/
817 817
 	case 71:
818 818
 		// get the search page
819
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
820
-		include_once(includeFileProcessor("actions/search.static.php",$manager_theme));
821
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
819
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
820
+		include_once(includeFileProcessor("actions/search.static.php", $manager_theme));
821
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
822 822
 	break;
823 823
 /********************************************************************/
824 824
 /* About                                                            */
825 825
 /********************************************************************/
826 826
 	case 59:
827 827
 		// get the about page
828
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
829
-		include_once(includeFileProcessor("actions/about.static.php",$manager_theme));
830
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
828
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
829
+		include_once(includeFileProcessor("actions/about.static.php", $manager_theme));
830
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
831 831
 	break;
832 832
 /********************************************************************/
833 833
 /* Add weblink                                                          */
834 834
 /********************************************************************/
835 835
 	case 72:
836 836
 		// get the weblink page
837
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
838
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
839
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
837
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
838
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
839
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
840 840
 	break;
841 841
 /********************************************************************/
842 842
 /* User management                                                  */
843 843
 /********************************************************************/
844 844
 	case 75:
845
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
846
-		include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme));
847
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
845
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
846
+		include_once(includeFileProcessor("actions/user_management.static.php", $manager_theme));
847
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
848 848
 	break;
849 849
 	case 99:
850
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
851
-		include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme));
852
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
850
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
851
+		include_once(includeFileProcessor("actions/web_user_management.static.php", $manager_theme));
852
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
853 853
 	break;
854 854
 	case 86:
855
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
856
-		include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme));
857
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
855
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
856
+		include_once(includeFileProcessor("actions/role_management.static.php", $manager_theme));
857
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
858 858
 	break;
859 859
 /********************************************************************/
860 860
 /* template/ snippet management                                                 */
861 861
 /********************************************************************/
862 862
 	case 76:
863
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
864
-		include_once(includeFileProcessor("actions/resources.static.php",$manager_theme));
865
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
863
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
864
+		include_once(includeFileProcessor("actions/resources.static.php", $manager_theme));
865
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
866 866
 	break;
867 867
 /********************************************************************/
868 868
 /* Export to file                                                   */
869 869
 /********************************************************************/
870 870
 	case 83:
871
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
872
-		include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme));
873
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
871
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
872
+		include_once(includeFileProcessor("actions/export_site.static.php", $manager_theme));
873
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
874 874
 	break;
875 875
 /********************************************************************/
876 876
 /* Resource Selector                                                    */
877 877
 /********************************************************************/
878 878
 	case 84:
879
-		include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme));
879
+		include_once(includeFileProcessor("actions/resource_selector.static.php", $manager_theme));
880 880
 	break;
881 881
 /********************************************************************/
882 882
 /* Backup Manager                                                   */
883 883
 /********************************************************************/
884 884
 	case 93:
885 885
 		# header and footer will be handled interally
886
-		include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme));
886
+		include_once(includeFileProcessor("actions/bkmanager.static.php", $manager_theme));
887 887
 	break;
888 888
 /********************************************************************/
889 889
 /* Duplicate Document                                                   */
890 890
 /********************************************************************/
891 891
 	case 94:
892 892
 		// get the duplicate processor
893
-		include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme));
893
+		include_once(includeFileProcessor("processors/duplicate_content.processor.php", $manager_theme));
894 894
 	break;
895 895
 /********************************************************************/
896 896
 /* Import Document from file                                        */
897 897
 /********************************************************************/
898 898
 	case 95:
899
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
900
-		include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme));
901
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
899
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
900
+		include_once(includeFileProcessor("actions/import_site.static.php", $manager_theme));
901
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
902 902
 	break;
903 903
 /********************************************************************/
904 904
 /* Help                                                             */
905 905
 /********************************************************************/
906 906
 	case 9:
907 907
 		// get the help page
908
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
909
-		include_once(includeFileProcessor("actions/help.static.php",$manager_theme));
910
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
908
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
909
+		include_once(includeFileProcessor("actions/help.static.php", $manager_theme));
910
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
911 911
 	break;
912 912
 /********************************************************************/
913 913
 /* Template Variables - Based on Apodigm's Docvars                  */
914 914
 /********************************************************************/
915 915
 	case 300:
916 916
 		// get the new document variable action
917
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
918
-		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
919
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
917
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
918
+		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme));
919
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
920 920
 	break;
921 921
 	case 301:
922 922
 		// get the edit document variable action
923
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
924
-		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
925
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
923
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
924
+		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme));
925
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
926 926
 	break;
927 927
 	case 302:
928 928
 		// get the save processor
929
-		include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme));
929
+		include_once(includeFileProcessor("processors/save_tmplvars.processor.php", $manager_theme));
930 930
 	break;
931 931
 	case 303:
932 932
 		// get the delete processor
933
-		include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme));
933
+		include_once(includeFileProcessor("processors/delete_tmplvars.processor.php", $manager_theme));
934 934
 	break;
935 935
 	case 304:
936 936
 		// get the duplicate processor
937
-		include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme));
937
+		include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php", $manager_theme));
938 938
 	break;
939 939
 	case 305:
940 940
 		// get the tv-rank action
941
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
942
-		include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme));
943
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
941
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
942
+		include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php", $manager_theme));
943
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
944 944
 	break;
945 945
 /********************************************************************/
946 946
 /* Event viewer: show event message log                             */
947 947
 /********************************************************************/
948 948
 	case 114:
949 949
 		// get event logs
950
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
951
-		include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme));
952
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
950
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
951
+		include_once(includeFileProcessor("actions/eventlog.dynamic.php", $manager_theme));
952
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
953 953
 	break;
954 954
 	case 115:
955 955
 		// get event log details viewer
956
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
957
-		include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme));
958
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
956
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
957
+		include_once(includeFileProcessor("actions/eventlog_details.dynamic.php", $manager_theme));
958
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
959 959
 	break;
960 960
 	case 116:
961 961
 		// get the event log delete processor
962
-		include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme));
962
+		include_once(includeFileProcessor("processors/delete_eventlog.processor.php", $manager_theme));
963 963
 	break;
964 964
 
965 965
 	case 501:
966 966
 		//delete category
967
-		include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme));
967
+		include_once(includeFileProcessor("processors/delete_category.processor.php", $manager_theme));
968 968
 	break;
969 969
 /********************************************************************/
970 970
 /* default action: show not implemented message                     */
971 971
 /********************************************************************/
972 972
 	default :
973 973
 		// say that what was requested doesn't do anything yet
974
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
974
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
975 975
 		echo "
976 976
 			<div class='sectionHeader'>".$_lang['functionnotimpl']."</div>
977 977
 			<div class='sectionBody'>
978 978
 				<p>".$_lang['functionnotimpl_message']."</p>
979 979
 			</div>
980 980
 		";
981
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
981
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
982 982
 }
983 983
 
984 984
 /********************************************************************/
985 985
 // log action, unless it's a frame request
986
-if($action!=1 && $action!=7 && $action!=2) {
986
+if ($action != 1 && $action != 7 && $action != 2) {
987 987
 	include_once "log.class.inc.php";
988 988
 	$log = new logHandler;
989 989
 	$log->initAndWriteLog();
Please login to merge, or discard this patch.
manager/processors/undelete_content.processor.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,50 +1,50 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('delete_document')) {
5
+if (!$modx->hasPermission('delete_document')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************ webber ********/
15
-$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************** webber *************/
19
-$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:'';
22
-$add_path=$sd.$sb.$pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /***********************************/
25 25
 
26 26
 
27 27
 // check permissions on the document
28
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
28
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
29 29
 $udperms = new udperms();
30 30
 $udperms->user = $modx->getLoginUserID();
31 31
 $udperms->document = $id;
32 32
 $udperms->role = $_SESSION['mgrRole'];
33 33
 
34
-if(!$udperms->checkPermissions()) {
34
+if (!$udperms->checkPermissions()) {
35 35
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
36 36
 }
37 37
 
38 38
 // get the timestamp on which the document was deleted.
39 39
 $rs = $modx->db->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1");
40 40
 $deltime = $modx->db->getValue($rs);
41
-if(!$deltime) {
41
+if (!$deltime) {
42 42
 	$modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
43 43
 }
44 44
 
45 45
 $children = array();
46 46
 
47
-function getChildren($parent) {
47
+function getChildren($parent){
48 48
 
49 49
 	global $modx;
50 50
 	global $children;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	$rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='{$parent}' AND deleted=1 AND deletedon='{$deltime}'");
54 54
 		// the document has children documents, we'll need to delete those too
55
-		while ($row=$modx->db->getRow($rs)) {
55
+		while ($row = $modx->db->getRow($rs)) {
56 56
 			$children[] = $row['id'];
57 57
 			getChildren($row['id']);
58 58
 			//echo "Found childNode of parentNode $parent: ".$row['id']."<br />";
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 getChildren($id);
63 63
 
64
-if(count($children)>0) {
64
+if (count($children) > 0) {
65 65
 	$modx->db->update(
66 66
 		array(
67 67
 			'deleted'   => 0,
@@ -90,5 +90,5 @@  discard block
 block discarded – undo
90 90
 $modx->clearCache('full');
91 91
 
92 92
 // finished emptying cache - redirect
93
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
93
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
94 94
 header($header);
Please login to merge, or discard this patch.
manager/processors/login.processor.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
2
+if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3 3
 	header('HTTP/1.0 404 Not Found');
4 4
 	exit('error');
5 5
 }
6
-define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
6
+define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
8
-include_once(__DIR__ . '/../../index.php');
8
+include_once(__DIR__.'/../../index.php');
9 9
 $modx->db->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 $modx->loadExtension('ManagerAPI');
13 13
 $modx->loadExtension('phpass');
14 14
 
15
-$core_path = MODX_MANAGER_PATH . 'includes/';
15
+$core_path = MODX_MANAGER_PATH.'includes/';
16 16
 // include_once the language file
17 17
 $_lang = array();
18 18
 include_once("{$core_path}lang/english.inc.php");
19 19
 
20
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
20
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
21 21
 	include_once("{$core_path}lang/{$manager_language}.inc.php");
22 22
 }
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 include_once("{$core_path}log.class.inc.php");
26 26
 
27 27
 // Initialize System Alert Message Queque
28
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
28
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
29 29
 	$_SESSION['SystemAlertMsgQueque'] = array();
30 30
 }
31 31
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 $rs = $modx->db->select($fields, $from, $where);
52 52
 $limit = $modx->db->getRecordCount($rs);
53 53
 
54
-if($limit == 0 || $limit > 1) {
54
+if ($limit == 0 || $limit > 1) {
55 55
 	jsAlert($_lang['login_processor_unknown_user']);
56 56
 	return;
57 57
 }
@@ -73,32 +73,32 @@  discard block
 block discarded – undo
73 73
 
74 74
 // get the user settings from the database
75 75
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
76
-while($row = $modx->db->getRow($rs)) {
76
+while ($row = $modx->db->getRow($rs)) {
77 77
 	extract($row);
78 78
 	${$setting_name} = $setting_value;
79 79
 }
80 80
 
81 81
 // blocked due to number of login errors.
82
-if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
82
+if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
83 83
 	@session_destroy();
84 84
 	session_unset();
85
-	if($cip = getenv("HTTP_CLIENT_IP")) {
85
+	if ($cip = getenv("HTTP_CLIENT_IP")) {
86 86
 		$ip = $cip;
87
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
87
+	} elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88 88
 		$ip = $cip;
89
-	} elseif($cip = getenv("REMOTE_ADDR")) {
89
+	} elseif ($cip = getenv("REMOTE_ADDR")) {
90 90
 		$ip = $cip;
91 91
 	} else {
92 92
 		$ip = "UNKNOWN";
93 93
 	}
94 94
 	$log = new logHandler;
95
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
95
+	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip);
96 96
 	jsAlert($_lang['login_processor_many_failed_logins']);
97 97
 	return;
98 98
 }
99 99
 
100 100
 // blocked due to number of login errors, but get to try again
101
-if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
101
+if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
102 102
 	$fields = array();
103 103
 	$fields['failedlogincount'] = '0';
104 104
 	$fields['blockeduntil'] = time() - 1;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 // this user has been blocked by an admin, so no way he's loggin in!
109
-if($blocked == '1') {
109
+if ($blocked == '1') {
110 110
 	@session_destroy();
111 111
 	session_unset();
112 112
 	jsAlert($_lang['login_processor_blocked1']);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 }
115 115
 
116 116
 // blockuntil: this user has a block until date
117
-if($blockeduntildate > time()) {
117
+if ($blockeduntildate > time()) {
118 118
 	@session_destroy();
119 119
 	session_unset();
120 120
 	jsAlert($_lang['login_processor_blocked2']);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 }
123 123
 
124 124
 // blockafter: this user has a block after date
125
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
125
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
126 126
 	@session_destroy();
127 127
 	session_unset();
128 128
 	jsAlert($_lang['login_processor_blocked3']);
@@ -130,24 +130,24 @@  discard block
 block discarded – undo
130 130
 }
131 131
 
132 132
 // allowed ip
133
-if($allowed_ip) {
134
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
133
+if ($allowed_ip) {
134
+	if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
+		if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
136 136
 			jsAlert($_lang['login_processor_remotehost_ip']);
137 137
 			return;
138 138
 		}
139 139
 	}
140
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
140
+	if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
141 141
 		jsAlert($_lang['login_processor_remote_ip']);
142 142
 		return;
143 143
 	}
144 144
 }
145 145
 
146 146
 // allowed days
147
-if($allowed_days) {
147
+if ($allowed_days) {
148 148
 	$date = getdate();
149 149
 	$day = $date['wday'] + 1;
150
-	if(strpos($allowed_days, $day) === false) {
150
+	if (strpos($allowed_days, $day) === false) {
151 151
 		jsAlert($_lang['login_processor_date']);
152 152
 		return;
153 153
 	}
@@ -164,33 +164,33 @@  discard block
 block discarded – undo
164 164
 
165 165
 // check if plugin authenticated the user
166 166
 $matchPassword = false;
167
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
167
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
168 168
 	// check user password - local authentication
169 169
 	$hashType = $modx->manager->getHashType($dbasePassword);
170
-	if($hashType == 'phpass') {
170
+	if ($hashType == 'phpass') {
171 171
 		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
172
-	} elseif($hashType == 'md5') {
172
+	} elseif ($hashType == 'md5') {
173 173
 		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
174
-	} elseif($hashType == 'v1') {
174
+	} elseif ($hashType == 'v1') {
175 175
 		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
176 176
 	} else {
177 177
 		$matchPassword = false;
178 178
 	}
179
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
179
+} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
180 180
 	$matchPassword = true;
181 181
 }
182 182
 
183
-if(!$matchPassword) {
183
+if (!$matchPassword) {
184 184
 	jsAlert($_lang['login_processor_wrong_password']);
185 185
 	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
186 186
 	return;
187 187
 }
188 188
 
189
-if($modx->config['use_captcha'] == 1) {
190
-	if(!isset ($_SESSION['veriword'])) {
189
+if ($modx->config['use_captcha'] == 1) {
190
+	if (!isset ($_SESSION['veriword'])) {
191 191
 		jsAlert($_lang['login_processor_captcha_config']);
192 192
 		return;
193
-	} elseif($_SESSION['veriword'] != $captcha_code) {
193
+	} elseif ($_SESSION['veriword'] != $captcha_code) {
194 194
 		jsAlert($_lang['login_processor_bad_code']);
195 195
 		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
196 196
 		return;
@@ -218,25 +218,25 @@  discard block
 block discarded – undo
218 218
 $_SESSION['mgrPermissions'] = $modx->db->getRow($rs);
219 219
 
220 220
 // successful login so reset fail count and update key values
221
-$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
221
+$modx->db->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
222 222
 
223 223
 // get user's document groups
224 224
 $i = 0;
225
-$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
226
-		INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
225
+$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug
226
+		INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
227 227
 $_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs);
228 228
 
229 229
 $_SESSION['mgrToken'] = md5($currentsessionid);
230 230
 
231
-if($rememberme == '1') {
232
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
231
+if ($rememberme == '1') {
232
+	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
233 233
 
234 234
 	// Set a cookie separate from the session cookie with the username in it.
235 235
 	// Are we using secure connection? If so, make sure the cookie is secure
236 236
 	global $https_port;
237 237
 
238 238
 	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
239
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
239
+	if (version_compare(PHP_VERSION, '5.2', '<')) {
240 240
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
241 241
 	} else {
242 242
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 // Check if user already has an active session, if not check if user pressed logout end of last session
252 252
 $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
253 253
 $activeSession = $modx->db->getValue($rs);
254
-if(!$activeSession) {
254
+if (!$activeSession) {
255 255
 	$rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
256
-	if($lastHit = $modx->db->getValue($rs)) {
256
+	if ($lastHit = $modx->db->getValue($rs)) {
257 257
 		$_SESSION['show_logout_reminder'] = array(
258 258
 			'type' => 'logout_reminder',
259 259
 			'lastHit' => $lastHit
@@ -274,17 +274,17 @@  discard block
 block discarded – undo
274 274
 
275 275
 // check if we should redirect user to a web page
276 276
 $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
277
-$id = (int)$modx->db->getValue($rs);
278
-if($id > 0) {
279
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
280
-	if($_POST['ajax'] == 1) {
277
+$id = (int) $modx->db->getValue($rs);
278
+if ($id > 0) {
279
+	$header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
280
+	if ($_POST['ajax'] == 1) {
281 281
 		echo $header;
282 282
 	} else {
283 283
 		header($header);
284 284
 	}
285 285
 } else {
286
-	$header = 'Location: ' . MODX_MANAGER_URL;
287
-	if($_POST['ajax'] == 1) {
286
+	$header = 'Location: '.MODX_MANAGER_URL;
287
+	if ($_POST['ajax'] == 1) {
288 288
 		echo $header;
289 289
 	} else {
290 290
 		header($header);
@@ -292,35 +292,35 @@  discard block
 block discarded – undo
292 292
 }
293 293
 
294 294
 // show javascript alert
295
-function jsAlert($msg) {
295
+function jsAlert($msg){
296 296
 	global $modx;
297
-	if($_POST['ajax'] != 1) {
298
-		echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
297
+	if ($_POST['ajax'] != 1) {
298
+		echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>";
299 299
 	} else {
300
-		echo $msg . "\n";
300
+		echo $msg."\n";
301 301
 	}
302 302
 }
303 303
 
304
-function login($username, $givenPassword, $dbasePassword) {
304
+function login($username, $givenPassword, $dbasePassword){
305 305
 	global $modx;
306 306
 	return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
307 307
 }
308 308
 
309
-function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
309
+function loginV1($internalKey, $givenPassword, $dbasePassword, $username){
310 310
 	global $modx;
311 311
 
312 312
 	$user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
313 313
 
314
-	if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
314
+	if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
315 315
 		$modx->config['pwd_hash_algo'] = 'UNCRYPT';
316 316
 	}
317 317
 
318
-	if($user_algo !== $modx->config['pwd_hash_algo']) {
318
+	if ($user_algo !== $modx->config['pwd_hash_algo']) {
319 319
 		$bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
320 320
 		$modx->config['pwd_hash_algo'] = $user_algo;
321 321
 	}
322 322
 
323
-	if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
323
+	if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
324 324
 		return false;
325 325
 	}
326 326
 
@@ -329,17 +329,17 @@  discard block
 block discarded – undo
329 329
 	return true;
330 330
 }
331 331
 
332
-function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
332
+function loginMD5($internalKey, $givenPassword, $dbasePassword, $username){
333 333
 	global $modx;
334 334
 
335
-	if($dbasePassword != md5($givenPassword)) {
335
+	if ($dbasePassword != md5($givenPassword)) {
336 336
 		return false;
337 337
 	}
338 338
 	updateNewHash($username, $givenPassword);
339 339
 	return true;
340 340
 }
341 341
 
342
-function updateNewHash($username, $password) {
342
+function updateNewHash($username, $password){
343 343
 	global $modx;
344 344
 
345 345
 	$field = array();
@@ -347,23 +347,23 @@  discard block
 block discarded – undo
347 347
 	$modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'");
348 348
 }
349 349
 
350
-function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
350
+function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes){
351 351
 	global $modx;
352 352
 
353 353
 	$failedlogins += 1;
354 354
 
355 355
 	$fields = array('failedlogincount' => $failedlogins);
356
-	if($failedlogins >= $failed_allowed) //block user for too many fail attempts
356
+	if ($failedlogins >= $failed_allowed) //block user for too many fail attempts
357 357
 	{
358 358
 		$fields['blockeduntil'] = time() + ($blocked_minutes * 60);
359 359
 	}
360 360
 
361 361
 	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
362 362
 
363
-	if($failedlogins < $failed_allowed) {
363
+	if ($failedlogins < $failed_allowed) {
364 364
 		//sleep to help prevent brute force attacks
365 365
 		$sleep = (int) $failedlogins / 2;
366
-		if($sleep > 5) {
366
+		if ($sleep > 5) {
367 367
 			$sleep = 5;
368 368
 		}
369 369
 		sleep($sleep);
Please login to merge, or discard this patch.