Passed
Push — 1.10.x ( 08890a...2189d7 )
by Yannick
116:38 queued 75:46
created
main/auth/shibboleth/test/shibboleth_test.class.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -206,8 +206,7 @@
 block discarded – undo
206 206
             echo $message;
207 207
             var_dump(debug_backtrace());
208 208
             die;
209
-        }
210
-        else
209
+        } else
211 210
         {
212 211
             $message = "Assert successful $message <br/>";
213 212
             echo $message;
Please login to merge, or discard this patch.
main/auth/shibboleth/app/model/shibboleth_store.class.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -168,12 +168,10 @@
 block discarded – undo
168 168
                 if (empty($result))
169 169
                 {
170 170
                     $result = $default;
171
-                }
172
-                else if (count($result) == 1)
171
+                } else if (count($result) == 1)
173 172
                 {
174 173
                     $result = reset($result);
175
-                }
176
-                else
174
+                } else
177 175
                 {
178 176
                     $result = $result;
179 177
                 }
Please login to merge, or discard this patch.
main/auth/shibboleth/app/controller/shibboleth_controller.class.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
             if ($email = $form->get_email())
57 57
             {
58 58
                 $user->email = $email;
59
-            }
60
-            else
59
+            } else
61 60
             {
62 61
                 $content = $form->display();
63 62
                 Shibboleth::display()->page($content);
@@ -71,8 +70,7 @@  discard block
 block discarded – undo
71 70
         if ($is_new_user && $user->status_request)
72 71
         {
73 72
             Shibboleth::redirect('/main/auth/shibboleth/app/view/request.php');
74
-        }
75
-        else
73
+        } else
76 74
         {
77 75
             Shibboleth::redirect();
78 76
         }
@@ -141,8 +139,7 @@  discard block
 block discarded – undo
141 139
             {
142 140
                 $request_submitted = get_lang('RequestSubmitted');
143 141
                 Shibboleth::display()->message_page($request_submitted);
144
-            }
145
-            else
142
+            } else
146 143
             {
147 144
                 $request_failed = get_lang('RequestFailed');
148 145
                 Shibboleth::display()->error_page($request_failed);
Please login to merge, or discard this patch.
main/auth/shibboleth/lib/store.class.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -107,8 +107,7 @@  discard block
 block discarded – undo
107 107
         if ($this->is_new($object))
108 108
         {
109 109
             $result = $this->insert($object);
110
-        }
111
-        else
110
+        } else
112 111
         {
113 112
             $result = $this->update($object);
114 113
         }
@@ -257,8 +256,7 @@  discard block
 block discarded – undo
257 256
             $object->{$this->id_name} = $id;
258 257
             $object->{db_name} = $db_name;
259 258
             return $id;
260
-        }
261
-        else
259
+        } else
262 260
         {
263 261
             return false;
264 262
         }
@@ -278,16 +276,13 @@  discard block
 block discarded – undo
278 276
                     return '';
279 277
                 }
280 278
                 $args = array($this->pk_name, $arg);
281
-            }
282
-            else if (is_string($arg))
279
+            } else if (is_string($arg))
283 280
             {
284 281
                 return $arg;
285
-            }
286
-            else if (is_array($arg))
282
+            } else if (is_array($arg))
287 283
             {
288 284
                 $args = $arg;
289
-            }
290
-            else
285
+            } else
291 286
             {
292 287
                 return $arg;
293 288
             }
@@ -309,17 +304,14 @@  discard block
 block discarded – undo
309 304
         if (is_bool($var))
310 305
         {
311 306
             return $value ? '1' : '0';
312
-        }
313
-        else if (is_numeric($value))
307
+        } else if (is_numeric($value))
314 308
         {
315 309
             return empty($value) ? '0' : $value;
316
-        }
317
-        else if (is_string($value))
310
+        } else if (is_string($value))
318 311
         {
319 312
             $value = mysql_escape_string($value);
320 313
             return "'$value'";
321
-        }
322
-        else
314
+        } else
323 315
         {
324 316
             return $value;
325 317
         }
Please login to merge, or discard this patch.
main/reports/reports.lib.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,9 +15,10 @@  discard block
 block discarded – undo
15 15
 // load templates 
16 16
 function reports_loadTemplates() {
17 17
 	global $reports_enabled_templates, $reports_template;
18
-	foreach ($reports_enabled_templates as $t)
19
-		require_once 'templates/'.$t.'.reports.php';
20
-}
18
+	foreach ($reports_enabled_templates as $t) {
19
+			require_once 'templates/'.$t.'.reports.php';
20
+	}
21
+	}
21 22
 
22 23
 
23 24
 // clear all reporting data
@@ -150,11 +151,12 @@  discard block
 block discarded – undo
150 151
 // return tools ID (parametre is a constant from main_api
151 152
 function reports_getToolId($tool) {
152 153
 	$tools = array_flip(api_get_tools_lists());
153
-	if (array_key_exists($tool, $tools)) 
154
-		return $tools[$tool];
155
-	else
156
-		return null;
157
-}
154
+	if (array_key_exists($tool, $tools)) {
155
+			return $tools[$tool];
156
+	} else {
157
+			return null;
158
+	}
159
+	}
158 160
 
159 161
 // return a sql clause returning triplet of (course, $session, $uid) the
160 162
 // current user is authorized to reed
Please login to merge, or discard this patch.
main/reports/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@
 block discarded – undo
25 25
 $tool_name=get_lang('Reports');
26 26
 
27 27
 // Displaying the header
28
-foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js)
28
+foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js) {
29 29
     $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/'.$js.'" type="text/javascript" language="javascript"></script>'."\n";
30
+}
30 31
 
31 32
 // FIXME
32 33
 $htmlHeadXtra[] = '    <style type="text/css">
Please login to merge, or discard this patch.
main/reports/multiquery.lib.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@  discard block
 block discarded – undo
8 8
 		// mysql handler
9 9
 		$result[$i]['mysql'] = mysql_query($array[$i]);
10 10
 
11
-		if (! $result[$i]['mysql'])
12
-			die("error in query $i : ".$array[$i]);
11
+		if (! $result[$i]['mysql']) {
12
+					die("error in query $i : ".$array[$i]);
13
+		}
13 14
 
14 15
 		// fields
15 16
 		$result[$i]['num_fields'] = mysql_num_fields($result[$i]['mysql']);
@@ -25,10 +26,11 @@  discard block
 block discarded – undo
25 26
 	$result['num_queries'] = sizeof($array);
26 27
 	// rows
27 28
 	$numberOfResult = mysql_num_rows($result[0]['mysql']);
28
-	for ($i = 1; $i <$result['num_queries']; $i++) 
29
-		if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
29
+	for ($i = 1; $i <$result['num_queries']; $i++) {
30
+			if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
30 31
 			die("wrong number of row: $numberOfResult vs ".
31 32
 				mysql_num_rows($result[$i]['mysql'])." on query $i");
33
+	}
32 34
 
33 35
 	$result['num_rows'] = $numberOfResult;
34 36
 	$result['num_fields'] = $field;
@@ -53,7 +55,10 @@  discard block
 block discarded – undo
53 55
 	$pos = 0;
54 56
 	for ($i = 0; $i < $mq_h['num_queries']; $i++) {
55 57
 		$row = mysql_fetch_row($mq_h[$i]['mysql']);
56
-		if (!$row) return false; // last line
58
+		if (!$row) {
59
+		    return false;
60
+		}
61
+		// last line
57 62
 		for ($j = 0; $j < sizeof($row); $j++) {
58 63
 			$result[$pos] = $row[$j];
59 64
 			$pos++;
Please login to merge, or discard this patch.
main/reports/templates/exercicesMultiCourses.reports.php 1 patch
Braces   +18 added lines, -11 removed lines patch added patch discarded remove patch
@@ -41,28 +41,35 @@
 block discarded – undo
41 41
 		'where r.course_id=c.id and r.tool_id='.
42 42
 		reports_getToolId(TOOL_QUIZ).
43 43
 		' order by r.course_id, r.child_name');
44
-	if (Database::num_rows($columns) == 0)
45
-		die('<b>'.get_lang('no data found').'</b>');
44
+	if (Database::num_rows($columns) == 0) {
45
+			die('<b>'.get_lang('no data found').'</b>');
46
+	}
46 47
 	$query = 'select u.lastname Name, u.firstname Firstname';
47 48
 	$columns = Database::store_result($columns);
48
-	if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max')
49
-		$function = $_REQUEST['tattempt'];
50
-	else
51
-		$function = 'avg';
52
-	foreach ($columns as $key => $column)
53
-		$query .= ', '.$function.'(k'.$key.'.score) as `'.
49
+	if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max') {
50
+			$function = $_REQUEST['tattempt'];
51
+	} else {
52
+			$function = 'avg';
53
+	}
54
+	foreach ($columns as $key => $column) {
55
+			$query .= ', '.$function.'(k'.$key.'.score) as `'.
54 56
 				$column['course'].' - '.
55
-				$column['test'].'` '; 
57
+				$column['test'].'` ';
58
+	}
56 59
 	$query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
57
-	foreach ($columns as $key => $column) // fixme sessions
60
+	foreach ($columns as $key => $column) {
61
+	    // fixme sessions
58 62
 		$query .= 'left outer join '.
59 63
 			Database::get_main_table(TABLE_MAIN_REPORTS_VALUES).
60 64
 			' k'.$key.
61 65
 			' on k'.$key.'.key_id = '.$column['kid'].
62 66
 				' and k'.$key.'.user_id = u.user_id ';
67
+	}
63 68
 	$query .= ' group by ';
64
-	foreach ($columns as $key => $column) // grouping attempt
69
+	foreach ($columns as $key => $column) {
70
+	    // grouping attempt
65 71
 		$query .= 'k'.$key.'.attempt, ';
72
+	}
66 73
 	$query = substr($query, 0, -2); // removing last ', ';
67 74
 
68 75
 
Please login to merge, or discard this patch.
main/reports/templates/courseArticulate.reports.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 	// Stored Value
40 40
 	$sv = array();
41 41
 	foreach ($sv as $k => $v) {
42
-        if (!isset($v['sql']))
43
-                $v['sql'] = 'FIELD';
42
+        if (!isset($v['sql'])) {
43
+                        $v['sql'] = 'FIELD';
44
+        }
44 45
         $sqlField = str_replace('FIELD', 'sv.sv_value', $v['sql']);
45 46
         $query = 'select '.$sqlField.' as "'.$v['title'].'" ';
46 47
 //		$query = 'select sec_to_time(sv.sv_value) as "'.$v.'" ';
@@ -110,8 +111,9 @@  discard block
 block discarded – undo
110 111
 		$query .= ' on u.user_id = lv.user_id and lv.lp_id = '.$v['lid'];
111 112
 		$query .= ' left outer join '.Database::get_course_table(TABLE_LP_ITEM_VIEW).' liv ';
112 113
 		$query .= ' on lv.id = liv.lp_view_id ';
113
-		if ($v['target_view_count'])
114
-			$query .= ' and liv.view_count = '.$v['target_view_count'];
114
+		if ($v['target_view_count']) {
115
+					$query .= ' and liv.view_count = '.$v['target_view_count'];
116
+		}
115 117
 		$query .= ' and liv.lp_item_id = '.$v['liid'].' ';
116 118
 		$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
117 119
 		$query .= ' group by u.user_id ';
Please login to merge, or discard this patch.