Completed
Push — develop ( d271f8...cb7ecf )
by Serg
08:17 queued 57s
created
manager/actions/web_user_management.static.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_web_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // initialize page view state - the $_PAGE object
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 // get and save search string
13 13
 if($_REQUEST['op'] == 'reset') {
14
-	$query = '';
15
-	$_PAGE['vs']['search'] = '';
14
+    $query = '';
15
+    $_PAGE['vs']['search'] = '';
16 16
 } else {
17
-	$query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
-	$sqlQuery = $modx->db->escape($query);
19
-	$_PAGE['vs']['search'] = $query;
17
+    $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
+    $sqlQuery = $modx->db->escape($query);
19
+    $_PAGE['vs']['search'] = $query;
20 20
 }
21 21
 
22 22
 // get & save listmode
@@ -120,30 +120,30 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
123
+                    $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
124 124
 			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
126
-					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127
-					$grd->noRecordMsg = $_lang["no_records_found"];
128
-					$grd->cssClass = "table data";
129
-					$grd->columnHeaderClass = "tableHeader";
130
-					$grd->itemClass = "tableItem";
131
-					$grd->altItemClass = "tableAltItem";
132
-					$grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
133
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
134
-					$grd->colWidths = "1%,,,,1%,1%,1%";
135
-					$grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
136
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . 
137
-					" %H:%M";
138
-					if($listmode == '1') {
139
-						$grd->pageSize = 0;
140
-					}
141
-					if($_REQUEST['op'] == 'reset') {
142
-						$grd->pageNumber = 1;
143
-					}
144
-					// render grid
145
-					echo $grd->render();
146
-					?>
125
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
126
+                    $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127
+                    $grd->noRecordMsg = $_lang["no_records_found"];
128
+                    $grd->cssClass = "table data";
129
+                    $grd->columnHeaderClass = "tableHeader";
130
+                    $grd->itemClass = "tableItem";
131
+                    $grd->altItemClass = "tableAltItem";
132
+                    $grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
133
+                    $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
134
+                    $grd->colWidths = "1%,,,,1%,1%,1%";
135
+                    $grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
136
+                    $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . 
137
+                    " %H:%M";
138
+                    if($listmode == '1') {
139
+                        $grd->pageSize = 0;
140
+                    }
141
+                    if($_REQUEST['op'] == 'reset') {
142
+                        $grd->pageNumber = 1;
143
+                    }
144
+                    // render grid
145
+                    echo $grd->render();
146
+                    ?>
147 147
 				</div>
148 148
 			</div>
149 149
 		</div>
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
 $autoloader = __DIR__.'/vendor/autoload.php';
49 49
 if (file_exists($autoloader) && is_readable($autoloader)) {
50
-	include_once($autoloader);
50
+    include_once($autoloader);
51 51
 }
52 52
 
53 53
 if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 if(is_file($base_path . 'assets/cache/siteManager.php'))
57 57
     include_once($base_path . 'assets/cache/siteManager.php');
58 58
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
59
-	define('MGR_DIR', 'manager');
59
+    define('MGR_DIR', 'manager');
60 60
 if(is_file($base_path . 'assets/cache/siteHostnames.php'))
61 61
     include_once($base_path . 'assets/cache/siteHostnames.php');
62 62
 if(!defined('MODX_SITE_HOSTNAMES'))
63
-	define('MODX_SITE_HOSTNAMES', '');
63
+    define('MODX_SITE_HOSTNAMES', '');
64 64
 
65 65
 // get start time
66 66
 $mstart = memory_get_usage();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 define('IN_PARSER_MODE', true);
86 86
 if ( ! defined('IN_MANAGER_MODE')) {
87
-	define('IN_MANAGER_MODE', false);
87
+    define('IN_MANAGER_MODE', false);
88 88
 }
89 89
 if (!defined('MODX_API_MODE')) {
90 90
     define('MODX_API_MODE', false);
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 
109 109
 // initiate a new document parser
110 110
 if (isset($coreClass) && class_exists($coreClass)) {
111
-	$modx = new $coreClass;
111
+    $modx = new $coreClass;
112 112
 }
113 113
 if (!isset($modx) || !($modx instanceof \DocumentParser)) {
114
-	include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
115
-	$modx = DocumentParser::getInstance();
114
+    include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
115
+    $modx = DocumentParser::getInstance();
116 116
 }
117 117
 
118 118
 // set some parser options
Please login to merge, or discard this patch.
install/src/controllers/summary.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,9 +248,9 @@
 block discarded – undo
248 248
         echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_not_exist'] . '</p>';
249 249
         $errors++;
250 250
         echo '<p>' . $_lang['table_prefix_not_exist_note'] . '</p>';
251
-  } else {
251
+    } else {
252 252
         echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
253
-  }
253
+    }
254 254
 }
255 255
 
256 256
 // check mysql version
Please login to merge, or discard this patch.
install/src/sqlParser.class.php 1 patch
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -4,141 +4,141 @@
 block discarded – undo
4 4
 // SNUFFKIN/ Alex 2004
5 5
 
6 6
 class SqlParser {
7
-	public $host;
8
-	public $dbname;
9
-	public $prefix;
10
-	public $user;
11
-	public $password;
12
-	public $mysqlErrors;
13
-	public $conn;
14
-	public $installFailed;
15
-	public $sitename;
16
-	public $adminname;
17
-	public $adminemail;
18
-	public $adminpass;
19
-	public $managerlanguage;
20
-	public $mode;
21
-	public $fileManagerPath;
22
-	public $imgPath;
23
-	public $imgUrl;
24
-	public $dbMODx;
25
-	public $dbVersion;
7
+    public $host;
8
+    public $dbname;
9
+    public $prefix;
10
+    public $user;
11
+    public $password;
12
+    public $mysqlErrors;
13
+    public $conn;
14
+    public $installFailed;
15
+    public $sitename;
16
+    public $adminname;
17
+    public $adminemail;
18
+    public $adminpass;
19
+    public $managerlanguage;
20
+    public $mode;
21
+    public $fileManagerPath;
22
+    public $imgPath;
23
+    public $imgUrl;
24
+    public $dbMODx;
25
+    public $dbVersion;
26 26
     public $connection_charset;
27 27
     public $connection_method;
28 28
     public $ignoreDuplicateErrors;
29 29
     public $autoTemplateLogic;
30 30
 
31
-	public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') {
32
-		$this->host = $host;
33
-		$this->dbname = $db;
34
-		$this->prefix = $prefix;
35
-		$this->user = $user;
36
-		$this->password = $password;
37
-		$this->adminpass = $adminpass;
38
-		$this->adminname = $adminname;
39
-		$this->adminemail = $adminemail;
40
-		$this->connection_charset = $connection_charset;
41
-		$this->connection_method = $connection_method;
42
-		$this->ignoreDuplicateErrors = false;
43
-		$this->managerlanguage = $managerlanguage;
31
+    public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') {
32
+        $this->host = $host;
33
+        $this->dbname = $db;
34
+        $this->prefix = $prefix;
35
+        $this->user = $user;
36
+        $this->password = $password;
37
+        $this->adminpass = $adminpass;
38
+        $this->adminname = $adminname;
39
+        $this->adminemail = $adminemail;
40
+        $this->connection_charset = $connection_charset;
41
+        $this->connection_method = $connection_method;
42
+        $this->ignoreDuplicateErrors = false;
43
+        $this->managerlanguage = $managerlanguage;
44 44
         $this->autoTemplateLogic = $auto_template_logic;
45
-	}
45
+    }
46 46
 
47
-	public function connect() {
48
-		$this->conn = mysqli_connect($this->host, $this->user, $this->password);
49
-		mysqli_select_db($this->conn, $this->dbname);
50
-		if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset);
47
+    public function connect() {
48
+        $this->conn = mysqli_connect($this->host, $this->user, $this->password);
49
+        mysqli_select_db($this->conn, $this->dbname);
50
+        if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset);
51 51
 
52
-		$this->dbVersion = 3.23; // assume version 3.23
53
-		if(function_exists("mysqli_get_server_info")) {
54
-			$ver = mysqli_get_server_info($this->conn);
55
-			$this->dbMODx 	 = version_compare($ver,"4.0.2");
56
-			$this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2]
57
-		}
52
+        $this->dbVersion = 3.23; // assume version 3.23
53
+        if(function_exists("mysqli_get_server_info")) {
54
+            $ver = mysqli_get_server_info($this->conn);
55
+            $this->dbMODx 	 = version_compare($ver,"4.0.2");
56
+            $this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2]
57
+        }
58 58
 
59 59
         mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}");
60
-	}
60
+    }
61 61
 
62 62
     public function process($filename) {
63
-	    global $custom_placeholders;
64
-
65
-		// check to make sure file exists
66
-		if (!file_exists($filename)) {
67
-			$this->mysqlErrors[] = array("error" => "File '$filename' not found");
68
-			$this->installFailed = true ;
69
-			return false;
70
-		}
71
-
72
-		$fh = fopen($filename, 'r');
73
-		$idata = '';
74
-
75
-		while (!feof($fh)) {
76
-			$idata .= fread($fh, 1024);
77
-		}
78
-
79
-		fclose($fh);
80
-		$idata = str_replace("\r", '', $idata);
81
-
82
-		// check if in upgrade mode
83
-		if ($this->mode === 'upd') {
84
-			// remove non-upgradeable parts
85
-			$s = strpos($idata,'non-upgrade-able[[');
86
-			$e = strpos($idata,']]non-upgrade-able') + 17;
87
-			if($s && $e) {
88
-			    $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata);
63
+        global $custom_placeholders;
64
+
65
+        // check to make sure file exists
66
+        if (!file_exists($filename)) {
67
+            $this->mysqlErrors[] = array("error" => "File '$filename' not found");
68
+            $this->installFailed = true ;
69
+            return false;
70
+        }
71
+
72
+        $fh = fopen($filename, 'r');
73
+        $idata = '';
74
+
75
+        while (!feof($fh)) {
76
+            $idata .= fread($fh, 1024);
77
+        }
78
+
79
+        fclose($fh);
80
+        $idata = str_replace("\r", '', $idata);
81
+
82
+        // check if in upgrade mode
83
+        if ($this->mode === 'upd') {
84
+            // remove non-upgradeable parts
85
+            $s = strpos($idata,'non-upgrade-able[[');
86
+            $e = strpos($idata,']]non-upgrade-able') + 17;
87
+            if($s && $e) {
88
+                $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata);
89 89
             }
90
-		}
91
-
92
-		// replace {} tags
93
-		$idata = str_replace('{PREFIX}', $this->prefix, $idata);
94
-		$idata = str_replace('{ADMIN}', $this->adminname, $idata);
95
-		$idata = str_replace('{ADMINEMAIL}', $this->adminemail, $idata);
96
-		$idata = str_replace('{ADMINPASS}', $this->adminpass, $idata);
97
-		$idata = str_replace('{IMAGEPATH}', $this->imgPath, $idata);
98
-		$idata = str_replace('{IMAGEURL}', $this->imgUrl, $idata);
99
-		$idata = str_replace('{FILEMANAGERPATH}', $this->fileManagerPath, $idata);
100
-		$idata = str_replace('{MANAGERLANGUAGE}', $this->managerlanguage, $idata);
101
-		$idata = str_replace('{AUTOTEMPLATELOGIC}', $this->autoTemplateLogic, $idata);
102
-		/*$idata = str_replace('{VERSION}', $modx_version, $idata);*/
103
-
104
-		// Replace custom placeholders
105
-		foreach($custom_placeholders as $key=>$val) {
106
-			if (strpos($idata, '{'.$key.'}') !== false) {
107
-				$idata = str_replace('{'.$key.'}', $val, $idata);
108
-			}
109
-		}
110
-
111
-		$sql_array = explode("\n\n", $idata);
112
-
113
-		$num = 0;
114
-		foreach($sql_array as $sql_entry) {
115
-			$sql_do = trim($sql_entry, "\r\n; ");
116
-
117
-			if (preg_match('/^\#/', $sql_do)) continue;
118
-
119
-			// strip out comments and \n for mysql 3.x
120
-			if ($this->dbVersion <4.0) {
121
-				$sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do);
122
-				$sql_do = str_replace('\r', "", $sql_do);
123
-				$sql_do = str_replace('\n', "", $sql_do);
124
-			}
125
-
126
-
127
-			$num = $num + 1;
128
-			if ($sql_do) mysqli_query($this->conn, $sql_do);
129
-			if(mysqli_error($this->conn)) {
130
-				// Ignore duplicate and drop errors - Raymond
131
-				if ($this->ignoreDuplicateErrors){
132
-					if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue;
133
-				}
134
-				// End Ignore duplicate
135
-				$this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do);
136
-				$this->installFailed = true;
137
-			}
138
-		}
139
-	}
90
+        }
91
+
92
+        // replace {} tags
93
+        $idata = str_replace('{PREFIX}', $this->prefix, $idata);
94
+        $idata = str_replace('{ADMIN}', $this->adminname, $idata);
95
+        $idata = str_replace('{ADMINEMAIL}', $this->adminemail, $idata);
96
+        $idata = str_replace('{ADMINPASS}', $this->adminpass, $idata);
97
+        $idata = str_replace('{IMAGEPATH}', $this->imgPath, $idata);
98
+        $idata = str_replace('{IMAGEURL}', $this->imgUrl, $idata);
99
+        $idata = str_replace('{FILEMANAGERPATH}', $this->fileManagerPath, $idata);
100
+        $idata = str_replace('{MANAGERLANGUAGE}', $this->managerlanguage, $idata);
101
+        $idata = str_replace('{AUTOTEMPLATELOGIC}', $this->autoTemplateLogic, $idata);
102
+        /*$idata = str_replace('{VERSION}', $modx_version, $idata);*/
103
+
104
+        // Replace custom placeholders
105
+        foreach($custom_placeholders as $key=>$val) {
106
+            if (strpos($idata, '{'.$key.'}') !== false) {
107
+                $idata = str_replace('{'.$key.'}', $val, $idata);
108
+            }
109
+        }
110
+
111
+        $sql_array = explode("\n\n", $idata);
112
+
113
+        $num = 0;
114
+        foreach($sql_array as $sql_entry) {
115
+            $sql_do = trim($sql_entry, "\r\n; ");
116
+
117
+            if (preg_match('/^\#/', $sql_do)) continue;
118
+
119
+            // strip out comments and \n for mysql 3.x
120
+            if ($this->dbVersion <4.0) {
121
+                $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do);
122
+                $sql_do = str_replace('\r', "", $sql_do);
123
+                $sql_do = str_replace('\n', "", $sql_do);
124
+            }
125
+
126
+
127
+            $num = $num + 1;
128
+            if ($sql_do) mysqli_query($this->conn, $sql_do);
129
+            if(mysqli_error($this->conn)) {
130
+                // Ignore duplicate and drop errors - Raymond
131
+                if ($this->ignoreDuplicateErrors){
132
+                    if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue;
133
+                }
134
+                // End Ignore duplicate
135
+                $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do);
136
+                $this->installFailed = true;
137
+            }
138
+        }
139
+    }
140 140
 
141 141
     public function close() {
142
-		mysqli_close($this->conn);
143
-	}
142
+        mysqli_close($this->conn);
143
+    }
144 144
 }
Please login to merge, or discard this patch.
manager/actions/mutate_categories.dynamic.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@  discard block
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!$modx->hasPermission('category_manager')) {
7
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10 10
 $_module_params = array(
11
-	'module_version'   => '1.0.0',
12
-	'module_params'    => '',
13
-	'module_id'        => $_GET['id'],
14
-	'package_name'     => 'Module_Categories_Manager',
15
-	'native_language'  => 'de',
16
-	'name'             => 'Categories Manager',
17
-	'dirname'          => $site_manager_url,
18
-	'url'              => 'index.php?a=120&amp;id=' . $_GET['id'],
19
-	'path'             => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR,
20
-	'inc_dir'          => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR,
21
-	'languages_dir'    => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR,
22
-	'views_dir'        => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR,
23
-	'request_key'      => 'module_categories_manager',
24
-	'messages'         => array()
11
+    'module_version'   => '1.0.0',
12
+    'module_params'    => '',
13
+    'module_id'        => $_GET['id'],
14
+    'package_name'     => 'Module_Categories_Manager',
15
+    'native_language'  => 'de',
16
+    'name'             => 'Categories Manager',
17
+    'dirname'          => $site_manager_url,
18
+    'url'              => 'index.php?a=120&amp;id=' . $_GET['id'],
19
+    'path'             => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR,
20
+    'inc_dir'          => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR,
21
+    'languages_dir'    => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR,
22
+    'views_dir'        => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR,
23
+    'request_key'      => 'module_categories_manager',
24
+    'messages'         => array()
25 25
 );
26 26
 
27 27
 $cm = new EvolutionCMS\Legacy\ModuleCategoriesManager();
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 // assign module_params to internal params
30 30
 foreach( $_module_params as $param => $value )
31 31
 {
32
-	$cm->set( $param, $value );
32
+    $cm->set( $param, $value );
33 33
 }
34 34
 
35 35
 // catch the request actions
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 
38 38
 if( !$categories = $cm->getCategories() )
39 39
 {
40
-	setcookie('webfxtab_manage-categories-pane', 0 );
41
-	$cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
40
+    setcookie('webfxtab_manage-categories-pane', 0 );
41
+    $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
42 42
 }
43 43
 
44 44
 $cm->renderView('main', $categories );
Please login to merge, or discard this patch.
manager/processors/execute_module.processor.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -3,51 +3,51 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('exec_module')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // check if user has access permission, except admins
15 15
 if($_SESSION['mgrRole']!=1){
16
-	$rs = $modx->db->select(
17
-		'sma.usergroup,mg.member',
18
-		$modx->getFullTableName("site_module_access")." sma
16
+    $rs = $modx->db->select(
17
+        'sma.usergroup,mg.member',
18
+        $modx->getFullTableName("site_module_access")." sma
19 19
 			LEFT JOIN ".$modx->getFullTableName("member_groups")." mg ON mg.user_group = sma.usergroup AND member='".$modx->getLoginUserID()."'",
20
-		"sma.module = '{$id}'"
21
-		);
22
-	//initialize permission to -1, if it stays -1 no permissions
23
-	//attached so permission granted
24
-	$permissionAccessInt = -1;
20
+        "sma.module = '{$id}'"
21
+        );
22
+    //initialize permission to -1, if it stays -1 no permissions
23
+    //attached so permission granted
24
+    $permissionAccessInt = -1;
25 25
 
26
-	while ($row = $modx->db->getRow($rs)) {
27
-		if($row["usergroup"] && $row["member"]) {
28
-			//if there are permissions and this member has permission, ofcourse
29
-			//this is granted
30
-			$permissionAccessInt = 1;
31
-		} elseif ($permissionAccessInt==-1) {
32
-			//if there are permissions but this member has no permission and the
33
-			//variable was still in init state we set permission to 0; no permissions
34
-			$permissionAccessInt = 0;
35
-		}
36
-	}
26
+    while ($row = $modx->db->getRow($rs)) {
27
+        if($row["usergroup"] && $row["member"]) {
28
+            //if there are permissions and this member has permission, ofcourse
29
+            //this is granted
30
+            $permissionAccessInt = 1;
31
+        } elseif ($permissionAccessInt==-1) {
32
+            //if there are permissions but this member has no permission and the
33
+            //variable was still in init state we set permission to 0; no permissions
34
+            $permissionAccessInt = 0;
35
+        }
36
+    }
37 37
 
38
-	if($permissionAccessInt==0) {
39
-		$modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40
-	}
38
+    if($permissionAccessInt==0) {
39
+        $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40
+    }
41 41
 }
42 42
 
43 43
 // get module data
44 44
 $rs = $modx->db->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'");
45 45
 $content = $modx->db->getRow($rs);
46 46
 if(!$content) {
47
-	$modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106");
47
+    $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106");
48 48
 }
49 49
 if($content['disabled']) {
50
-	$modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106");
50
+    $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106");
51 51
 }
52 52
 
53 53
 // Set the item name for logger
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 $output = evalModule($content["modulecode"],$parameter);
64 64
 if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) {
65
-	echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller
65
+    echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller
66 66
 }
67 67
 echo $output;
68 68
 include MODX_MANAGER_PATH."includes/sysalert.display.inc.php";
Please login to merge, or discard this patch.
manager/processors/duplicate_content.processor.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 $children = array();
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $udperms->duplicateDoc = true;
22 22
 
23 23
 if(!$udperms->checkPermissions()) {
24
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
24
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
25 25
 }
26 26
 
27 27
 // Run the duplicator
Please login to merge, or discard this patch.
manager/processors/duplicate_module.processor.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('new_module')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 // count duplicates
14 14
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'"));
@@ -18,40 +18,40 @@  discard block
 block discarded – undo
18 18
 
19 19
 // duplicate module
20 20
 $newid = $modx->db->insert(
21
-	array(
22
-		'name'=>'',
23
-		'description'=>'',
24
-		'disabled'=>'',
25
-		'category'=>'',
26
-		'wrap'=>'',
27
-		'icon'=>'',
28
-		'enable_resource'=>'',
29
-		'resourcefile'=>'',
30
-		'createdon'=>'',
31
-		'editedon'=>'',
32
-		'guid'=>'',
33
-		'enable_sharedparams'=>'',
34
-		'properties'=>'',
35
-		'modulecode'=>'',
36
-		), $modx->getFullTableName('site_modules'), // Insert into
37
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from
21
+    array(
22
+        'name'=>'',
23
+        'description'=>'',
24
+        'disabled'=>'',
25
+        'category'=>'',
26
+        'wrap'=>'',
27
+        'icon'=>'',
28
+        'enable_resource'=>'',
29
+        'resourcefile'=>'',
30
+        'createdon'=>'',
31
+        'editedon'=>'',
32
+        'guid'=>'',
33
+        'enable_sharedparams'=>'',
34
+        'properties'=>'',
35
+        'modulecode'=>'',
36
+        ), $modx->getFullTableName('site_modules'), // Insert into
37
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from
38 38
 
39 39
 // duplicate module dependencies
40 40
 $modx->db->insert(
41
-	array(
42
-		'module'=>'',
43
-		'resource'=>'',
44
-		'type'=>'',
45
-		), $modx->getFullTableName('site_module_depobj'), // Insert into
46
-	"'{$newid}', resource, type", $modx->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from
41
+    array(
42
+        'module'=>'',
43
+        'resource'=>'',
44
+        'type'=>'',
45
+        ), $modx->getFullTableName('site_module_depobj'), // Insert into
46
+    "'{$newid}', resource, type", $modx->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from
47 47
 
48 48
 // duplicate module user group access
49 49
 $modx->db->insert(
50
-	array(
51
-		'module'=>'',
52
-		'usergroup'=>'',
53
-		), $modx->getFullTableName('site_module_access'), // Insert into
54
-	"'{$newid}', usergroup", $modx->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from
50
+    array(
51
+        'module'=>'',
52
+        'usergroup'=>'',
53
+        ), $modx->getFullTableName('site_module_access'), // Insert into
54
+    "'{$newid}', usergroup", $modx->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from
55 55
 
56 56
 // Set the item name for logger
57 57
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/login.processor.php 1 patch
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3
-	header('HTTP/1.0 404 Not Found');
4
-	exit('error');
3
+    header('HTTP/1.0 404 Not Found');
4
+    exit('error');
5 5
 }
6 6
 define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 include_once("{$core_path}lang/english.inc.php");
19 19
 
20 20
 if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
21
-	include_once("{$core_path}lang/{$manager_language}.inc.php");
21
+    include_once("{$core_path}lang/{$manager_language}.inc.php");
22 22
 }
23 23
 
24 24
 // Initialize System Alert Message Queque
25 25
 if(!isset($_SESSION['SystemAlertMsgQueque'])) {
26
-	$_SESSION['SystemAlertMsgQueque'] = array();
26
+    $_SESSION['SystemAlertMsgQueque'] = array();
27 27
 }
28 28
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
29 29
 
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
 
39 39
 // invoke OnBeforeManagerLogin event
40 40
 $modx->invokeEvent('OnBeforeManagerLogin', array(
41
-		'username' => $username,
42
-		'userpassword' => $givenPassword,
43
-		'rememberme' => $rememberme
44
-	));
41
+        'username' => $username,
42
+        'userpassword' => $givenPassword,
43
+        'rememberme' => $rememberme
44
+    ));
45 45
 $fields = 'mu.*, ua.*';
46 46
 $from = '[+prefix+]manager_users AS mu, [+prefix+]user_attributes AS ua';
47 47
 $where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id";
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 $limit = $modx->db->getRecordCount($rs);
50 50
 
51 51
 if($limit == 0 || $limit > 1) {
52
-	jsAlert($_lang['login_processor_unknown_user']);
53
-	return;
52
+    jsAlert($_lang['login_processor_unknown_user']);
53
+    return;
54 54
 }
55 55
 
56 56
 $row = $modx->db->getRow($rs);
@@ -71,127 +71,127 @@  discard block
 block discarded – undo
71 71
 // get the user settings from the database
72 72
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
73 73
 while($row = $modx->db->getRow($rs)) {
74
-	extract($row);
75
-	${$setting_name} = $setting_value;
74
+    extract($row);
75
+    ${$setting_name} = $setting_value;
76 76
 }
77 77
 
78 78
 // blocked due to number of login errors.
79 79
 if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
80
-	@session_destroy();
81
-	session_unset();
82
-	if($cip = getenv("HTTP_CLIENT_IP")) {
83
-		$ip = $cip;
84
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
85
-		$ip = $cip;
86
-	} elseif($cip = getenv("REMOTE_ADDR")) {
87
-		$ip = $cip;
88
-	} else {
89
-		$ip = "UNKNOWN";
90
-	}
91
-	$log = new EvolutionCMS\Legacy\LogHandler();
92
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
93
-	jsAlert($_lang['login_processor_many_failed_logins']);
94
-	return;
80
+    @session_destroy();
81
+    session_unset();
82
+    if($cip = getenv("HTTP_CLIENT_IP")) {
83
+        $ip = $cip;
84
+    } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
85
+        $ip = $cip;
86
+    } elseif($cip = getenv("REMOTE_ADDR")) {
87
+        $ip = $cip;
88
+    } else {
89
+        $ip = "UNKNOWN";
90
+    }
91
+    $log = new EvolutionCMS\Legacy\LogHandler();
92
+    $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
93
+    jsAlert($_lang['login_processor_many_failed_logins']);
94
+    return;
95 95
 }
96 96
 
97 97
 // blocked due to number of login errors, but get to try again
98 98
 if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
99
-	$fields = array();
100
-	$fields['failedlogincount'] = '0';
101
-	$fields['blockeduntil'] = time() - 1;
102
-	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
99
+    $fields = array();
100
+    $fields['failedlogincount'] = '0';
101
+    $fields['blockeduntil'] = time() - 1;
102
+    $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
103 103
 }
104 104
 
105 105
 // this user has been blocked by an admin, so no way he's loggin in!
106 106
 if($blocked == '1') {
107
-	@session_destroy();
108
-	session_unset();
109
-	jsAlert($_lang['login_processor_blocked1']);
110
-	return;
107
+    @session_destroy();
108
+    session_unset();
109
+    jsAlert($_lang['login_processor_blocked1']);
110
+    return;
111 111
 }
112 112
 
113 113
 // blockuntil: this user has a block until date
114 114
 if($blockeduntildate > time()) {
115
-	@session_destroy();
116
-	session_unset();
117
-	jsAlert($_lang['login_processor_blocked2']);
118
-	return;
115
+    @session_destroy();
116
+    session_unset();
117
+    jsAlert($_lang['login_processor_blocked2']);
118
+    return;
119 119
 }
120 120
 
121 121
 // blockafter: this user has a block after date
122 122
 if($blockedafterdate > 0 && $blockedafterdate < time()) {
123
-	@session_destroy();
124
-	session_unset();
125
-	jsAlert($_lang['login_processor_blocked3']);
126
-	return;
123
+    @session_destroy();
124
+    session_unset();
125
+    jsAlert($_lang['login_processor_blocked3']);
126
+    return;
127 127
 }
128 128
 
129 129
 // allowed ip
130 130
 if($allowed_ip) {
131
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
132
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
133
-			jsAlert($_lang['login_processor_remotehost_ip']);
134
-			return;
135
-		}
136
-	}
137
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
138
-		jsAlert($_lang['login_processor_remote_ip']);
139
-		return;
140
-	}
131
+    if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
132
+        if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
133
+            jsAlert($_lang['login_processor_remotehost_ip']);
134
+            return;
135
+        }
136
+    }
137
+    if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
138
+        jsAlert($_lang['login_processor_remote_ip']);
139
+        return;
140
+    }
141 141
 }
142 142
 
143 143
 // allowed days
144 144
 if($allowed_days) {
145
-	$date = getdate();
146
-	$day = $date['wday'] + 1;
147
-	if(!in_array($day,explode(',',$allowed_days))) {
148
-		jsAlert($_lang['login_processor_date']);
149
-		return;
150
-	}
145
+    $date = getdate();
146
+    $day = $date['wday'] + 1;
147
+    if(!in_array($day,explode(',',$allowed_days))) {
148
+        jsAlert($_lang['login_processor_date']);
149
+        return;
150
+    }
151 151
 }
152 152
 
153 153
 // invoke OnManagerAuthentication event
154 154
 $rt = $modx->invokeEvent('OnManagerAuthentication', array(
155
-		'userid' => $internalKey,
156
-		'username' => $username,
157
-		'userpassword' => $givenPassword,
158
-		'savedpassword' => $dbasePassword,
159
-		'rememberme' => $rememberme
160
-	));
155
+        'userid' => $internalKey,
156
+        'username' => $username,
157
+        'userpassword' => $givenPassword,
158
+        'savedpassword' => $dbasePassword,
159
+        'rememberme' => $rememberme
160
+    ));
161 161
 
162 162
 // check if plugin authenticated the user
163 163
 $matchPassword = false;
164 164
 if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
165
-	// check user password - local authentication
166
-	$hashType = $modx->manager->getHashType($dbasePassword);
167
-	if($hashType == 'phpass') {
168
-		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
169
-	} elseif($hashType == 'md5') {
170
-		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171
-	} elseif($hashType == 'v1') {
172
-		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
173
-	} else {
174
-		$matchPassword = false;
175
-	}
165
+    // check user password - local authentication
166
+    $hashType = $modx->manager->getHashType($dbasePassword);
167
+    if($hashType == 'phpass') {
168
+        $matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
169
+    } elseif($hashType == 'md5') {
170
+        $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171
+    } elseif($hashType == 'v1') {
172
+        $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
173
+    } else {
174
+        $matchPassword = false;
175
+    }
176 176
 } else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
177
-	$matchPassword = true;
177
+    $matchPassword = true;
178 178
 }
179 179
 
180 180
 if(!$matchPassword) {
181
-	jsAlert($_lang['login_processor_wrong_password']);
182
-	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
183
-	return;
181
+    jsAlert($_lang['login_processor_wrong_password']);
182
+    incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
183
+    return;
184 184
 }
185 185
 
186 186
 if($modx->config['use_captcha'] == 1) {
187
-	if(!isset ($_SESSION['veriword'])) {
188
-		jsAlert($_lang['login_processor_captcha_config']);
189
-		return;
190
-	} elseif($_SESSION['veriword'] != $captcha_code) {
191
-		jsAlert($_lang['login_processor_bad_code']);
192
-		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
193
-		return;
194
-	}
187
+    if(!isset ($_SESSION['veriword'])) {
188
+        jsAlert($_lang['login_processor_captcha_config']);
189
+        return;
190
+    } elseif($_SESSION['veriword'] != $captcha_code) {
191
+        jsAlert($_lang['login_processor_bad_code']);
192
+        incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
193
+        return;
194
+    }
195 195
 }
196 196
 
197 197
 $modx->cleanupExpiredLocks();
@@ -226,36 +226,36 @@  discard block
 block discarded – undo
226 226
 $_SESSION['mgrToken'] = md5($currentsessionid);
227 227
 
228 228
 if($rememberme == '1') {
229
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
230
-
231
-	// Set a cookie separate from the session cookie with the username in it.
232
-	// Are we using secure connection? If so, make sure the cookie is secure
233
-	global $https_port;
234
-
235
-	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
236
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
237
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
238
-	} else {
239
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
240
-	}
229
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
230
+
231
+    // Set a cookie separate from the session cookie with the username in it.
232
+    // Are we using secure connection? If so, make sure the cookie is secure
233
+    global $https_port;
234
+
235
+    $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
236
+    if(version_compare(PHP_VERSION, '5.2', '<')) {
237
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
238
+    } else {
239
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
240
+    }
241 241
 } else {
242
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
242
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
243 243
 
244
-	// Remove the Remember Me cookie
245
-	setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
244
+    // Remove the Remember Me cookie
245
+    setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
246 246
 }
247 247
 
248 248
 // Check if user already has an active session, if not check if user pressed logout end of last session
249 249
 $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
250 250
 $activeSession = $modx->db->getValue($rs);
251 251
 if(!$activeSession) {
252
-	$rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
253
-	if($lastHit = $modx->db->getValue($rs)) {
254
-		$_SESSION['show_logout_reminder'] = array(
255
-			'type' => 'logout_reminder',
256
-			'lastHit' => $lastHit
257
-		);
258
-	}
252
+    $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
253
+    if($lastHit = $modx->db->getValue($rs)) {
254
+        $_SESSION['show_logout_reminder'] = array(
255
+            'type' => 'logout_reminder',
256
+            'lastHit' => $lastHit
257
+        );
258
+    }
259 259
 }
260 260
 
261 261
 $log = new EvolutionCMS\Legacy\LogHandler();
@@ -263,27 +263,27 @@  discard block
 block discarded – undo
263 263
 
264 264
 // invoke OnManagerLogin event
265 265
 $modx->invokeEvent('OnManagerLogin', array(
266
-		'userid' => $internalKey,
267
-		'username' => $username,
268
-		'userpassword' => $givenPassword,
269
-		'rememberme' => $rememberme
270
-	));
266
+        'userid' => $internalKey,
267
+        'username' => $username,
268
+        'userpassword' => $givenPassword,
269
+        'rememberme' => $rememberme
270
+    ));
271 271
 
272 272
 // check if we should redirect user to a web page
273 273
 $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
274 274
 $id = (int)$modx->db->getValue($rs);
275 275
 if($id > 0) {
276
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
277
-	if($_POST['ajax'] == 1) {
278
-		echo $header;
279
-	} else {
280
-		header($header);
281
-	}
276
+    $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
277
+    if($_POST['ajax'] == 1) {
278
+        echo $header;
279
+    } else {
280
+        header($header);
281
+    }
282 282
 } else {
283
-	$header = 'Location: ' . MODX_MANAGER_URL;
284
-	if($_POST['ajax'] == 1) {
285
-		echo $header;
286
-	} else {
287
-		header($header);
288
-	}
283
+    $header = 'Location: ' . MODX_MANAGER_URL;
284
+    if($_POST['ajax'] == 1) {
285
+        echo $header;
286
+    } else {
287
+        header($header);
288
+    }
289 289
 }
Please login to merge, or discard this patch.