Completed
Push — 1.10.x ( 1567b9...eba9e5 )
by Julito
81:35 queued 25:27
created
main/webservices/lp.php 1 patch
Braces   +48 added lines, -20 removed lines patch added patch discarded remove patch
@@ -48,19 +48,22 @@  discard block
 block discarded – undo
48 48
         list($ip1) = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
49 49
         $ip = trim($ip1);
50 50
     }
51
-    if ($debug)
52
-        error_log("ip: $ip");
51
+    if ($debug) {
52
+            error_log("ip: $ip");
53
+    }
53 54
     // Check if a file that limits access from webservices exists and contains
54 55
     // the restraining check
55 56
     if (is_file('webservice-auth-ip.conf.php')) {
56 57
         include 'webservice-auth-ip.conf.php';
57
-        if ($debug)
58
-            error_log("webservice-auth-ip.conf.php file included");
58
+        if ($debug) {
59
+                    error_log("webservice-auth-ip.conf.php file included");
60
+        }
59 61
         if (!empty($ws_auth_ip)) {
60 62
             $check_ip = true;
61 63
             $ip_matches = api_check_ip_in_range($ip, $ws_auth_ip);
62
-            if ($debug)
63
-                error_log("ip_matches: $ip_matches");
64
+            if ($debug) {
65
+                            error_log("ip_matches: $ip_matches");
66
+            }
64 67
         }
65 68
     }
66 69
 
@@ -76,8 +79,9 @@  discard block
 block discarded – undo
76 79
     }
77 80
     $result = api_is_valid_secret_key($secret_key, $security_key);
78 81
     //error_log($secret_key.'-'.$security_key);
79
-    if ($debug)
80
-        error_log('WSHelperVerifyKey result: '.intval($result));
82
+    if ($debug) {
83
+            error_log('WSHelperVerifyKey result: '.intval($result));
84
+    }
81 85
     return $result;
82 86
 }
83 87
 
@@ -140,7 +144,9 @@  discard block
 block discarded – undo
140 144
     if (!WSHelperVerifyKey($params)) {
141 145
         return return_error(WS_ERROR_SECRET_KEY);
142 146
     }
143
-    if ($debug) error_log('WSImportLP');
147
+    if ($debug) {
148
+        error_log('WSImportLP');
149
+    }
144 150
 
145 151
     $courseIdName = $params['course_id_name'];
146 152
     $courseIdValue = $params['course_id_value'];
@@ -156,7 +162,9 @@  discard block
 block discarded – undo
156 162
     $courseId = $courseInfo['real_id'];
157 163
 
158 164
     if (empty($courseInfo)) {
159
-        if ($debug) error_log('Course not found');
165
+        if ($debug) {
166
+            error_log('Course not found');
167
+        }
160 168
         return 'Course not found';
161 169
     }
162 170
 
@@ -169,7 +177,9 @@  discard block
 block discarded – undo
169 177
 
170 178
         if (empty($sessionId)) {
171 179
 
172
-            if ($debug) error_log('Session not found');
180
+            if ($debug) {
181
+                error_log('Session not found');
182
+            }
173 183
             return 'Session not found';
174 184
         }
175 185
     }
@@ -196,7 +206,9 @@  discard block
 block discarded – undo
196 206
     $manifest = $oScorm->import_package($fileInfo, '', $courseInfo);
197 207
 
198 208
     if (!$manifest) {
199
-        if ($debug) error_log('manifest.xml file not found');
209
+        if ($debug) {
210
+            error_log('manifest.xml file not found');
211
+        }
200 212
         //if api_set_failure
201 213
         return 'manifest.xml file not found';
202 214
     }
@@ -215,10 +227,14 @@  discard block
 block discarded – undo
215 227
         $oScorm->set_maker($maker, $courseId);
216 228
         //$oScorm->set_jslib('scorm_api.php');
217 229
 
218
-        if ($debug) error_log('scorm was added');
230
+        if ($debug) {
231
+            error_log('scorm was added');
232
+        }
219 233
         return 1;
220 234
     } else {
221
-        if ($debug) error_log('manifest data empty');
235
+        if ($debug) {
236
+            error_log('manifest data empty');
237
+        }
222 238
         return 'manifest data empty';
223 239
     }
224 240
 }
@@ -311,7 +327,9 @@  discard block
 block discarded – undo
311 327
     );
312 328
 
313 329
     if (empty($courseInfo)) {
314
-        if ($debug) error_log("Course not found: $courseIdName : $courseIdValue");
330
+        if ($debug) {
331
+            error_log("Course not found: $courseIdName : $courseIdValue");
332
+        }
315 333
         return 'Course not found';
316 334
     }
317 335
 
@@ -326,7 +344,9 @@  discard block
 block discarded – undo
326 344
 
327 345
         if (empty($sessionId)) {
328 346
 
329
-            if ($debug) error_log('Session not found');
347
+            if ($debug) {
348
+                error_log('Session not found');
349
+            }
330 350
             return 'Session not found';
331 351
         }
332 352
     }
@@ -407,7 +427,9 @@  discard block
 block discarded – undo
407 427
     );
408 428
 
409 429
     if (empty($courseInfo)) {
410
-        if ($debug) error_log("Course not found: $courseIdName : $courseIdValue");
430
+        if ($debug) {
431
+            error_log("Course not found: $courseIdName : $courseIdValue");
432
+        }
411 433
         return 'Course not found';
412 434
     }
413 435
     $courseId = $courseInfo['real_id'];
@@ -432,7 +454,9 @@  discard block
 block discarded – undo
432 454
 
433 455
     $lp = new learnpath($courseCode, $lpId, null);
434 456
     if ($lp) {
435
-        if ($debug) error_log("LP deleted $lpId");
457
+        if ($debug) {
458
+            error_log("LP deleted $lpId");
459
+        }
436 460
 
437 461
         $course_dir = $courseInfo['directory'] . '/document';
438 462
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
@@ -448,7 +472,9 @@  discard block
 block discarded – undo
448 472
                 if ($item) {
449 473
                     $documentId = $item->get_path();
450 474
 
451
-                    if ($debug) error_log("lp item id found #$itemId");
475
+                    if ($debug) {
476
+                        error_log("lp item id found #$itemId");
477
+                    }
452 478
 
453 479
                     $documentInfo = DocumentManager::get_document_data_by_id(
454 480
                         $documentId,
@@ -474,7 +500,9 @@  discard block
 block discarded – undo
474 500
                         }
475 501
                     }
476 502
                 } else {
477
-                    if ($debug) error_log("Document not found #$itemId");
503
+                    if ($debug) {
504
+                        error_log("Document not found #$itemId");
505
+                    }
478 506
                 }
479 507
             }
480 508
         }
Please login to merge, or discard this patch.
main/inc/lib/message.lib.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -143,8 +143,9 @@  discard block
 block discarded – undo
143 143
             $direction = 'DESC';
144 144
         } else {
145 145
             $column = intval($column);
146
-            if (!in_array($direction, array('ASC', 'DESC')))
147
-                $direction = 'ASC';
146
+            if (!in_array($direction, array('ASC', 'DESC'))) {
147
+                            $direction = 'ASC';
148
+            }
148 149
         }
149 150
 
150 151
         $keyword = Session::read('message_search_keyword');
@@ -521,8 +522,9 @@  discard block
 block discarded – undo
521 522
     public static function delete_message_by_user_receiver($user_receiver_id, $id)
522 523
     {
523 524
         $table_message = Database::get_main_table(TABLE_MESSAGE);
524
-        if ($id != strval(intval($id)))
525
-            return false;
525
+        if ($id != strval(intval($id))) {
526
+                    return false;
527
+        }
526 528
         $user_receiver_id = intval($user_receiver_id);
527 529
         $id = intval($id);
528 530
         $sql = "SELECT * FROM $table_message
@@ -697,8 +699,9 @@  discard block
 block discarded – undo
697 699
      */
698 700
     public static function update_message($user_id, $message_id)
699 701
     {
700
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
701
-            return false;
702
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
703
+                    return false;
704
+        }
702 705
 
703 706
         $table_message = Database::get_main_table(TABLE_MESSAGE);
704 707
         $sql = "UPDATE $table_message SET msg_status = '0'
@@ -738,8 +741,9 @@  discard block
 block discarded – undo
738 741
      */
739 742
     public static function get_message_by_user($user_id, $message_id)
740 743
     {
741
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
742
-            return false;
744
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
745
+                    return false;
746
+        }
743 747
         $table_message = Database::get_main_table(TABLE_MESSAGE);
744 748
         $query = "SELECT * FROM $table_message
745 749
                   WHERE user_receiver_id=".intval($user_id)." AND id='".intval($message_id)."'";
@@ -754,8 +758,9 @@  discard block
 block discarded – undo
754 758
      */
755 759
     public static function get_messages_by_group($group_id)
756 760
     {
757
-        if ($group_id != strval(intval($group_id)))
758
-            return false;
761
+        if ($group_id != strval(intval($group_id))) {
762
+                    return false;
763
+        }
759 764
 
760 765
         $table_message = Database::get_main_table(TABLE_MESSAGE);
761 766
         $group_id = intval($group_id);
@@ -782,8 +787,9 @@  discard block
 block discarded – undo
782 787
      */
783 788
     public static function get_messages_by_group_by_message($group_id, $message_id)
784 789
     {
785
-        if ($group_id != strval(intval($group_id)))
786
-            return false;
790
+        if ($group_id != strval(intval($group_id))) {
791
+                    return false;
792
+        }
787 793
         $table_message = Database::get_main_table(TABLE_MESSAGE);
788 794
         $group_id = intval($group_id);
789 795
         $sql = "SELECT * FROM $table_message
@@ -861,8 +867,9 @@  discard block
 block discarded – undo
861 867
      */
862 868
     public static function exist_message($user_id, $id)
863 869
     {
864
-        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id)))
865
-            return false;
870
+        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) {
871
+                    return false;
872
+        }
866 873
         $table_message = Database::get_main_table(TABLE_MESSAGE);
867 874
         $query = "SELECT id FROM $table_message
868 875
                   WHERE
@@ -893,8 +900,9 @@  discard block
 block discarded – undo
893 900
             $direction = 'DESC';
894 901
         } else {
895 902
             $column = intval($column);
896
-            if (!in_array($direction, array('ASC', 'DESC')))
897
-                $direction = 'ASC';
903
+            if (!in_array($direction, array('ASC', 'DESC'))) {
904
+                            $direction = 'ASC';
905
+            }
898 906
         }
899 907
         $table_message = Database::get_main_table(TABLE_MESSAGE);
900 908
         $request = api_is_xml_http_request();
Please login to merge, or discard this patch.
main/inc/lib/blog.lib.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1001,8 +1001,9 @@  discard block
 block discarded – undo
1001 1001
             $blog_post_actions .= '</a>';
1002 1002
         }
1003 1003
 
1004
-		if (api_is_allowed('BLOG_' . $blog_id, 'article_rate'))
1005
-			$rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1004
+		if (api_is_allowed('BLOG_' . $blog_id, 'article_rate')) {
1005
+					$rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1006
+		}
1006 1007
 
1007 1008
 		$blog_post_text=stripslashes($blog_post_text);
1008 1009
 
@@ -1648,8 +1649,9 @@  discard block
 block discarded – undo
1648 1649
 
1649 1650
 						$arrPermissions = array();
1650 1651
 
1651
-						while ($row = Database::fetch_array($result))
1652
-							$arrPermissions[] = $row['action'];
1652
+						while ($row = Database::fetch_array($result)) {
1653
+													$arrPermissions[] = $row['action'];
1654
+						}
1653 1655
 
1654 1656
 						    echo '<tr>';
1655 1657
 							echo '<td style="text-align:right; vertical-align:top;">' . get_lang('TaskManager') . ':&nbsp;&nbsp;</td>';
@@ -2325,8 +2327,9 @@  discard block
 block discarded – undo
2325 2327
 		//Handle leap year
2326 2328
 		$numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
2327 2329
 
2328
-		if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0))
2329
-			$numberofdays[2] = 29;
2330
+		if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {
2331
+					$numberofdays[2] = 29;
2332
+		}
2330 2333
 
2331 2334
 		//Get the first day of the month
2332 2335
 		$dayone = getdate(mktime(0, 0, 0, $month, 1, $year));
@@ -2356,8 +2359,9 @@  discard block
 block discarded – undo
2356 2359
 		if( Database::num_rows($result) > 0) {
2357 2360
 			while($blog_post = Database::fetch_array($result)) {
2358 2361
 				// If the day of this post is not yet in the array, add it.
2359
-				if (!in_array($blog_post['post_day'], $posts))
2360
-					$posts[] = $blog_post['post_day'];
2362
+				if (!in_array($blog_post['post_day'], $posts)) {
2363
+									$posts[] = $blog_post['post_day'];
2364
+				}
2361 2365
 			}
2362 2366
 		}
2363 2367
 
@@ -2396,8 +2400,9 @@  discard block
 block discarded – undo
2396 2400
 
2397 2401
 		echo "<tr>";
2398 2402
 
2399
-		for($ii = 1; $ii < 8; $ii ++)
2400
-			echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2403
+		for($ii = 1; $ii < 8; $ii ++) {
2404
+					echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2405
+		}
2401 2406
 
2402 2407
 		echo "</tr>";
2403 2408
 
@@ -2407,8 +2412,9 @@  discard block
 block discarded – undo
2407 2412
 		while ($curday <= $numberofdays[$month]) {
2408 2413
 			echo "<tr>";
2409 2414
 			for ($ii = 0; $ii < 7; $ii ++) {
2410
-				if (($curday == -1) && ($ii == $startdayofweek))
2411
-					$curday = 1;
2415
+				if (($curday == -1) && ($ii == $startdayofweek)) {
2416
+									$curday = 1;
2417
+				}
2412 2418
 
2413 2419
 			 	if (($curday > 0) && ($curday <= $numberofdays[$month])) {
2414 2420
 					$bgcolor = $ii < 5 ? $class="class=\"days_week\"" : $class="class=\"days_weekend\"";
@@ -2422,10 +2428,11 @@  discard block
 block discarded – undo
2422 2428
 					echo "<td " . $class.">";
2423 2429
 
2424 2430
 					// If there are posts on this day, create a filter link.
2425
-					if(in_array($curday, $posts))
2426
-						echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2427
-					else
2428
-						echo $dayheader;
2431
+					if(in_array($curday, $posts)) {
2432
+											echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2433
+					} else {
2434
+											echo $dayheader;
2435
+					}
2429 2436
 
2430 2437
 					if (count($tasks) > 0) {
2431 2438
 						if (isset($tasks[$curday]) && is_array($tasks[$curday])) {
@@ -2440,8 +2447,9 @@  discard block
 block discarded – undo
2440 2447
 
2441 2448
 					echo "</td>";
2442 2449
 					$curday ++;
2443
-				} else
2444
-					echo "<td>&nbsp;</td>";
2450
+				} else {
2451
+									echo "<td>&nbsp;</td>";
2452
+				}
2445 2453
 			}
2446 2454
 			echo "</tr>";
2447 2455
 		}
Please login to merge, or discard this patch.
main/search/search_suggestions.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,6 +115,8 @@
 block discarded – undo
115 115
 }
116 116
 
117 117
 $q = strtolower($_GET["term"]);
118
-if (!$q) return;
118
+if (!$q) {
119
+    return;
120
+}
119 121
 //echo $q . "| value\n";
120 122
 get_suggestions_from_search_engine($q);
Please login to merge, or discard this patch.
main/document/edit_draw.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,13 +90,14 @@
 block discarded – undo
90 90
 
91 91
 $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
92 92
 
93
-if (!$is_certificate_mode)
93
+if (!$is_certificate_mode) {
94 94
 	$interbreadcrumb[] = array(
95 95
 		"url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(),
96 96
 		"name" => get_lang('Documents')
97 97
 	);
98
-else
98
+} else {
99 99
 	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
100
+}
100 101
 
101 102
 // Interbreadcrumb for the current directory root path
102 103
 if (empty($document_data['parents'])) {
Please login to merge, or discard this patch.
main/exercice/export/aiken/aiken_classes.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@
 block discarded – undo
7 7
  * @package chamilo.exercise
8 8
  */
9 9
 
10
-if ( count( get_included_files() ) == 1 ) die( '---' );
10
+if ( count( get_included_files() ) == 1 ) {
11
+    die( '---' );
12
+}
11 13
 
12 14
 if (!function_exists('mime_content_type')) {
13 15
 
Please login to merge, or discard this patch.
main/auth/shibboleth/test/shibboleth_test.class.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,8 +207,7 @@
 block discarded – undo
207 207
             // Dump variable for debug
208 208
             var_dump(debug_backtrace());
209 209
             die;
210
-        }
211
-        else
210
+        } else
212 211
         {
213 212
             $message = "Assert successful $message <br/>";
214 213
             echo $message;
Please login to merge, or discard this patch.