@@ -124,7 +124,7 @@ |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | - * @param $variable |
|
127 | + * @param string $variable |
|
128 | 128 | * @return mixed |
129 | 129 | */ |
130 | 130 | public function getConfigurationValue($variable) |
@@ -204,7 +204,6 @@ discard block |
||
204 | 204 | * lock = the user can no longer use this account |
205 | 205 | * @author Patrick Cool <[email protected]>, Ghent University |
206 | 206 | * @param int $active the current state of the account |
207 | - * @param int $user_id The user id |
|
208 | 207 | * @param string $url_params |
209 | 208 | * @return string Some HTML-code with the lock/unlock button |
210 | 209 | */ |
@@ -236,7 +235,7 @@ discard block |
||
236 | 235 | * @author Patrick Cool <[email protected]>, Ghent University |
237 | 236 | * @param int $status, do we want to lock the user ($status=lock) or unlock it ($status=unlock) |
238 | 237 | * @param int $user_id The user id |
239 | - * @return language variable |
|
238 | + * @return string|null variable |
|
240 | 239 | */ |
241 | 240 | function lock_unlock_user($status, $user_id) { |
242 | 241 | $user_table = Database :: get_main_table(TABLE_MAIN_USER); |
@@ -412,8 +412,9 @@ |
||
412 | 412 | //$table->set_column_filter(6, 'status_filter'); |
413 | 413 | //$table->set_column_filter(7, 'active_filter'); |
414 | 414 | //$table->set_column_filter(8, 'modify_filter'); |
415 | - if (api_is_platform_admin()) |
|
416 | - $table->set_form_actions(array('delete' => get_lang('DeleteFromPlatform'))); |
|
415 | + if (api_is_platform_admin()) { |
|
416 | + $table->set_form_actions(array('delete' => get_lang('DeleteFromPlatform'))); |
|
417 | + } |
|
417 | 418 | $table->display(); |
418 | 419 | } |
419 | 420 | Display :: display_footer(); |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | * display the edit and delete icons in the sortable table |
908 | 908 | * |
909 | 909 | * @param integer $id the id of the template |
910 | - * @return html code for the link to edit and delete the template |
|
910 | + * @return string code for the link to edit and delete the template |
|
911 | 911 | * |
912 | 912 | * @author Patrick Cool <[email protected]>, Ghent University, Belgium |
913 | 913 | * @version August 2008 |
@@ -923,7 +923,7 @@ discard block |
||
923 | 923 | * Display the image of the template in the sortable table |
924 | 924 | * |
925 | 925 | * @param string $image the image |
926 | - * @return html code for the image |
|
926 | + * @return string code for the image |
|
927 | 927 | * |
928 | 928 | * @author Patrick Cool <[email protected]>, Ghent University, Belgium |
929 | 929 | * @version August 2008 |
@@ -1120,7 +1120,7 @@ discard block |
||
1120 | 1120 | /** |
1121 | 1121 | * Returns an array containing the list of options used to populate the gradebook_number_decimals variable |
1122 | 1122 | * This function is called through a call_user_func() in the generate_settings_form function. |
1123 | - * @return array List of gradebook_number_decimals options |
|
1123 | + * @return string[] List of gradebook_number_decimals options |
|
1124 | 1124 | * |
1125 | 1125 | * @author Guillaume Viguier <[email protected]> |
1126 | 1126 | */ |
@@ -471,8 +471,9 @@ discard block |
||
471 | 471 | $extraction_path = $cssToUpload.$style_name.'/'; |
472 | 472 | for ($i = 0; $i < $num_files; $i++) { |
473 | 473 | $entry = $zip->getNameIndex($i); |
474 | - if (substr($entry, -1) == '/') |
|
475 | - continue; |
|
474 | + if (substr($entry, -1) == '/') { |
|
475 | + continue; |
|
476 | + } |
|
476 | 477 | |
477 | 478 | $pos_slash = strpos($entry, '/'); |
478 | 479 | $entry_without_first_dir = substr($entry, $pos_slash + 1); |
@@ -1231,17 +1232,21 @@ discard block |
||
1231 | 1232 | $hideme = array('disabled'); |
1232 | 1233 | } elseif ($url_info['active'] == 1) { |
1233 | 1234 | // We show the elements. |
1234 | - if (empty($row['variable'])) |
|
1235 | - $row['variable'] = 0; |
|
1236 | - if (empty($row['subkey'])) |
|
1237 | - $row['subkey'] = 0; |
|
1238 | - if (empty($row['category'])) |
|
1239 | - $row['category'] = 0; |
|
1235 | + if (empty($row['variable'])) { |
|
1236 | + $row['variable'] = 0; |
|
1237 | + } |
|
1238 | + if (empty($row['subkey'])) { |
|
1239 | + $row['subkey'] = 0; |
|
1240 | + } |
|
1241 | + if (empty($row['category'])) { |
|
1242 | + $row['category'] = 0; |
|
1243 | + } |
|
1240 | 1244 | |
1241 | 1245 | if (is_array($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ])) { |
1242 | 1246 | // We are sure that the other site have a selected value. |
1243 | - if ($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ]['selected_value'] != '') |
|
1244 | - $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value']; |
|
1247 | + if ($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ]['selected_value'] != '') { |
|
1248 | + $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value']; |
|
1249 | + } |
|
1245 | 1250 | } |
1246 | 1251 | // There is no else{} statement because we load the default $row['selected_value'] of the main Chamilo site. |
1247 | 1252 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @param string ISO code (fr_FR, ...) |
29 | 29 | * @param int Whether the sublanguage is published (0=unpublished, 1=published) |
30 | 30 | * @param int ID del idioma padre |
31 | - * @return int New sub language ID or false on error |
|
31 | + * @return false|string New sub language ID or false on error |
|
32 | 32 | */ |
33 | 33 | function add_sub_language ($original_name,$english_name,$isocode,$sublanguage_available,$parent_id) { |
34 | 34 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
@@ -128,7 +128,7 @@ |
||
128 | 128 | /** |
129 | 129 | * Update users from the imported data |
130 | 130 | * @param array $users List of users |
131 | - * @return void |
|
131 | + * @return false|null |
|
132 | 132 | * @uses global variable $inserted_in_course, which returns the list of courses the user was inserted in |
133 | 133 | */ |
134 | 134 |
@@ -454,7 +454,10 @@ |
||
454 | 454 | <blockquote> |
455 | 455 | <pre> |
456 | 456 | <b>UserName</b>;LastName;FirstName;Email;NewUserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;Active;Language;Courses;ClassId; |
457 | - xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;0/1;xxx;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br /> |
|
457 | + xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;0/1;xxx;<span style="color:red;"><?php if (count($list_reponse) > 0) { |
|
458 | + echo implode(';', $list_reponse).';'; |
|
459 | +} |
|
460 | +?></span>xxx1|xxx2|xxx3;1;<br /> |
|
458 | 461 | </pre> |
459 | 462 | </blockquote> |
460 | 463 | <p><?php |
@@ -206,7 +206,7 @@ |
||
206 | 206 | |
207 | 207 | /** |
208 | 208 | * Restores an attendance entry and fallback to attendances rendering |
209 | - * @param int $attendanceId |
|
209 | + * @param int $attendance_id |
|
210 | 210 | */ |
211 | 211 | public function attendance_restore($attendance_id) |
212 | 212 | { |
@@ -529,10 +529,11 @@ |
||
529 | 529 | $result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']); |
530 | 530 | foreach ($data_array['attendant_calendar'] as $class_day) { |
531 | 531 | if ($class_day['done_attendance'] == 1) { |
532 | - if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) |
|
533 | - $result[$class_day['id']] = get_lang('UserAttendedSymbol'); |
|
534 | - else |
|
535 | - $result[$class_day['id']] = '<span style="color:red">'.get_lang('UserNotAttendedSymbol').'</span>'; |
|
532 | + if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) { |
|
533 | + $result[$class_day['id']] = get_lang('UserAttendedSymbol'); |
|
534 | + } else { |
|
535 | + $result[$class_day['id']] = '<span style="color:red">'.get_lang('UserNotAttendedSymbol').'</span>'; |
|
536 | + } |
|
536 | 537 | } else { |
537 | 538 | $result[$class_day['id']] = " "; |
538 | 539 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | require_once api_get_path(SYS_PATH).'main/auth/external_login/functions.inc.php'; |
11 | 11 | |
12 | 12 | /** |
13 | -* @return true if cas is configured |
|
13 | +* @return boolean if cas is configured |
|
14 | 14 | * |
15 | 15 | **/ |
16 | 16 | function cas_configured() { |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | /** |
517 | 517 | * Logs a string in debug mode. |
518 | 518 | * |
519 | - * @param $str the string to write |
|
519 | + * @param string $str the string to write |
|
520 | 520 | * |
521 | 521 | * @private |
522 | 522 | */ |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | * This method is used by interface methods to print an error and where the function |
538 | 538 | * was originally called from. |
539 | 539 | * |
540 | - * @param $msg the message to print |
|
540 | + * @param string $msg the message to print |
|
541 | 541 | * |
542 | 542 | * @private |
543 | 543 | */ |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | /** |
665 | 665 | * This method returns the phpCAS version. |
666 | 666 | * |
667 | - * @return the phpCAS version. |
|
667 | + * @return string phpCAS version. |
|
668 | 668 | */ |
669 | 669 | function getVersion() { |
670 | 670 | return PHPCAS_VERSION; |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | * @warning should not be called only after phpCAS::forceAuthentication() |
1071 | 1071 | * or phpCAS::checkAuthentication(). |
1072 | 1072 | * |
1073 | - * @return the login name of the authenticated user |
|
1073 | + * @return string login name of the authenticated user |
|
1074 | 1074 | */ |
1075 | 1075 | function getUser() { |
1076 | 1076 | global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * |
75 | 75 | * Used by CASClient::PrintHTMLHeader() and CASClient::printHTMLFooter(). |
76 | 76 | * |
77 | - * @param $str the string to filter and output |
|
77 | + * @param string $str the string to filter and output |
|
78 | 78 | * |
79 | 79 | * @private |
80 | 80 | */ |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | /** |
188 | 188 | * This method returns the language used by phpCAS. |
189 | 189 | * |
190 | - * @return a string representing the language |
|
190 | + * @return string string representing the language |
|
191 | 191 | * |
192 | 192 | * @private |
193 | 193 | */ |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | /** |
213 | 213 | * This method returns a string depending on the language. |
214 | 214 | * |
215 | - * @param $str the index of the string in $_string. |
|
215 | + * @param integer $str the index of the string in $_string. |
|
216 | 216 | * |
217 | 217 | * @return the string corresponding to $index in $string. |
218 | 218 | * |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * This method is used to set the language used by phpCAS. |
234 | 234 | * @note Can be called only once. |
235 | 235 | * |
236 | - * @param $lang a string representing the language. |
|
236 | + * @param string $lang a string representing the language. |
|
237 | 237 | * |
238 | 238 | * @public |
239 | 239 | * @sa CAS_LANG_FRENCH, CAS_LANG_ENGLISH |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | /** |
422 | 422 | * This method is used to retrieve the service validating URL of the CAS server. |
423 | - * @return a URL. |
|
423 | + * @return string URL. |
|
424 | 424 | * @private |
425 | 425 | */ |
426 | 426 | function getServerServiceValidateURL() |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | } |
442 | 442 | /** |
443 | 443 | * This method is used to retrieve the SAML validating URL of the CAS server. |
444 | - * @return a URL. |
|
444 | + * @return string URL. |
|
445 | 445 | * @private |
446 | 446 | */ |
447 | 447 | function getServerSamlValidateURL() |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | } |
461 | 461 | /** |
462 | 462 | * This method is used to retrieve the proxy validating URL of the CAS server. |
463 | - * @return a URL. |
|
463 | + * @return string URL. |
|
464 | 464 | * @private |
465 | 465 | */ |
466 | 466 | function getServerProxyValidateURL() |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | |
542 | 542 | /** |
543 | 543 | * This method checks to see if the request is secured via HTTPS |
544 | - * @return true if https, false otherwise |
|
544 | + * @return boolean if https, false otherwise |
|
545 | 545 | * @private |
546 | 546 | */ |
547 | 547 | function isHttps() { |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | * CASClient constructor. |
562 | 562 | * |
563 | 563 | * @param $server_version the version of the CAS server |
564 | - * @param $proxy TRUE if the CAS client is a CAS proxy, FALSE otherwise |
|
564 | + * @param boolean $proxy TRUE if the CAS client is a CAS proxy, FALSE otherwise |
|
565 | 565 | * @param $server_hostname the hostname of the CAS server |
566 | 566 | * @param $server_port the port the CAS server is running on |
567 | 567 | * @param $server_uri the URI the CAS server is responding on |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | * @warning should be called only after CASClient::forceAuthentication() or |
760 | 760 | * CASClient::isAuthenticated(), otherwise halt with an error. |
761 | 761 | * |
762 | - * @return the login name of the authenticated user |
|
762 | + * @return string login name of the authenticated user |
|
763 | 763 | */ |
764 | 764 | function getUser() |
765 | 765 | { |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | /** |
832 | 832 | * This method is called to be sure that the user is authenticated. When not |
833 | 833 | * authenticated, halt by redirecting to the CAS server; otherwise return TRUE. |
834 | - * @return TRUE when the user is authenticated; otherwise halt. |
|
834 | + * @return boolean when the user is authenticated; otherwise halt. |
|
835 | 835 | * @public |
836 | 836 | */ |
837 | 837 | function forceAuthentication() |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | |
878 | 878 | /** |
879 | 879 | * This method is called to check whether the user is authenticated or not. |
880 | - * @return TRUE when the user is authenticated, FALSE otherwise. |
|
880 | + * @return boolean when the user is authenticated, FALSE otherwise. |
|
881 | 881 | * @public |
882 | 882 | */ |
883 | 883 | function checkAuthentication() |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | * This method is called to check if the user is authenticated (previously or by |
934 | 934 | * tickets given in the URL). |
935 | 935 | * |
936 | - * @return TRUE when the user is authenticated. Also may redirect to the same URL without the ticket. |
|
936 | + * @return boolean when the user is authenticated. Also may redirect to the same URL without the ticket. |
|
937 | 937 | * |
938 | 938 | * @public |
939 | 939 | */ |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | |
1004 | 1004 | /** |
1005 | 1005 | * This method tells if the current session is authenticated. |
1006 | - * @return true if authenticated based soley on $_SESSION variable |
|
1006 | + * @return boolean if authenticated based soley on $_SESSION variable |
|
1007 | 1007 | * @since 0.4.22 by Brendan Arnold |
1008 | 1008 | */ |
1009 | 1009 | function isSessionAuthenticated () |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | * |
1018 | 1018 | * @note This function switches to callback mode when needed. |
1019 | 1019 | * |
1020 | - * @return TRUE when the user has already been authenticated; FALSE otherwise. |
|
1020 | + * @return boolean when the user has already been authenticated; FALSE otherwise. |
|
1021 | 1021 | * |
1022 | 1022 | * @private |
1023 | 1023 | */ |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | } |
1130 | 1130 | |
1131 | 1131 | /** |
1132 | - * @return true if the current request is a logout request. |
|
1132 | + * @return boolean if the current request is a logout request. |
|
1133 | 1133 | * @private |
1134 | 1134 | */ |
1135 | 1135 | function isLogoutRequest() { |
@@ -1241,7 +1241,7 @@ discard block |
||
1241 | 1241 | |
1242 | 1242 | /** |
1243 | 1243 | * This method returns the Service Ticket provided in the URL of the request. |
1244 | - * @return The service ticket. |
|
1244 | + * @return string service ticket. |
|
1245 | 1245 | * @private |
1246 | 1246 | */ |
1247 | 1247 | function getST() |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | |
1258 | 1258 | /** |
1259 | 1259 | * This method tells if a Service Ticket was stored. |
1260 | - * @return TRUE if a Service Ticket has been stored. |
|
1260 | + * @return boolean if a Service Ticket has been stored. |
|
1261 | 1261 | * @private |
1262 | 1262 | */ |
1263 | 1263 | function hasST() |
@@ -1330,7 +1330,7 @@ discard block |
||
1330 | 1330 | * $text_reponse and $tree_response on success. These parameters are used later |
1331 | 1331 | * by CASClient::validatePGT() for CAS proxies. |
1332 | 1332 | * Used for all CAS 1.0 validations |
1333 | - * @param $validate_url the URL of the request to the CAS server. |
|
1333 | + * @param string $validate_url the URL of the request to the CAS server. |
|
1334 | 1334 | * @param $text_response the response of the CAS server, as is (XML text). |
1335 | 1335 | * @param $tree_response the response of the CAS server, as a DOM XML tree. |
1336 | 1336 | * |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | * $text_reponse and $tree_response on success. These parameters are used later |
1461 | 1461 | * by CASClient::validatePGT() for CAS proxies. |
1462 | 1462 | * |
1463 | - * @param $validate_url the URL of the request to the CAS server. |
|
1463 | + * @param string $validate_url the URL of the request to the CAS server. |
|
1464 | 1464 | * @param $text_response the response of the CAS server, as is (XML text). |
1465 | 1465 | * @param $tree_response the response of the CAS server, as a DOM XML tree. |
1466 | 1466 | * |
@@ -1648,7 +1648,7 @@ discard block |
||
1648 | 1648 | |
1649 | 1649 | /** |
1650 | 1650 | * This method returns the Proxy Granting Ticket given by the CAS server. |
1651 | - * @return The Proxy Granting Ticket. |
|
1651 | + * @return string Proxy Granting Ticket. |
|
1652 | 1652 | * @private |
1653 | 1653 | */ |
1654 | 1654 | function getPGT() |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | |
1665 | 1665 | /** |
1666 | 1666 | * This method tells if a Proxy Granting Ticket was stored. |
1667 | - * @return TRUE if a Proxy Granting Ticket has been stored. |
|
1667 | + * @return boolean if a Proxy Granting Ticket has been stored. |
|
1668 | 1668 | * @private |
1669 | 1669 | */ |
1670 | 1670 | function hasPGT() |
@@ -1697,7 +1697,7 @@ discard block |
||
1697 | 1697 | /** |
1698 | 1698 | * This method sets/unsets callback mode. |
1699 | 1699 | * |
1700 | - * @param $callback_mode TRUE to set callback mode, FALSE otherwise. |
|
1700 | + * @param boolean $callback_mode TRUE to set callback mode, FALSE otherwise. |
|
1701 | 1701 | * |
1702 | 1702 | * @private |
1703 | 1703 | */ |
@@ -1710,7 +1710,7 @@ discard block |
||
1710 | 1710 | * This method returns TRUE when the CAs client is running i callback mode, |
1711 | 1711 | * FALSE otherwise. |
1712 | 1712 | * |
1713 | - * @return A boolean. |
|
1713 | + * @return boolean boolean. |
|
1714 | 1714 | * |
1715 | 1715 | * @private |
1716 | 1716 | */ |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | * fact the URL of the current request without any CGI parameter, except if |
1735 | 1735 | * phpCAS::setFixedCallbackURL() was used). |
1736 | 1736 | * |
1737 | - * @return The callback URL |
|
1737 | + * @return string callback URL |
|
1738 | 1738 | * |
1739 | 1739 | * @private |
1740 | 1740 | */ |
@@ -1777,6 +1777,7 @@ discard block |
||
1777 | 1777 | * This method sets the callback url. |
1778 | 1778 | * |
1779 | 1779 | * @param $callback_url url to set callback |
1780 | + * @param string $url |
|
1780 | 1781 | * |
1781 | 1782 | * @private |
1782 | 1783 | */ |
@@ -1861,7 +1862,7 @@ discard block |
||
1861 | 1862 | /** |
1862 | 1863 | * This method reads a PGT from its Iou and deletes the corresponding storage entry. |
1863 | 1864 | * |
1864 | - * @param $pgt_iou the PGT Iou |
|
1865 | + * @param string $pgt_iou the PGT Iou |
|
1865 | 1866 | * |
1866 | 1867 | * @return The PGT corresponding to the Iou, FALSE when not found. |
1867 | 1868 | * |
@@ -1991,7 +1992,7 @@ discard block |
||
1991 | 1992 | * @param $err_code an error code (PHPCAS_SERVICE_OK on success). |
1992 | 1993 | * @param $err_msg an error message (empty on success). |
1993 | 1994 | * |
1994 | - * @return a Proxy Ticket, or FALSE on error. |
|
1995 | + * @return false|string Proxy Ticket, or FALSE on error. |
|
1995 | 1996 | * |
1996 | 1997 | * @private |
1997 | 1998 | */ |
@@ -2093,14 +2094,14 @@ discard block |
||
2093 | 2094 | /** |
2094 | 2095 | * This method is used to acces a remote URL. |
2095 | 2096 | * |
2096 | - * @param $url the URL to access. |
|
2097 | + * @param string $url the URL to access. |
|
2097 | 2098 | * @param $cookies an array containing cookies strings such as 'name=val' |
2098 | 2099 | * @param $headers an array containing the HTTP header lines of the response |
2099 | 2100 | * (an empty array on failure). |
2100 | 2101 | * @param $body the body of the response, as a string (empty on failure). |
2101 | 2102 | * @param $err_msg an error message, filled on failure. |
2102 | 2103 | * |
2103 | - * @return TRUE on success, FALSE otherwise (in this later case, $err_msg |
|
2104 | + * @return boolean on success, FALSE otherwise (in this later case, $err_msg |
|
2104 | 2105 | * contains an error message). |
2105 | 2106 | * |
2106 | 2107 | * @private |
@@ -2197,7 +2198,7 @@ discard block |
||
2197 | 2198 | /** |
2198 | 2199 | * This method is used to build the SAML POST body sent to /samlValidate URL. |
2199 | 2200 | * |
2200 | - * @return the SOAP-encased SAMLP artifact (the ticket). |
|
2201 | + * @return string SOAP-encased SAMLP artifact (the ticket). |
|
2201 | 2202 | * |
2202 | 2203 | * @private |
2203 | 2204 | */ |
@@ -2235,7 +2236,7 @@ discard block |
||
2235 | 2236 | * @param $output the output of the service (also used to give an error |
2236 | 2237 | * message on failure). |
2237 | 2238 | * |
2238 | - * @return TRUE on success, FALSE otherwise (in this later case, $err_code |
|
2239 | + * @return boolean on success, FALSE otherwise (in this later case, $err_code |
|
2239 | 2240 | * gives the reason why it failed and $output contains an error message). |
2240 | 2241 | * |
2241 | 2242 | * @public |
@@ -2382,7 +2383,7 @@ discard block |
||
2382 | 2383 | |
2383 | 2384 | /** |
2384 | 2385 | * This method returns the Proxy Ticket provided in the URL of the request. |
2385 | - * @return The proxy ticket. |
|
2386 | + * @return string proxy ticket. |
|
2386 | 2387 | * @private |
2387 | 2388 | */ |
2388 | 2389 | function getPT() |
@@ -2401,14 +2402,14 @@ discard block |
||
2401 | 2402 | |
2402 | 2403 | /** |
2403 | 2404 | * This method tells if a Proxy Ticket was stored. |
2404 | - * @return TRUE if a Proxy Ticket has been stored. |
|
2405 | + * @return boolean if a Proxy Ticket has been stored. |
|
2405 | 2406 | * @private |
2406 | 2407 | */ |
2407 | 2408 | function hasPT() |
2408 | 2409 | { return !empty($this->_pt); } |
2409 | 2410 | /** |
2410 | 2411 | * This method returns the SAML Ticket provided in the URL of the request. |
2411 | - * @return The SAML ticket. |
|
2412 | + * @return string SAML ticket. |
|
2412 | 2413 | * @private |
2413 | 2414 | */ |
2414 | 2415 | function getSA() |
@@ -2424,7 +2425,7 @@ discard block |
||
2424 | 2425 | |
2425 | 2426 | /** |
2426 | 2427 | * This method tells if a SAML Ticket was stored. |
2427 | - * @return TRUE if a SAML Ticket has been stored. |
|
2428 | + * @return boolean if a SAML Ticket has been stored. |
|
2428 | 2429 | * @private |
2429 | 2430 | */ |
2430 | 2431 | function hasSA() |
@@ -2442,6 +2443,7 @@ discard block |
||
2442 | 2443 | /** |
2443 | 2444 | * This method is used to validate a ST or PT; halt on failure |
2444 | 2445 | * Used for all CAS 2.0 validations |
2446 | + * @param string $validate_url |
|
2445 | 2447 | * @return bool TRUE when successfull, halt otherwise by calling CASClient::authError(). |
2446 | 2448 | * |
2447 | 2449 | * @private |
@@ -2556,7 +2558,7 @@ discard block |
||
2556 | 2558 | * This method returns the URL of the current request (without any ticket |
2557 | 2559 | * CGI parameter). |
2558 | 2560 | * |
2559 | - * @return The URL |
|
2561 | + * @return string URL |
|
2560 | 2562 | * |
2561 | 2563 | * @private |
2562 | 2564 | */ |
@@ -2634,7 +2636,7 @@ discard block |
||
2634 | 2636 | /** |
2635 | 2637 | * This method sets the URL of the current request |
2636 | 2638 | * |
2637 | - * @param $url url to set for service |
|
2639 | + * @param string $url url to set for service |
|
2638 | 2640 | * |
2639 | 2641 | * @private |
2640 | 2642 | */ |
@@ -2649,9 +2651,9 @@ discard block |
||
2649 | 2651 | /** |
2650 | 2652 | * This method is used to print the HTML output when the user was not authenticated. |
2651 | 2653 | * |
2652 | - * @param $failure the failure that occured |
|
2654 | + * @param string $failure the failure that occured |
|
2653 | 2655 | * @param $cas_url the URL the CAS server was asked for |
2654 | - * @param $no_response the response from the CAS server (other |
|
2656 | + * @param boolean $no_response the response from the CAS server (other |
|
2655 | 2657 | * parameters are ignored if TRUE) |
2656 | 2658 | * @param $bad_response bad response from the CAS server ($err_code |
2657 | 2659 | * and $err_msg ignored if TRUE) |
@@ -193,8 +193,9 @@ discard block |
||
193 | 193 | */ |
194 | 194 | function getLang() |
195 | 195 | { |
196 | - if ( empty($this->_lang) ) |
|
197 | - $this->setLang(PHPCAS_LANG_DEFAULT); |
|
196 | + if ( empty($this->_lang) ) { |
|
197 | + $this->setLang(PHPCAS_LANG_DEFAULT); |
|
198 | + } |
|
198 | 199 | return $this->_lang; |
199 | 200 | } |
200 | 201 | |
@@ -596,14 +597,14 @@ discard block |
||
596 | 597 | phpCAS::trace("No session found, creating new session"); |
597 | 598 | session_start(); |
598 | 599 | } |
599 | - }else{ |
|
600 | + } else{ |
|
600 | 601 | phpCAS::trace("Ticket found"); |
601 | 602 | // We have to copy any old data before renaming the session |
602 | 603 | if (session_id()) { |
603 | 604 | phpCAS::trace("Old active session found, saving old data and destroying session"); |
604 | 605 | $old_session = $_SESSION; |
605 | 606 | session_destroy(); |
606 | - }else{ |
|
607 | + } else{ |
|
607 | 608 | session_start(); |
608 | 609 | phpCAS::trace("Starting possible old session to copy variables"); |
609 | 610 | $old_session = $_SESSION; |
@@ -620,7 +621,7 @@ discard block |
||
620 | 621 | $_SESSION = $old_session; |
621 | 622 | } |
622 | 623 | } |
623 | - }else{ |
|
624 | + } else{ |
|
624 | 625 | phpCAS::trace("Skipping session creation"); |
625 | 626 | } |
626 | 627 | |
@@ -631,9 +632,10 @@ discard block |
||
631 | 632 | //check version |
632 | 633 | switch ($server_version) { |
633 | 634 | case CAS_VERSION_1_0: |
634 | - if ( $this->isProxy() ) |
|
635 | - phpCAS::error('CAS proxies are not supported in CAS ' |
|
635 | + if ( $this->isProxy() ) { |
|
636 | + phpCAS::error('CAS proxies are not supported in CAS ' |
|
636 | 637 | .$server_version); |
638 | + } |
|
637 | 639 | break; |
638 | 640 | case CAS_VERSION_2_0: |
639 | 641 | break; |
@@ -817,8 +819,9 @@ discard block |
||
817 | 819 | function renewAuthentication(){ |
818 | 820 | phpCAS::traceBegin(); |
819 | 821 | // Either way, the user is authenticated by CAS |
820 | - if( isset( $_SESSION['phpCAS']['auth_checked'] ) ) |
|
821 | - unset($_SESSION['phpCAS']['auth_checked']); |
|
822 | + if( isset( $_SESSION['phpCAS']['auth_checked'] ) ) { |
|
823 | + unset($_SESSION['phpCAS']['auth_checked']); |
|
824 | + } |
|
822 | 825 | if ( $this->isAuthenticated() ) { |
823 | 826 | phpCAS::trace('user already authenticated; renew'); |
824 | 827 | $this->redirectToCas(false,true); |
@@ -897,8 +900,10 @@ discard block |
||
897 | 900 | // // never reached |
898 | 901 | // $res = FALSE; |
899 | 902 | // avoid a check against CAS on every request |
900 | - if (! isset($_SESSION['phpCAS']['unauth_count']) ) |
|
901 | - $_SESSION['phpCAS']['unauth_count'] = -2; // uninitialized |
|
903 | + if (! isset($_SESSION['phpCAS']['unauth_count']) ) { |
|
904 | + $_SESSION['phpCAS']['unauth_count'] = -2; |
|
905 | + } |
|
906 | + // uninitialized |
|
902 | 907 | |
903 | 908 | if (($_SESSION['phpCAS']['unauth_count'] != -2 && $this->_cache_times_for_auth_recheck == -1) |
904 | 909 | || ($_SESSION['phpCAS']['unauth_count'] >= 0 && $_SESSION['phpCAS']['unauth_count'] < $this->_cache_times_for_auth_recheck)) |
@@ -909,13 +914,11 @@ discard block |
||
909 | 914 | { |
910 | 915 | $_SESSION['phpCAS']['unauth_count']++; |
911 | 916 | phpCAS::trace('user is not authenticated (cached for '.$_SESSION['phpCAS']['unauth_count'].' times of '.$this->_cache_times_for_auth_recheck.')'); |
912 | - } |
|
913 | - else |
|
917 | + } else |
|
914 | 918 | { |
915 | 919 | phpCAS::trace('user is not authenticated (cached for until login pressed)'); |
916 | 920 | } |
917 | - } |
|
918 | - else |
|
921 | + } else |
|
919 | 922 | { |
920 | 923 | $_SESSION['phpCAS']['unauth_count'] = 0; |
921 | 924 | $_SESSION['phpCAS']['auth_checked'] = true; |
@@ -948,8 +951,7 @@ discard block |
||
948 | 951 | // authenticated, nothing to be done. |
949 | 952 | phpCAS::trace('user was already authenticated, no need to look for tickets'); |
950 | 953 | $res = TRUE; |
951 | - } |
|
952 | - else { |
|
954 | + } else { |
|
953 | 955 | if ( $this->hasST() ) { |
954 | 956 | // if a Service Ticket was given, validate it |
955 | 957 | phpCAS::trace('ST `'.$this->getST().'\' is present'); |
@@ -962,8 +964,7 @@ discard block |
||
962 | 964 | } |
963 | 965 | $_SESSION['phpCAS']['user'] = $this->getUser(); |
964 | 966 | $res = TRUE; |
965 | - } |
|
966 | - elseif ( $this->hasPT() ) { |
|
967 | + } elseif ( $this->hasPT() ) { |
|
967 | 968 | // if a Proxy Ticket was given, validate it |
968 | 969 | phpCAS::trace('PT `'.$this->getPT().'\' is present'); |
969 | 970 | $this->validatePT($validate_url,$text_response,$tree_response); // note: if it fails, it halts |
@@ -975,8 +976,7 @@ discard block |
||
975 | 976 | } |
976 | 977 | $_SESSION['phpCAS']['user'] = $this->getUser(); |
977 | 978 | $res = TRUE; |
978 | - } |
|
979 | - elseif ( $this->hasSA() ) { |
|
979 | + } elseif ( $this->hasSA() ) { |
|
980 | 980 | // if we have a SAML ticket, validate it. |
981 | 981 | phpCAS::trace('SA `'.$this->getSA().'\' is present'); |
982 | 982 | $this->validateSA($validate_url,$text_response,$tree_response); // if it fails, it halts |
@@ -984,8 +984,7 @@ discard block |
||
984 | 984 | $_SESSION['phpCAS']['user'] = $this->getUser(); |
985 | 985 | $_SESSION['phpCAS']['attributes'] = $this->getAttributes(); |
986 | 986 | $res = TRUE; |
987 | - } |
|
988 | - else { |
|
987 | + } else { |
|
989 | 988 | // no ticket given, not authenticated |
990 | 989 | phpCAS::trace('no ticket found'); |
991 | 990 | } |
@@ -1581,8 +1580,7 @@ discard block |
||
1581 | 1580 | foreach($attr_array as $attr_key => $attr_value) { |
1582 | 1581 | if(count($attr_value) > 1) { |
1583 | 1582 | $this->_attributes[$attr_key] = $attr_value; |
1584 | - } |
|
1585 | - else { |
|
1583 | + } else { |
|
1586 | 1584 | $this->_attributes[$attr_key] = $attr_value[0]; |
1587 | 1585 | } |
1588 | 1586 | } |
@@ -2601,8 +2599,9 @@ discard block |
||
2601 | 2599 | $query_string = $this->removeParameterFromQueryString('ticket', $request_uri[1]); |
2602 | 2600 | |
2603 | 2601 | // If the query string still has anything left, append it to the final URI |
2604 | - if ($query_string !== '') |
|
2605 | - $final_uri .= "?$query_string"; |
|
2602 | + if ($query_string !== '') { |
|
2603 | + $final_uri .= "?$query_string"; |
|
2604 | + } |
|
2606 | 2605 | |
2607 | 2606 | } |
2608 | 2607 | |
@@ -2680,10 +2679,11 @@ discard block |
||
2680 | 2679 | phpCAS::trace('Reason: CAS error'); |
2681 | 2680 | break; |
2682 | 2681 | case CAS_VERSION_2_0: |
2683 | - if ( empty($err_code) ) |
|
2684 | - phpCAS::trace('Reason: no CAS error'); |
|
2685 | - else |
|
2686 | - phpCAS::trace('Reason: ['.$err_code.'] CAS error: '.$err_msg); |
|
2682 | + if ( empty($err_code) ) { |
|
2683 | + phpCAS::trace('Reason: no CAS error'); |
|
2684 | + } else { |
|
2685 | + phpCAS::trace('Reason: ['.$err_code.'] CAS error: '.$err_msg); |
|
2686 | + } |
|
2687 | 2687 | break; |
2688 | 2688 | } |
2689 | 2689 | } |