Completed
Push — develop ( 4e806c...6a553b )
by Agel_Nash
10:03
created
manager/processors/delete_eventlog.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  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_eventlog')) {
5
+if (!$modx->hasPermission('delete_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-if (isset($_GET['cls']) && $_GET['cls']==1) {
9
+if (isset($_GET['cls']) && $_GET['cls'] == 1) {
10 10
 	$where = '';
11 11
 } else {
12
-	$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
-	if($id==0) {
12
+	$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
13
+	if ($id == 0) {
14 14
 		$modx->webAlertAndQuit($_lang["error_no_id"]);
15 15
 	}
16 16
 	$where = "id='{$id}'";
@@ -19,5 +19,5 @@  discard block
 block discarded – undo
19 19
 // delete event log
20 20
 $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('event_log'), $where);
21 21
 
22
-$header="Location: index.php?a=114";
22
+$header = "Location: index.php?a=114";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_htmlsnippet.processor.php 2 patches
Indentation   +9 added lines, -9 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_chunk')) {
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
 // count duplicates
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate htmlsnippet
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'name'=>'',
24
-		'description'=>'',
25
-		'snippet'=>'',
26
-		'category'=>'',
27
-		), $modx->getDatabase()->getFullTableName('site_htmlsnippets'), // Insert into
28
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, category", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'name'=>'',
24
+        'description'=>'',
25
+        'snippet'=>'',
26
+        'category'=>'',
27
+        ), $modx->getDatabase()->getFullTableName('site_htmlsnippets'), // Insert into
28
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, category", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$id}'"); // Copy from
29 29
 
30 30
 // Set the item name for logger
31 31
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$newid}'"));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  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('new_chunk')) {
5
+if (!$modx->hasPermission('new_chunk')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
17
+if ($count >= 1) $count = ' '.($count + 1);
18 18
 else $count = '';
19 19
 
20 20
 // duplicate htmlsnippet
@@ -32,5 +32,5 @@  discard block
 block discarded – undo
32 32
 $_SESSION['itemname'] = $name;
33 33
 
34 34
 // finish duplicating - redirect to new chunk
35
-$header="Location: index.php?r=2&a=78&id=$newid";
35
+$header = "Location: index.php?r=2&a=78&id=$newid";
36 36
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_module.processor.php 2 patches
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->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_modules'), "id='{$id}'"));
@@ -18,40 +18,40 @@  discard block
 block discarded – undo
18 18
 
19 19
 // duplicate module
20 20
 $newid = $modx->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->getFullTableName('site_modules'), "id='{$id}'"); // Copy from
38 38
 
39 39
 // duplicate module dependencies
40 40
 $modx->getDatabase()->insert(
41
-	array(
42
-		'module'=>'',
43
-		'resource'=>'',
44
-		'type'=>'',
45
-		), $modx->getDatabase()->getFullTableName('site_module_depobj'), // Insert into
46
-	"'{$newid}', resource, type", $modx->getDatabase()->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from
41
+    array(
42
+        'module'=>'',
43
+        'resource'=>'',
44
+        'type'=>'',
45
+        ), $modx->getDatabase()->getFullTableName('site_module_depobj'), // Insert into
46
+    "'{$newid}', resource, type", $modx->getDatabase()->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from
47 47
 
48 48
 // duplicate module user group access
49 49
 $modx->getDatabase()->insert(
50
-	array(
51
-		'module'=>'',
52
-		'usergroup'=>'',
53
-		), $modx->getDatabase()->getFullTableName('site_module_access'), // Insert into
54
-	"'{$newid}', usergroup", $modx->getDatabase()->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from
50
+    array(
51
+        'module'=>'',
52
+        'usergroup'=>'',
53
+        ), $modx->getDatabase()->getFullTableName('site_module_access'), // Insert into
54
+    "'{$newid}', usergroup", $modx->getDatabase()->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from
55 55
 
56 56
 // Set the item name for logger
57 57
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_modules'), "id='{$newid}'"));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  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('new_module')) {
5
+if (!$modx->hasPermission('new_module')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 // count duplicates
14 14
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_modules'), "id='{$id}'"));
15 15
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_modules'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
16
-if($count>=1) $count = ' '.($count+1);
16
+if ($count >= 1) $count = ' '.($count + 1);
17 17
 else $count = '';
18 18
 
19 19
 // duplicate module
@@ -58,5 +58,5 @@  discard block
 block discarded – undo
58 58
 $_SESSION['itemname'] = $name;
59 59
 
60 60
 // finish duplicating - redirect to new module
61
-$header="Location: index.php?r=2&a=108&id=$newid";
61
+$header = "Location: index.php?r=2&a=108&id=$newid";
62 62
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_template.processor.php 2 patches
Indentation   +15 added lines, -15 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_template')) {
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
 // count duplicates
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate template
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'templatename'=>'',
24
-		'description'=>'',
25
-		'content'=>'',
26
-		'category'=>'',
27
-		), $modx->getDatabase()->getFullTableName('site_templates'), // Insert into
28
-	"CONCAT(templatename, ' {$_lang['duplicated_el_suffix']}{$count}') AS templatename, description, content, category", $modx->getDatabase()->getFullTableName('site_templates'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'templatename'=>'',
24
+        'description'=>'',
25
+        'content'=>'',
26
+        'category'=>'',
27
+        ), $modx->getDatabase()->getFullTableName('site_templates'), // Insert into
28
+    "CONCAT(templatename, ' {$_lang['duplicated_el_suffix']}{$count}') AS templatename, description, content, category", $modx->getDatabase()->getFullTableName('site_templates'), "id='{$id}'"); // Copy from
29 29
 
30 30
 // duplicate TV values
31 31
 $modx->getDatabase()->insert(
32
-	array(
33
-		'tmplvarid'=>'',
34
-		'templateid'=>'',
35
-		'rank'=>'',
36
-		), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into
37
-	"tmplvarid, '{$newid}', rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'"); // Copy from
32
+    array(
33
+        'tmplvarid'=>'',
34
+        'templateid'=>'',
35
+        'rank'=>'',
36
+        ), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into
37
+    "tmplvarid, '{$newid}', rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'"); // Copy from
38 38
 
39 39
 // Set the item name for logger
40 40
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('templatename', $modx->getDatabase()->getFullTableName('site_templates'), "id='{$newid}'"));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  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('new_template')) {
5
+if (!$modx->hasPermission('new_template')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('templatename', $modx->getDatabase()->getFullTableName('site_templates'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('templatename', $modx->getDatabase()->getFullTableName('site_templates'), "templatename LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
17
+if ($count >= 1) $count = ' '.($count + 1);
18 18
 else $count = '';
19 19
 
20 20
 // duplicate template
@@ -41,5 +41,5 @@  discard block
 block discarded – undo
41 41
 $_SESSION['itemname'] = $name;
42 42
 
43 43
 // finish duplicating - redirect to new template
44
-$header="Location: index.php?r=2&a=16&id=$newid";
44
+$header = "Location: index.php?r=2&a=16&id=$newid";
45 45
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_tmplvars.processor.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  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('delete_template')) {
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
 $forced = isset($_GET['force']) ? $_GET['force'] : 0;
15 15
 
16 16
 // check for relations
17 17
 if(!$forced) {
18
-	$drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getDatabase()->getFullTableName('site_content') . " AS sc
18
+    $drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getDatabase()->getFullTableName('site_content') . " AS sc
19 19
 			INNER JOIN " . $modx->getDatabase()->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
20
-	$count = $modx->getDatabase()->getRecordCount($drs);
21
-	if($count > 0) {
22
-		include_once "header.inc.php";
23
-		?>
20
+    $count = $modx->getDatabase()->getRecordCount($drs);
21
+    if($count > 0) {
22
+        include_once "header.inc.php";
23
+        ?>
24 24
 		<script>
25 25
 			var actions = {
26 26
 				delete: function() {
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
 				<p><?= $_lang['tmplvar_inuse'] ?></p>
43 43
 				<ul>
44 44
 					<?php
45
-					while($row = $modx->getDatabase()->getRow($drs)) {
46
-						echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
47
-					}
48
-					?>
45
+                    while($row = $modx->getDatabase()->getRow($drs)) {
46
+                        echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
47
+                    }
48
+                    ?>
49 49
 				</ul>
50 50
 			</div>
51 51
 		</div>
52 52
 		<?php
53
-		include_once "footer.inc.php";
54
-		exit;
55
-	}
53
+        include_once "footer.inc.php";
54
+        exit;
55
+    }
56 56
 }
57 57
 
58 58
 // Set the item name for logger
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 // invoke OnBeforeTVFormDelete event
63 63
 $modx->invokeEvent("OnBeforeTVFormDelete", array(
64
-	"id" => $id
64
+    "id" => $id
65 65
 ));
66 66
 
67 67
 // delete variable
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 // invoke OnTVFormDelete event
80 80
 $modx->invokeEvent("OnTVFormDelete", array(
81
-	"id" => $id
81
+    "id" => $id
82 82
 ));
83 83
 
84 84
 // empty cache
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@  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_template')) {
5
+if (!$modx->hasPermission('delete_template')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
10
-if($id == 0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 $forced = isset($_GET['force']) ? $_GET['force'] : 0;
15 15
 
16 16
 // check for relations
17
-if(!$forced) {
18
-	$drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getDatabase()->getFullTableName('site_content') . " AS sc
19
-			INNER JOIN " . $modx->getDatabase()->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
17
+if (!$forced) {
18
+	$drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getDatabase()->getFullTableName('site_content')." AS sc
19
+			INNER JOIN " . $modx->getDatabase()->getFullTableName('site_tmplvar_contentvalues')." AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
20 20
 	$count = $modx->getDatabase()->getRecordCount($drs);
21
-	if($count > 0) {
21
+	if ($count > 0) {
22 22
 		include_once "header.inc.php";
23 23
 		?>
24 24
 		<script>
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 				<p><?= $_lang['tmplvar_inuse'] ?></p>
43 43
 				<ul>
44 44
 					<?php
45
-					while($row = $modx->getDatabase()->getRow($drs)) {
46
-						echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
45
+					while ($row = $modx->getDatabase()->getRow($drs)) {
46
+						echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['description'] != '' ? ' - '.$row['description'] : '').'</li>';
47 47
 					}
48 48
 					?>
49 49
 				</ul>
Please login to merge, or discard this patch.
manager/processors/login.processor.php 2 patches
Indentation   +128 added lines, -128 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);
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 include_once("{$core_path}lang/english.inc.php");
17 17
 
18 18
 if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
19
-	include_once("{$core_path}lang/{$manager_language}.inc.php");
19
+    include_once("{$core_path}lang/{$manager_language}.inc.php");
20 20
 }
21 21
 
22 22
 // Initialize System Alert Message Queque
23 23
 if(!isset($_SESSION['SystemAlertMsgQueque'])) {
24
-	$_SESSION['SystemAlertMsgQueque'] = array();
24
+    $_SESSION['SystemAlertMsgQueque'] = array();
25 25
 }
26 26
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
27 27
 
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 
37 37
 // invoke OnBeforeManagerLogin event
38 38
 $modx->invokeEvent('OnBeforeManagerLogin', array(
39
-		'username' => $username,
40
-		'userpassword' => $givenPassword,
41
-		'rememberme' => $rememberme
42
-	));
39
+        'username' => $username,
40
+        'userpassword' => $givenPassword,
41
+        'rememberme' => $rememberme
42
+    ));
43 43
 $fields = 'mu.*, ua.*';
44 44
 $from = $modx->getDatabase()->getFullTableName('manager_users') . ' AS mu, ' .
45 45
     $modx->getDatabase()->getFullTableName('user_attributes') . ' AS ua';
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 $limit = $modx->getDatabase()->getRecordCount($rs);
49 49
 
50 50
 if($limit == 0 || $limit > 1) {
51
-	jsAlert($_lang['login_processor_unknown_user']);
52
-	return;
51
+    jsAlert($_lang['login_processor_unknown_user']);
52
+    return;
53 53
 }
54 54
 
55 55
 $row = $modx->getDatabase()->getRow($rs);
@@ -74,36 +74,36 @@  discard block
 block discarded – undo
74 74
     "user='{$internalKey}' AND setting_value!=''"
75 75
 );
76 76
 while($row = $modx->getDatabase()->getRow($rs)) {
77
-	extract($row);
78
-	${$setting_name} = $setting_value;
77
+    extract($row);
78
+    ${$setting_name} = $setting_value;
79 79
 }
80 80
 
81 81
 // blocked due to number of login errors.
82 82
 if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
83
-	@session_destroy();
84
-	session_unset();
85
-	if($cip = getenv("HTTP_CLIENT_IP")) {
86
-		$ip = $cip;
87
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88
-		$ip = $cip;
89
-	} elseif($cip = getenv("REMOTE_ADDR")) {
90
-		$ip = $cip;
91
-	} else {
92
-		$ip = "UNKNOWN";
93
-	}
94
-	$log = new EvolutionCMS\Legacy\LogHandler();
95
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
96
-	jsAlert($_lang['login_processor_many_failed_logins']);
97
-	return;
83
+    @session_destroy();
84
+    session_unset();
85
+    if($cip = getenv("HTTP_CLIENT_IP")) {
86
+        $ip = $cip;
87
+    } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88
+        $ip = $cip;
89
+    } elseif($cip = getenv("REMOTE_ADDR")) {
90
+        $ip = $cip;
91
+    } else {
92
+        $ip = "UNKNOWN";
93
+    }
94
+    $log = new EvolutionCMS\Legacy\LogHandler();
95
+    $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
96
+    jsAlert($_lang['login_processor_many_failed_logins']);
97
+    return;
98 98
 }
99 99
 
100 100
 // blocked due to number of login errors, but get to try again
101 101
 if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
102
-	$fields = array();
103
-	$fields['failedlogincount'] = '0';
104
-	$fields['blockeduntil'] = time() - 1;
105
-	$modx->getDatabase()->update(
106
-	    $fields,
102
+    $fields = array();
103
+    $fields['failedlogincount'] = '0';
104
+    $fields['blockeduntil'] = time() - 1;
105
+    $modx->getDatabase()->update(
106
+        $fields,
107 107
         $modx->getDatabase()->getFullTableName('user_attributes'),
108 108
         "internalKey='{$internalKey}'"
109 109
     );
@@ -111,94 +111,94 @@  discard block
 block discarded – undo
111 111
 
112 112
 // this user has been blocked by an admin, so no way he's loggin in!
113 113
 if($blocked == '1') {
114
-	@session_destroy();
115
-	session_unset();
116
-	jsAlert($_lang['login_processor_blocked1']);
117
-	return;
114
+    @session_destroy();
115
+    session_unset();
116
+    jsAlert($_lang['login_processor_blocked1']);
117
+    return;
118 118
 }
119 119
 
120 120
 // blockuntil: this user has a block until date
121 121
 if($blockeduntildate > time()) {
122
-	@session_destroy();
123
-	session_unset();
124
-	jsAlert($_lang['login_processor_blocked2']);
125
-	return;
122
+    @session_destroy();
123
+    session_unset();
124
+    jsAlert($_lang['login_processor_blocked2']);
125
+    return;
126 126
 }
127 127
 
128 128
 // blockafter: this user has a block after date
129 129
 if($blockedafterdate > 0 && $blockedafterdate < time()) {
130
-	@session_destroy();
131
-	session_unset();
132
-	jsAlert($_lang['login_processor_blocked3']);
133
-	return;
130
+    @session_destroy();
131
+    session_unset();
132
+    jsAlert($_lang['login_processor_blocked3']);
133
+    return;
134 134
 }
135 135
 
136 136
 // allowed ip
137 137
 if($allowed_ip) {
138
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
139
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
140
-			jsAlert($_lang['login_processor_remotehost_ip']);
141
-			return;
142
-		}
143
-	}
144
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
145
-		jsAlert($_lang['login_processor_remote_ip']);
146
-		return;
147
-	}
138
+    if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
139
+        if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
140
+            jsAlert($_lang['login_processor_remotehost_ip']);
141
+            return;
142
+        }
143
+    }
144
+    if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
145
+        jsAlert($_lang['login_processor_remote_ip']);
146
+        return;
147
+    }
148 148
 }
149 149
 
150 150
 // allowed days
151 151
 if($allowed_days) {
152
-	$date = getdate();
153
-	$day = $date['wday'] + 1;
154
-	if(!in_array($day,explode(',',$allowed_days))) {
155
-		jsAlert($_lang['login_processor_date']);
156
-		return;
157
-	}
152
+    $date = getdate();
153
+    $day = $date['wday'] + 1;
154
+    if(!in_array($day,explode(',',$allowed_days))) {
155
+        jsAlert($_lang['login_processor_date']);
156
+        return;
157
+    }
158 158
 }
159 159
 
160 160
 // invoke OnManagerAuthentication event
161 161
 $rt = $modx->invokeEvent('OnManagerAuthentication', array(
162
-		'userid' => $internalKey,
163
-		'username' => $username,
164
-		'userpassword' => $givenPassword,
165
-		'savedpassword' => $dbasePassword,
166
-		'rememberme' => $rememberme
167
-	));
162
+        'userid' => $internalKey,
163
+        'username' => $username,
164
+        'userpassword' => $givenPassword,
165
+        'savedpassword' => $dbasePassword,
166
+        'rememberme' => $rememberme
167
+    ));
168 168
 
169 169
 // check if plugin authenticated the user
170 170
 $matchPassword = false;
171 171
 if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
172
-	// check user password - local authentication
173
-	$hashType = $modx->getManagerApi()->getHashType($dbasePassword);
174
-	if($hashType == 'phpass') {
175
-		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
176
-	} elseif($hashType == 'md5') {
177
-		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
178
-	} elseif($hashType == 'v1') {
179
-		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
180
-	} else {
181
-		$matchPassword = false;
182
-	}
172
+    // check user password - local authentication
173
+    $hashType = $modx->getManagerApi()->getHashType($dbasePassword);
174
+    if($hashType == 'phpass') {
175
+        $matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
176
+    } elseif($hashType == 'md5') {
177
+        $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
178
+    } elseif($hashType == 'v1') {
179
+        $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
180
+    } else {
181
+        $matchPassword = false;
182
+    }
183 183
 } else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
184
-	$matchPassword = true;
184
+    $matchPassword = true;
185 185
 }
186 186
 
187 187
 if(!$matchPassword) {
188
-	jsAlert($_lang['login_processor_wrong_password']);
189
-	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
190
-	return;
188
+    jsAlert($_lang['login_processor_wrong_password']);
189
+    incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
190
+    return;
191 191
 }
192 192
 
193 193
 if($modx->config['use_captcha'] == 1) {
194
-	if(!isset ($_SESSION['veriword'])) {
195
-		jsAlert($_lang['login_processor_captcha_config']);
196
-		return;
197
-	} elseif($_SESSION['veriword'] != $captcha_code) {
198
-		jsAlert($_lang['login_processor_bad_code']);
199
-		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
200
-		return;
201
-	}
194
+    if(!isset ($_SESSION['veriword'])) {
195
+        jsAlert($_lang['login_processor_captcha_config']);
196
+        return;
197
+    } elseif($_SESSION['veriword'] != $captcha_code) {
198
+        jsAlert($_lang['login_processor_bad_code']);
199
+        incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
200
+        return;
201
+    }
202 202
 }
203 203
 
204 204
 $modx->cleanupExpiredLocks();
@@ -237,36 +237,36 @@  discard block
 block discarded – undo
237 237
 $_SESSION['mgrToken'] = md5($currentsessionid);
238 238
 
239 239
 if($rememberme == '1') {
240
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
241
-
242
-	// Set a cookie separate from the session cookie with the username in it.
243
-	// Are we using secure connection? If so, make sure the cookie is secure
244
-	global $https_port;
245
-
246
-	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
247
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
248
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
249
-	} else {
250
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
251
-	}
240
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
241
+
242
+    // Set a cookie separate from the session cookie with the username in it.
243
+    // Are we using secure connection? If so, make sure the cookie is secure
244
+    global $https_port;
245
+
246
+    $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
247
+    if(version_compare(PHP_VERSION, '5.2', '<')) {
248
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
249
+    } else {
250
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
251
+    }
252 252
 } else {
253
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
253
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
254 254
 
255
-	// Remove the Remember Me cookie
256
-	setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
255
+    // Remove the Remember Me cookie
256
+    setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
257 257
 }
258 258
 
259 259
 // Check if user already has an active session, if not check if user pressed logout end of last session
260 260
 $rs = $modx->getDatabase()->select('lasthit', $modx->getDatabase()->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
261 261
 $activeSession = $modx->getDatabase()->getValue($rs);
262 262
 if(!$activeSession) {
263
-	$rs = $modx->getDatabase()->select('lasthit', $modx->getDatabase()->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
264
-	if($lastHit = $modx->getDatabase()->getValue($rs)) {
265
-		$_SESSION['show_logout_reminder'] = array(
266
-			'type' => 'logout_reminder',
267
-			'lastHit' => $lastHit
268
-		);
269
-	}
263
+    $rs = $modx->getDatabase()->select('lasthit', $modx->getDatabase()->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
264
+    if($lastHit = $modx->getDatabase()->getValue($rs)) {
265
+        $_SESSION['show_logout_reminder'] = array(
266
+            'type' => 'logout_reminder',
267
+            'lastHit' => $lastHit
268
+        );
269
+    }
270 270
 }
271 271
 
272 272
 $log = new EvolutionCMS\Legacy\LogHandler();
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
 
275 275
 // invoke OnManagerLogin event
276 276
 $modx->invokeEvent('OnManagerLogin', array(
277
-		'userid' => $internalKey,
278
-		'username' => $username,
279
-		'userpassword' => $givenPassword,
280
-		'rememberme' => $rememberme
281
-	));
277
+        'userid' => $internalKey,
278
+        'username' => $username,
279
+        'userpassword' => $givenPassword,
280
+        'rememberme' => $rememberme
281
+    ));
282 282
 
283 283
 // check if we should redirect user to a web page
284 284
 $rs = $modx->getDatabase()->select(
@@ -288,17 +288,17 @@  discard block
 block discarded – undo
288 288
 );
289 289
 $id = (int)$modx->getDatabase()->getValue($rs);
290 290
 if($id > 0) {
291
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
292
-	if($_POST['ajax'] == 1) {
293
-		echo $header;
294
-	} else {
295
-		header($header);
296
-	}
291
+    $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
292
+    if($_POST['ajax'] == 1) {
293
+        echo $header;
294
+    } else {
295
+        header($header);
296
+    }
297 297
 } else {
298
-	$header = 'Location: ' . MODX_MANAGER_URL;
299
-	if($_POST['ajax'] == 1) {
300
-		echo $header;
301
-	} else {
302
-		header($header);
303
-	}
298
+    $header = 'Location: ' . MODX_MANAGER_URL;
299
+    if($_POST['ajax'] == 1) {
300
+        echo $header;
301
+    } else {
302
+        header($header);
303
+    }
304 304
 }
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  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->getDatabase()->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 
13
-$core_path = MODX_MANAGER_PATH . 'includes/';
13
+$core_path = MODX_MANAGER_PATH.'includes/';
14 14
 // include_once the language file
15 15
 $_lang = array();
16 16
 include_once("{$core_path}lang/english.inc.php");
17 17
 
18
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
18
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
19 19
 	include_once("{$core_path}lang/{$manager_language}.inc.php");
20 20
 }
21 21
 
22 22
 // Initialize System Alert Message Queque
23
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
23
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
24 24
 	$_SESSION['SystemAlertMsgQueque'] = array();
25 25
 }
26 26
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 		'rememberme' => $rememberme
42 42
 	));
43 43
 $fields = 'mu.*, ua.*';
44
-$from = $modx->getDatabase()->getFullTableName('manager_users') . ' AS mu, ' .
45
-    $modx->getDatabase()->getFullTableName('user_attributes') . ' AS ua';
44
+$from = $modx->getDatabase()->getFullTableName('manager_users').' AS mu, '.
45
+    $modx->getDatabase()->getFullTableName('user_attributes').' AS ua';
46 46
 $where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id";
47 47
 $rs = $modx->getDatabase()->select($fields, $from, $where);
48 48
 $limit = $modx->getDatabase()->getRecordCount($rs);
49 49
 
50
-if($limit == 0 || $limit > 1) {
50
+if ($limit == 0 || $limit > 1) {
51 51
 	jsAlert($_lang['login_processor_unknown_user']);
52 52
 	return;
53 53
 }
@@ -73,32 +73,32 @@  discard block
 block discarded – undo
73 73
     $modx->getDatabase()->getFullTableName('user_settings'),
74 74
     "user='{$internalKey}' AND setting_value!=''"
75 75
 );
76
-while($row = $modx->getDatabase()->getRow($rs)) {
76
+while ($row = $modx->getDatabase()->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 EvolutionCMS\Legacy\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;
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 }
111 111
 
112 112
 // this user has been blocked by an admin, so no way he's loggin in!
113
-if($blocked == '1') {
113
+if ($blocked == '1') {
114 114
 	@session_destroy();
115 115
 	session_unset();
116 116
 	jsAlert($_lang['login_processor_blocked1']);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 }
119 119
 
120 120
 // blockuntil: this user has a block until date
121
-if($blockeduntildate > time()) {
121
+if ($blockeduntildate > time()) {
122 122
 	@session_destroy();
123 123
 	session_unset();
124 124
 	jsAlert($_lang['login_processor_blocked2']);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 }
127 127
 
128 128
 // blockafter: this user has a block after date
129
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
129
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
130 130
 	@session_destroy();
131 131
 	session_unset();
132 132
 	jsAlert($_lang['login_processor_blocked3']);
@@ -134,24 +134,24 @@  discard block
 block discarded – undo
134 134
 }
135 135
 
136 136
 // allowed ip
137
-if($allowed_ip) {
138
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
139
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
137
+if ($allowed_ip) {
138
+	if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
139
+		if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
140 140
 			jsAlert($_lang['login_processor_remotehost_ip']);
141 141
 			return;
142 142
 		}
143 143
 	}
144
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
144
+	if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
145 145
 		jsAlert($_lang['login_processor_remote_ip']);
146 146
 		return;
147 147
 	}
148 148
 }
149 149
 
150 150
 // allowed days
151
-if($allowed_days) {
151
+if ($allowed_days) {
152 152
 	$date = getdate();
153 153
 	$day = $date['wday'] + 1;
154
-	if(!in_array($day,explode(',',$allowed_days))) {
154
+	if (!in_array($day, explode(',', $allowed_days))) {
155 155
 		jsAlert($_lang['login_processor_date']);
156 156
 		return;
157 157
 	}
@@ -168,33 +168,33 @@  discard block
 block discarded – undo
168 168
 
169 169
 // check if plugin authenticated the user
170 170
 $matchPassword = false;
171
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
171
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
172 172
 	// check user password - local authentication
173 173
 	$hashType = $modx->getManagerApi()->getHashType($dbasePassword);
174
-	if($hashType == 'phpass') {
174
+	if ($hashType == 'phpass') {
175 175
 		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
176
-	} elseif($hashType == 'md5') {
176
+	} elseif ($hashType == 'md5') {
177 177
 		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
178
-	} elseif($hashType == 'v1') {
178
+	} elseif ($hashType == 'v1') {
179 179
 		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
180 180
 	} else {
181 181
 		$matchPassword = false;
182 182
 	}
183
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
183
+} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
184 184
 	$matchPassword = true;
185 185
 }
186 186
 
187
-if(!$matchPassword) {
187
+if (!$matchPassword) {
188 188
 	jsAlert($_lang['login_processor_wrong_password']);
189 189
 	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
190 190
 	return;
191 191
 }
192 192
 
193
-if($modx->config['use_captcha'] == 1) {
194
-	if(!isset ($_SESSION['veriword'])) {
193
+if ($modx->config['use_captcha'] == 1) {
194
+	if (!isset ($_SESSION['veriword'])) {
195 195
 		jsAlert($_lang['login_processor_captcha_config']);
196 196
 		return;
197
-	} elseif($_SESSION['veriword'] != $captcha_code) {
197
+	} elseif ($_SESSION['veriword'] != $captcha_code) {
198 198
 		jsAlert($_lang['login_processor_bad_code']);
199 199
 		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
200 200
 		return;
@@ -223,28 +223,28 @@  discard block
 block discarded – undo
223 223
 
224 224
 // successful login so reset fail count and update key values
225 225
 $modx->getDatabase()->update(
226
-    'failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'",
226
+    'failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'",
227 227
     $modx->getDatabase()->getFullTableName('user_attributes'),
228 228
     "internalKey='{$internalKey}'"
229 229
 );
230 230
 
231 231
 // get user's document groups
232 232
 $i = 0;
233
-$rs = $modx->getDatabase()->select('uga.documentgroup', $modx->getDatabase()->getFullTableName('member_groups') . ' ug
234
-		INNER JOIN ' . $modx->getDatabase()->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
233
+$rs = $modx->getDatabase()->select('uga.documentgroup', $modx->getDatabase()->getFullTableName('member_groups').' ug
234
+		INNER JOIN ' . $modx->getDatabase()->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
235 235
 $_SESSION['mgrDocgroups'] = $modx->getDatabase()->getColumn('documentgroup', $rs);
236 236
 
237 237
 $_SESSION['mgrToken'] = md5($currentsessionid);
238 238
 
239
-if($rememberme == '1') {
240
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
239
+if ($rememberme == '1') {
240
+	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
241 241
 
242 242
 	// Set a cookie separate from the session cookie with the username in it.
243 243
 	// Are we using secure connection? If so, make sure the cookie is secure
244 244
 	global $https_port;
245 245
 
246 246
 	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
247
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
247
+	if (version_compare(PHP_VERSION, '5.2', '<')) {
248 248
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
249 249
 	} else {
250 250
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
@@ -259,9 +259,9 @@  discard block
 block discarded – undo
259 259
 // Check if user already has an active session, if not check if user pressed logout end of last session
260 260
 $rs = $modx->getDatabase()->select('lasthit', $modx->getDatabase()->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
261 261
 $activeSession = $modx->getDatabase()->getValue($rs);
262
-if(!$activeSession) {
262
+if (!$activeSession) {
263 263
 	$rs = $modx->getDatabase()->select('lasthit', $modx->getDatabase()->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
264
-	if($lastHit = $modx->getDatabase()->getValue($rs)) {
264
+	if ($lastHit = $modx->getDatabase()->getValue($rs)) {
265 265
 		$_SESSION['show_logout_reminder'] = array(
266 266
 			'type' => 'logout_reminder',
267 267
 			'lastHit' => $lastHit
@@ -286,17 +286,17 @@  discard block
 block discarded – undo
286 286
     $modx->getDatabase()->getFullTableName('user_settings'),
287 287
     "user='{$internalKey}' AND setting_name='manager_login_startup'"
288 288
 );
289
-$id = (int)$modx->getDatabase()->getValue($rs);
290
-if($id > 0) {
291
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
292
-	if($_POST['ajax'] == 1) {
289
+$id = (int) $modx->getDatabase()->getValue($rs);
290
+if ($id > 0) {
291
+	$header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
292
+	if ($_POST['ajax'] == 1) {
293 293
 		echo $header;
294 294
 	} else {
295 295
 		header($header);
296 296
 	}
297 297
 } else {
298
-	$header = 'Location: ' . MODX_MANAGER_URL;
299
-	if($_POST['ajax'] == 1) {
298
+	$header = 'Location: '.MODX_MANAGER_URL;
299
+	if ($_POST['ajax'] == 1) {
300 300
 		echo $header;
301 301
 	} else {
302 302
 		header($header);
Please login to merge, or discard this patch.
manager/processors/remove_content.processor.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  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('delete_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_content'), "deleted=1");
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 
12 12
 // invoke OnBeforeEmptyTrash event
13 13
 $modx->invokeEvent("OnBeforeEmptyTrash",
14
-						array(
15
-							"ids"=>$ids
16
-						));
14
+                        array(
15
+                            "ids"=>$ids
16
+                        ));
17 17
 
18 18
 // remove the document groups link.
19 19
 $sql = "DELETE document_groups
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
 //'undelete' the document.
33 33
 $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('site_content'), "deleted=1");
34 34
 
35
-	// invoke OnEmptyTrash event
36
-	$modx->invokeEvent("OnEmptyTrash",
37
-						array(
38
-							"ids"=>$ids
39
-						));
35
+    // invoke OnEmptyTrash event
36
+    $modx->invokeEvent("OnEmptyTrash",
37
+                        array(
38
+                            "ids"=>$ids
39
+                        ));
40 40
 
41
-	// empty cache
42
-	$modx->clearCache('full');
41
+    // empty cache
42
+    $modx->clearCache('full');
43 43
 
44
-	// finished emptying cache - redirect
45
-	$header="Location: index.php?a=2&r=1";
46
-	header($header);
44
+    // finished emptying cache - redirect
45
+    $header="Location: index.php?a=2&r=1";
46
+    header($header);
Please login to merge, or discard this patch.
manager/processors/publish_content.processor.php 2 patches
Indentation   +12 added lines, -12 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('save_document')||!$modx->hasPermission('publish_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_REQUEST['id'])? (int)$_REQUEST['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
 /************webber ********/
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
 $udperms->role = $_SESSION['mgrRole'];
33 33
 
34 34
 if(!$udperms->checkPermissions()) {
35
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
35
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
36 36
 }
37 37
 
38 38
 // update the document
39 39
 $modx->getDatabase()->update(
40
-	array(
41
-		'published'   => 1,
42
-		'pub_date'    => 0,
43
-		'unpub_date'  => 0,
44
-		'editedby'    => $modx->getLoginUserID(),
45
-		'editedon'    => time(),
46
-		'publishedby' => $modx->getLoginUserID(),
47
-		'publishedon' => time(),
48
-	), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'");
40
+    array(
41
+        'published'   => 1,
42
+        'pub_date'    => 0,
43
+        'unpub_date'  => 0,
44
+        'editedby'    => $modx->getLoginUserID(),
45
+        'editedon'    => time(),
46
+        'publishedby' => $modx->getLoginUserID(),
47
+        'publishedon' => time(),
48
+    ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'");
49 49
 
50 50
 // invoke OnDocPublished  event
51 51
 $modx->invokeEvent("OnDocPublished",array("docid"=>$id));
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  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('save_document')||!$modx->hasPermission('publish_document')) {
5
+if (!$modx->hasPermission('save_document') || !$modx->hasPermission('publish_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->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->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
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
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
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'");
49 49
 
50 50
 // invoke OnDocPublished  event
51
-$modx->invokeEvent("OnDocPublished",array("docid"=>$id));
51
+$modx->invokeEvent("OnDocPublished", array("docid"=>$id));
52 52
 
53 53
 // Set the item name for logger
54 54
 $_SESSION['itemname'] = $content['pagetitle'];
@@ -56,6 +56,6 @@  discard block
 block discarded – undo
56 56
 // empty cache
57 57
 $modx->clearCache('full');
58 58
 
59
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
59
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
60 60
 
61 61
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_template.processor.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  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('delete_template')) {
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
 // delete the template, but first check it doesn't have any documents using it
15 15
 $rs = $modx->getDatabase()->select('id, pagetitle,introtext', $modx->getDatabase()->getFullTableName('site_content'), "template='{$id}' AND deleted=0");
16 16
 $limit = $modx->getDatabase()->getRecordCount($rs);
17 17
 if($limit > 0) {
18
-	include "header.inc.php";
19
-	?>
18
+    include "header.inc.php";
19
+    ?>
20 20
 
21 21
 	<h1><?php echo $_lang['manage_templates']; ?></h1>
22 22
 
@@ -28,20 +28,20 @@  discard block
 block discarded – undo
28 28
 			<p>Documents using this template:</p>
29 29
 			<ul>
30 30
 				<?php
31
-				while($row = $modx->getDatabase()->getRow($rs)) {
32
-					echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
33
-				}
34
-				?>
31
+                while($row = $modx->getDatabase()->getRow($rs)) {
32
+                    echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
33
+                }
34
+                ?>
35 35
 			</ul>
36 36
 		</div>
37 37
 	</div>
38 38
 	<?php
39
-	include_once "footer.inc.php";
40
-	exit;
39
+    include_once "footer.inc.php";
40
+    exit;
41 41
 }
42 42
 
43 43
 if($id == $default_template) {
44
-	$modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
44
+    $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
45 45
 }
46 46
 
47 47
 // Set the item name for logger
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 
51 51
 // invoke OnBeforeTempFormDelete event
52 52
 $modx->invokeEvent("OnBeforeTempFormDelete", array(
53
-		"id" => $id
54
-	));
53
+        "id" => $id
54
+    ));
55 55
 
56 56
 // delete the document.
57 57
 $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('site_templates'), "id='{$id}'");
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 
61 61
 // invoke OnTempFormDelete event
62 62
 $modx->invokeEvent("OnTempFormDelete", array(
63
-		"id" => $id
64
-	));
63
+        "id" => $id
64
+    ));
65 65
 
66 66
 // empty cache
67 67
 $modx->clearCache('full');
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  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_template')) {
5
+if (!$modx->hasPermission('delete_template')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
10
-if($id == 0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // delete the template, but first check it doesn't have any documents using it
15 15
 $rs = $modx->getDatabase()->select('id, pagetitle,introtext', $modx->getDatabase()->getFullTableName('site_content'), "template='{$id}' AND deleted=0");
16 16
 $limit = $modx->getDatabase()->getRecordCount($rs);
17
-if($limit > 0) {
17
+if ($limit > 0) {
18 18
 	include "header.inc.php";
19 19
 	?>
20 20
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 			<p>Documents using this template:</p>
29 29
 			<ul>
30 30
 				<?php
31
-				while($row = $modx->getDatabase()->getRow($rs)) {
32
-					echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
31
+				while ($row = $modx->getDatabase()->getRow($rs)) {
32
+					echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['introtext'] != '' ? ' - '.$row['introtext'] : '').'</li>';
33 33
 				}
34 34
 				?>
35 35
 			</ul>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	exit;
41 41
 }
42 42
 
43
-if($id == $default_template) {
43
+if ($id == $default_template) {
44 44
 	$modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
45 45
 }
46 46
 
Please login to merge, or discard this patch.