Completed
Pull Request — develop (#716)
by Serg
11:55
created
manager/actions/user_management.static.php 1 patch
Indentation   +54 added lines, -54 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_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,55 +120,55 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$where = "";
124
-					if(!$modx->hasPermission('save_role')) {
125
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
126
-					}
127
-					if(!empty($sqlQuery)) {
128
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129
-					}
130
-					$ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
123
+                    $where = "";
124
+                    if(!$modx->hasPermission('save_role')) {
125
+                        $where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
126
+                    }
127
+                    if(!empty($sqlQuery)) {
128
+                        $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129
+                    }
130
+                    $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
131 131
 			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
132 132
 			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
134
-					$grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135
-					$grd->noRecordMsg = $_lang["no_records_found"];
136
-					$grd->cssClass = "table data";
137
-					$grd->columnHeaderClass = "tableHeader";
138
-					$grd->itemClass = "tableItem";
139
-					$grd->altItemClass = "tableAltItem";
140
-					$grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked";
141
-					$grd->columns = implode(',', array(
142
-						$_lang["icon"],
143
-						$_lang["name"],
144
-						$_lang["user_full_name"],
145
-						$_lang['role'],
146
-						$_lang["email"],
147
-						$_lang["user_prevlogin"],
148
-						$_lang["user_logincount"],
149
-						$_lang["user_block"]
150
-					));
151
-					$grd->colWidths = "1%,,,,,1%,1%,1%";
152
-					$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
153
-					$grd->colTypes = implode('||', array(
154
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
156
-						'template:[+fullname+]',
157
-						'template:[+role+]',
158
-						'template:[+email+]',
159
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
160
-						'template:[+logincount+]',
161
-						'template:[+blocked+]'
162
-					));
163
-					if($listmode == '1') {
164
-						$grd->pageSize = 0;
165
-					}
166
-					if($_REQUEST['op'] == 'reset') {
167
-						$grd->pageNumber = 1;
168
-					}
169
-					// render grid
170
-					echo $grd->render();
171
-					?>
133
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
134
+                    $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135
+                    $grd->noRecordMsg = $_lang["no_records_found"];
136
+                    $grd->cssClass = "table data";
137
+                    $grd->columnHeaderClass = "tableHeader";
138
+                    $grd->itemClass = "tableItem";
139
+                    $grd->altItemClass = "tableAltItem";
140
+                    $grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked";
141
+                    $grd->columns = implode(',', array(
142
+                        $_lang["icon"],
143
+                        $_lang["name"],
144
+                        $_lang["user_full_name"],
145
+                        $_lang['role'],
146
+                        $_lang["email"],
147
+                        $_lang["user_prevlogin"],
148
+                        $_lang["user_logincount"],
149
+                        $_lang["user_block"]
150
+                    ));
151
+                    $grd->colWidths = "1%,,,,,1%,1%,1%";
152
+                    $grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
153
+                    $grd->colTypes = implode('||', array(
154
+                        'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
+                        'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
156
+                        'template:[+fullname+]',
157
+                        'template:[+role+]',
158
+                        'template:[+email+]',
159
+                        'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
160
+                        'template:[+logincount+]',
161
+                        'template:[+blocked+]'
162
+                    ));
163
+                    if($listmode == '1') {
164
+                        $grd->pageSize = 0;
165
+                    }
166
+                    if($_REQUEST['op'] == 'reset') {
167
+                        $grd->pageNumber = 1;
168
+                    }
169
+                    // render grid
170
+                    echo $grd->render();
171
+                    ?>
172 172
 				</div>
173 173
 			</div>
174 174
 		</div>
Please login to merge, or discard this patch.
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.
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.
manager/processors/move_document.processor.php 1 patch
Indentation   +48 added lines, -48 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('edit_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0;
@@ -25,68 +25,68 @@  discard block
 block discarded – undo
25 25
 // check user has permission to move document to chosen location
26 26
 
27 27
 if ($use_udperms == 1) {
28
-	if ($oldparent != $newParentID) {
29
-		$udperms = new EvolutionCMS\Legacy\Permissions();
30
-		$udperms->user = $modx->getLoginUserID();
31
-		$udperms->document = $newParentID;
32
-		$udperms->role = $_SESSION['mgrRole'];
28
+    if ($oldparent != $newParentID) {
29
+        $udperms = new EvolutionCMS\Legacy\Permissions();
30
+        $udperms->user = $modx->getLoginUserID();
31
+        $udperms->document = $newParentID;
32
+        $udperms->role = $_SESSION['mgrRole'];
33 33
 
34
-		 if (!$udperms->checkPermissions()) {
35
-			$modx->webAlertAndQuit($_lang["access_permission_parent_denied"]);
36
-		 }
37
-	}
34
+            if (!$udperms->checkPermissions()) {
35
+            $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]);
36
+            }
37
+    }
38 38
 }
39 39
 
40 40
 $evtOut = $modx->invokeEvent("onBeforeMoveDocument", array (
41
-	"id_document" => $documentID,
42
-	"old_parent" => $oldparent,
43
-	"new_parent" => $newParentID
41
+    "id_document" => $documentID,
42
+    "old_parent" => $oldparent,
43
+    "new_parent" => $newParentID
44 44
 ));
45 45
 if (is_array($evtOut) && count($evtOut) > 0){
46
-	$newParent = array_pop($evtOut);
47
-	if($newParent == $oldparent) {
48
-		$modx->webAlertAndQuit($_lang["error_movedocument2"]);
49
-	}else{
50
-		$newParentID = $newParent;
51
-	}
46
+    $newParent = array_pop($evtOut);
47
+    if($newParent == $oldparent) {
48
+        $modx->webAlertAndQuit($_lang["error_movedocument2"]);
49
+    }else{
50
+        $newParentID = $newParent;
51
+    }
52 52
 }
53 53
 
54 54
 $children = allChildren($documentID);
55 55
 if (!array_search($newParentID, $children)) {
56
-	$modx->db->update(array(
57
-		'isfolder' => 1,
58
-	), $modx->getFullTableName('site_content'), "id='{$newParentID}'");
56
+    $modx->db->update(array(
57
+        'isfolder' => 1,
58
+    ), $modx->getFullTableName('site_content'), "id='{$newParentID}'");
59 59
 
60
-	$modx->db->update(array(
61
-		'parent'   => $newParentID,
62
-		'editedby' => $modx->getLoginUserID(),
63
-		'editedon' => time(),
64
-	), $modx->getFullTableName('site_content'), "id='{$documentID}'");
60
+    $modx->db->update(array(
61
+        'parent'   => $newParentID,
62
+        'editedby' => $modx->getLoginUserID(),
63
+        'editedon' => time(),
64
+    ), $modx->getFullTableName('site_content'), "id='{$documentID}'");
65 65
 
66
-	// finished moving the document, now check to see if the old_parent should no longer be a folder.
67
-	$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'");
68
-	$limit = $modx->db->getValue($rs);
66
+    // finished moving the document, now check to see if the old_parent should no longer be a folder.
67
+    $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'");
68
+    $limit = $modx->db->getValue($rs);
69 69
 
70
-	if(!$limit>0) {
71
-		$modx->db->update(array(
72
-			'isfolder' => 0,
73
-		), $modx->getFullTableName('site_content'), "id='{$oldparent}'");
74
-	}
75
-	// Set the item name for logger
76
-	$pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'"));
77
-	$_SESSION['itemname'] = $pagetitle;
70
+    if(!$limit>0) {
71
+        $modx->db->update(array(
72
+            'isfolder' => 0,
73
+        ), $modx->getFullTableName('site_content'), "id='{$oldparent}'");
74
+    }
75
+    // Set the item name for logger
76
+    $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'"));
77
+    $_SESSION['itemname'] = $pagetitle;
78 78
 
79
-	$modx->invokeEvent("onAfterMoveDocument", array (
80
-		"id_document" => $documentID,
81
-		"old_parent" => $oldparent,
82
-		"new_parent" => $newParentID
83
-	));
79
+    $modx->invokeEvent("onAfterMoveDocument", array (
80
+        "id_document" => $documentID,
81
+        "old_parent" => $oldparent,
82
+        "new_parent" => $newParentID
83
+    ));
84 84
 
85
-	// empty cache & sync site
86
-	$modx->clearCache('full');
85
+    // empty cache & sync site
86
+    $modx->clearCache('full');
87 87
 
88
-	$header="Location: index.php?a=3&id={$documentID}&r=9";
89
-	header($header);
88
+    $header="Location: index.php?a=3&id={$documentID}&r=9";
89
+    header($header);
90 90
 } else {
91
-	$modx->webAlertAndQuit("You cannot move a document to a child document!");
91
+    $modx->webAlertAndQuit("You cannot move a document to a child document!");
92 92
 }
Please login to merge, or discard this patch.
manager/processors/undelete_content.processor.php 1 patch
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('delete_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 ********/
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 $udperms->role = $_SESSION['mgrRole'];
32 32
 
33 33
 if(!$udperms->checkPermissions()) {
34
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
34
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
35 35
 }
36 36
 
37 37
 // get the timestamp on which the document was deleted.
38 38
 $rs = $modx->db->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1");
39 39
 $deltime = $modx->db->getValue($rs);
40 40
 if(!$deltime) {
41
-	$modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
41
+    $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
42 42
 }
43 43
 
44 44
 $children = array();
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 getChildrenForUnDelete($id);
47 47
 
48 48
 if(count($children)>0) {
49
-	$modx->db->update(
50
-		array(
51
-			'deleted'   => 0,
52
-			'deletedby' => 0,
53
-			'deletedon' => 0,
54
-		), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
49
+    $modx->db->update(
50
+        array(
51
+            'deleted'   => 0,
52
+            'deletedby' => 0,
53
+            'deletedon' => 0,
54
+        ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
55 55
 }
56 56
 //'undelete' the document.
57 57
 $modx->db->update(
58
-	array(
59
-		'deleted'   => 0,
60
-		'deletedby' => 0,
61
-		'deletedon' => 0,
62
-	), $modx->getFullTableName('site_content'), "id='{$id}'");
58
+    array(
59
+        'deleted'   => 0,
60
+        'deletedby' => 0,
61
+        'deletedon' => 0,
62
+    ), $modx->getFullTableName('site_content'), "id='{$id}'");
63 63
 
64 64
 $modx->invokeEvent("OnDocFormUnDelete",
65 65
     array(
Please login to merge, or discard this patch.