Completed
Push — develop ( d271f8...cb7ecf )
by Serg
08:17 queued 57s
created
manager/media/style/common/moo-datepicker/datepicker.inc.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2
-class DATEPICKER {
3
-    function __construct() {
2
+class DATEPICKER{
3
+    function __construct(){
4 4
     }
5
-    function getDP() {
5
+    function getDP(){
6 6
         $modx = evolutionCMS(); global$_lang;
7 7
 
8 8
         $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl');
9
-        return $modx->parseText($tpl,$_lang,'[%','%]');
9
+        return $modx->parseText($tpl, $_lang, '[%', '%]');
10 10
     }
11 11
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,11 @@
 block discarded – undo
1 1
 <?php
2
-class DATEPICKER {
3
-    function __construct() {
2
+class DATEPICKER
3
+{
4
+    function __construct()
5
+    {
4 6
     }
5
-    function getDP() {
7
+    function getDP()
8
+    {
6 9
         $modx = evolutionCMS(); global$_lang;
7 10
 
8 11
         $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl');
Please login to merge, or discard this patch.
manager/processors/save_content.processor.php 4 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -492,7 +492,7 @@
 block discarded – undo
492 492
                 }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
493 493
                 $publishedon = $pub_date;
494 494
                 $publishedby = $modx->getLoginUserID();
495
-                   }elseif ($was_published && !$published) {
495
+                    }elseif ($was_published && !$published) {
496 496
                 $publishedon = 0;
497 497
                 $publishedby = 0;
498 498
             } else {
Please login to merge, or discard this patch.
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -280,19 +280,19 @@
 block discarded – undo
280 280
             // invoke OnBeforeDocFormSave event
281 281
             switch($modx->config['docid_incrmnt_method'])
282 282
             {
283
-            case '1':
284
-                $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
285
-                $where = "T1.id IS NULL";
286
-                $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
287
-                $id = $modx->db->getValue($rs);
283
+                case '1':
284
+                    $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
285
+                    $where = "T1.id IS NULL";
286
+                    $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
287
+                    $id = $modx->db->getValue($rs);
288
+                    break;
289
+                case '2':
290
+                    $rs = $modx->db->select('MAX(id)+1', $tbl_site_content);
291
+                    $id = $modx->db->getValue($rs);
288 292
                 break;
289
-            case '2':
290
-                $rs = $modx->db->select('MAX(id)+1', $tbl_site_content);
291
-                $id = $modx->db->getValue($rs);
292
-            break;
293 293
 
294
-            default:
295
-                $id = '';
294
+                default:
295
+                    $id = '';
296 296
             }
297 297
 
298 298
         $modx->invokeEvent("OnBeforeDocFormSave", array(
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         case 'new' :
279 279
 
280 280
             // invoke OnBeforeDocFormSave event
281
-            switch($modx->config['docid_incrmnt_method'])
281
+            switch ($modx->config['docid_incrmnt_method'])
282 282
             {
283 283
             case '1':
284 284
                 $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
             if (!$was_published && $published) {
490 490
                 $publishedon = $currentdate;
491 491
                 $publishedby = $modx->getLoginUserID();
492
-                }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
492
+                }elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) {
493 493
                 $publishedon = $pub_date;
494 494
                 $publishedby = $modx->getLoginUserID();
495 495
                    }elseif ($was_published && !$published) {
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
             }
502 502
 
503 503
             // invoke OnBeforeDocFormSave event
504
-            $modx->invokeEvent("OnBeforeDocFormSave", array (
504
+            $modx->invokeEvent("OnBeforeDocFormSave", array(
505 505
                 "mode" => "upd",
506 506
                 "id" => $id
507 507
             ));
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                 . "menuindex={$menuindex}, "
527 527
                 . "searchable={$searchable}, "
528 528
                 . "cacheable={$cacheable}, "
529
-                . "editedby=" . $modx->getLoginUserID() . ", "
529
+                . "editedby=".$modx->getLoginUserID().", "
530 530
                 . "editedon={$currentdate}, "
531 531
                 . "publishedon={$publishedon}, "
532 532
                 . "publishedby={$publishedby}, "
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 
541 541
             // update template variables
542 542
             $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'");
543
-            $tvIds = array ();
543
+            $tvIds = array();
544 544
             while ($row = $modx->db->getRow($rs)) {
545 545
                 $tvIds[$row['tmplvarid']] = $row['id'];
546 546
             }
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                     'groups.id, groups.document_group',
594 594
                     "{$tbl_document_groups} AS groups
595 595
                     LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group",
596
-                    "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'"
596
+                    "((1=".(int) $isManager." AND dgn.private_memgroup) OR (1=".(int) $isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'"
597 597
                     );
598 598
                 $old_groups = array();
599 599
                 while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id'];
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
                         unset($old_groups[$group]);
606 606
                         continue;
607 607
                     } elseif ($link_id == 'new') {
608
-                        $insertions[] = '('.(int)$group.','.$id.')';
608
+                        $insertions[] = '('.(int) $group.','.$id.')';
609 609
                     }
610 610
                 }
611 611
                 if (!empty($insertions)) {
@@ -637,17 +637,17 @@  discard block
 block discarded – undo
637 637
 
638 638
 
639 639
             // invoke OnDocFormSave event
640
-            $modx->invokeEvent("OnDocFormSave", array (
640
+            $modx->invokeEvent("OnDocFormSave", array(
641 641
                 "mode" => "upd",
642 642
                 "id" => $id
643 643
             ));
644 644
 
645 645
             // secure web documents - flag as private
646
-            include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php";
646
+            include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
647 647
             secureWebDocument($id);
648 648
 
649 649
             // secure manager documents - flag as private
650
-            include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php";
650
+            include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php";
651 651
             secureMgrDocument($id);
652 652
 
653 653
             // Set the item name for logger
@@ -673,13 +673,13 @@  discard block
 block discarded – undo
673 673
                         // document
674 674
                         $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent";
675 675
                     }
676
-                    $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path;
676
+                    $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'].$add_path;
677 677
                 } else {
678 678
                     $header = "Location: index.php?a=3&id=$id&r=1".$add_path;
679 679
                 }
680 680
             }
681 681
             if (headers_sent()) {
682
-                $header = str_replace('Location: ','',$header);
682
+                $header = str_replace('Location: ', '', $header);
683 683
                 echo "<script>document.location.href='$header';</script>\n";
684 684
             } else {
685 685
                 header($header);
Please login to merge, or discard this patch.
Braces   +23 added lines, -19 removed lines patch added patch discarded remove patch
@@ -134,8 +134,7 @@  discard block
 block discarded – undo
134 134
         }
135 135
         //end webber
136 136
     }
137
-}
138
-elseif ($alias) {
137
+} elseif ($alias) {
139 138
     $alias = $modx->stripAlias($alias);
140 139
 }
141 140
 
@@ -149,8 +148,7 @@  discard block
 block discarded – undo
149 148
 
150 149
     if ($pub_date < $currentdate) {
151 150
         $published = 1;
152
-    }
153
-    elseif ($pub_date > $currentdate) {
151
+    } elseif ($pub_date > $currentdate) {
154 152
         $published = 0;
155 153
     }
156 154
 }
@@ -278,8 +276,7 @@  discard block
 block discarded – undo
278 276
         case 'new' :
279 277
 
280 278
             // invoke OnBeforeDocFormSave event
281
-            switch($modx->config['docid_incrmnt_method'])
282
-            {
279
+            switch($modx->config['docid_incrmnt_method']) {
283 280
             case '1':
284 281
                 $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
285 282
                 $where = "T1.id IS NULL";
@@ -347,8 +344,9 @@  discard block
 block discarded – undo
347 344
             "alias_visible"    => $aliasvisible
348 345
         );
349 346
 
350
-        if ($id != '')
351
-            $dbInsert["id"] = $id;
347
+        if ($id != '') {
348
+                    $dbInsert["id"] = $id;
349
+        }
352 350
 
353 351
         $key = $modx->db->insert($dbInsert, $tbl_site_content);
354 352
 
@@ -424,11 +422,13 @@  discard block
 block discarded – undo
424 422
         // redirect/stay options
425 423
         if ($_POST['stay'] != '') {
426 424
             // weblink
427
-            if ($_POST['mode'] == "72")
428
-                $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent";
425
+            if ($_POST['mode'] == "72") {
426
+                            $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent";
427
+            }
429 428
             // document
430
-            if ($_POST['mode'] == "4")
431
-                $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent";
429
+            if ($_POST['mode'] == "4") {
430
+                            $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent";
431
+            }
432 432
             $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'];
433 433
         } else {
434 434
             $header = "Location: index.php?a=3&id=$key&r=1";
@@ -489,10 +489,10 @@  discard block
 block discarded – undo
489 489
             if (!$was_published && $published) {
490 490
                 $publishedon = $currentdate;
491 491
                 $publishedby = $modx->getLoginUserID();
492
-                }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
492
+                } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
493 493
                 $publishedon = $pub_date;
494 494
                 $publishedby = $modx->getLoginUserID();
495
-                   }elseif ($was_published && !$published) {
495
+                   } elseif ($was_published && !$published) {
496 496
                 $publishedon = 0;
497 497
                 $publishedby = 0;
498 498
             } else {
@@ -548,7 +548,9 @@  discard block
 block discarded – undo
548 548
             $tvChanges = array();
549 549
             foreach ($tmplvars as $field => $value) {
550 550
                 if (!is_array($value)) {
551
-                    if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value];
551
+                    if (isset($tvIds[$value])) {
552
+                        $tvDeletions[] = $tvIds[$value];
553
+                    }
552 554
                 } else {
553 555
                     $tvId = $value[0];
554 556
                     $tvVal = $value[1];
@@ -596,7 +598,9 @@  discard block
 block discarded – undo
596 598
                     "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'"
597 599
                     );
598 600
                 $old_groups = array();
599
-                while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id'];
601
+                while ($row = $modx->db->getRow($rs)) {
602
+                    $old_groups[$row['document_group']] = $row['id'];
603
+                }
600 604
 
601 605
                 // update the permissions in the database
602 606
                 $insertions = $deletions = array();
@@ -658,9 +662,9 @@  discard block
 block discarded – undo
658 662
                 $modx->clearCache('full');
659 663
             }
660 664
 
661
-            if ($_POST['refresh_preview'] == '1')
662
-                $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev";
663
-            else {
665
+            if ($_POST['refresh_preview'] == '1') {
666
+                            $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev";
667
+            } else {
664 668
                 if ($_POST['stay'] != '2' && $id > 0) {
665 669
                     $modx->unlockElement(7, $id);
666 670
                 }
Please login to merge, or discard this patch.
manager/actions/help/version_notices/1.3.6.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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 5
 ?>
Please login to merge, or discard this patch.
manager/actions/help/version_notices/1.4.1.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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 5
 ?>
Please login to merge, or discard this patch.
manager/actions/help/version_notices/1.4.0.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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 5
 ?>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab6_filemanager_settings.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
         <?php
114 114
             // invoke OnMiscSettingsRender event
115 115
             $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender');
116
-            if(is_array($evtOut)) echo implode("",$evtOut);
116
+            if (is_array($evtOut)) echo implode("", $evtOut);
117 117
         ?>
118 118
     </td>
119 119
   </tr>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,9 @@
 block discarded – undo
113 113
         <?php
114 114
             // invoke OnMiscSettingsRender event
115 115
             $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender');
116
-            if(is_array($evtOut)) echo implode("",$evtOut);
116
+            if(is_array($evtOut)) {
117
+                echo implode("",$evtOut);
118
+            }
117 119
         ?>
118 120
     </td>
119 121
   </tr>
Please login to merge, or discard this patch.
manager/actions/mutate_user.dynamic.php 4 patches
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch($modx->manager->action) {
7
-	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 12:
8
+		    if(!$modx->hasPermission('edit_user')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 11:
13
+		    if(!$modx->hasPermission('new_user')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 	// get user settings
40 40
 	$rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
41 41
 	$usersettings = array();
42
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
42
+	while($row = $modx->db->getRow($rs)) {
43
+	    $usersettings[$row['setting_name']] = $row['setting_value'];
44
+	}
43 45
 	// manually extract so that user display settings are not overwritten
44 46
 	foreach($usersettings as $k => $v) {
45 47
 		if($k != 'manager_language' && $k != 'manager_theme') {
@@ -763,13 +765,16 @@  discard block
 block discarded – undo
763 765
 
764 766
 			$groupsarray = array();
765 767
 
766
-			if($modx->manager->action == '12') { // only do this bit if the user is being edited
768
+			if($modx->manager->action == '12') {
769
+// only do this bit if the user is being edited
767 770
 				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
768 771
 				$groupsarray = $modx->db->getColumn('user_group', $rs);
769 772
 			}
770 773
 			// retain selected doc groups between post
771 774
 			if(is_array($_POST['user_groups'])) {
772
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
775
+				foreach($_POST['user_groups'] as $n => $v) {
776
+				    $groupsarray[] = $v;
777
+				}
773 778
 			}
774 779
 			?>
775 780
 			<div class="tab-page" id="tabAccess">
Please login to merge, or discard this patch.
Indentation   +155 added lines, -155 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  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
 
6 6
 switch($modx->manager->action) {
7
-	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    case 12:
8
+        if(!$modx->hasPermission('edit_user')) {
9
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+        }
11
+        break;
12
+    case 11:
13
+        if(!$modx->hasPermission('new_user')) {
14
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+        }
16
+        break;
17
+    default:
18
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -23,79 +23,79 @@  discard block
 block discarded – undo
23 23
 // check to see the snippet editor isn't locked
24 24
 $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
25 25
 if($username = $modx->db->getValue($rs)) {
26
-	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
26
+    $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
27 27
 }
28 28
 // end check for lock
29 29
 
30 30
 if($modx->manager->action == '12') {
31
-	// get user attribute
32
-	$rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
-	$userdata = $modx->db->getRow($rs);
34
-	if(!$userdata) {
35
-		$modx->webAlertAndQuit("No user returned!");
36
-	}
31
+    // get user attribute
32
+    $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
+    $userdata = $modx->db->getRow($rs);
34
+    if(!$userdata) {
35
+        $modx->webAlertAndQuit("No user returned!");
36
+    }
37 37
 
38 38
     if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) {
39 39
         $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!');
40 40
     }
41 41
 
42 42
 
43
-	// get user settings
44
-	$rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45
-	$usersettings = array();
46
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47
-	// manually extract so that user display settings are not overwritten
48
-	foreach($usersettings as $k => $v) {
49
-		if($k != 'manager_language' && $k != 'manager_theme') {
50
-			${$k} = $v;
51
-		}
52
-	}
43
+    // get user settings
44
+    $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45
+    $usersettings = array();
46
+    while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47
+    // manually extract so that user display settings are not overwritten
48
+    foreach($usersettings as $k => $v) {
49
+        if($k != 'manager_language' && $k != 'manager_theme') {
50
+            ${$k} = $v;
51
+        }
52
+    }
53 53
 
54
-	// get user name
55
-	$rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56
-	$usernamedata = $modx->db->getRow($rs);
57
-	if(!$usernamedata) {
58
-		$modx->webAlertAndQuit("No user returned while getting username!");
59
-	}
60
-	$_SESSION['itemname'] = $usernamedata['username'];
54
+    // get user name
55
+    $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56
+    $usernamedata = $modx->db->getRow($rs);
57
+    if(!$usernamedata) {
58
+        $modx->webAlertAndQuit("No user returned while getting username!");
59
+    }
60
+    $_SESSION['itemname'] = $usernamedata['username'];
61 61
 } else {
62
-	$userdata = array();
63
-	$usersettings = array();
64
-	$usernamedata = array();
65
-	$_SESSION['itemname'] = $_lang["new_user"];
62
+    $userdata = array();
63
+    $usersettings = array();
64
+    $usernamedata = array();
65
+    $_SESSION['itemname'] = $_lang["new_user"];
66 66
 }
67 67
 
68 68
 // avoid doubling htmlspecialchars (already encoded in DB)
69 69
 foreach($userdata as $key => $val) {
70
-	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
70
+    $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
71 71
 };
72 72
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
73 73
 
74 74
 // restore saved form
75 75
 $formRestored = false;
76 76
 if($modx->manager->hasFormValues()) {
77
-	$modx->manager->loadFormValues();
78
-	// restore post values
79
-	$userdata = array_merge($userdata, $_POST);
80
-	$userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
81
-	$usernamedata['username'] = $userdata['newusername'];
82
-	$usernamedata['oldusername'] = $_POST['oldusername'];
83
-	$usersettings = array_merge($usersettings, $userdata);
84
-	$usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
85
-	extract($usersettings, EXTR_OVERWRITE);
77
+    $modx->manager->loadFormValues();
78
+    // restore post values
79
+    $userdata = array_merge($userdata, $_POST);
80
+    $userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
81
+    $usernamedata['username'] = $userdata['newusername'];
82
+    $usernamedata['oldusername'] = $_POST['oldusername'];
83
+    $usersettings = array_merge($usersettings, $userdata);
84
+    $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
85
+    extract($usersettings, EXTR_OVERWRITE);
86 86
 }
87 87
 
88 88
 // include the country list language file
89 89
 $_country_lang = array();
90 90
 include_once "lang/country/english_country.inc.php";
91 91
 if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
92
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
92
+    include_once "lang/country/" . $manager_language . "_country.inc.php";
93 93
 }
94 94
 asort($_country_lang);
95 95
 
96 96
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
97 97
 if($which_browser == 'default') {
98
-	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
98
+    $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
99 99
 }
100 100
 ?>
101 101
 <script type="text/javascript">
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
 <form action="index.php?a=32" method="post" name="userform">
206 206
 	<?php
207 207
 
208
-	// invoke OnUserFormPrerender event
209
-	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210
-		"id" => $user
211
-	));
212
-	if(is_array($evtOut)) {
213
-		echo implode("", $evtOut);
214
-	}
215
-	?>
208
+    // invoke OnUserFormPrerender event
209
+    $evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210
+        "id" => $user
211
+    ));
212
+    if(is_array($evtOut)) {
213
+        echo implode("", $evtOut);
214
+    }
215
+    ?>
216 216
 	<input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>">
217 217
 	<input type="hidden" name="id" value="<?php echo $user ?>">
218 218
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
@@ -305,21 +305,21 @@  discard block
 block discarded – undo
305 305
 						<td>&nbsp;</td>
306 306
 						<td><?php
307 307
 
308
-							$rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
309
-							?>
308
+                            $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
309
+                            ?>
310 310
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
311 311
 								<?php
312
-								while($row = $modx->db->getRow($rs)) {
313
-									if($modx->manager->action == '11') {
314
-										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315
-									} else {
316
-										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
317
-									}
318
-									?>
312
+                                while($row = $modx->db->getRow($rs)) {
313
+                                    if($modx->manager->action == '11') {
314
+                                        $selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315
+                                    } else {
316
+                                        $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
317
+                                    }
318
+                                    ?>
319 319
 									<option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option>
320 320
 									<?php
321
-								}
322
-								?>
321
+                                }
322
+                                ?>
323 323
 							</select></td>
324 324
 					</tr>
325 325
 					<tr>
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
365 365
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
366 366
 								<?php
367
-								foreach($_country_lang as $key => $country) {
368
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
369
-								}
370
-								?>
367
+                                foreach($_country_lang as $key => $country) {
368
+                                    echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
369
+                                }
370
+                                ?>
371 371
 							</select></td>
372 372
 					</tr>
373 373
 					<tr>
@@ -443,21 +443,21 @@  discard block
 block discarded – undo
443 443
 						<td><select name="manager_language" class="inputBox" onChange="documentDirty=true">
444 444
 								<option value=""></option>
445 445
 								<?php
446
-								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447
-								$dir = dir("includes/lang");
448
-								while($file = $dir->read()) {
449
-									if(strpos($file, ".inc.php") > 0) {
450
-										$endpos = strpos($file, ".");
451
-										$languagename = substr($file, 0, $endpos);
452
-										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
453
-										?>
446
+                                $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447
+                                $dir = dir("includes/lang");
448
+                                while($file = $dir->read()) {
449
+                                    if(strpos($file, ".inc.php") > 0) {
450
+                                        $endpos = strpos($file, ".");
451
+                                        $languagename = substr($file, 0, $endpos);
452
+                                        $selectedtext = $languagename == $activelang ? "selected='selected'" : "";
453
+                                        ?>
454 454
 										<option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option>
455 455
 										<?php
456 456
 
457
-									}
458
-								}
459
-								$dir->close();
460
-								?>
457
+                                    }
458
+                                }
459
+                                $dir->close();
460
+                                ?>
461 461
 							</select></td>
462 462
 					</tr>
463 463
 					<tr>
@@ -532,22 +532,22 @@  discard block
 block discarded – undo
532 532
 						<td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());">
533 533
 								<option value=""></option>
534 534
 								<?php
535
-								$dir = dir("media/style/");
536
-								while($file = $dir->read()) {
537
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538
-										$themename = $file;
539
-										if($themename === 'common') {
540
-											continue;
541
-										}
542
-										$attr = 'value="' . $themename . '" ';
543
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544
-											$attr .= 'selected="selected" ';
545
-										}
546
-										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
547
-									}
548
-								}
549
-								$dir->close();
550
-								?>
535
+                                $dir = dir("media/style/");
536
+                                while($file = $dir->read()) {
537
+                                    if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538
+                                        $themename = $file;
539
+                                        if($themename === 'common') {
540
+                                            continue;
541
+                                        }
542
+                                        $attr = 'value="' . $themename . '" ';
543
+                                        if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544
+                                            $attr .= 'selected="selected" ';
545
+                                        }
546
+                                        echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
547
+                                    }
548
+                                }
549
+                                $dir->close();
550
+                                ?>
551 551
 							</select>
552 552
 							<input type="hidden" name="theme_refresher" value=""></td>
553 553
 					</tr>
@@ -583,15 +583,15 @@  discard block
 block discarded – undo
583 583
 						<th><?php echo $_lang["which_browser_title"] ?></th>
584 584
 						<td><select name="which_browser" class="inputBox" onChange="documentDirty=true;">
585 585
 								<?php
586
-								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
-								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589
-									$dir = str_replace('\\', '/', $dir);
590
-									$browser_name = substr($dir, strrpos($dir, '/') + 1);
591
-									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
-									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
593
-								}
594
-								?>
586
+                                $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
+                                echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
+                                foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589
+                                    $dir = str_replace('\\', '/', $dir);
590
+                                    $browser_name = substr($dir, strrpos($dir, '/') + 1);
591
+                                    $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
+                                    echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
593
+                                }
594
+                                ?>
595 595
 							</select></td>
596 596
 					</tr>
597 597
 					<tr>
@@ -668,17 +668,17 @@  discard block
 block discarded – undo
668 668
 								<option value=""></option>
669 669
 								<?php
670 670
 
671
-								$edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672
-								// invoke OnRichTextEditorRegister event
673
-								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
-								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
-								if(is_array($evtOut)) {
676
-									for($i = 0; $i < count($evtOut); $i++) {
677
-										$editor = $evtOut[$i];
678
-										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
679
-									}
680
-								}
681
-								?>
671
+                                $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672
+                                // invoke OnRichTextEditorRegister event
673
+                                $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
+                                echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
+                                if(is_array($evtOut)) {
676
+                                    for($i = 0; $i < count($evtOut); $i++) {
677
+                                        $editor = $evtOut[$i];
678
+                                        echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
679
+                                    }
680
+                                }
681
+                                ?>
682 682
 							</select></td>
683 683
 					</tr>
684 684
 					<tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>">
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
 					</tr>
712 712
 				</table>
713 713
 				<?php
714
-				// invoke OnInterfaceSettingsRender event
715
-				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
-				if(is_array($evtOut)) {
717
-					echo implode("", $evtOut);
718
-				}
719
-				?>
714
+                // invoke OnInterfaceSettingsRender event
715
+                $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
+                if(is_array($evtOut)) {
717
+                    echo implode("", $evtOut);
718
+                }
719
+                ?>
720 720
 			</div>
721 721
 
722 722
 			<!-- Photo -->
@@ -765,39 +765,39 @@  discard block
 block discarded – undo
765 765
 			</div>
766 766
 			<?php if($use_udperms == 1) {
767 767
 
768
-			$groupsarray = array();
769
-
770
-			if($modx->manager->action == '12') { // only do this bit if the user is being edited
771
-				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772
-				$groupsarray = $modx->db->getColumn('user_group', $rs);
773
-			}
774
-			// retain selected doc groups between post
775
-			if(is_array($_POST['user_groups'])) {
776
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777
-			}
778
-			?>
768
+            $groupsarray = array();
769
+
770
+            if($modx->manager->action == '12') { // only do this bit if the user is being edited
771
+                $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772
+                $groupsarray = $modx->db->getColumn('user_group', $rs);
773
+            }
774
+            // retain selected doc groups between post
775
+            if(is_array($_POST['user_groups'])) {
776
+                foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777
+            }
778
+            ?>
779 779
 			<div class="tab-page" id="tabAccess">
780 780
 				<h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2>
781 781
 				<script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script>
782 782
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
783 783
 				<?php
784
-				$rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
-				while($row = $modx->db->getRow($rs)) {
786
-					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
787
-				}
788
-				}
789
-				?>
784
+                $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
+                while($row = $modx->db->getRow($rs)) {
786
+                    echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
787
+                }
788
+                }
789
+                ?>
790 790
 			</div>
791 791
 		</div>
792 792
 	</div>
793 793
 	<input type="submit" name="save" style="display:none">
794 794
 	<?php
795
-	// invoke OnUserFormRender event
796
-	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
797
-		"id" => $user
798
-	));
799
-	if(is_array($evtOut)) {
800
-		echo implode("", $evtOut);
801
-	}
802
-	?>
795
+    // invoke OnUserFormRender event
796
+    $evtOut = $modx->invokeEvent("OnUserFormRender", array(
797
+        "id" => $user
798
+    ));
799
+    if(is_array($evtOut)) {
800
+        echo implode("", $evtOut);
801
+    }
802
+    ?>
803 803
 </form>
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 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 5
 
6
-switch($modx->manager->action) {
6
+switch ($modx->manager->action) {
7 7
 	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
8
+		if (!$modx->hasPermission('edit_user')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
13
+		if (!$modx->hasPermission('new_user')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -18,24 +18,24 @@  discard block
 block discarded – undo
18 18
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 // check to see the snippet editor isn't locked
24
-$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
25
-if($username = $modx->db->getValue($rs)) {
24
+$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
25
+if ($username = $modx->db->getValue($rs)) {
26 26
 	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
27 27
 }
28 28
 // end check for lock
29 29
 
30
-if($modx->manager->action == '12') {
30
+if ($modx->manager->action == '12') {
31 31
 	// get user attribute
32 32
 	$rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33 33
 	$userdata = $modx->db->getRow($rs);
34
-	if(!$userdata) {
34
+	if (!$userdata) {
35 35
 		$modx->webAlertAndQuit("No user returned!");
36 36
 	}
37 37
 
38
-    if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) {
38
+    if ($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) {
39 39
         $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!');
40 40
     }
41 41
 
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 	// get user settings
44 44
 	$rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45 45
 	$usersettings = array();
46
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
46
+	while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47 47
 	// manually extract so that user display settings are not overwritten
48
-	foreach($usersettings as $k => $v) {
49
-		if($k != 'manager_language' && $k != 'manager_theme') {
48
+	foreach ($usersettings as $k => $v) {
49
+		if ($k != 'manager_language' && $k != 'manager_theme') {
50 50
 			${$k} = $v;
51 51
 		}
52 52
 	}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	// get user name
55 55
 	$rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56 56
 	$usernamedata = $modx->db->getRow($rs);
57
-	if(!$usernamedata) {
57
+	if (!$usernamedata) {
58 58
 		$modx->webAlertAndQuit("No user returned while getting username!");
59 59
 	}
60 60
 	$_SESSION['itemname'] = $usernamedata['username'];
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
 }
67 67
 
68 68
 // avoid doubling htmlspecialchars (already encoded in DB)
69
-foreach($userdata as $key => $val) {
69
+foreach ($userdata as $key => $val) {
70 70
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
71 71
 };
72 72
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
73 73
 
74 74
 // restore saved form
75 75
 $formRestored = false;
76
-if($modx->manager->hasFormValues()) {
76
+if ($modx->manager->hasFormValues()) {
77 77
 	$modx->manager->loadFormValues();
78 78
 	// restore post values
79 79
 	$userdata = array_merge($userdata, $_POST);
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 // include the country list language file
89 89
 $_country_lang = array();
90 90
 include_once "lang/country/english_country.inc.php";
91
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
92
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
91
+if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
92
+	include_once "lang/country/".$manager_language."_country.inc.php";
93 93
 }
94 94
 asort($_country_lang);
95 95
 
96 96
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
97
-if($which_browser == 'default') {
97
+if ($which_browser == 'default') {
98 98
 	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
99 99
 }
100 100
 ?>
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			document.userform.save.click();
187 187
 		},
188 188
 		delete: function() {
189
-			<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
189
+			<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
190 190
 			alert("<?php echo $_lang['alert_delete_self']; ?>");
191 191
 			<?php } else { ?>
192 192
 			if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210 210
 		"id" => $user
211 211
 	));
212
-	if(is_array($evtOut)) {
212
+	if (is_array($evtOut)) {
213 213
 		echo implode("", $evtOut);
214 214
 	}
215 215
 	?>
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
219 219
 
220 220
 	<h1>
221
-        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?>
221
+        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?>
222 222
     </h1>
223 223
 
224 224
 	<?php echo $_style['actionbuttons']['dynamic']['user'] ?>
@@ -236,13 +236,13 @@  discard block
 block discarded – undo
236 236
 				<table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser">
237 237
 					<tr>
238 238
 						<td colspan="3"><span id="blocked" class="warning">
239
-							<?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
239
+							<?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
240 240
 								<?php echo $_lang['user_is_blocked']; ?>
241 241
 							<?php } ?>
242 242
 							</span>
243 243
 							<br /></td>
244 244
 					</tr>
245
-					<?php if(!empty($userdata['id'])) { ?>
245
+					<?php if (!empty($userdata['id'])) { ?>
246 246
 						<tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> ">
247 247
 							<td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i>&nbsp;<b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span>
248 248
 								<input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" />
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 						<td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td>
256 256
 					</tr>
257 257
 					<tr>
258
-						<th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th>
258
+						<th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th>
259 259
 						<td>&nbsp;</td>
260 260
 						<td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>>
261 261
 							<input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" />
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 							?>
310 310
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
311 311
 								<?php
312
-								while($row = $modx->db->getRow($rs)) {
313
-									if($modx->manager->action == '11') {
312
+								while ($row = $modx->db->getRow($rs)) {
313
+									if ($modx->manager->action == '11') {
314 314
 										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315 315
 									} else {
316 316
 										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
365 365
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
366 366
 								<?php
367
-								foreach($_country_lang as $key => $country) {
368
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
367
+								foreach ($_country_lang as $key => $country) {
368
+									echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>";
369 369
 								}
370 370
 								?>
371 371
 							</select></td>
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 						<td>&nbsp;</td>
392 392
 						<td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td>
393 393
 					</tr>
394
-					<?php if($modx->manager->action == '12') { ?>
394
+					<?php if ($modx->manager->action == '12') { ?>
395 395
 						<tr>
396 396
 							<th><?php echo $_lang['user_logincount']; ?>:</th>
397 397
 							<td>&nbsp;</td>
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 						</tr>
429 429
 					<?php } ?>
430 430
 				</table>
431
-				<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
431
+				<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
432 432
 					<p><?php echo $_lang['user_edit_self_msg']; ?></p>
433 433
 				<?php } ?>
434 434
 			</div>
@@ -445,8 +445,8 @@  discard block
 block discarded – undo
445 445
 								<?php
446 446
 								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447 447
 								$dir = dir("includes/lang");
448
-								while($file = $dir->read()) {
449
-									if(strpos($file, ".inc.php") > 0) {
448
+								while ($file = $dir->read()) {
449
+									if (strpos($file, ".inc.php") > 0) {
450 450
 										$endpos = strpos($file, ".");
451 451
 										$languagename = substr($file, 0, $endpos);
452 452
 										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
@@ -533,17 +533,17 @@  discard block
 block discarded – undo
533 533
 								<option value=""></option>
534 534
 								<?php
535 535
 								$dir = dir("media/style/");
536
-								while($file = $dir->read()) {
537
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
536
+								while ($file = $dir->read()) {
537
+									if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538 538
 										$themename = $file;
539
-										if($themename === 'common') {
539
+										if ($themename === 'common') {
540 540
 											continue;
541 541
 										}
542
-										$attr = 'value="' . $themename . '" ';
543
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
542
+										$attr = 'value="'.$themename.'" ';
543
+										if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544 544
 											$attr .= 'selected="selected" ';
545 545
 										}
546
-										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
546
+										echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n";
547 547
 									}
548 548
 								}
549 549
 								$dir->close();
@@ -584,12 +584,12 @@  discard block
 block discarded – undo
584 584
 						<td><select name="which_browser" class="inputBox" onChange="documentDirty=true;">
585 585
 								<?php
586 586
 								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
-								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
587
+								echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n";
588
+								foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589 589
 									$dir = str_replace('\\', '/', $dir);
590 590
 									$browser_name = substr($dir, strrpos($dir, '/') + 1);
591 591
 									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
-									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
592
+									echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
593 593
 								}
594 594
 								?>
595 595
 							</select></td>
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 					</tr>
617 617
 					<tr>
618 618
 						<td>&nbsp;</td>
619
-						<td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td>
619
+						<td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td>
620 620
 					</tr>
621 621
 					<tr>
622 622
 						<th><?php echo $_lang["uploadable_media_title"] ?></th>
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 					</tr>
629 629
 					<tr>
630 630
 						<td>&nbsp;</td>
631
-						<td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td>
631
+						<td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td>
632 632
 					</tr>
633 633
 					<tr>
634 634
 						<th><?php echo $_lang["uploadable_flash_title"] ?></th>
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 					</tr>
641 641
 					<tr>
642 642
 						<td>&nbsp;</td>
643
-						<td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td>
643
+						<td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td>
644 644
 					</tr>
645 645
 					<tr>
646 646
 						<th><?php echo $_lang["uploadable_files_title"] ?></th>
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 					</tr>
653 653
 					<tr>
654 654
 						<td>&nbsp;</td>
655
-						<td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td>
655
+						<td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td>
656 656
 					</tr>
657 657
 					<tr class='row2'>
658 658
 						<th><?php echo $_lang["upload_maxsize_title"] ?></th>
@@ -671,11 +671,11 @@  discard block
 block discarded – undo
671 671
 								$edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672 672
 								// invoke OnRichTextEditorRegister event
673 673
 								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
-								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
-								if(is_array($evtOut)) {
676
-									for($i = 0; $i < count($evtOut); $i++) {
674
+								echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n";
675
+								if (is_array($evtOut)) {
676
+									for ($i = 0; $i < count($evtOut); $i++) {
677 677
 										$editor = $evtOut[$i];
678
-										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
678
+										echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n";
679 679
 									}
680 680
 								}
681 681
 								?>
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 				<?php
714 714
 				// invoke OnInterfaceSettingsRender event
715 715
 				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
-				if(is_array($evtOut)) {
716
+				if (is_array($evtOut)) {
717 717
 					echo implode("", $evtOut);
718 718
 				}
719 719
 				?>
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 					function BrowseServer() {
741 741
 						var w = screen.width * 0.7;
742 742
 						var h = screen.height * 0.7;
743
-						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
743
+						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
744 744
 					}
745 745
 
746 746
 					function SetUrl(url, width, height, alt) {
@@ -763,17 +763,17 @@  discard block
 block discarded – undo
763 763
 					</tr>
764 764
 				</table>
765 765
 			</div>
766
-			<?php if($use_udperms == 1) {
766
+			<?php if ($use_udperms == 1) {
767 767
 
768 768
 			$groupsarray = array();
769 769
 
770
-			if($modx->manager->action == '12') { // only do this bit if the user is being edited
770
+			if ($modx->manager->action == '12') { // only do this bit if the user is being edited
771 771
 				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772 772
 				$groupsarray = $modx->db->getColumn('user_group', $rs);
773 773
 			}
774 774
 			// retain selected doc groups between post
775
-			if(is_array($_POST['user_groups'])) {
776
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
775
+			if (is_array($_POST['user_groups'])) {
776
+				foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777 777
 			}
778 778
 			?>
779 779
 			<div class="tab-page" id="tabAccess">
@@ -782,8 +782,8 @@  discard block
 block discarded – undo
782 782
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
783 783
 				<?php
784 784
 				$rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
-				while($row = $modx->db->getRow($rs)) {
786
-					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
785
+				while ($row = $modx->db->getRow($rs)) {
786
+					echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />";
787 787
 				}
788 788
 				}
789 789
 				?>
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
797 797
 		"id" => $user
798 798
 	));
799
-	if(is_array($evtOut)) {
799
+	if (is_array($evtOut)) {
800 800
 		echo implode("", $evtOut);
801 801
 	}
802 802
 	?>
Please login to merge, or discard this patch.
manager/includes/header.inc.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -20,28 +20,28 @@  discard block
 block discarded – undo
20 20
 $body_class = '';
21 21
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
22 22
 if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
23
-    $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
23
+    $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']];
24 24
 } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
25
-    $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
25
+    $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']];
26 26
 }
27 27
 
28
-$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime;
28
+$css = 'media/style/'.$modx->config['manager_theme'].'/style.css?v='.$lastInstallTime;
29 29
 
30 30
 if ($modx->config['manager_theme'] == 'default') {
31
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')
32
-        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
31
+    if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')
32
+        && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) {
33 33
         $files = array(
34
-            'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css',
35
-            'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css',
36
-            'fonts' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css',
37
-            'forms' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css',
38
-            'mainmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css',
39
-            'tree' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css',
40
-            'custom' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css',
41
-            'tabpane' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css',
42
-            'contextmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css',
43
-            'index' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css',
44
-            'main' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'
34
+            'bootstrap' => MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css',
35
+            'font-awesome' => MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css',
36
+            'fonts' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css',
37
+            'forms' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css',
38
+            'mainmenu' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css',
39
+            'tree' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css',
40
+            'custom' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css',
41
+            'tabpane' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css',
42
+            'contextmenu' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css',
43
+            'index' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css',
44
+            'main' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'
45 45
         );
46 46
         $evtOut = $modx->invokeEvent('OnBeforeMinifyCss', array(
47 47
             'files' => $files,
@@ -58,16 +58,16 @@  discard block
 block discarded – undo
58 58
             default:
59 59
                 $modx->webAlertAndQuit(sprintf($_lang['invalid_event_response'], 'OnBeforeMinifyManagerCss'));
60 60
         }
61
-        require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
61
+        require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
62 62
         $minifier = new Formatter\CSSMinify($files);
63 63
         $css = $minifier->minify();
64 64
         file_put_contents(
65
-            MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css',
65
+            MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css',
66 66
             $css
67 67
         );
68 68
     }
69
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
70
-        $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
69
+    if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
70
+        $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime;
71 71
     }
72 72
 }
73 73
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
83 83
     <link rel="stylesheet" type="text/css" href="<?= $css ?>"/>
84 84
     <script type="text/javascript" src="media/script/tabpane.js"></script>
85
-    <?= sprintf('<script type="text/javascript" src="%s"></script>' . "\n", $modx->config['mgr_jquery_path']) ?>
85
+    <?= sprintf('<script type="text/javascript" src="%s"></script>'."\n", $modx->config['mgr_jquery_path']) ?>
86 86
     <?php if ($modx->config['show_picker'] != "0") { ?>
87 87
         <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/color.switcher.js"
88 88
                 type="text/javascript"></script>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     <?php } ?>
96 96
 
97 97
     <!-- OnManagerMainFrameHeaderHTMLBlock -->
98
-    <?= $onManagerMainFrameHeaderHTMLBlock . "\n" ?>
98
+    <?= $onManagerMainFrameHeaderHTMLBlock."\n" ?>
99 99
 
100 100
     <script type="text/javascript">
101 101
       if (!evo) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     <script>
126 126
         <?php
127 127
         if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
128
-            echo 'doRefresh(' . $_REQUEST['r'] . ");\n";
128
+            echo 'doRefresh('.$_REQUEST['r'].");\n";
129 129
         }
130 130
         ?>
131 131
     </script>
Please login to merge, or discard this patch.
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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 />
4 4
     Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
@@ -10,26 +10,26 @@  discard block
 block discarded – undo
10 10
 $modx_textdir = isset($modx_textdir) ? $modx_textdir : null;
11 11
 $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
12 12
 $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr';
13
-if (!isset($modx->config['mgr_jquery_path'])) {
13
+if (!isset($modx->config['mgr_jquery_path'])) {
14 14
     $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js';
15 15
 }
16
-if (!isset($modx->config['mgr_date_picker_path'])) {
16
+if (!isset($modx->config['mgr_date_picker_path'])) {
17 17
     $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php';
18 18
 }
19 19
 
20 20
 $body_class = '';
21 21
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
22
-if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
22
+if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
23 23
     $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
24
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
24
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
25 25
     $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
26 26
 }
27 27
 
28 28
 $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime;
29 29
 
30
-if ($modx->config['manager_theme'] == 'default') {
30
+if ($modx->config['manager_theme'] == 'default') {
31 31
     if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')
32
-        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
32
+        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
33 33
         $files = array(
34 34
             'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css',
35 35
             'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css',
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             'source' => 'manager',
49 49
             'theme' => $modx->config['manager_theme']
50 50
         ));
51
-        switch (true) {
51
+        switch (true) {
52 52
             case empty($evtOut):
53 53
             case is_array($evtOut) && count($evtOut) === 0:
54 54
                 break;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $css
67 67
         );
68 68
     }
69
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
69
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
70 70
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
71 71
     }
72 72
 }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     <script src="media/script/main.js"></script>
125 125
     <script>
126 126
         <?php
127
-        if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
127
+        if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
128 128
             echo 'doRefresh(' . $_REQUEST['r'] . ");\n";
129 129
         }
130 130
         ?>
Please login to merge, or discard this patch.
manager/actions/user_management.static.php 2 patches
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.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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('edit_user')) {
5
+if (!$modx->hasPermission('edit_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $modx->manager->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
 	$query = '';
15 15
 	$_PAGE['vs']['search'] = '';
16 16
 } else {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
 // context menu
28
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
28
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0));
31 31
 $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0));
@@ -121,16 +121,16 @@  discard block
 block discarded – undo
121 121
 				<div class="table-responsive">
122 122
 					<?php
123 123
 					$where = "";
124
-					if(!$modx->hasPermission('save_role')) {
125
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
124
+					if (!$modx->hasPermission('save_role')) {
125
+						$where .= (empty($where) ? "" : " AND ")."mua.role != 1";
126 126
 					}
127
-					if(!empty($sqlQuery)) {
128
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
127
+					if (!empty($sqlQuery)) {
128
+						$where .= (empty($where) ? "" : " AND ")."((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129 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
-			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
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";
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
+			INNER JOIN " . $modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id 
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 134
 					$grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135 135
 					$grd->noRecordMsg = $_lang["no_records_found"];
136 136
 					$grd->cssClass = "table data";
@@ -151,19 +151,19 @@  discard block
 block discarded – undo
151 151
 					$grd->colWidths = "1%,,,,,1%,1%,1%";
152 152
 					$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
153 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>',
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 156
 						'template:[+fullname+]',
157 157
 						'template:[+role+]',
158 158
 						'template:[+email+]',
159
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
159
+						'date: '.$modx->toDateFormat('[+thislogin+]', 'formatOnly').' %H:%M',
160 160
 						'template:[+logincount+]',
161 161
 						'template:[+blocked+]'
162 162
 					));
163
-					if($listmode == '1') {
163
+					if ($listmode == '1') {
164 164
 						$grd->pageSize = 0;
165 165
 					}
166
-					if($_REQUEST['op'] == 'reset') {
166
+					if ($_REQUEST['op'] == 'reset') {
167 167
 						$grd->pageNumber = 1;
168 168
 					}
169 169
 					// render grid
Please login to merge, or discard this patch.