Completed
Push — master ( 565c08...93d030 )
by José
125:33 queued 71:22
created
main/admin/specific_fields_add.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 $tool_name = get_lang('AddSpecificSearchField');
28 28
 
29 29
 if (isset($_GET['action']) && $_GET['action'] === 'edit') {
30
-  $tool_name = get_lang('EditSpecificSearchField');
30
+    $tool_name = get_lang('EditSpecificSearchField');
31 31
 }
32 32
 // Create the form
33 33
 $form = new FormValidator('specific_fields_add');
Please login to merge, or discard this patch.
src/Chamilo/UserBundle/Entity/User.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1875,11 +1875,11 @@  discard block
 block discarded – undo
1875 1875
         return $this->locale;
1876 1876
     }
1877 1877
 
1878
-     /**
1879
-     * @param string $timezone
1880
-     *
1881
-     * @return User
1882
-     */
1878
+        /**
1879
+         * @param string $timezone
1880
+         *
1881
+         * @return User
1882
+         */
1883 1883
     public function setTimezone($timezone)
1884 1884
     {
1885 1885
         $this->timezone = $timezone;
@@ -2048,11 +2048,11 @@  discard block
 block discarded – undo
2048 2048
         return $this->plainPassword;
2049 2049
     }
2050 2050
 
2051
-      /**
2052
-     * Returns the user roles
2053
-     *
2054
-     * @return array The roles
2055
-     */
2051
+        /**
2052
+         * Returns the user roles
2053
+         *
2054
+         * @return array The roles
2055
+         */
2056 2056
     public function getRoles()
2057 2057
     {
2058 2058
         $roles = $this->roles;
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/SelectTheme.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@
 block discarded – undo
6 6
 */
7 7
 class SelectTheme extends HTML_QuickForm_select
8 8
 {
9
-	/**
10
-	 * Class constructor
11
-	 */
12
-	public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
13
-	{
14
-		parent::__construct($elementName, $elementLabel, $options, $attributes);
15
-		// Get all languages
16
-		$themes = api_get_themes();
17
-		$this->_options = array();
18
-		$this->_values = array();
19
-		$this->addOption('--',''); // no theme select
20
-		for ($i=0; $i< count($themes[0]); $i++) {
21
-			$this->addOption($themes[1][$i],$themes[0][$i]);
22
-		}
23
-	}
9
+    /**
10
+     * Class constructor
11
+     */
12
+    public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
13
+    {
14
+        parent::__construct($elementName, $elementLabel, $options, $attributes);
15
+        // Get all languages
16
+        $themes = api_get_themes();
17
+        $this->_options = array();
18
+        $this->_values = array();
19
+        $this->addOption('--',''); // no theme select
20
+        for ($i=0; $i< count($themes[0]); $i++) {
21
+            $this->addOption($themes[1][$i],$themes[0][$i]);
22
+        }
23
+    }
24 24
 }
Please login to merge, or discard this patch.
main/document/create_paint.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -50,26 +50,26 @@  discard block
 block discarded – undo
50 50
 // Please, do not modify this dirname formatting
51 51
 
52 52
 if (strstr($dir, '..')) {
53
-	$dir = '/';
53
+    $dir = '/';
54 54
 }
55 55
 
56 56
 if ($dir[0] == '.') {
57
-	$dir = substr($dir, 1);
57
+    $dir = substr($dir, 1);
58 58
 }
59 59
 
60 60
 if ($dir[0] != '/') {
61
-	$dir = '/'.$dir;
61
+    $dir = '/'.$dir;
62 62
 }
63 63
 
64 64
 if ($dir[strlen($dir) - 1] != '/') {
65
-	$dir .= '/';
65
+    $dir .= '/';
66 66
 }
67 67
 
68 68
 $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
69 69
 
70 70
 if (!is_dir($filepath)) {
71
-	$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
72
-	$dir = '/';
71
+    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
72
+    $dir = '/';
73 73
 }
74 74
 
75 75
 $groupId = api_get_group_id();
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 }
98 98
 
99 99
 if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] ||
100
-	DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id()))
100
+    DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id()))
101 101
 ) {
102 102
     api_not_allowed(true);
103 103
 }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
 // Interbreadcrumb for the current directory root path
116 116
 if (empty($document_data['parents'])) {
117
-	$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
117
+    $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
118 118
 } else {
119 119
     foreach ($document_data['parents'] as $document_sub_data) {
120 120
         $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
@@ -147,17 +147,17 @@  discard block
 block discarded – undo
147 147
 $locktitle="false";
148 148
 
149 149
 if ($_SERVER['HTTP_HOST']=="localhost") {
150
-	$path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
151
-	if (!file_exists($path_and_file)) {
152
-		$crossdomain='<?xml version="1.0"?>
150
+    $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
151
+    if (!file_exists($path_and_file)) {
152
+        $crossdomain='<?xml version="1.0"?>
153 153
 			<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
154 154
 			<cross-domain-policy>
155 155
 				<allow-access-from domain="cdn.pixlr.com" />
156 156
 				<site-control permitted-cross-domain-policies="master-only"/>
157 157
 				<allow-http-request-headers-from domain="cnd.pixlr.com" headers="*" secure="true"/>
158 158
 			</cross-domain-policy>';//more open domain="*"
159
-		@file_put_contents($path_and_file, $crossdomain);
160
-	}
159
+        @file_put_contents($path_and_file, $crossdomain);
160
+    }
161 161
     $credentials = "true";
162 162
 } else {
163 163
     $credentials = "false";
Please login to merge, or discard this patch.
main/document/edit_paint.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -61,44 +61,44 @@  discard block
 block discarded – undo
61 61
 /* Please, do not modify this dirname formatting */
62 62
 
63 63
 if (strstr($dir, '..')) {
64
-	$dir = '/';
64
+    $dir = '/';
65 65
 }
66 66
 
67 67
 if ($dir[0] == '.') {
68
-	$dir = substr($dir, 1);
68
+    $dir = substr($dir, 1);
69 69
 }
70 70
 
71 71
 if ($dir[0] != '/') {
72
-	$dir = '/'.$dir;
72
+    $dir = '/'.$dir;
73 73
 }
74 74
 
75 75
 if ($dir[strlen($dir) - 1] != '/') {
76
-	$dir .= '/';
76
+    $dir .= '/';
77 77
 }
78 78
 
79 79
 $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
80 80
 
81 81
 if (!is_dir($filepath)) {
82
-	$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
83
-	$dir = '/';
82
+    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
83
+    $dir = '/';
84 84
 }
85 85
 
86 86
 //groups //TODO:clean
87 87
 if (!empty($groupId)) {
88
-	$interbreadcrumb[] = array(
89
-		'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
90
-		'name' => get_lang('GroupSpace'),
91
-	);
92
-	$group_document = true;
93
-	$noPHP_SELF = true;
88
+    $interbreadcrumb[] = array(
89
+        'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
90
+        'name' => get_lang('GroupSpace'),
91
+    );
92
+    $group_document = true;
93
+    $noPHP_SELF = true;
94 94
 }
95 95
 
96 96
 $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
97 97
 
98 98
 if (!$is_certificate_mode)
99
-	$interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
99
+    $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
100 100
 else
101
-	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
101
+    $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
102 102
 
103 103
 // Interbreadcrumb for the current directory root path
104 104
 if (empty($document_data['parents'])) {
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
 }
114 114
 
115 115
 $is_allowedToEdit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights'] ||
116
-	DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
116
+    DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
117 117
 
118 118
 if (!$is_allowedToEdit) {
119
-	api_not_allowed(true);
119
+    api_not_allowed(true);
120 120
 }
121 121
 
122 122
 Event::event_access_tool(TOOL_DOCUMENT);
@@ -148,21 +148,21 @@  discard block
 block discarded – undo
148 148
 $locktitle="false";
149 149
 
150 150
 if ($_SERVER['HTTP_HOST']=="localhost") {
151
-	$path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
152
-	if (!file_exists($path_and_file)) {
153
-		$crossdomain='<?xml version="1.0"?>
151
+    $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
152
+    if (!file_exists($path_and_file)) {
153
+        $crossdomain='<?xml version="1.0"?>
154 154
 			<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
155 155
 			<cross-domain-policy>
156 156
 				<allow-access-from domain="cdn.pixlr.com" />
157 157
 				<site-control permitted-cross-domain-policies="master-only"/>
158 158
 				<allow-http-request-headers-from domain="cnd.pixlr.com" headers="*" secure="true"/>
159 159
 			</cross-domain-policy>';//more open domain="*"
160
-		@file_put_contents($path_and_file, $crossdomain);
161
-	}
162
-	$credentials="true";
160
+        @file_put_contents($path_and_file, $crossdomain);
161
+    }
162
+    $credentials="true";
163 163
 }
164 164
 else {
165
-	$credentials="false";
165
+    $credentials="false";
166 166
 }
167 167
 
168 168
 //make temp images
@@ -175,23 +175,23 @@  discard block
 block discarded – undo
175 175
 $htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
176 176
 if (!file_exists($htaccess)) {
177 177
 
178
-	$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
178
+    $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
179 179
 
180
-	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
181
-	if ($fp) {
182
-		fwrite($fp, $htaccess_content);
183
-		fclose($fp);
184
-	}
180
+    $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
181
+    if ($fp) {
182
+        fwrite($fp, $htaccess_content);
183
+        fclose($fp);
184
+    }
185 185
 }
186 186
 
187 187
 $html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
188 188
 if (!file_exists($html_index)) {
189
-	$html_index_content="<html><head></head><body></body></html>";
190
-	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
191
-	if ($fp) {
192
-		fwrite($fp, $html_index_content);
193
-		fclose($fp);
194
-	}
189
+    $html_index_content="<html><head></head><body></body></html>";
190
+    $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
191
+    if ($fp) {
192
+        fwrite($fp, $html_index_content);
193
+        fclose($fp);
194
+    }
195 195
 }
196 196
 
197 197
 //encript temp name file
Please login to merge, or discard this patch.
custompages/first_login-dist.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * Security checks
15 15
  */
16 16
 if (! isset($_SESSION['conditional_login']['uid']))
17
-  die("Not Authorised");
17
+    die("Not Authorised");
18 18
 
19 19
 if (isset($_POST['password'])) {
20 20
     $u = api_get_user_info($_SESSION['conditional_login']['uid']);
@@ -27,26 +27,26 @@  discard block
 block discarded – undo
27 27
         exit();
28 28
     }
29 29
     $password = $_POST['password'];
30
-	$updated = UserManager::update_user(
31
-		$u['user_id'],
32
-		$u['firstname'],
33
-		$u['lastname'],
34
-		$u['username'],
35
-		$password,
36
-		$u['auth_source'],
37
-		$u['email'],
38
-		$u['status'],
39
-		$u['official_code'],
40
-		$u['phone'],
41
-		$u['picture_uri'],
42
-		$u['expiration_date'],
43
-		$u['active'],
44
-		$u['creator_id'],
45
-		$u['hr_dept_id'],
46
-		null,
47
-		$u['language'],
48
-		''
49
-	);
30
+    $updated = UserManager::update_user(
31
+        $u['user_id'],
32
+        $u['firstname'],
33
+        $u['lastname'],
34
+        $u['username'],
35
+        $password,
36
+        $u['auth_source'],
37
+        $u['email'],
38
+        $u['status'],
39
+        $u['official_code'],
40
+        $u['phone'],
41
+        $u['picture_uri'],
42
+        $u['expiration_date'],
43
+        $u['active'],
44
+        $u['creator_id'],
45
+        $u['hr_dept_id'],
46
+        null,
47
+        $u['language'],
48
+        ''
49
+    );
50 50
 
51 51
     if ($updated !== false) {
52 52
         UserManager::update_extra_field_value($u['user_id'], 'already_logged_in', 'true');
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 		<div id="changepassword-form-box" class="form-box">
105 105
       <div class="info"> <?php echo custompages_get_lang('FirstLoginChangePassword');?> </div>
106 106
 		<?php if (isset($error_message)) {
107
-			echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>';
108
-		}?>
107
+            echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>';
108
+        }?>
109 109
 			<form id="changepassword-form" class="form" method="post">
110 110
 				<div>
111 111
           <label for="password">*<?php echo custompages_get_lang('Password');?></label>
Please login to merge, or discard this patch.
main/auth/ldap/authldap.php 1 patch
Indentation   +20 added lines, -21 removed lines patch added patch discarded remove patch
@@ -46,10 +46,9 @@  discard block
 block discarded – undo
46 46
     - Universite Jean Monet (J Dubois / Michel Courbon)
47 47
     - Michel Panckoucke for reporting and fixing a bug
48 48
     - Patrick Cool: fixing security hole
49
-
50
-    *    @author Roan Embrechts
51
-    *    @version 3.0
52
-    *    @package chamilo.auth.ldap
49
+ *    @author Roan Embrechts
50
+ *    @version 3.0
51
+ *    @package chamilo.auth.ldap
53 52
  * Note:
54 53
  * If you are using a firewall, you might need to check port 389 is open in
55 54
  * order for Chamilo to communicate with the LDAP server.
@@ -211,8 +210,8 @@  discard block
 block discarded – undo
211 210
     $language = api_get_setting('platformLanguage');
212 211
     if (empty($language)) { $language = 'english'; }
213 212
     $_userId = UserManager::create_user($prenom, $nom, $status,
214
-                     $email, $uname, $password, $official_code,
215
-                     $language,'', '', 'ldap');
213
+                        $email, $uname, $password, $official_code,
214
+                        $language,'', '', 'ldap');
216 215
 
217 216
     //echo "new user added to Chamilo, id = $_userId";
218 217
 
@@ -271,7 +270,7 @@  discard block
 block discarded – undo
271 270
         // Open anonymous LDAP connection
272 271
         $result=false;
273 272
         $ldap_bind_res = ldap_handle_bind($ds,$result);
274
-	// Executing the search with the $filter parametr
273
+    // Executing the search with the $filter parametr
275 274
         //error_log('Searching for '.$filter.' on LDAP server',0);
276 275
         $sr=ldap_search($ds,$ldap_basedn,$filter);
277 276
         $info = ldap_get_entries($ds, $sr);
@@ -564,35 +563,35 @@  discard block
 block discarded – undo
564 563
         foreach ($UserList as $enreg_user) {
565 564
             $enreg_user = (int) $enreg_user;
566 565
             Database::query("INSERT IGNORE ".
567
-              " INTO $tbl_session_rel_course_rel_user ".
568
-              "(session_id,c_id,user_id) VALUES ".
569
-              "('$id_session','$enreg_course','$enreg_user')");
566
+                " INTO $tbl_session_rel_course_rel_user ".
567
+                "(session_id,c_id,user_id) VALUES ".
568
+                "('$id_session','$enreg_course','$enreg_user')");
570 569
         }
571 570
         $sql = "SELECT COUNT(user_id) as nbUsers ".
572
-               " FROM $tbl_session_rel_course_rel_user " .
573
-               " WHERE session_id='$id_session' ".
574
-               " AND c_id='$enreg_course'";
571
+                " FROM $tbl_session_rel_course_rel_user " .
572
+                " WHERE session_id='$id_session' ".
573
+                " AND c_id='$enreg_course'";
575 574
         $rs = Database::query($sql);
576 575
         list($nbr_users) = Database::fetch_array($rs);
577 576
         Database::query("UPDATE $tbl_session_rel_course  ".
578
-               " SET nbr_users=$nbr_users " .
579
-               " WHERE session_id='$id_session' ".
580
-               " AND c_id='$enreg_course'");
577
+                " SET nbr_users=$nbr_users " .
578
+                " WHERE session_id='$id_session' ".
579
+                " AND c_id='$enreg_course'");
581 580
     }
582 581
     foreach ($UserList as $enreg_user) {
583 582
         $enreg_user = (int) $enreg_user;
584 583
         Database::query("INSERT IGNORE INTO $tbl_session_rel_user ".
585
-               " (session_id, user_id, registered_at) " .
586
-               " VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')");
584
+                " (session_id, user_id, registered_at) " .
585
+                " VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')");
587 586
     }
588 587
     // We update the number of users in the session
589 588
     $sql = "SELECT COUNT(user_id) as nbUsers FROM $tbl_session_rel_user ".
590
-           " WHERE session_id='$id_session' ".
591
-           " AND relation_type<>".SESSION_RELATION_TYPE_RRHH." ";
589
+            " WHERE session_id='$id_session' ".
590
+            " AND relation_type<>".SESSION_RELATION_TYPE_RRHH." ";
592 591
     $rs = Database::query($sql);
593 592
     list($nbr_users) = Database::fetch_array($rs);
594 593
     Database::query("UPDATE $tbl_session SET nbr_users=$nbr_users ".
595
-           " WHERE id='$id_session'");
594
+            " WHERE id='$id_session'");
596 595
 }
597 596
 
598 597
 function syncro_users() {
Please login to merge, or discard this patch.
main/admin/cli.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@
 block discarded – undo
28 28
 switch ($_GET["cmd"]) {
29 29
     case "clear_stapi":
30 30
       echo "Are you sure you are willing to erease all storage api data (no backup)? <a href='cli.php?cmd=clear_stapi_confirm' >Yes</a>";
31
-      break;
31
+        break;
32 32
     case "clear_stapi_confirm":
33 33
       Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES));
34
-      Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK));
35
-      echo "Done";
36
-      break;
34
+        Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK));
35
+        echo "Done";
36
+        break;
37 37
     default:
38 38
       echo "UNKNOWN COMMAND";
39
-      break;
39
+        break;
40 40
 }
41 41
 /**
42 42
  * Footer 
Please login to merge, or discard this patch.
main/admin/user_update_import.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
                     $user['error'] = get_lang('UserNameNotAvailable');
61 61
                     $errors[] = $user;
62 62
                 }
63
-             }
64
-          }
63
+                }
64
+            }
65 65
 
66 66
         // 3. Check status.
67 67
         if (isset($user['Status']) && !api_status_exists($user['Status'])) {
Please login to merge, or discard this patch.