Completed
Push — develop ( 0c91f3...21b315 )
by Agel_Nash
10:05 queued 04:14
created
manager/actions/mutate_user.dynamic.php 1 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.
manager/includes/preload.functions.inc.php 1 patch
Braces   +24 added lines, -20 removed lines patch added patch discarded remove patch
@@ -4,21 +4,21 @@  discard block
 block discarded – undo
4 4
 $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession
5 5
 
6 6
 
7
-if( ! function_exists('evolutionCMS')) {
7
+if( ! function_exists('evolutionCMS')) {
8 8
     /**
9 9
      * @return DocumentParser
10 10
      */
11
-    function evolutionCMS()
12
-    {
13
-        if( ! defined('MODX_CLASS')) {
14
-            if( ! class_exists('DocumentParser')) {
11
+    function evolutionCMS()
12
+    {
13
+        if( ! defined('MODX_CLASS')) {
14
+            if( ! class_exists('DocumentParser')) {
15 15
                 throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists');
16 16
             }
17 17
             define('MODX_CLASS', 'DocumentParser');
18 18
         }
19 19
         
20 20
         global $modx;
21
-        if ($modx === null) {
21
+        if ($modx === null) {
22 22
             $obj = new ReflectionClass(MODX_CLASS);
23 23
             $modx = $obj->newInstanceWithoutConstructor()->getInstance();
24 24
         }
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 /**
30 30
  * @return string
31 31
  */
32
-function genEvoSessionName()
33
-{
32
+function genEvoSessionName()
33
+{
34 34
     $_ = crc32(__FILE__);
35 35
     $_ = sprintf('%u', $_);
36 36
 
@@ -40,10 +40,12 @@  discard block
 block discarded – undo
40 40
 /**
41 41
  * @return void
42 42
  */
43
-function startCMSSession()
44
-{
43
+function startCMSSession()
44
+{
45 45
     global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain;
46
-    if(MODX_CLI) return;
46
+    if(MODX_CLI) {
47
+        return;
48
+    }
47 49
 
48 50
     session_name($site_sessionname);
49 51
     removeInvalidCmsSessionIds($site_sessionname);
@@ -54,14 +56,14 @@  discard block
 block discarded – undo
54 56
     session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true);
55 57
     session_start();
56 58
     $key = "modx.mgr.session.cookie.lifetime";
57
-    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
59
+    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
58 60
         $cookieLifetime = (int)$_SESSION[$key];
59
-        if ($cookieLifetime) {
61
+        if ($cookieLifetime) {
60 62
             $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime;
61 63
         }
62 64
         setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true);
63 65
     }
64
-    if (!isset($_SESSION['modx.session.created.time'])) {
66
+    if (!isset($_SESSION['modx.session.created.time'])) {
65 67
         $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME'];
66 68
     }
67 69
 }
@@ -71,9 +73,9 @@  discard block
 block discarded – undo
71 73
  * @param $session_name
72 74
  * @return void
73 75
  */
74
-function removeInvalidCmsSessionFromStorage(&$storage, $session_name)
75
-{
76
-    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
76
+function removeInvalidCmsSessionFromStorage(&$storage, $session_name)
77
+{
78
+    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
77 79
         unset($storage[$session_name]);
78 80
     }
79 81
 }
@@ -82,9 +84,11 @@  discard block
 block discarded – undo
82 84
  * @param $session_name
83 85
  * @return void
84 86
  */
85
-function removeInvalidCmsSessionIds($session_name)
86
-{
87
-    if(MODX_CLI) return;
87
+function removeInvalidCmsSessionIds($session_name)
88
+{
89
+    if(MODX_CLI) {
90
+        return;
91
+    }
88 92
     // session ids is invalid iff it is empty string
89 93
     // storage priorioty can see in PHP source ext/session/session.c
90 94
     removeInvalidCmsSessionFromStorage($_COOKIE, $session_name);
Please login to merge, or discard this patch.