@@ -166,11 +166,21 @@ discard block |
||
166 | 166 | // call the ancestor's constructor |
167 | 167 | $this->PGTStorage($cas_parent); |
168 | 168 | |
169 | - if ( empty($database_type) ) $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE; |
|
170 | - if ( empty($hostname) ) $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME; |
|
171 | - if ( $port==0 ) $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT; |
|
172 | - if ( empty($database) ) $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE; |
|
173 | - if ( empty($table) ) $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE; |
|
169 | + if ( empty($database_type) ) { |
|
170 | + $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE; |
|
171 | + } |
|
172 | + if ( empty($hostname) ) { |
|
173 | + $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME; |
|
174 | + } |
|
175 | + if ( $port==0 ) { |
|
176 | + $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT; |
|
177 | + } |
|
178 | + if ( empty($database) ) { |
|
179 | + $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE; |
|
180 | + } |
|
181 | + if ( empty($table) ) { |
|
182 | + $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE; |
|
183 | + } |
|
174 | 184 | |
175 | 185 | // build and store the PEAR DB URL |
176 | 186 | $this->_url = $database_type.':'.'//'.$user.':'.$password.'@'.$hostname.':'.$port.'/'.$database; |
@@ -192,8 +202,9 @@ discard block |
||
192 | 202 | { |
193 | 203 | phpCAS::traceBegin(); |
194 | 204 | // if the storage has already been initialized, return immediatly |
195 | - if ( $this->isInitialized() ) |
|
196 | - return; |
|
205 | + if ( $this->isInitialized() ) { |
|
206 | + return; |
|
207 | + } |
|
197 | 208 | // call the ancestor's method (mark as initialized) |
198 | 209 | parent::init(); |
199 | 210 |
@@ -4,8 +4,9 @@ |
||
4 | 4 | require_once dirname(__FILE__).'/../../inc/global.inc.php'; |
5 | 5 | $url = api_get_path(WEB_PATH).'main/auth/conditional_login/complete_phone_number.php'; |
6 | 6 | |
7 | -if (! isset($_SESSION['conditional_login']['uid'])) |
|
7 | +if (! isset($_SESSION['conditional_login']['uid'])) { |
|
8 | 8 | die("Not Authorised"); |
9 | +} |
|
9 | 10 | ?> |
10 | 11 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
11 | 12 | <html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml"> |
@@ -80,7 +80,12 @@ discard block |
||
80 | 80 | |
81 | 81 | if ($res==1) { //WRONG PASSWORD |
82 | 82 | //$errorMessage = "LDAP User or password incorrect, try again.<br />"; |
83 | - if (isset($log)) unset($log); if (isset($uid)) unset($uid); |
|
83 | + if (isset($log)) { |
|
84 | + unset($log); |
|
85 | + } |
|
86 | + if (isset($uid)) { |
|
87 | + unset($uid); |
|
88 | + } |
|
84 | 89 | $loginLdapSucces = false; |
85 | 90 | } |
86 | 91 | if ($res==-1) { //WRONG USERNAME |
@@ -401,8 +406,9 @@ discard block |
||
401 | 406 | return $info; |
402 | 407 | |
403 | 408 | } else { |
404 | - if (count($ldap_query)!=0) |
|
405 | - Display :: display_error_message(get_lang('LDAPConnectionError')); |
|
409 | + if (count($ldap_query)!=0) { |
|
410 | + Display :: display_error_message(get_lang('LDAPConnectionError')); |
|
411 | + } |
|
406 | 412 | return array(); |
407 | 413 | } |
408 | 414 | } |
@@ -206,8 +206,7 @@ |
||
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; |
@@ -168,12 +168,10 @@ |
||
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 | } |
@@ -56,8 +56,7 @@ discard block |
||
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 |
||
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 |
||
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); |
@@ -107,8 +107,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -15,9 +15,10 @@ discard block |
||
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 |
||
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 |
@@ -25,8 +25,9 @@ |
||
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"> |