Test Setup Failed
Pull Request — 1.11.x (#1541)
by José
33:51 queued 05:26
created
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.
main/cron/lang/langstats.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -22,59 +22,59 @@
 block discarded – undo
22 22
 $output = false;
23 23
 $ls = new langstats();
24 24
 if ($ls === false) {
25
-  exit($ls->error);
25
+    exit($ls->error);
26 26
 }
27 27
 $list = $ls->get_popular_terms($x_most_popular);
28 28
 if ($_GET['output'] == 1) {
29
-  $output = true;
30
-  $variables_origin = $ls->get_variables_origin();
29
+    $output = true;
30
+    $variables_origin = $ls->get_variables_origin();
31 31
 }
32 32
 /**
33 33
  * Display
34 34
  */
35 35
 if (count($list)==0) { echo 'No terms loaded so far'; }
36 36
 if (count($list)>0) {
37
-  $i = 1;
38
-  $j = 1;
39
-  $k = 0;
40
-  $files = array();
41
-  $trans = array();
42
-  echo 'Number of records: '.count($list).'<br />';
43
-  echo '<table><tr><th>Index</th><th>Registration order</th><th>Term</th>'.($output==1?'<th>Origin</th>':'').'<th>Count</th></tr>';
44
-  foreach($list as $elem) {
37
+    $i = 1;
38
+    $j = 1;
39
+    $k = 0;
40
+    $files = array();
41
+    $trans = array();
42
+    echo 'Number of records: '.count($list).'<br />';
43
+    echo '<table><tr><th>Index</th><th>Registration order</th><th>Term</th>'.($output==1?'<th>Origin</th>':'').'<th>Count</th></tr>';
44
+    foreach($list as $elem) {
45 45
     if ($k > $terms_limit) { break; }
46 46
     $fixed_elem = $elem;
47 47
     if ($output) {
48
-      if (empty($variables_origin[$elem['term_name']]) && !empty($variables_origin['lang'.$elem['term_name']])) {
48
+        if (empty($variables_origin[$elem['term_name']]) && !empty($variables_origin['lang'.$elem['term_name']])) {
49 49
         $fixed_elem = array('id' => $elem['id'], 'term_name' => 'lang'.$elem['term_name'], 'term_count' => $elem['term_count']);
50
-      }
51
-      if (empty($variables_origin[$fixed_elem['term_name']])) {
50
+        }
51
+        if (empty($variables_origin[$fixed_elem['term_name']])) {
52 52
         continue; 
53
-      }
54
-      $files[$variables_origin[$fixed_elem['term_name']]][] = $fixed_elem['term_name'];
55
-      $translation = get_lang($fixed_elem['term_name']);
56
-      $k += str_word_count($translation);
57
-      $trans[$fixed_elem['term_name']] = $translation;
58
-      $j++;
53
+        }
54
+        $files[$variables_origin[$fixed_elem['term_name']]][] = $fixed_elem['term_name'];
55
+        $translation = get_lang($fixed_elem['term_name']);
56
+        $k += str_word_count($translation);
57
+        $trans[$fixed_elem['term_name']] = $translation;
58
+        $j++;
59 59
     }
60 60
     echo '<tr><td>',$i,
61
-      '</td><td>',$fixed_elem['id'],
62
-      '</td><td>',$fixed_elem['term_name'];
61
+        '</td><td>',$fixed_elem['id'],
62
+        '</td><td>',$fixed_elem['term_name'];
63 63
     if ($output) {
64
-      echo '</td><td>'.$variables_origin[$fixed_elem['term_name']];
64
+        echo '</td><td>'.$variables_origin[$fixed_elem['term_name']];
65 65
     }
66 66
     echo '</td><td>',$fixed_elem['term_count'],'</td></tr>';
67 67
     $i++;
68
-  }
69
-  echo '</table>';
70
-  if ($output) {
68
+    }
69
+    echo '</table>';
70
+    if ($output) {
71 71
     @mkdir('/tmp/lang');
72 72
     foreach ($files as $file => $terms) {
73
-      @touch('/tmp/lang/'.$file);
74
-      file_put_contents('/tmp/lang/'.$file,"<?php".PHP_EOL);
75
-      foreach ($terms as $term) {
73
+        @touch('/tmp/lang/'.$file);
74
+        file_put_contents('/tmp/lang/'.$file,"<?php".PHP_EOL);
75
+        foreach ($terms as $term) {
76 76
         file_put_contents('/tmp/lang/'.$file,'$'.$term.' = "'.str_replace('"','\"',$trans[$term]).'";'.PHP_EOL, FILE_APPEND);
77
-      }
77
+        }
78 78
     }  
79
-  }
79
+    }
80 80
 }
Please login to merge, or discard this patch.
main/cron/lang/langstats_file_builder.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
  * Code run
34 34
  */
35 35
 foreach ($terms as $row) {
36
-  if ($words_counter > 10000) { break; }
37
-  $words = str_word_count(get_lang($row['term_name'],null,$orig_lang));
38
-  $words_counter += $words;
39
-  $terms_in_limit[$row['term_name']] = $i;
40
-  //echo "Term <b>".$row['term_name']."</b> is <b>'".get_lang($row['term_name'],null,$orig_lang)."'</b> which means $words words<br /><br />\n";
41
-  //if ($words_counter%1000 >= 0) {
36
+    if ($words_counter > 10000) { break; }
37
+    $words = str_word_count(get_lang($row['term_name'],null,$orig_lang));
38
+    $words_counter += $words;
39
+    $terms_in_limit[$row['term_name']] = $i;
40
+    //echo "Term <b>".$row['term_name']."</b> is <b>'".get_lang($row['term_name'],null,$orig_lang)."'</b> which means $words words<br /><br />\n";
41
+    //if ($words_counter%1000 >= 0) {
42 42
     //echo "Reached $words_counter words at term $i (".$row['term_name']." used ".$row['term_count']." times)...<br />\n";
43
-  //}
44
-  $i++;
43
+    //}
44
+    $i++;
45 45
 }
46 46
 //echo $words_counter.'<br />';
47 47
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 echo "Scanning English files, trying to find these terms...<br />\n";
51 51
 if (!is_dir($arch_dir.'/langstats')) {
52
-  mkdir($arch_dir.'/langstats');
53
-  mkdir($arch_dir.'/langstats/'.$orig_lang);
52
+    mkdir($arch_dir.'/langstats');
53
+    mkdir($arch_dir.'/langstats/'.$orig_lang);
54 54
 }
55 55
 $list_files = scandir($lang_dir.'/'.$orig_lang);
56 56
 $j = 1;
@@ -59,35 +59,35 @@  discard block
 block discarded – undo
59 59
 $global_var = array(); //keep the combination of all vars
60 60
 $terms_in_limit = array_flip($terms_in_limit);
61 61
 foreach ($list_files as $file) {
62
-  if (substr($file,0,1) == '.') {continue;}
63
-  //echo "'".substr($file,0,-8)."',<br />"; //print in a PHP array format
64
-  $vars = file($lang_dir.'/'.$orig_lang.'/'.$file);
65
-  $local_var = array();
66
-  $file_string = '<?php'."\n";
67
-  foreach ($vars as $line) {
62
+    if (substr($file,0,1) == '.') {continue;}
63
+    //echo "'".substr($file,0,-8)."',<br />"; //print in a PHP array format
64
+    $vars = file($lang_dir.'/'.$orig_lang.'/'.$file);
65
+    $local_var = array();
66
+    $file_string = '<?php'."\n";
67
+    foreach ($vars as $line) {
68 68
     $var = array();
69 69
     $res = preg_match('/^(\$\w*)/',$line,$var);
70 70
     if ($res>0) {
71
-      //echo $var[1]."<br />";
71
+        //echo $var[1]."<br />";
72 72
       
73
-      if (in_array(substr($var[1],1),$terms_in_limit)) {
73
+        if (in_array(substr($var[1],1),$terms_in_limit)) {
74 74
         //echo "Var ".$var[1]." was in the limit<br />";
75 75
         $local_var[$var[1]] = $line;
76 76
         $file_string .= $line;
77 77
         $terms_found[] = substr($var[1],1); //e.g. store Tools
78 78
         $words_found += str_word_count(get_lang($var[1],null,$orig_lang));
79
-      } elseif (in_array(substr($var[1],5),$terms_in_limit)) {
79
+        } elseif (in_array(substr($var[1],5),$terms_in_limit)) {
80 80
         //echo "Var ".$var[1]." was in the limit<br />";
81 81
         $local_var[$var[1]] = $line;
82 82
         $file_string .= $line;
83 83
         $terms_found[] = substr($var[1],5); //e.g. store langTools
84 84
         $words_found += str_word_count(get_lang(substr($var[1],5),null,$orig_lang));
85
-      } //else do not care
85
+        } //else do not care
86 86
     }
87
-  }
88
-  echo "Writing ".$arch_dir.'/langstats/'.$orig_lang.'/'.$file."<br />\n";
89
-  file_put_contents($arch_dir.'/langstats/'.$orig_lang.'/'.$file,$file_string); 
90
-  $global_var += $local_var;
87
+    }
88
+    echo "Writing ".$arch_dir.'/langstats/'.$orig_lang.'/'.$file."<br />\n";
89
+    file_put_contents($arch_dir.'/langstats/'.$orig_lang.'/'.$file,$file_string); 
90
+    $global_var += $local_var;
91 91
 };
92 92
 $terms_diff = count($global_var)-count($terms_in_limit);
93 93
 echo count($global_var)." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files<br />";
Please login to merge, or discard this patch.
main/install/install.lib.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
         $html .= '<label class="checkbox-inline">
1683 1683
                         <input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
1684 1684
                     </label>';
1685
-         $html .= '<label class="checkbox-inline">
1685
+            $html .= '<label class="checkbox-inline">
1686 1686
                     <input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ') .' /> '. get_lang('AfterApproval') .'
1687 1687
                 </label>';
1688 1688
         $html .= '</div>';
@@ -1716,7 +1716,7 @@  discard block
 block discarded – undo
1716 1716
     </div>';
1717 1717
 
1718 1718
     echo panel($html, get_lang('Platform'), 'platform');
1719
- ?>
1719
+    ?>
1720 1720
     <div class='form-group'>
1721 1721
         <div class="col-sm-6">
1722 1722
             <button type="submit" class="btn btn-default pull-right" name="step3" value="&lt; <?php echo get_lang('Previous'); ?>" ><em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?></button>
Please login to merge, or discard this patch.
main/course_home/course_home.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             if (Database::num_rows($result) ==  0) {
214 214
                 $condition = '';
215 215
             } else {
216
-            	//great, there is an specific auto launch for this session we leave the $condition
216
+                //great, there is an specific auto launch for this session we leave the $condition
217 217
             }
218 218
         }
219 219
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             $lp_data = Database::fetch_array($result,'ASSOC');
226 226
             if (!empty($lp_data['id'])) {
227 227
                 if (api_is_platform_admin() || api_is_allowed_to_edit()) {
228
-                	$show_autolaunch_lp_warning = true;
228
+                    $show_autolaunch_lp_warning = true;
229 229
                 } else {
230 230
                     $session_key = 'lp_autolaunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id();
231 231
                     if (!isset($_SESSION[$session_key])) {
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         //if (!isset($_SESSION[$forumKey])) {
255 255
             //redirecting to the LP
256 256
             $url = api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&id_session='.$session_id;
257
-          //  $_SESSION[$forumKey] = true;
257
+            //  $_SESSION[$forumKey] = true;
258 258
             header("Location: $url");
259 259
             exit;
260 260
         //}
@@ -280,13 +280,13 @@  discard block
 block discarded – undo
280 280
 if (api_get_setting('course.homepage_view') == 'activity' ||
281 281
     api_get_setting('course.homepage_view') == 'activity_big'
282 282
 ) {
283
-	require 'activity.php';
283
+    require 'activity.php';
284 284
 } elseif (api_get_setting('course.homepage_view') == '2column') {
285
-	require '2column.php';
285
+    require '2column.php';
286 286
 } elseif (api_get_setting('course.homepage_view') == '3column') {
287
-	require '3column.php';
287
+    require '3column.php';
288 288
 } elseif (api_get_setting('course.homepage_view') == 'vertical_activity') {
289
-	require 'vertical_activity.php';
289
+    require 'vertical_activity.php';
290 290
 }
291 291
 
292 292
 $content = '<div id="course_tools">'.$content.'</div>';
Please login to merge, or discard this patch.
main/inc/lib/login.lib.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -852,14 +852,14 @@  discard block
 block discarded – undo
852 852
             $email = false;
853 853
         }
854 854
 
855
-		if ($email) {
856
-			$condition = "LOWER(email) = '".Database::escape_string($username)."' ";
857
-		} else {
855
+        if ($email) {
856
+            $condition = "LOWER(email) = '".Database::escape_string($username)."' ";
857
+        } else {
858 858
             $condition = "LOWER(username) = '".Database::escape_string($username)."'";
859 859
         }
860 860
 
861
-		$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
862
-		$query = "SELECT 
861
+        $tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
862
+        $query = "SELECT 
863 863
 		            user_id AS uid, 
864 864
 		            lastname AS lastName, 
865 865
 		            firstname AS firstName, 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
                     auth_source
875 875
 				 FROM $tbl_user
876 876
 				 WHERE ( $condition AND active = 1) ";
877
-		$result = Database::query($query);
877
+        $result = Database::query($query);
878 878
         $num_rows = Database::num_rows($result);
879 879
         if ($result && $num_rows > 0) {
880 880
             return Database::fetch_assoc($result);
Please login to merge, or discard this patch.