Completed
Push — 1.11.x ( 683301...61da54 )
by José
78:34 queued 46:29
created
main/admin/ldap_synchro.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,8 +118,7 @@
 block discarded – undo
118 118
 		if (isset($included) && ($included))
119 119
 		{
120 120
 			$message .= "> $name_session: ".count($UserAdd)." ".get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified').'<br/>';
121
-		}
122
-		else
121
+		} else
123 122
 		{
124 123
 			print "> $name_session: ".count($UserAdd).get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified')."\n";
125 124
 		}
Please login to merge, or discard this patch.
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -44,121 +44,121 @@
 block discarded – undo
44 44
 $users=Database::store_result($result);
45 45
 
46 46
 foreach($Sessions as $session){
47
-	$id_session = $session['id'];
48
-	$name_session = $session['name'];
49
-	$UserList=array();
50
-	$UserUpdate=array();
51
-	$UserAdd=array();
47
+    $id_session = $session['id'];
48
+    $name_session = $session['name'];
49
+    $UserList=array();
50
+    $UserUpdate=array();
51
+    $UserAdd=array();
52 52
 
53
-	// Parse des code etape de la session
54
-	/*
53
+    // Parse des code etape de la session
54
+    /*
55 55
 	$sql = "SELECT  id_session, code_etape, etape_description, code_ufr, annee
56 56
 		FROM $tbl_session_rel_etape
57 57
 		WHERE id_session='$id_session'
58 58
 		ORDER BY code_ufr, code_etape";
59 59
 	$result = Database::query($sql);
60 60
 	*/
61
-	$ds = ldap_connect($ldap_host, $ldap_port) or die(get_lang('LDAPConnectionError'));
62
-	ldap_set_version($ds);
63
-	// Import des utilisateurs des etapes dans la session
64
-	if ($ds)
65
-	{
66
-		$r = false;
67
-		$res = ldap_handle_bind($ds, $r);
68
-		$UserList=array();
69
-		if($result !== false)
70
-		{
71
-			//while($row = Database::fetch_array($result))
72
-			//{
73
-				/*
61
+    $ds = ldap_connect($ldap_host, $ldap_port) or die(get_lang('LDAPConnectionError'));
62
+    ldap_set_version($ds);
63
+    // Import des utilisateurs des etapes dans la session
64
+    if ($ds)
65
+    {
66
+        $r = false;
67
+        $res = ldap_handle_bind($ds, $r);
68
+        $UserList=array();
69
+        if($result !== false)
70
+        {
71
+            //while($row = Database::fetch_array($result))
72
+            //{
73
+                /*
74 74
 				$annee = $row['annee'];
75 75
 				$code_ufr = $row['code_ufr'];
76 76
 				$etape = $row['code_etape'];
77 77
 				*/
78
-				// LDAP Query
79
-				// edupersonorgunitdn=ou=12CI1,ou=2006,ou=diploma,o=Paris1,dc=univ-paris1,dc=fr
80
-				//etapescommented
81
-				//$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "edupersonorgunitdn=ou=$etape,ou=$annee,ou=diploma,$LDAPbasedn");
82
-				$sr = @ ldap_search($ds, $ldap_basedn, '(uid=*)');
83
-				$info = ldap_get_entries($ds, $sr);
84
-				for ($key = 0; $key < $info["count"]; $key ++)
85
-				{
86
-					echo "<pre>";
87
-					print_r($info[$key]);
88
-					echo "</pre>";
89
-					$lastname = api_utf8_decode($info[$key]["sn"][0]);
90
-					$firstname = api_utf8_decode($info[$key]["givenname"][0]);
91
-					$email = $info[$key]["mail"][0];
92
-					// Get uid from dn
93
-					$dn_array=ldap_explode_dn($info[$key]["dn"],1);
94
-					$username = $dn_array[0]; // uid is first key
95
-					$outab[] = $info[$key]["edupersonprimaryaffiliation"][0]; // Ici "student"
96
-					$val = ldap_get_values_len($ds, $sr, "userPassword");
97
-					$password = $val[0];
98
-					// Pour faciliter la gestion on ajoute le code "etape-annee"
99
-					$official_code=$etape."-".$annee;
100
-					$auth_source="ldap";
101
-					// Pas de date d'expiration d'etudiant (a recuperer par rapport au shadow expire LDAP)
102
-					$expiration_date='';
103
-					$active=1;
104
-					// Ajout de l'utilisateur
105
-					if (UserManager::is_username_available($username)) {
106
-						$user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active);
107
-						$UserAdd[]=$user_id;
108
-					} else {
109
-						$user = api_get_user_info_from_username($username);
110
-						$user_id=$user['user_id'];
111
-						UserManager::update_user($user_id, $firstname, $lastname, $username, null, null, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active);
112
-						$UserUpdate[]=$user_id;
113
-					}
114
-					$UserList[]=$user_id;
115
-				}
116
-			//}
117
-		}
118
-		if (isset($included) && ($included))
119
-		{
120
-			$message .= "> $name_session: ".count($UserAdd)." ".get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified').'<br/>';
121
-		}
122
-		else
123
-		{
124
-			print "> $name_session: ".count($UserAdd).get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified')."\n";
125
-		}
78
+                // LDAP Query
79
+                // edupersonorgunitdn=ou=12CI1,ou=2006,ou=diploma,o=Paris1,dc=univ-paris1,dc=fr
80
+                //etapescommented
81
+                //$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "edupersonorgunitdn=ou=$etape,ou=$annee,ou=diploma,$LDAPbasedn");
82
+                $sr = @ ldap_search($ds, $ldap_basedn, '(uid=*)');
83
+                $info = ldap_get_entries($ds, $sr);
84
+                for ($key = 0; $key < $info["count"]; $key ++)
85
+                {
86
+                    echo "<pre>";
87
+                    print_r($info[$key]);
88
+                    echo "</pre>";
89
+                    $lastname = api_utf8_decode($info[$key]["sn"][0]);
90
+                    $firstname = api_utf8_decode($info[$key]["givenname"][0]);
91
+                    $email = $info[$key]["mail"][0];
92
+                    // Get uid from dn
93
+                    $dn_array=ldap_explode_dn($info[$key]["dn"],1);
94
+                    $username = $dn_array[0]; // uid is first key
95
+                    $outab[] = $info[$key]["edupersonprimaryaffiliation"][0]; // Ici "student"
96
+                    $val = ldap_get_values_len($ds, $sr, "userPassword");
97
+                    $password = $val[0];
98
+                    // Pour faciliter la gestion on ajoute le code "etape-annee"
99
+                    $official_code=$etape."-".$annee;
100
+                    $auth_source="ldap";
101
+                    // Pas de date d'expiration d'etudiant (a recuperer par rapport au shadow expire LDAP)
102
+                    $expiration_date='';
103
+                    $active=1;
104
+                    // Ajout de l'utilisateur
105
+                    if (UserManager::is_username_available($username)) {
106
+                        $user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active);
107
+                        $UserAdd[]=$user_id;
108
+                    } else {
109
+                        $user = api_get_user_info_from_username($username);
110
+                        $user_id=$user['user_id'];
111
+                        UserManager::update_user($user_id, $firstname, $lastname, $username, null, null, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active);
112
+                        $UserUpdate[]=$user_id;
113
+                    }
114
+                    $UserList[]=$user_id;
115
+                }
116
+            //}
117
+        }
118
+        if (isset($included) && ($included))
119
+        {
120
+            $message .= "> $name_session: ".count($UserAdd)." ".get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified').'<br/>';
121
+        }
122
+        else
123
+        {
124
+            print "> $name_session: ".count($UserAdd).get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified')."\n";
125
+        }
126 126
 
127
-		// Une fois les utilisateurs importer dans la base des utilisateurs, on peux les affecter la session
128
-		$result=Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'");
129
-		$CourseList=array();
130
-		while($row=Database::fetch_array($result)) {
131
-			$CourseList[]= $row['c_id'];
132
-		}
127
+        // Une fois les utilisateurs importer dans la base des utilisateurs, on peux les affecter la session
128
+        $result=Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'");
129
+        $CourseList=array();
130
+        while($row=Database::fetch_array($result)) {
131
+            $CourseList[]= $row['c_id'];
132
+        }
133 133
 
134
-		foreach ($CourseList as $enreg_course) {
135
-			// On ajoute la relation entre l'utilisateur et le cours
136
-			foreach ($UserList as $enreg_user) {
137
-				$sql = "INSERT IGNORE INTO $tbl_session_rel_course_rel_user(session_id,c_id,user_id)
134
+        foreach ($CourseList as $enreg_course) {
135
+            // On ajoute la relation entre l'utilisateur et le cours
136
+            foreach ($UserList as $enreg_user) {
137
+                $sql = "INSERT IGNORE INTO $tbl_session_rel_course_rel_user(session_id,c_id,user_id)
138 138
 						VALUES('$id_session','$enreg_course','$enreg_user')";
139
-				Database::query($sql);
140
-			}
141
-			$sql = "SELECT COUNT(user_id) as nbUsers " .
142
-					"FROM $tbl_session_rel_course_rel_user " .
143
-					"WHERE session_id='$id_session' AND c_id='$enreg_course'";
144
-			$rs = Database::query($sql);
145
-			list($nbr_users) = Database::fetch_array($rs);
146
-			$sql = "UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users
139
+                Database::query($sql);
140
+            }
141
+            $sql = "SELECT COUNT(user_id) as nbUsers " .
142
+                    "FROM $tbl_session_rel_course_rel_user " .
143
+                    "WHERE session_id='$id_session' AND c_id='$enreg_course'";
144
+            $rs = Database::query($sql);
145
+            list($nbr_users) = Database::fetch_array($rs);
146
+            $sql = "UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users
147 147
 					WHERE session_id='$id_session' AND c_id = '$enreg_course'";
148
-			Database::query($sql);
149
-		}
150
-		// On ajoute la relation entre l'utilisateur et la session
151
-		foreach($UserList as $enreg_user){
152
-			$sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) " .
153
-					"VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')";
154
-			Database::query($sql);
155
-		}
156
-		$sql = "SELECT COUNT(user_id) as nbUsers " .
157
-				"FROM $tbl_session_rel_user " .
158
-				"WHERE session_id='$id_session' AND relation_type<>".SESSION_RELATION_TYPE_RRHH."";
159
-		$rs = Database::query($sql);
160
-		list($nbr_users) = Database::fetch_array($rs);
161
-		$sql = "UPDATE $tbl_session SET nbr_users=$nbr_users WHERE id='$id_session'";
162
-		Database::query($sql);
163
-	}
148
+            Database::query($sql);
149
+        }
150
+        // On ajoute la relation entre l'utilisateur et la session
151
+        foreach($UserList as $enreg_user){
152
+            $sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) " .
153
+                    "VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')";
154
+            Database::query($sql);
155
+        }
156
+        $sql = "SELECT COUNT(user_id) as nbUsers " .
157
+                "FROM $tbl_session_rel_user " .
158
+                "WHERE session_id='$id_session' AND relation_type<>".SESSION_RELATION_TYPE_RRHH."";
159
+        $rs = Database::query($sql);
160
+        list($nbr_users) = Database::fetch_array($rs);
161
+        $sql = "UPDATE $tbl_session SET nbr_users=$nbr_users WHERE id='$id_session'";
162
+        Database::query($sql);
163
+    }
164 164
 }
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -8,47 +8,47 @@  discard block
 block discarded – undo
8 8
  */
9 9
 exit(); //not yet functional, needs to be revised
10 10
 
11
-$cidReset=true;
11
+$cidReset = true;
12 12
 
13 13
 require('../inc/global.inc.php');
14 14
 $libpath = api_get_path(LIBRARY_PATH);
15 15
 require_once('../auth/ldap/authldap.php');
16
-$annee_base=date('Y');
16
+$annee_base = date('Y');
17 17
 // setting the section (for the tabs)
18 18
 $this_section = SECTION_PLATFORM_ADMIN;
19 19
 //api_protect_admin_script(); // on vire la secu... qui n'a pas lieu d'etre ici (script de synchro)
20 20
 
21 21
 // setting breadcrumbs
22
-$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
23
-$interbreadcrumb[]=array('url' => api_get_self(),"name" => "Liste des sessions");
22
+$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin'));
23
+$interbreadcrumb[] = array('url' => api_get_self(), "name" => "Liste des sessions");
24 24
 
25 25
 // Database Table Definitions
26 26
 $tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION);
27
-$tbl_session_rel_class				= Database::get_main_table(TABLE_MAIN_SESSION_CLASS);
28
-$tbl_session_rel_course				= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
29
-$tbl_session_rel_course_rel_user	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
30
-$tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE);
31
-$tbl_user							= Database::get_main_table(TABLE_MAIN_USER);
32
-$tbl_session_rel_user				= Database::get_main_table(TABLE_MAIN_SESSION_USER);
33
-$tbl_class							= Database::get_main_table(TABLE_MAIN_CLASS);
34
-$tbl_class_user						= Database::get_main_table(TABLE_MAIN_CLASS_USER);
27
+$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS);
28
+$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
29
+$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
30
+$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
31
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
32
+$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
33
+$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS);
34
+$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER);
35 35
 
36
-$tbl_session_rel_etape 				= "session_rel_etape";
36
+$tbl_session_rel_etape = "session_rel_etape";
37 37
 
38
-$message="";
38
+$message = "";
39 39
 
40
-$result=Database::query("SELECT id, name FROM $tbl_session");
41
-$Sessions=Database::store_result($result);
40
+$result = Database::query("SELECT id, name FROM $tbl_session");
41
+$Sessions = Database::store_result($result);
42 42
 
43
-$result=Database::query($sql);
44
-$users=Database::store_result($result);
43
+$result = Database::query($sql);
44
+$users = Database::store_result($result);
45 45
 
46
-foreach($Sessions as $session){
46
+foreach ($Sessions as $session) {
47 47
 	$id_session = $session['id'];
48 48
 	$name_session = $session['name'];
49
-	$UserList=array();
50
-	$UserUpdate=array();
51
-	$UserAdd=array();
49
+	$UserList = array();
50
+	$UserUpdate = array();
51
+	$UserAdd = array();
52 52
 
53 53
 	// Parse des code etape de la session
54 54
 	/*
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	{
66 66
 		$r = false;
67 67
 		$res = ldap_handle_bind($ds, $r);
68
-		$UserList=array();
69
-		if($result !== false)
68
+		$UserList = array();
69
+		if ($result !== false)
70 70
 		{
71 71
 			//while($row = Database::fetch_array($result))
72 72
 			//{
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 				//$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "edupersonorgunitdn=ou=$etape,ou=$annee,ou=diploma,$LDAPbasedn");
82 82
 				$sr = @ ldap_search($ds, $ldap_basedn, '(uid=*)');
83 83
 				$info = ldap_get_entries($ds, $sr);
84
-				for ($key = 0; $key < $info["count"]; $key ++)
84
+				for ($key = 0; $key < $info["count"]; $key++)
85 85
 				{
86 86
 					echo "<pre>";
87 87
 					print_r($info[$key]);
@@ -90,28 +90,28 @@  discard block
 block discarded – undo
90 90
 					$firstname = api_utf8_decode($info[$key]["givenname"][0]);
91 91
 					$email = $info[$key]["mail"][0];
92 92
 					// Get uid from dn
93
-					$dn_array=ldap_explode_dn($info[$key]["dn"],1);
93
+					$dn_array = ldap_explode_dn($info[$key]["dn"], 1);
94 94
 					$username = $dn_array[0]; // uid is first key
95 95
 					$outab[] = $info[$key]["edupersonprimaryaffiliation"][0]; // Ici "student"
96 96
 					$val = ldap_get_values_len($ds, $sr, "userPassword");
97 97
 					$password = $val[0];
98 98
 					// Pour faciliter la gestion on ajoute le code "etape-annee"
99
-					$official_code=$etape."-".$annee;
100
-					$auth_source="ldap";
99
+					$official_code = $etape."-".$annee;
100
+					$auth_source = "ldap";
101 101
 					// Pas de date d'expiration d'etudiant (a recuperer par rapport au shadow expire LDAP)
102
-					$expiration_date='';
103
-					$active=1;
102
+					$expiration_date = '';
103
+					$active = 1;
104 104
 					// Ajout de l'utilisateur
105 105
 					if (UserManager::is_username_available($username)) {
106
-						$user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active);
107
-						$UserAdd[]=$user_id;
106
+						$user_id = UserManager::create_user($firstname, $lastname, $status, $email, $username, $password, $official_code, api_get_setting('platformLanguage'), $phone, $picture_uri, $auth_source, $expiration_date, $active);
107
+						$UserAdd[] = $user_id;
108 108
 					} else {
109 109
 						$user = api_get_user_info_from_username($username);
110
-						$user_id=$user['user_id'];
110
+						$user_id = $user['user_id'];
111 111
 						UserManager::update_user($user_id, $firstname, $lastname, $username, null, null, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active);
112
-						$UserUpdate[]=$user_id;
112
+						$UserUpdate[] = $user_id;
113 113
 					}
114
-					$UserList[]=$user_id;
114
+					$UserList[] = $user_id;
115 115
 				}
116 116
 			//}
117 117
 		}
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
 		}
126 126
 
127 127
 		// Une fois les utilisateurs importer dans la base des utilisateurs, on peux les affecter la session
128
-		$result=Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'");
129
-		$CourseList=array();
130
-		while($row=Database::fetch_array($result)) {
131
-			$CourseList[]= $row['c_id'];
128
+		$result = Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'");
129
+		$CourseList = array();
130
+		while ($row = Database::fetch_array($result)) {
131
+			$CourseList[] = $row['c_id'];
132 132
 		}
133 133
 
134 134
 		foreach ($CourseList as $enreg_course) {
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 						VALUES('$id_session','$enreg_course','$enreg_user')";
139 139
 				Database::query($sql);
140 140
 			}
141
-			$sql = "SELECT COUNT(user_id) as nbUsers " .
142
-					"FROM $tbl_session_rel_course_rel_user " .
141
+			$sql = "SELECT COUNT(user_id) as nbUsers ".
142
+					"FROM $tbl_session_rel_course_rel_user ".
143 143
 					"WHERE session_id='$id_session' AND c_id='$enreg_course'";
144 144
 			$rs = Database::query($sql);
145 145
 			list($nbr_users) = Database::fetch_array($rs);
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
 			Database::query($sql);
149 149
 		}
150 150
 		// On ajoute la relation entre l'utilisateur et la session
151
-		foreach($UserList as $enreg_user){
152
-			$sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) " .
153
-					"VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')";
151
+		foreach ($UserList as $enreg_user) {
152
+			$sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) ".
153
+					"VALUES('$id_session','$enreg_user', '".api_get_utc_datetime()."')";
154 154
 			Database::query($sql);
155 155
 		}
156
-		$sql = "SELECT COUNT(user_id) as nbUsers " .
157
-				"FROM $tbl_session_rel_user " .
156
+		$sql = "SELECT COUNT(user_id) as nbUsers ".
157
+				"FROM $tbl_session_rel_user ".
158 158
 				"WHERE session_id='$id_session' AND relation_type<>".SESSION_RELATION_TYPE_RRHH."";
159 159
 		$rs = Database::query($sql);
160 160
 		list($nbr_users) = Database::fetch_array($rs);
Please login to merge, or discard this patch.
main/admin/skill_badge.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@
 block discarded – undo
23 23
 
24 24
 $interbreadcrumb = array(
25 25
     array(
26
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php',
26
+        'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
27 27
         'name' => get_lang('Administration')
28 28
     )
29 29
 );
30 30
 
31 31
 $toolbar = Display::toolbarButton(
32 32
     get_lang('ManageSkills'),
33
-    api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php',
33
+    api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
34 34
     'list',
35 35
     'primary',
36 36
     ['title' => get_lang('ManageSkills')]
Please login to merge, or discard this patch.
main/admin/user_import.php 2 patches
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -505,8 +505,14 @@
 block discarded – undo
505 505
     <p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
506 506
     <blockquote>
507 507
 <pre>
508
-<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) echo implode(';', $list).';'; ?></span>Courses;ClassId;
509
-<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br />
508
+<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) {
509
+    echo implode(';', $list).';';
510
+}
511
+?></span>Courses;ClassId;
512
+<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) {
513
+    echo implode(';', $list_reponse).';';
514
+}
515
+?></span>xxx1|xxx2|xxx3;1;<br />
510 516
 </pre>
511 517
 </blockquote>
512 518
 <p><?php echo get_lang('XMLMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     global $current_tag;
281 281
     switch ($data) {
282 282
         case 'Contact':
283
-            $user = array ();
283
+            $user = array();
284 284
             break;
285 285
         default:
286 286
             $current_tag = $data;
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
     $allowed_file_mimetype = array('csv', 'xml');
374 374
     $error_kind_file = false;
375 375
 
376
-    $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] :null;
376
+    $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] : null;
377 377
 
378 378
     $uploadInfo = pathinfo($_FILES['import_file']['name']);
379 379
     $ext_import_file = $uploadInfo['extension'];
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         if (strcmp($file_type, 'csv') === 0 &&
383 383
             $ext_import_file == $allowed_file_mimetype[0]
384 384
         ) {
385
-            $users	= parse_csv_data($_FILES['import_file']['tmp_name']);
385
+            $users = parse_csv_data($_FILES['import_file']['tmp_name']);
386 386
             $errors = validate_data($users, $checkUniqueEmail);
387 387
             $error_kind_file = false;
388 388
         } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
Please login to merge, or discard this patch.
main/admin/ldap_users_list.php 3 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 }
31 31
 */
32 32
 
33
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
33
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
34 34
 $tool_name = get_lang('SearchLDAPUsers');
35 35
 //Display :: display_header($tool_name); //cannot display now as we need to redirect
36 36
 //api_display_tool_title($tool_name);
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 if (isset ($_GET['action']))
39 39
 {
40 40
 	$check = Security::check_token('get');
41
-	if($check)
41
+	if ($check)
42 42
 	{
43 43
 		switch ($_GET['action'])
44 44
 		{
@@ -59,41 +59,41 @@  discard block
 block discarded – undo
59 59
 				break;
60 60
 			case 'lock' :
61 61
 				Display :: display_header($tool_name);
62
-				$message=lock_unlock_user('lock',$_GET['user_id']);
62
+				$message = lock_unlock_user('lock', $_GET['user_id']);
63 63
 				Display :: display_normal_message($message);
64 64
 				break;
65 65
 			case 'unlock';
66 66
 				Display :: display_header($tool_name);
67
-				$message=lock_unlock_user('unlock',$_GET['user_id']);
67
+				$message = lock_unlock_user('unlock', $_GET['user_id']);
68 68
 				Display :: display_normal_message($message);
69 69
 				break;
70 70
 			case 'add_user';
71
-				$id=$_GET['id'];
72
-				$UserList=array();
71
+				$id = $_GET['id'];
72
+				$UserList = array();
73 73
 				$userid_match_login = array();
74 74
 				foreach ($id as $user_id) {
75 75
 					$tmp = ldap_add_user($user_id);
76
-					$UserList[]= $tmp;
76
+					$UserList[] = $tmp;
77 77
 					$userid_match_login[$tmp] = $user_id;
78 78
 				}
79
-				if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) {
79
+				if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session'] > 0)) {
80 80
 					ldap_add_user_to_session($UserList, $_GET['id_session']);
81 81
 					header('Location: resume_session.php?id_session='.$_GET['id_session']);
82 82
 				} else {
83 83
 					Display :: display_header($tool_name);
84
-					if(count($userid_match_login)>0)
84
+					if (count($userid_match_login) > 0)
85 85
 					{
86
-						$message=get_lang('LDAPUsersAddedOrUpdated').':<br />';
87
-						foreach($userid_match_login as $user_id => $login)
86
+						$message = get_lang('LDAPUsersAddedOrUpdated').':<br />';
87
+						foreach ($userid_match_login as $user_id => $login)
88 88
 						{
89 89
 							$message .= '- '.$login.'<br />';
90 90
 						}
91 91
 					}
92 92
 					else
93 93
 					{
94
-						$message=get_lang('NoUserAdded');
94
+						$message = get_lang('NoUserAdded');
95 95
 					}
96
-					Display :: display_normal_message($message,false);
96
+					Display :: display_normal_message($message, false);
97 97
 				}
98 98
 				break;
99 99
 			default :
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 if (isset ($_POST['action']))
114 114
 {
115 115
 	$check = Security::check_token('get');
116
-	if($check)
116
+	if ($check)
117 117
 	{
118 118
 		switch ($_POST['action'])
119 119
 		{
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
 				$number_of_deleted_users = 0;
123 123
 				foreach ($_POST['id'] as $index => $user_id)
124 124
 				{
125
-					if($user_id != $_user['user_id'])
125
+					if ($user_id != $_user['user_id'])
126 126
 					{
127
-						if(UserManager :: delete_user($user_id))
127
+						if (UserManager :: delete_user($user_id))
128 128
 						{
129 129
 							$number_of_deleted_users++;
130 130
 						}
131 131
 					}
132 132
 				}
133
-				if($number_of_selected_users == $number_of_deleted_users)
133
+				if ($number_of_selected_users == $number_of_deleted_users)
134 134
 				{
135 135
 					Display :: display_normal_message(get_lang('SelectedUsersDeleted'));
136 136
 				}
@@ -142,17 +142,17 @@  discard block
 block discarded – undo
142 142
 			case 'add_user' :
143 143
 				$number_of_selected_users = count($_POST['id']);
144 144
 				$number_of_added_users = 0;
145
-				$UserList=array();
145
+				$UserList = array();
146 146
 				foreach ($_POST['id'] as $index => $user_id)
147 147
 				{
148
-					if($user_id != $_user['user_id'])
148
+					if ($user_id != $_user['user_id'])
149 149
 					{
150 150
 						$UserList[] = ldap_add_user($user_id);
151 151
 					}
152 152
 				}
153
-				if (isset($_GET['id_session']) && (trim($_GET['id_session'])!=""))
153
+				if (isset($_GET['id_session']) && (trim($_GET['id_session']) != ""))
154 154
 					addUserToSession($UserList, $_GET['id_session']);
155
-				if(count($UserList)>0)
155
+				if (count($UserList) > 0)
156 156
 				{
157 157
 					Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded'));
158 158
 				}
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	}
168 168
 }
169 169
 
170
-$form = new FormValidator('advanced_search','get');
171
-$form->addText('keyword_username',get_lang('LoginName'),false);
170
+$form = new FormValidator('advanced_search', 'get');
171
+$form->addText('keyword_username', get_lang('LoginName'), false);
172 172
 if (api_is_western_name_order())
173 173
 {
174 174
 	$form->addText('keyword_firstname', get_lang('FirstName'), false);
@@ -176,20 +176,20 @@  discard block
 block discarded – undo
176 176
 }
177 177
 else
178 178
 {
179
-	$form->addText('keyword_lastname',get_lang('LastName'),false);
180
-	$form->addText('keyword_firstname',get_lang('FirstName'),false);
179
+	$form->addText('keyword_lastname', get_lang('LastName'), false);
180
+	$form->addText('keyword_firstname', get_lang('FirstName'), false);
181 181
 }
182 182
 if (isset($_GET['id_session']))
183
-	$form->addElement('hidden','id_session',$_GET['id_session']);
183
+	$form->addElement('hidden', 'id_session', $_GET['id_session']);
184 184
 
185 185
 $type = array();
186 186
 $type["all"] = get_lang('All');
187
-$type["employee"]  = get_lang('Teacher');
187
+$type["employee"] = get_lang('Teacher');
188 188
 $type["student"] = get_lang('Student');
189 189
 
190
-$form->addElement('select','keyword_type',get_lang('Status'),$type);
190
+$form->addElement('select', 'keyword_type', get_lang('Status'), $type);
191 191
 // Structure a rajouer ??
192
-$form->addElement('submit','submit',get_lang('Ok'));
192
+$form->addElement('submit', 'submit', get_lang('Ok'));
193 193
 //$defaults['keyword_active'] = 1;
194 194
 //$defaults['keyword_inactive'] = 1;
195 195
 //$form->setDefaults($defaults);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 //$table->set_column_filter(5, 'email_filter');
226 226
 //$table->set_column_filter(5, 'active_filter');
227 227
 $table->set_column_filter(5, 'modify_filter');
228
-$table->set_form_actions(array ('add_user' => get_lang('AddLDAPUsers')));
228
+$table->set_form_actions(array('add_user' => get_lang('AddLDAPUsers')));
229 229
 $table->display();
230 230
 
231 231
 /*
Please login to merge, or discard this patch.
Braces   +15 added lines, -20 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@  discard block
 block discarded – undo
51 51
 				if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id']))
52 52
 				{
53 53
 					Display :: display_normal_message(get_lang('UserDeleted'));
54
-				}
55
-				else
54
+				} else
56 55
 				{
57 56
 					Display :: display_error_message(get_lang('CannotDeleteUser'));
58 57
 				}
@@ -88,8 +87,7 @@  discard block
 block discarded – undo
88 87
 						{
89 88
 							$message .= '- '.$login.'<br />';
90 89
 						}
91
-					}
92
-					else
90
+					} else
93 91
 					{
94 92
 						$message=get_lang('NoUserAdded');
95 93
 					}
@@ -100,13 +98,11 @@  discard block
 block discarded – undo
100 98
 				Display :: display_header($tool_name);
101 99
 		}
102 100
 		Security::clear_token();
103
-	}
104
-	else
101
+	} else
105 102
 	{
106 103
 		Display::display_header($tool_name);
107 104
 	}
108
-}
109
-else
105
+} else
110 106
 {
111 107
 	Display::display_header($tool_name);
112 108
 }
@@ -133,8 +129,7 @@  discard block
 block discarded – undo
133 129
 				if($number_of_selected_users == $number_of_deleted_users)
134 130
 				{
135 131
 					Display :: display_normal_message(get_lang('SelectedUsersDeleted'));
136
-				}
137
-				else
132
+				} else
138 133
 				{
139 134
 					Display :: display_error_message(get_lang('SomeUsersNotDeleted'));
140 135
 				}
@@ -150,13 +145,13 @@  discard block
 block discarded – undo
150 145
 						$UserList[] = ldap_add_user($user_id);
151 146
 					}
152 147
 				}
153
-				if (isset($_GET['id_session']) && (trim($_GET['id_session'])!=""))
154
-					addUserToSession($UserList, $_GET['id_session']);
148
+				if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) {
149
+									addUserToSession($UserList, $_GET['id_session']);
150
+				}
155 151
 				if(count($UserList)>0)
156 152
 				{
157 153
 					Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded'));
158
-				}
159
-				else
154
+				} else
160 155
 				{
161 156
 					Display :: display_normal_message(get_lang('NoUserAdded'));
162 157
 				}
@@ -173,14 +168,14 @@  discard block
 block discarded – undo
173 168
 {
174 169
 	$form->addText('keyword_firstname', get_lang('FirstName'), false);
175 170
 	$form->addText('keyword_lastname', get_lang('LastName'), false);
176
-}
177
-else
171
+} else
178 172
 {
179 173
 	$form->addText('keyword_lastname',get_lang('LastName'),false);
180 174
 	$form->addText('keyword_firstname',get_lang('FirstName'),false);
181 175
 }
182
-if (isset($_GET['id_session']))
176
+if (isset($_GET['id_session'])) {
183 177
 	$form->addElement('hidden','id_session',$_GET['id_session']);
178
+}
184 179
 
185 180
 $type = array();
186 181
 $type["all"] = get_lang('All');
@@ -201,8 +196,9 @@  discard block
 block discarded – undo
201 196
 $parameters['keyword_firstname'] = @$_GET['keyword_firstname'] ?: null;
202 197
 $parameters['keyword_lastname'] = @$_GET['keyword_lastname'] ?: null;
203 198
 $parameters['keyword_email'] = @$_GET['keyword_email'] ?: null;
204
-if (isset($_GET['id_session']))
199
+if (isset($_GET['id_session'])) {
205 200
 	$parameters['id_session'] = $_GET['id_session'];
201
+}
206 202
 // Create a sortable table with user-data
207 203
 
208 204
 $parameters['sec_token'] = Security::get_token();
@@ -214,8 +210,7 @@  discard block
 block discarded – undo
214 210
 {
215 211
 	$table->set_header(2, get_lang('FirstName'));
216 212
 	$table->set_header(3, get_lang('LastName'));
217
-}
218
-else
213
+} else
219 214
 {
220 215
 	$table->set_header(2, get_lang('LastName'));
221 216
 	$table->set_header(3, get_lang('FirstName'));
Please login to merge, or discard this patch.
Indentation   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 // Login as ...
21 21
 if ($action == "login_as" && !empty ($login_as_user_id))
22 22
 {
23
-	login_user($login_as_user_id);
23
+    login_user($login_as_user_id);
24 24
 }
25 25
 
26 26
 //if we already have a session id and a user...
@@ -37,150 +37,150 @@  discard block
 block discarded – undo
37 37
 
38 38
 if (isset ($_GET['action']))
39 39
 {
40
-	$check = Security::check_token('get');
41
-	if($check)
42
-	{
43
-		switch ($_GET['action'])
44
-		{
45
-			case 'show_message' :
46
-				Display :: display_header($tool_name);
47
-				Display :: display_normal_message($_GET['message']);
48
-				break;
49
-			case 'delete_user' :
50
-				Display :: display_header($tool_name);
51
-				if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id']))
52
-				{
53
-					Display :: display_normal_message(get_lang('UserDeleted'));
54
-				}
55
-				else
56
-				{
57
-					Display :: display_error_message(get_lang('CannotDeleteUser'));
58
-				}
59
-				break;
60
-			case 'lock' :
61
-				Display :: display_header($tool_name);
62
-				$message=lock_unlock_user('lock',$_GET['user_id']);
63
-				Display :: display_normal_message($message);
64
-				break;
65
-			case 'unlock';
66
-				Display :: display_header($tool_name);
67
-				$message=lock_unlock_user('unlock',$_GET['user_id']);
68
-				Display :: display_normal_message($message);
69
-				break;
70
-			case 'add_user';
71
-				$id=$_GET['id'];
72
-				$UserList=array();
73
-				$userid_match_login = array();
74
-				foreach ($id as $user_id) {
75
-					$tmp = ldap_add_user($user_id);
76
-					$UserList[]= $tmp;
77
-					$userid_match_login[$tmp] = $user_id;
78
-				}
79
-				if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) {
80
-					ldap_add_user_to_session($UserList, $_GET['id_session']);
81
-					header('Location: resume_session.php?id_session='.intval($_GET['id_session']));
82
-				} else {
83
-					Display :: display_header($tool_name);
84
-					if(count($userid_match_login)>0)
85
-					{
86
-						$message=get_lang('LDAPUsersAddedOrUpdated').':<br />';
87
-						foreach($userid_match_login as $user_id => $login)
88
-						{
89
-							$message .= '- '.$login.'<br />';
90
-						}
91
-					}
92
-					else
93
-					{
94
-						$message=get_lang('NoUserAdded');
95
-					}
96
-					Display :: display_normal_message($message,false);
97
-				}
98
-				break;
99
-			default :
100
-				Display :: display_header($tool_name);
101
-		}
102
-		Security::clear_token();
103
-	}
104
-	else
105
-	{
106
-		Display::display_header($tool_name);
107
-	}
40
+    $check = Security::check_token('get');
41
+    if($check)
42
+    {
43
+        switch ($_GET['action'])
44
+        {
45
+            case 'show_message' :
46
+                Display :: display_header($tool_name);
47
+                Display :: display_normal_message($_GET['message']);
48
+                break;
49
+            case 'delete_user' :
50
+                Display :: display_header($tool_name);
51
+                if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id']))
52
+                {
53
+                    Display :: display_normal_message(get_lang('UserDeleted'));
54
+                }
55
+                else
56
+                {
57
+                    Display :: display_error_message(get_lang('CannotDeleteUser'));
58
+                }
59
+                break;
60
+            case 'lock' :
61
+                Display :: display_header($tool_name);
62
+                $message=lock_unlock_user('lock',$_GET['user_id']);
63
+                Display :: display_normal_message($message);
64
+                break;
65
+            case 'unlock';
66
+                Display :: display_header($tool_name);
67
+                $message=lock_unlock_user('unlock',$_GET['user_id']);
68
+                Display :: display_normal_message($message);
69
+                break;
70
+            case 'add_user';
71
+                $id=$_GET['id'];
72
+                $UserList=array();
73
+                $userid_match_login = array();
74
+                foreach ($id as $user_id) {
75
+                    $tmp = ldap_add_user($user_id);
76
+                    $UserList[]= $tmp;
77
+                    $userid_match_login[$tmp] = $user_id;
78
+                }
79
+                if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) {
80
+                    ldap_add_user_to_session($UserList, $_GET['id_session']);
81
+                    header('Location: resume_session.php?id_session='.intval($_GET['id_session']));
82
+                } else {
83
+                    Display :: display_header($tool_name);
84
+                    if(count($userid_match_login)>0)
85
+                    {
86
+                        $message=get_lang('LDAPUsersAddedOrUpdated').':<br />';
87
+                        foreach($userid_match_login as $user_id => $login)
88
+                        {
89
+                            $message .= '- '.$login.'<br />';
90
+                        }
91
+                    }
92
+                    else
93
+                    {
94
+                        $message=get_lang('NoUserAdded');
95
+                    }
96
+                    Display :: display_normal_message($message,false);
97
+                }
98
+                break;
99
+            default :
100
+                Display :: display_header($tool_name);
101
+        }
102
+        Security::clear_token();
103
+    }
104
+    else
105
+    {
106
+        Display::display_header($tool_name);
107
+    }
108 108
 }
109 109
 else
110 110
 {
111
-	Display::display_header($tool_name);
111
+    Display::display_header($tool_name);
112 112
 }
113 113
 if (isset ($_POST['action']))
114 114
 {
115
-	$check = Security::check_token('get');
116
-	if($check)
117
-	{
118
-		switch ($_POST['action'])
119
-		{
120
-			case 'delete' :
121
-				$number_of_selected_users = count($_POST['id']);
122
-				$number_of_deleted_users = 0;
123
-				foreach ($_POST['id'] as $index => $user_id)
124
-				{
125
-					if($user_id != $_user['user_id'])
126
-					{
127
-						if(UserManager :: delete_user($user_id))
128
-						{
129
-							$number_of_deleted_users++;
130
-						}
131
-					}
132
-				}
133
-				if($number_of_selected_users == $number_of_deleted_users)
134
-				{
135
-					Display :: display_normal_message(get_lang('SelectedUsersDeleted'));
136
-				}
137
-				else
138
-				{
139
-					Display :: display_error_message(get_lang('SomeUsersNotDeleted'));
140
-				}
141
-				break;
142
-			case 'add_user' :
143
-				$number_of_selected_users = count($_POST['id']);
144
-				$number_of_added_users = 0;
145
-				$UserList=array();
146
-				foreach ($_POST['id'] as $index => $user_id)
147
-				{
148
-					if($user_id != $_user['user_id'])
149
-					{
150
-						$UserList[] = ldap_add_user($user_id);
151
-					}
152
-				}
153
-				if (isset($_GET['id_session']) && (trim($_GET['id_session'])!=""))
154
-					addUserToSession($UserList, $_GET['id_session']);
155
-				if(count($UserList)>0)
156
-				{
157
-					Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded'));
158
-				}
159
-				else
160
-				{
161
-					Display :: display_normal_message(get_lang('NoUserAdded'));
162
-				}
163
-				break;
115
+    $check = Security::check_token('get');
116
+    if($check)
117
+    {
118
+        switch ($_POST['action'])
119
+        {
120
+            case 'delete' :
121
+                $number_of_selected_users = count($_POST['id']);
122
+                $number_of_deleted_users = 0;
123
+                foreach ($_POST['id'] as $index => $user_id)
124
+                {
125
+                    if($user_id != $_user['user_id'])
126
+                    {
127
+                        if(UserManager :: delete_user($user_id))
128
+                        {
129
+                            $number_of_deleted_users++;
130
+                        }
131
+                    }
132
+                }
133
+                if($number_of_selected_users == $number_of_deleted_users)
134
+                {
135
+                    Display :: display_normal_message(get_lang('SelectedUsersDeleted'));
136
+                }
137
+                else
138
+                {
139
+                    Display :: display_error_message(get_lang('SomeUsersNotDeleted'));
140
+                }
141
+                break;
142
+            case 'add_user' :
143
+                $number_of_selected_users = count($_POST['id']);
144
+                $number_of_added_users = 0;
145
+                $UserList=array();
146
+                foreach ($_POST['id'] as $index => $user_id)
147
+                {
148
+                    if($user_id != $_user['user_id'])
149
+                    {
150
+                        $UserList[] = ldap_add_user($user_id);
151
+                    }
152
+                }
153
+                if (isset($_GET['id_session']) && (trim($_GET['id_session'])!=""))
154
+                    addUserToSession($UserList, $_GET['id_session']);
155
+                if(count($UserList)>0)
156
+                {
157
+                    Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded'));
158
+                }
159
+                else
160
+                {
161
+                    Display :: display_normal_message(get_lang('NoUserAdded'));
162
+                }
163
+                break;
164 164
 
165
-		}
166
-		Security::clear_token();
167
-	}
165
+        }
166
+        Security::clear_token();
167
+    }
168 168
 }
169 169
 
170 170
 $form = new FormValidator('advanced_search','get');
171 171
 $form->addText('keyword_username',get_lang('LoginName'),false);
172 172
 if (api_is_western_name_order())
173 173
 {
174
-	$form->addText('keyword_firstname', get_lang('FirstName'), false);
175
-	$form->addText('keyword_lastname', get_lang('LastName'), false);
174
+    $form->addText('keyword_firstname', get_lang('FirstName'), false);
175
+    $form->addText('keyword_lastname', get_lang('LastName'), false);
176 176
 }
177 177
 else
178 178
 {
179
-	$form->addText('keyword_lastname',get_lang('LastName'),false);
180
-	$form->addText('keyword_firstname',get_lang('FirstName'),false);
179
+    $form->addText('keyword_lastname',get_lang('LastName'),false);
180
+    $form->addText('keyword_firstname',get_lang('FirstName'),false);
181 181
 }
182 182
 if (isset($_GET['id_session']))
183
-	$form->addElement('hidden','id_session',$_GET['id_session']);
183
+    $form->addElement('hidden','id_session',$_GET['id_session']);
184 184
 
185 185
 $type = array();
186 186
 $type["all"] = get_lang('All');
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 $parameters['keyword_lastname'] = @$_GET['keyword_lastname'] ?: null;
203 203
 $parameters['keyword_email'] = @$_GET['keyword_email'] ?: null;
204 204
 if (isset($_GET['id_session']))
205
-	$parameters['id_session'] = $_GET['id_session'];
205
+    $parameters['id_session'] = $_GET['id_session'];
206 206
 // Create a sortable table with user-data
207 207
 
208 208
 $parameters['sec_token'] = Security::get_token();
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 $table->set_header(1, get_lang('LoginName'));
213 213
 if (api_is_western_name_order())
214 214
 {
215
-	$table->set_header(2, get_lang('FirstName'));
216
-	$table->set_header(3, get_lang('LastName'));
215
+    $table->set_header(2, get_lang('FirstName'));
216
+    $table->set_header(3, get_lang('LastName'));
217 217
 }
218 218
 else
219 219
 {
220
-	$table->set_header(2, get_lang('LastName'));
221
-	$table->set_header(3, get_lang('FirstName'));
220
+    $table->set_header(2, get_lang('LastName'));
221
+    $table->set_header(3, get_lang('FirstName'));
222 222
 }
223 223
 $table->set_header(4, get_lang('Email'));
224 224
 $table->set_header(5, get_lang('Actions'));
Please login to merge, or discard this patch.
main/admin/access_url_edit_course_category_to_url.php 3 patches
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -240,10 +240,11 @@
 block discarded – undo
240 240
 	<td colspan="3" align="center">
241 241
 		<br />
242 242
 		<?php
243
-		if(isset($_GET['add']))
244
-			echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
245
-		else
246
-			echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
243
+		if(isset($_GET['add'])) {
244
+					echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
245
+		} else {
246
+					echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
247
+		}
247 248
 		?>
248 249
 	</td>
249 250
 </tr>
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 }
121 121
 
122 122
 if ($add_type == 'multiple') {
123
-	$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.
123
+    $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.
124 124
         get_lang('SessionAddTypeUnique').'</a>';
125
-	$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
125
+    $link_add_type_multiple = get_lang('SessionAddTypeMultiple');
126 126
 } else {
127
-	$link_add_type_unique = get_lang('SessionAddTypeUnique');
128
-	$link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.
127
+    $link_add_type_unique = get_lang('SessionAddTypeUnique');
128
+    $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.
129 129
         get_lang('SessionAddTypeMultiple').'</a>';
130 130
 }
131 131
 
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
 	<td colspan="3" align="center">
224 224
 		<br />
225 225
 		<?php
226
-		if(isset($_GET['add']))
227
-			echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
228
-		else
229
-			echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
230
-		?>
226
+        if(isset($_GET['add']))
227
+            echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
228
+        else
229
+            echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
230
+        ?>
231 231
 	</td>
232 232
 </tr>
233 233
 </table>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     foreach ($userGroups as $item) {
115 115
         if ($item['access_url_id'] == $access_url_id) {
116
-            $userGroupList[$item['id']] = $item ;
116
+            $userGroupList[$item['id']] = $item;
117 117
         }
118 118
     }
119 119
     $noUserGroupList = CourseCategory::getCourseCategoryNotInList(array_keys($userGroupList));
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
         if (!empty($access_url_id)) {
152 152
             if ($url_obj[0] == $access_url_id) {
153 153
                 $checked = 'selected=true';
154
-                $url_selected=$url_obj[1];
154
+                $url_selected = $url_obj[1];
155 155
             }
156 156
         }
157
-        if ($url_obj['active']==1) { ?>
158
-            <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
157
+        if ($url_obj['active'] == 1) { ?>
158
+            <option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
159 159
             </option>
160 160
         <?php
161 161
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
   <td align="center"><b><?php echo get_lang('CourseCategoryInPlatform') ?> :</b>
172 172
   </td>
173 173
   <td></td>
174
-  <td align="center"><b><?php printf(get_lang('CourseCategoryListInX'),$url_selected); ?></b></td>
174
+  <td align="center"><b><?php printf(get_lang('CourseCategoryListInX'), $url_selected); ?></b></td>
175 175
 </tr>
176 176
 
177 177
 <tr>
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
   <td align="center">
209 209
   <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
210 210
 <?php
211
-foreach($userGroupList as $item) {
211
+foreach ($userGroupList as $item) {
212 212
 ?>
213 213
 	<option value="<?php echo $item['id']; ?>">
214 214
         <?php echo $item['name']; ?>
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	<td colspan="3" align="center">
224 224
 		<br />
225 225
 		<?php
226
-		if(isset($_GET['add']))
226
+		if (isset($_GET['add']))
227 227
 			echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
228 228
 		else
229 229
 			echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
Please login to merge, or discard this patch.
main/admin/specific_fields.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 $table->set_column_filter(3, 'edit_filter');
44 44
 
45 45
 function edit_filter($id,$url_params,$row) {
46
-	global $charset;
47
-	$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
48
-	$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
49
-	return $return;
46
+    global $charset;
47
+    $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
48
+    $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
49
+    return $return;
50 50
 }
51 51
 
52 52
 if ($_REQUEST['action'] == 'delete') {
53
-	delete_specific_field($_REQUEST['field_id']);
54
-	header('Location: specific_fields.php?message='.get_lang('FieldRemoved'));
53
+    delete_specific_field($_REQUEST['field_id']);
54
+    header('Location: specific_fields.php?message='.get_lang('FieldRemoved'));
55 55
 }
56 56
 
57 57
 // Start output
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro'));
62 62
 
63 63
 if(!empty($_GET['message'])) {
64
-  Display::display_confirmation_message($_GET['message']);
64
+    Display::display_confirmation_message($_GET['message']);
65 65
 }
66 66
 
67 67
 echo '<div class="actions">';
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -15,36 +15,36 @@  discard block
 block discarded – undo
15 15
 api_protect_admin_script();
16 16
 
17 17
 // Breadcrumb
18
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19
-$interbreadcrumb[] = array ('url' => 'settings.php?category=Search', 'name' => get_lang('PlatformConfigSettings'));
18
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19
+$interbreadcrumb[] = array('url' => 'settings.php?category=Search', 'name' => get_lang('PlatformConfigSettings'));
20 20
 
21 21
 $libpath = api_get_path(LIBRARY_PATH);
22 22
 
23 23
 include_once $libpath.'specific_fields_manager.lib.php';
24 24
 
25 25
 // Create an add-field box
26
-$form = new FormValidator('add_field','post','','',null,false);
27
-$renderer =& $form->defaultRenderer();
26
+$form = new FormValidator('add_field', 'post', '', '', null, false);
27
+$renderer = & $form->defaultRenderer();
28 28
 $renderer->setCustomElementTemplate('<span>{element}</span> ');
29
-$form->addElement('static','search_advanced_link',null,'<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>');
29
+$form->addElement('static', 'search_advanced_link', null, '<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>');
30 30
 
31 31
 // Create a sortable table with specific fields data
32
-$column_show = array(1,1,1);
33
-$column_order = array(3,2,1);
32
+$column_show = array(1, 1, 1);
33
+$column_order = array(3, 2, 1);
34 34
 $extra_fields = get_specific_field_list();
35 35
 $number_of_extra_fields = count($extra_fields);
36 36
 
37
-$table = new SortableTableFromArrayConfig($extra_fields,2,50,'',$column_show,$column_order);
38
-$table->set_header(0, '&nbsp;', false,null,'width="2%"', 'style="display:none"');
37
+$table = new SortableTableFromArrayConfig($extra_fields, 2, 50, '', $column_show, $column_order);
38
+$table->set_header(0, '&nbsp;', false, null, 'width="2%"', 'style="display:none"');
39 39
 $table->set_header(1, get_lang('Code'), TRUE, 'width="10%"');
40 40
 $table->set_header(2, get_lang('Name'));
41
-$table->set_header(3, get_lang('Modify'),false,'width="10%"');
41
+$table->set_header(3, get_lang('Modify'), false, 'width="10%"');
42 42
 $table->set_column_filter(3, 'edit_filter');
43 43
 
44
-function edit_filter($id,$url_params,$row) {
44
+function edit_filter($id, $url_params, $row) {
45 45
 	global $charset;
46
-	$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
47
-	$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
46
+	$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
47
+	$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
48 48
 	return $return;
49 49
 }
50 50
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 Display::display_header(get_lang('SpecificSearchFields'));
61 61
 echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro'));
62 62
 
63
-if(!empty($_GET['message'])) {
63
+if (!empty($_GET['message'])) {
64 64
   Display::display_confirmation_message($_GET['message']);
65 65
 }
66 66
 
Please login to merge, or discard this patch.
main/admin/extra_field_options.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 $htmlHeadXtra[] = api_get_jqgrid_js();
19 19
 
20 20
 // setting breadcrumbs
21
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
21
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
22 22
 
23 23
 $tool_name = null;
24 24
 
@@ -39,23 +39,23 @@  discard block
 block discarded – undo
39 39
 $token = Security::get_token();
40 40
 
41 41
 if ($action == 'add') {
42
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName);
43
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']);
44
-    $interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
45
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
42
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
43
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']);
44
+    $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
45
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
46 46
 } elseif ($action == 'edit') {
47
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName);
48
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']);
49
-    $interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
47
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
48
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']);
49
+    $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
50 50
 
51
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
51
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
52 52
 } else {
53
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName);
54
-    $interbreadcrumb[]=array(
53
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
54
+    $interbreadcrumb[] = array(
55 55
         'url' =>  'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],
56 56
         'name' => $extra_field_info['display_text']
57 57
     );
58
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('EditExtraFieldOptions'));
58
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditExtraFieldOptions'));
59 59
 }
60 60
 
61 61
 //jqgrid will use this URL to do the selects
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
 
109 109
 //With this function we can add actions to the jgrid (edit, delete, etc)
110 110
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
111
-    return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
112
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'.
111
+    return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
112
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'.
113 113
     '\';
114 114
  }';
115 115
 
116
-$htmlHeadXtra[]='<script>
116
+$htmlHeadXtra[] = '<script>
117 117
 $(function() {
118 118
     // grid definition see the $obj->display() function
119 119
     '.Display::grid_js(
Please login to merge, or discard this patch.
main/admin/add_users_to_usergroup.php 2 patches
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -345,7 +345,10 @@  discard block
 block discarded – undo
345 345
 $searchForm->display();
346 346
 echo '</div>';
347 347
 ?>
348
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;">
348
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) {
349
+    echo '&add=true' ;
350
+}
351
+?>" style="margin:0px;">
349 352
 <?php
350 353
 echo '<legend>'.$tool_name.': '.$data['name'].'</legend>';
351 354
 
@@ -420,7 +423,10 @@  discard block
 block discarded – undo
420 423
     ?>
421 424
     <br />
422 425
       <label class="control-label">
423
-          <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"';?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id">
426
+          <input type="checkbox" <?php if ($user_with_any_group) {
427
+    echo 'checked="checked"';
428
+}
429
+?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id">
424 430
           <?php echo get_lang('UsersRegisteredInAnyGroup'); ?>
425 431
       </label>
426 432
     </div>
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 api_protect_admin_script(true);
19 19
 
20 20
 // setting breadcrumbs
21
-$interbreadcrumb[]= array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
22
-$interbreadcrumb[]= array('url' => 'usergroups.php','name' => get_lang('Classes'));
21
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
22
+$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
23 23
 
24 24
 // Database Table Definitions
25 25
 
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 
92 92
 </script>';
93 93
 
94
-$form_sent  = 0;
94
+$form_sent = 0;
95 95
 
96 96
 $extra_field_list = UserManager::get_extra_fields();
97 97
 $new_field_list = array();
98 98
 if (is_array($extra_field_list)) {
99 99
     foreach ($extra_field_list as $extra_field) {
100 100
         //if is enabled to filter and is a "<select>" field type
101
-        if ($extra_field[8]==1 && $extra_field[2]==4 ) {
101
+        if ($extra_field[8] == 1 && $extra_field[2] == 4) {
102 102
             $new_field_list[] = array(
103 103
                 'name'=> $extra_field[3],
104 104
                 'variable' => $extra_field[1], 'data'=> $extra_field[9]
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         foreach ($users as $user) {
147 147
             $data[] = array($user['username'], $groupInfo['name']);
148 148
         }
149
-        $filename = 'export_user_class_' . api_get_local_time();
149
+        $filename = 'export_user_class_'.api_get_local_time();
150 150
         Export::arrayToCsv($data, $filename);
151 151
         exit;
152 152
     }
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 // Filter by Extra Fields
157 157
 $use_extra_fields = false;
158 158
 if (is_array($extra_field_list)) {
159
-    if (is_array($new_field_list) && count($new_field_list)>0 ) {
159
+    if (is_array($new_field_list) && count($new_field_list) > 0) {
160 160
         foreach ($new_field_list as $new_field) {
161 161
             $varname = 'field_'.$new_field['variable'];
162 162
             if (UserManager::is_extra_field_available($new_field['variable'])) {
163
-                if (isset($_POST[$varname]) && $_POST[$varname]!='0') {
163
+                if (isset($_POST[$varname]) && $_POST[$varname] != '0') {
164 164
                     $use_extra_fields = true;
165 165
                     $extra_field_result[] = UserManager::get_extra_user_data_by_value(
166 166
                         $new_field['variable'],
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 
175 175
 if ($use_extra_fields) {
176 176
     $final_result = array();
177
-    if (count($extra_field_result)>1) {
178
-        for ($i=0; $i<count($extra_field_result)-1; $i++) {
179
-            if (is_array($extra_field_result[$i+1])) {
180
-                $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i+1]);
177
+    if (count($extra_field_result) > 1) {
178
+        for ($i = 0; $i < count($extra_field_result) - 1; $i++) {
179
+            if (is_array($extra_field_result[$i + 1])) {
180
+                $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]);
181 181
             }
182 182
         }
183 183
     } else {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
 $searchForm = new FormValidator('search', 'get', api_get_self().'?id='.$id);
198 198
 $searchForm->addHeader(get_lang('AdvancedSearch'));
199
-$renderer =& $searchForm->defaultRenderer();
199
+$renderer = & $searchForm->defaultRenderer();
200 200
 
201 201
 $searchForm->addElement('hidden', 'id', $id);
202 202
 foreach ($filters as $param) {
@@ -345,13 +345,13 @@  discard block
 block discarded – undo
345 345
 $searchForm->display();
346 346
 echo '</div>';
347 347
 ?>
348
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;">
348
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;">
349 349
 <?php
350 350
 echo '<legend>'.$tool_name.': '.$data['name'].'</legend>';
351 351
 
352 352
 
353 353
     if (is_array($extra_field_list)) {
354
-        if (is_array($new_field_list) && count($new_field_list)>0) {
354
+        if (is_array($new_field_list) && count($new_field_list) > 0) {
355 355
             echo '<h3>'.get_lang('FilterByUser').'</h3>';
356 356
             foreach ($new_field_list as $new_field) {
357 357
                 echo $new_field['name'];
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
                 echo '&nbsp;<select name="'.$varname.'">';
360 360
                 echo '<option value="0">--'.get_lang('Select').'--</option>';
361 361
                 foreach ($new_field['data'] as $option) {
362
-                    $checked='';
362
+                    $checked = '';
363 363
                     if (isset($_POST[$varname])) {
364 364
                         if ($_POST[$varname] == $option[1]) {
365 365
                             $checked = 'selected="true"';
@@ -386,15 +386,15 @@  discard block
 block discarded – undo
386 386
         <?php if ($data['group_type'] == UserGroup::SOCIAL_CLASS) { ?>
387 387
         <select name="relation" id="relation">
388 388
             <option value=""><?php echo get_lang('SelectARelationType')?></option>
389
-            <option value="<?php echo GROUP_USER_PERMISSION_ADMIN ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN)?'selected=selected':'') ?> >
389
+            <option value="<?php echo GROUP_USER_PERMISSION_ADMIN ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN) ? 'selected=selected' : '') ?> >
390 390
                 <?php echo get_lang('Admin') ?></option>
391
-            <option value="<?php echo GROUP_USER_PERMISSION_READER ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_READER)?'selected=selected':'') ?> >
391
+            <option value="<?php echo GROUP_USER_PERMISSION_READER ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_READER) ? 'selected=selected' : '') ?> >
392 392
                 <?php echo get_lang('Reader') ?></option>
393
-            <option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION)?'selected=selected':'') ?> >
393
+            <option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION) ? 'selected=selected' : '') ?> >
394 394
                 <?php echo get_lang('PendingInvitation') ?></option>
395
-            <option value="<?php echo GROUP_USER_PERMISSION_MODERATOR ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR)?'selected=selected':'') ?> >
395
+            <option value="<?php echo GROUP_USER_PERMISSION_MODERATOR ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR) ? 'selected=selected' : '') ?> >
396 396
                 <?php echo get_lang('Moderator') ?></option>
397
-            <option value="<?php echo GROUP_USER_PERMISSION_HRM ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_HRM)?'selected=selected':'') ?> >
397
+            <option value="<?php echo GROUP_USER_PERMISSION_HRM ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_HRM) ? 'selected=selected' : '') ?> >
398 398
                 <?php echo get_lang('Drh') ?></option>
399 399
         </select>
400 400
         <?php } ?>
@@ -414,13 +414,13 @@  discard block
 block discarded – undo
414 414
         'elements_not_in_name',
415 415
         $elements_not_in,
416 416
         '',
417
-        array('class'=>'col-md-7', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),
417
+        array('class'=>'col-md-7', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'),
418 418
         false
419 419
     );
420 420
     ?>
421 421
     <br />
422 422
       <label class="control-label">
423
-          <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"';?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id">
423
+          <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"'; ?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id">
424 424
           <?php echo get_lang('UsersRegisteredInAnyGroup'); ?>
425 425
       </label>
426 426
     </div>
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
             'elements_in_name[]',
445 445
             $elements_in,
446 446
             '',
447
-            array('class'=>'col-md-7', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),
447
+            array('class'=>'col-md-7', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'),
448 448
             false
449 449
         );
450 450
         unset($sessionUsersList);
Please login to merge, or discard this patch.
main/admin/system_status.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 $this_section = SECTION_PLATFORM_ADMIN;
12 12
 // User permissions
13 13
 api_protect_admin_script();
14
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
14
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
15 15
 Display :: display_header(get_lang('SystemStatus'));
16 16
 $diag = new Diagnoser();
17 17
 $diag->show_html();
Please login to merge, or discard this patch.