@@ -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); |
@@ -117,14 +117,12 @@ |
||
117 | 117 | // Loops while the current group is a subgroup |
118 | 118 | while (isset($groupRelations[$id]['group_id'])) { |
119 | 119 | $name = $name ? |
120 | - $groupRelations[$id]['name'] . " > " . $name : |
|
121 | - $groupRelations[$id]['name']; |
|
120 | + $groupRelations[$id]['name']." > ".$name : $groupRelations[$id]['name']; |
|
122 | 121 | $id = $groupRelations[$id]['group_id']; |
123 | 122 | } |
124 | 123 | // The base group |
125 | 124 | $name = $name ? |
126 | - $groupRelations[$id]['name'] . " > " . $name : |
|
127 | - $groupRelations[$id]['name']; |
|
125 | + $groupRelations[$id]['name']." > ".$name : $groupRelations[$id]['name']; |
|
128 | 126 | $group[3] = $status[$group[3]]; |
129 | 127 | $group['1'] = '<a href="'.api_get_path(WEB_CODE_PATH).'social/group_view.php?id='.$group['0'].'">'.$name.'</a>'; |
130 | 128 | $groups[] = $group; |
@@ -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 | */ |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | //Plugins NOT installed |
131 | 131 | echo Display::page_subheader(get_lang('Plugins')); |
132 | - echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token=' . $token . '">'; |
|
132 | + echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token='.$token.'">'; |
|
133 | 133 | echo '<table class="data_table">'; |
134 | 134 | echo '<tr>'; |
135 | 135 | echo '<th width="20px">'; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $plugin_list = array(); |
143 | 143 | $my_plugin_list = $plugin_obj->get_plugin_regions(); |
144 | - foreach($my_plugin_list as $plugin_item) { |
|
144 | + foreach ($my_plugin_list as $plugin_item) { |
|
145 | 145 | $plugin_list[$plugin_item] = $plugin_item; |
146 | 146 | } |
147 | 147 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | if (file_exists(api_get_path(SYS_PLUGIN_PATH).$plugin.'/readme.txt')) { |
181 | 181 | echo Display::url( |
182 | 182 | "<em class='fa fa-file-text-o'></em> readme.txt", |
183 | - api_get_path(WEB_PLUGIN_PATH) . $plugin . "/readme.txt", |
|
183 | + api_get_path(WEB_PLUGIN_PATH).$plugin."/readme.txt", |
|
184 | 184 | [ |
185 | 185 | 'class' => 'btn btn-default ajax', |
186 | 186 | 'data-title' => $plugin_info['title'], |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $show_name = ucwords(str_replace('_', ' ', $style_dir)); |
323 | 323 | |
324 | 324 | if ($is_style_changeable) { |
325 | - $list_of_names[$style_dir] = $show_name; |
|
325 | + $list_of_names[$style_dir] = $show_name; |
|
326 | 326 | } |
327 | 327 | $counter++; |
328 | 328 | } |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | if (is_dir($dir)) { |
354 | 354 | $zip = new PclZip($arch); |
355 | 355 | // Remove path prefix except the style name and put file on disk |
356 | - $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir,0,-strlen($safe_style_dir))); |
|
356 | + $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir, 0, -strlen($safe_style_dir))); |
|
357 | 357 | //@TODO: use more generic script to download. |
358 | - $str = '<a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch) . '">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
358 | + $str = '<a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch).'">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
359 | 359 | Display::display_normal_message($str, false); |
360 | 360 | } else { |
361 | 361 | Display::addFlash(Display::return_message(get_lang('FileNotFound'), 'warning')); |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | if (!empty($areas_to_installed)) { |
544 | 544 | $plugin_obj->remove_all_regions($plugin); |
545 | 545 | foreach ($areas_to_installed as $region) { |
546 | - if (!empty($region) && $region != '-1' ) { |
|
546 | + if (!empty($region) && $region != '-1') { |
|
547 | 547 | $plugin_obj->add_to_region($plugin, $region); |
548 | 548 | } |
549 | 549 | } |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $values = api_get_settings_options('search_enabled'); |
636 | 636 | $form->addElement('header', null, get_lang('SearchEnabledTitle')); |
637 | 637 | |
638 | - $group = array (); |
|
638 | + $group = array(); |
|
639 | 639 | if (is_array($values)) { |
640 | 640 | foreach ($values as $key => $value) { |
641 | 641 | $element = & $form->createElement('radio', 'search_enabled', '', get_lang($value['display_text']), $value['value']); |
@@ -661,12 +661,12 @@ discard block |
||
661 | 661 | |
662 | 662 | if ($search_enabled == 'true') { |
663 | 663 | $values = api_get_settings_options('search_show_unlinked_results'); |
664 | - $group = array (); |
|
664 | + $group = array(); |
|
665 | 665 | foreach ($values as $key => $value) { |
666 | 666 | $element = & $form->createElement('radio', 'search_show_unlinked_results', '', get_lang($value['display_text']), $value['value']); |
667 | 667 | $group[] = $element; |
668 | 668 | } |
669 | - $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'),get_lang('SearchShowUnlinkedResultsComment')), '', false); |
|
669 | + $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'), get_lang('SearchShowUnlinkedResultsComment')), '', false); |
|
670 | 670 | $default_values['search_show_unlinked_results'] = api_get_setting('search_show_unlinked_results'); |
671 | 671 | |
672 | 672 | $sf_values = array(); |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | $sf_values[$sf['code']] = $sf['name']; |
675 | 675 | } |
676 | 676 | $group = array(); |
677 | - $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
677 | + $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
678 | 678 | if (empty($sf_values)) { |
679 | 679 | $form->addElement('html', get_lang('SearchPrefilterPrefix').$url); |
680 | 680 | } else { |
@@ -741,10 +741,10 @@ discard block |
||
741 | 741 | $dir_is_writable = Display::return_icon('bullet_red.png', get_lang('Error')); |
742 | 742 | } |
743 | 743 | |
744 | - $data[] = array(get_lang('XapianModuleInstalled'),$xapian_loaded); |
|
745 | - $data[] = array(get_lang('DirectoryExists').' - '.$xapian_path,$dir_exists); |
|
746 | - $data[] = array(get_lang('IsWritable').' - '.$xapian_path,$dir_is_writable); |
|
747 | - $data[] = array(get_lang('SpecificSearchFieldsAvailable') ,$specific_fields_exists); |
|
744 | + $data[] = array(get_lang('XapianModuleInstalled'), $xapian_loaded); |
|
745 | + $data[] = array(get_lang('DirectoryExists').' - '.$xapian_path, $dir_exists); |
|
746 | + $data[] = array(get_lang('IsWritable').' - '.$xapian_path, $dir_is_writable); |
|
747 | + $data[] = array(get_lang('SpecificSearchFieldsAvailable'), $specific_fields_exists); |
|
748 | 748 | |
749 | 749 | echo Display::tag('h3', get_lang('Settings')); |
750 | 750 | $table = new SortableTableFromArray($data); |
@@ -754,16 +754,16 @@ discard block |
||
754 | 754 | |
755 | 755 | //@todo windows support |
756 | 756 | if (api_is_windows_os() == false) { |
757 | - $list_of_programs = array('pdftotext','ps2pdf', 'catdoc','html2text','unrtf', 'catppt', 'xls2csv'); |
|
757 | + $list_of_programs = array('pdftotext', 'ps2pdf', 'catdoc', 'html2text', 'unrtf', 'catppt', 'xls2csv'); |
|
758 | 758 | |
759 | - foreach($list_of_programs as $program) { |
|
759 | + foreach ($list_of_programs as $program) { |
|
760 | 760 | $output = $ret_val = null; |
761 | 761 | exec("which $program", $output, $ret_val); |
762 | 762 | $icon = Display::return_icon('bullet_red.png', get_lang('NotInstalled')); |
763 | 763 | if (!empty($output[0])) { |
764 | 764 | $icon = Display::return_icon('bullet_green.png', get_lang('Installed')); |
765 | 765 | } |
766 | - $data2[]= array($program, $output[0], $icon); |
|
766 | + $data2[] = array($program, $output[0], $icon); |
|
767 | 767 | } |
768 | 768 | echo Display::tag('h3', get_lang('ProgramsNeededToConvertFiles')); |
769 | 769 | $table = new SortableTableFromArray($data2); |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | if ($action != 'add') { |
796 | 796 | echo '<div class="actions" style="margin-left: 1px;">'; |
797 | 797 | echo '<a href="settings.php?category=Templates&action=add">'. |
798 | - Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
798 | + Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
799 | 799 | echo '</div>'; |
800 | 800 | } |
801 | 801 | |
@@ -914,8 +914,8 @@ discard block |
||
914 | 914 | * @since Dokeos 1.8.6 |
915 | 915 | */ |
916 | 916 | function actions_filter($id) { |
917 | - $return = '<a href="settings.php?category=Templates&action=edit&id='.Security::remove_XSS($id).'">'.Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
918 | - $return .= '<a href="settings.php?category=Templates&action=delete&id='.Security::remove_XSS($id).'" onClick="javascript:if(!confirm('."'".get_lang('ConfirmYourChoice')."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
917 | + $return = '<a href="settings.php?category=Templates&action=edit&id='.Security::remove_XSS($id).'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
918 | + $return .= '<a href="settings.php?category=Templates&action=delete&id='.Security::remove_XSS($id).'" onClick="javascript:if(!confirm('."'".get_lang('ConfirmYourChoice')."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
919 | 919 | return $return; |
920 | 920 | } |
921 | 921 | |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | $form->addElement('html_editor', 'template_text', get_lang('Text'), null, array('ToolbarSet' => 'AdminTemplates', 'Width' => '100%', 'Height' => '400')); |
966 | 966 | |
967 | 967 | // Setting the form elements: the form to upload an image to be used with the template. |
968 | - $form->addElement('file','template_image',get_lang('Image'),''); |
|
968 | + $form->addElement('file', 'template_image', get_lang('Image'), ''); |
|
969 | 969 | |
970 | 970 | // Setting the form elements: a little bit information about the template image. |
971 | 971 | $form->addElement('static', 'file_comment', '', get_lang('TemplateImageComment100x70')); |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | // Store the information in the database (as insert or as update). |
1044 | 1044 | $table_system_template = Database :: get_main_table('system_template'); |
1045 | 1045 | if ($_GET['action'] == 'add') { |
1046 | - $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1046 | + $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1047 | 1047 | $params = [ |
1048 | 1048 | 'title' => $values['title'], |
1049 | 1049 | 'content' => $content_template, |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | |
1054 | 1054 | // Display a feedback message. |
1055 | 1055 | Display::display_confirmation_message(get_lang('TemplateAdded')); |
1056 | - echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
1056 | + echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
1057 | 1057 | } else { |
1058 | 1058 | $content_template = '<head>{CSS}<style type="text/css">.text{font-weight: normal;}</style></head><body>'.Database::escape_string($values['template_text']).'</body>'; |
1059 | 1059 | $sql = "UPDATE $table_system_template set title = '".Database::escape_string($values['title'])."', content = '".$content_template."'"; |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | display_templates(); |
1072 | 1072 | } else { |
1073 | 1073 | $token = Security::get_token(); |
1074 | - $form->addElement('hidden','sec_token'); |
|
1074 | + $form->addElement('hidden', 'sec_token'); |
|
1075 | 1075 | $form->setConstants(array('sec_token' => $token)); |
1076 | 1076 | // Display the form. |
1077 | 1077 | $form->display(); |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | |
1172 | 1172 | $form = new FormValidator('settings', 'post', 'settings.php?category='.Security::remove_XSS($_GET['category'])); |
1173 | 1173 | |
1174 | - $form->addElement('hidden', 'search_field', (!empty($_GET['search_field'])?Security::remove_XSS($_GET['search_field']):null)); |
|
1174 | + $form->addElement('hidden', 'search_field', (!empty($_GET['search_field']) ? Security::remove_XSS($_GET['search_field']) : null)); |
|
1175 | 1175 | |
1176 | 1176 | $url_id = api_get_current_access_url_id(); |
1177 | 1177 | |
@@ -1238,9 +1238,9 @@ discard block |
||
1238 | 1238 | if (empty($row['category'])) |
1239 | 1239 | $row['category'] = 0; |
1240 | 1240 | |
1241 | - if (is_array($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ])) { |
|
1241 | + if (is_array($settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']])) { |
|
1242 | 1242 | // 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'] != '') |
|
1243 | + if ($settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value'] != '') |
|
1244 | 1244 | $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value']; |
1245 | 1245 | } |
1246 | 1246 | // There is no else{} statement because we load the default $row['selected_value'] of the main Chamilo site. |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | array('maxlength' => '8') |
1262 | 1262 | ); |
1263 | 1263 | $form->applyFilter($row['variable'], 'html_filter'); |
1264 | - $default_values[$row['variable']] = round($row['selected_value']/1024/1024, 1); |
|
1264 | + $default_values[$row['variable']] = round($row['selected_value'] / 1024 / 1024, 1); |
|
1265 | 1265 | } elseif ($row['variable'] == 'account_valid_duration') { |
1266 | 1266 | $form->addElement( |
1267 | 1267 | 'text', |
@@ -1289,7 +1289,7 @@ discard block |
||
1289 | 1289 | ), |
1290 | 1290 | $hideme |
1291 | 1291 | ); |
1292 | - $form->applyFilter($row['variable'],'html_filter'); |
|
1292 | + $form->applyFilter($row['variable'], 'html_filter'); |
|
1293 | 1293 | $default_values[$row['variable']] = $row['selected_value']; |
1294 | 1294 | } |
1295 | 1295 | break; |
@@ -1300,7 +1300,7 @@ discard block |
||
1300 | 1300 | if (file_exists($file)) { |
1301 | 1301 | $value = file_get_contents($file); |
1302 | 1302 | } |
1303 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1303 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1304 | 1304 | $default_values[$row['variable']] = $value; |
1305 | 1305 | } elseif ($row['variable'] == 'footer_extra_content') { |
1306 | 1306 | $file = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt'; |
@@ -1308,16 +1308,16 @@ discard block |
||
1308 | 1308 | if (file_exists($file)) { |
1309 | 1309 | $value = file_get_contents($file); |
1310 | 1310 | } |
1311 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1311 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1312 | 1312 | $default_values[$row['variable']] = $value; |
1313 | 1313 | } else { |
1314 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1314 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1315 | 1315 | $default_values[$row['variable']] = $row['selected_value']; |
1316 | 1316 | } |
1317 | 1317 | break; |
1318 | 1318 | case 'radio': |
1319 | 1319 | $values = api_get_settings_options($row['variable']); |
1320 | - $group = array (); |
|
1320 | + $group = array(); |
|
1321 | 1321 | if (is_array($values)) { |
1322 | 1322 | foreach ($values as $key => $value) { |
1323 | 1323 | $element = &$form->createElement( |
@@ -1348,7 +1348,7 @@ discard block |
||
1348 | 1348 | WHERE variable='".$row['variable']."' AND access_url = 1"; |
1349 | 1349 | |
1350 | 1350 | $result = Database::query($sql); |
1351 | - $group = array (); |
|
1351 | + $group = array(); |
|
1352 | 1352 | while ($rowkeys = Database::fetch_array($result)) { |
1353 | 1353 | // Profile tab option should be hidden when the social tool is enabled. |
1354 | 1354 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -1420,10 +1420,10 @@ discard block |
||
1420 | 1420 | |
1421 | 1421 | switch ($row['variable']) { |
1422 | 1422 | case 'pdf_export_watermark_enable': |
1423 | - $url = PDF::get_watermark(null); |
|
1423 | + $url = PDF::get_watermark(null); |
|
1424 | 1424 | |
1425 | 1425 | if ($url != false) { |
1426 | - $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png',get_lang('DelImage')).'</a>'; |
|
1426 | + $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png', get_lang('DelImage')).'</a>'; |
|
1427 | 1427 | $form->addElement('html', '<div style="max-height:100px; max-width:100px; margin-left:162px; margin-bottom:10px; clear:both;"><img src="'.$url.'" style="margin-bottom:10px;" />'.$delete_url.'</div>'); |
1428 | 1428 | } |
1429 | 1429 |
@@ -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); |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $tool_name = get_lang('CreateSubLanguage'); |
19 | 19 | |
20 | 20 | // setting breadcrumbs |
21 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | -$interbreadcrumb[] = array ('url' => 'languages.php', 'name' => get_lang('PlatformLanguages')); |
|
21 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array('url' => 'languages.php', 'name' => get_lang('PlatformLanguages')); |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Add sub-language |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param int ID del idioma padre |
31 | 31 | * @return int New sub language ID or false on error |
32 | 32 | */ |
33 | -function add_sub_language ($original_name,$english_name,$isocode,$sublanguage_available,$parent_id) { |
|
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); |
35 | 35 | $original_name = Database::escape_string($original_name); |
36 | 36 | $english_name = Database::escape_string($english_name); |
@@ -61,41 +61,41 @@ discard block |
||
61 | 61 | * @todo This function is not transaction-safe and should probably be included |
62 | 62 | * inside the add_sub_language function. |
63 | 63 | */ |
64 | -function check_if_language_exist ($original_name, $english_name, $isocode, $sublanguage_available) { |
|
65 | - $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
|
66 | - $sql_original_name='SELECT count(*) AS count_original_name FROM '.$tbl_admin_languages.' WHERE original_name="'.Database::escape_string($original_name).'" '; |
|
67 | - $sql_english_name='SELECT count(*) AS count_english_name FROM '.$tbl_admin_languages.' WHERE english_name="'.Database::escape_string($english_name).'" '; |
|
64 | +function check_if_language_exist($original_name, $english_name, $isocode, $sublanguage_available) { |
|
65 | + $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
|
66 | + $sql_original_name = 'SELECT count(*) AS count_original_name FROM '.$tbl_admin_languages.' WHERE original_name="'.Database::escape_string($original_name).'" '; |
|
67 | + $sql_english_name = 'SELECT count(*) AS count_english_name FROM '.$tbl_admin_languages.' WHERE english_name="'.Database::escape_string($english_name).'" '; |
|
68 | 68 | //$sql_isocode='SELECT count(*) AS count_isocode FROM '.$tbl_admin_languages.' WHERE isocode="'.Database::escape_string($isocode).'" '; |
69 | - $rs_original_name=Database::query($sql_original_name); |
|
70 | - $rs_english_name=Database::query($sql_english_name); |
|
69 | + $rs_original_name = Database::query($sql_original_name); |
|
70 | + $rs_english_name = Database::query($sql_english_name); |
|
71 | 71 | //$rs_isocode=Database::query($sql_isocode); |
72 | - $count_original_name=Database::result($rs_original_name,0,'count_original_name'); |
|
73 | - $count_english_name=Database::result($rs_english_name,0,'count_english_name'); |
|
72 | + $count_original_name = Database::result($rs_original_name, 0, 'count_original_name'); |
|
73 | + $count_english_name = Database::result($rs_english_name, 0, 'count_english_name'); |
|
74 | 74 | //$count_isocode=Database::result($rs_isocode,0,'count_isocode'); |
75 | - $has_error=false; |
|
76 | - $message_information=array(); |
|
75 | + $has_error = false; |
|
76 | + $message_information = array(); |
|
77 | 77 | |
78 | - if ($count_original_name==1) { |
|
79 | - $has_error=true; |
|
80 | - $message_information['original_name']=true; |
|
78 | + if ($count_original_name == 1) { |
|
79 | + $has_error = true; |
|
80 | + $message_information['original_name'] = true; |
|
81 | 81 | } |
82 | - if ($count_english_name==1) { |
|
83 | - $has_error=true; |
|
84 | - $message_information['english_name']=true; |
|
82 | + if ($count_english_name == 1) { |
|
83 | + $has_error = true; |
|
84 | + $message_information['english_name'] = true; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $iso_list = api_get_platform_isocodes(); |
88 | 88 | $iso_list = array_values($iso_list); |
89 | 89 | |
90 | 90 | if (!in_array($isocode, $iso_list)) { |
91 | - $has_error=true; |
|
92 | - $message_information['isocode']=true; |
|
91 | + $has_error = true; |
|
92 | + $message_information['isocode'] = true; |
|
93 | 93 | } |
94 | - if ($has_error===true) { |
|
95 | - $message_information['execute_add']=false; |
|
94 | + if ($has_error === true) { |
|
95 | + $message_information['execute_add'] = false; |
|
96 | 96 | } |
97 | - if ($has_error===false) { |
|
98 | - $message_information['execute_add']=true; |
|
97 | + if ($has_error === false) { |
|
98 | + $message_information['execute_add'] = true; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $message_information; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @return bool |
109 | 109 | * @todo deprecate this function and use the static method directly |
110 | 110 | */ |
111 | -function check_if_exist_language_by_id ($language_id) { |
|
111 | +function check_if_exist_language_by_id($language_id) { |
|
112 | 112 | return SubLanguageManager::check_if_exist_language_by_id($language_id); |
113 | 113 | } |
114 | 114 | /** |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | * @param int Language ID of the presumed parent |
117 | 117 | * @return bool True if this language has children, false otherwise |
118 | 118 | */ |
119 | -function ckeck_if_is_parent_of_sub_language ($parent_id) { |
|
120 | - $sql='SELECT count(*) AS count FROM language WHERE parent_id= '.intval($parent_id).''; |
|
121 | - $rs=Database::query($sql); |
|
122 | - if (Database::num_rows($rs)>0 && Database::result($rs,0,'count')==1) { |
|
119 | +function ckeck_if_is_parent_of_sub_language($parent_id) { |
|
120 | + $sql = 'SELECT count(*) AS count FROM language WHERE parent_id= '.intval($parent_id).''; |
|
121 | + $rs = Database::query($sql); |
|
122 | + if (Database::num_rows($rs) > 0 && Database::result($rs, 0, 'count') == 1) { |
|
123 | 123 | return true; |
124 | 124 | } else { |
125 | 125 | return false; |
@@ -131,117 +131,117 @@ discard block |
||
131 | 131 | * @param int Child language ID |
132 | 132 | * @return array |
133 | 133 | */ |
134 | -function allow_get_all_information_of_sub_language ($parent_id,$sub_language_id) { |
|
135 | - return SubLanguageManager::get_all_information_of_sub_language($parent_id,$sub_language_id); |
|
134 | +function allow_get_all_information_of_sub_language($parent_id, $sub_language_id) { |
|
135 | + return SubLanguageManager::get_all_information_of_sub_language($parent_id, $sub_language_id); |
|
136 | 136 | } |
137 | 137 | /*end declare functions*/ |
138 | 138 | |
139 | 139 | //add data |
140 | 140 | |
141 | -if (isset($_GET['sub_language_id']) && $_GET['sub_language_id']==strval(intval($_GET['sub_language_id']))) { |
|
142 | - $language_name=SubLanguageManager::get_name_of_language_by_id($_GET['sub_language_id']); |
|
143 | - if (check_if_exist_language_by_id ($_GET['sub_language_id'])===true) { |
|
144 | - $sub_language_id=$_GET['sub_language_id']; |
|
145 | - $sub_language_id_exist=true; |
|
141 | +if (isset($_GET['sub_language_id']) && $_GET['sub_language_id'] == strval(intval($_GET['sub_language_id']))) { |
|
142 | + $language_name = SubLanguageManager::get_name_of_language_by_id($_GET['sub_language_id']); |
|
143 | + if (check_if_exist_language_by_id($_GET['sub_language_id']) === true) { |
|
144 | + $sub_language_id = $_GET['sub_language_id']; |
|
145 | + $sub_language_id_exist = true; |
|
146 | 146 | } else { |
147 | - $sub_language_id_exist=false; |
|
147 | + $sub_language_id_exist = false; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | } |
151 | 151 | $language_details = array(); |
152 | -$language_name=''; |
|
153 | -if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) { |
|
152 | +$language_name = ''; |
|
153 | +if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) { |
|
154 | 154 | $language_details = SubLanguageManager::get_all_information_of_language($_GET['id']); |
155 | 155 | $language_name = $language_details['original_name']; |
156 | - if (check_if_exist_language_by_id ($_GET['id'])===true) { |
|
157 | - $parent_id=$_GET['id']; |
|
158 | - $language_id_exist=true; |
|
156 | + if (check_if_exist_language_by_id($_GET['id']) === true) { |
|
157 | + $parent_id = $_GET['id']; |
|
158 | + $language_id_exist = true; |
|
159 | 159 | } else { |
160 | - $language_id_exist=false; |
|
160 | + $language_id_exist = false; |
|
161 | 161 | } |
162 | 162 | } else { |
163 | - $language_id_exist=false; |
|
163 | + $language_id_exist = false; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | //removed and register |
167 | 167 | |
168 | -if ((isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) && (isset($_GET['sub_language_id']) && $_GET['sub_language_id']==strval(intval($_GET['sub_language_id'])))) { |
|
169 | - if (check_if_exist_language_by_id($_GET['id'])===true && check_if_exist_language_by_id($_GET['sub_language_id'])===true) { |
|
170 | - $get_all_information=allow_get_all_information_of_sub_language ($_GET['id'],$_GET['sub_language_id']); |
|
171 | - $original_name=$get_all_information['original_name']; |
|
172 | - $english_name=$get_all_information['english_name']; |
|
173 | - $isocode=$get_all_information['isocode']; |
|
168 | +if ((isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) && (isset($_GET['sub_language_id']) && $_GET['sub_language_id'] == strval(intval($_GET['sub_language_id'])))) { |
|
169 | + if (check_if_exist_language_by_id($_GET['id']) === true && check_if_exist_language_by_id($_GET['sub_language_id']) === true) { |
|
170 | + $get_all_information = allow_get_all_information_of_sub_language($_GET['id'], $_GET['sub_language_id']); |
|
171 | + $original_name = $get_all_information['original_name']; |
|
172 | + $english_name = $get_all_information['english_name']; |
|
173 | + $isocode = $get_all_information['isocode']; |
|
174 | 174 | |
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
178 | -$language_name=get_lang('CreateSubLanguageForLanguage').' ( '.strtolower($language_name).' )'; |
|
178 | +$language_name = get_lang('CreateSubLanguageForLanguage').' ( '.strtolower($language_name).' )'; |
|
179 | 179 | |
180 | -if (ckeck_if_is_parent_of_sub_language($parent_id)===true && isset($_GET['action']) && $_GET['action']=='deletesublanguage') { |
|
181 | - $language_name=get_lang('DeleteSubLanguage'); |
|
180 | +if (ckeck_if_is_parent_of_sub_language($parent_id) === true && isset($_GET['action']) && $_GET['action'] == 'deletesublanguage') { |
|
181 | + $language_name = get_lang('DeleteSubLanguage'); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | $msg = ''; |
185 | 185 | |
186 | 186 | if (isset($_POST['SubmitAddNewLanguage'])) { |
187 | - $original_name=$_POST['original_name']; |
|
188 | - $english_name=$_POST['english_name']; |
|
189 | - $isocode=$_POST['isocode']; |
|
190 | - $english_name=str_replace(' ','_',$english_name); |
|
191 | - $isocode=str_replace(' ','_',$isocode); |
|
187 | + $original_name = $_POST['original_name']; |
|
188 | + $english_name = $_POST['english_name']; |
|
189 | + $isocode = $_POST['isocode']; |
|
190 | + $english_name = str_replace(' ', '_', $english_name); |
|
191 | + $isocode = str_replace(' ', '_', $isocode); |
|
192 | 192 | |
193 | - $sublanguage_available=$_POST['sub_language_is_visible']; |
|
194 | - $check_information=array(); |
|
195 | - $check_information=check_if_language_exist($original_name,$english_name,$isocode,$sublanguage_available); |
|
193 | + $sublanguage_available = $_POST['sub_language_is_visible']; |
|
194 | + $check_information = array(); |
|
195 | + $check_information = check_if_language_exist($original_name, $english_name, $isocode, $sublanguage_available); |
|
196 | 196 | foreach ($check_information as $index_information => $value_information) { |
197 | - $allow_insert_info=false; |
|
198 | - if ($index_information=='original_name') { |
|
199 | - $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('OriginalName').'" '.'('.$original_name.')','error'); |
|
197 | + $allow_insert_info = false; |
|
198 | + if ($index_information == 'original_name') { |
|
199 | + $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('OriginalName').'" '.'('.$original_name.')', 'error'); |
|
200 | 200 | } |
201 | - if ($index_information=='english_name') { |
|
202 | - $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('EnglishName').'" '.'('.$english_name.')','error'); |
|
201 | + if ($index_information == 'english_name') { |
|
202 | + $msg .= Display::return_message(get_lang('AlreadyExists').' "'.get_lang('EnglishName').'" '.'('.$english_name.')', 'error'); |
|
203 | 203 | } |
204 | - if ($index_information=='isocode') { |
|
205 | - $msg .= Display::return_message(get_lang('CodeDoesNotExists').': '.$isocode.'','error'); |
|
204 | + if ($index_information == 'isocode') { |
|
205 | + $msg .= Display::return_message(get_lang('CodeDoesNotExists').': '.$isocode.'', 'error'); |
|
206 | 206 | } |
207 | - if ($index_information=='execute_add' && $value_information===true) { |
|
208 | - $allow_insert_info=true; |
|
207 | + if ($index_information == 'execute_add' && $value_information === true) { |
|
208 | + $allow_insert_info = true; |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 | |
212 | - if (strlen($original_name)>0 && strlen($english_name)>0 && strlen($isocode)>0) { |
|
213 | - if ($allow_insert_info===true && $language_id_exist===true) { |
|
214 | - $english_name=str_replace(' ','_',$english_name); |
|
212 | + if (strlen($original_name) > 0 && strlen($english_name) > 0 && strlen($isocode) > 0) { |
|
213 | + if ($allow_insert_info === true && $language_id_exist === true) { |
|
214 | + $english_name = str_replace(' ', '_', $english_name); |
|
215 | 215 | //Fixes BT#1636 |
216 | - $english_name=api_strtolower($english_name); |
|
216 | + $english_name = api_strtolower($english_name); |
|
217 | 217 | |
218 | - $isocode=str_replace(' ','_',$isocode); |
|
219 | - $str_info='<br/>'.get_lang('OriginalName').' : '.$original_name.'<br/>'.get_lang('EnglishName').' : '.$english_name.'<br/>'.get_lang('PlatformCharsetTitle').' : '.$isocode; |
|
218 | + $isocode = str_replace(' ', '_', $isocode); |
|
219 | + $str_info = '<br/>'.get_lang('OriginalName').' : '.$original_name.'<br/>'.get_lang('EnglishName').' : '.$english_name.'<br/>'.get_lang('PlatformCharsetTitle').' : '.$isocode; |
|
220 | 220 | |
221 | - $mkdir_result=SubLanguageManager::add_language_directory($english_name); |
|
221 | + $mkdir_result = SubLanguageManager::add_language_directory($english_name); |
|
222 | 222 | if ($mkdir_result) { |
223 | - $sl_id = add_sub_language($original_name,$english_name,$isocode,$sublanguage_available,$parent_id); |
|
223 | + $sl_id = add_sub_language($original_name, $english_name, $isocode, $sublanguage_available, $parent_id); |
|
224 | 224 | if ($sl_id === false) { |
225 | 225 | SubLanguageManager::remove_language_directory($english_name); |
226 | - $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'),'error'); |
|
226 | + $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'), 'error'); |
|
227 | 227 | } else { |
228 | 228 | // Here we build the confirmation message and we send the user to the sub language terms definition page, using a little hack - see #3712 |
229 | - $_SESSION['msg'] = Display::return_message(get_lang('TheNewSubLanguageHasBeenAdded').$str_info.'confirm',false); |
|
229 | + $_SESSION['msg'] = Display::return_message(get_lang('TheNewSubLanguageHasBeenAdded').$str_info.'confirm', false); |
|
230 | 230 | unset($interbreadcrumb); |
231 | 231 | $_GET['sub_language_id'] = $_REQUEST['sub_language_id'] = $sl_id; |
232 | 232 | require 'sub_language.php'; |
233 | 233 | exit(); |
234 | 234 | } |
235 | 235 | } else { |
236 | - $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'),'error'); |
|
236 | + $msg .= Display::return_message(get_lang('LanguageDirectoryNotWriteableContactAdmin'), 'error'); |
|
237 | 237 | } |
238 | 238 | } else { |
239 | - if ($language_id_exist===false) { |
|
240 | - $msg .= Display::return_message(get_lang('LanguageParentNotExist'),'error'); |
|
239 | + if ($language_id_exist === false) { |
|
240 | + $msg .= Display::return_message(get_lang('LanguageParentNotExist'), 'error'); |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | } else { |
244 | - $msg .= Display::return_message(get_lang('FormHasErrorsPleaseComplete'),'error'); |
|
244 | + $msg .= Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error'); |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | if (isset($_POST['SubmitAddDeleteLanguage'])) { |
253 | 253 | $rs = SubLanguageManager::remove_sub_language($_GET['id'], $_GET['sub_language_id']); |
254 | - if ($rs===true) { |
|
254 | + if ($rs === true) { |
|
255 | 255 | Display::display_confirmation_message(get_lang('TheSubLanguageHasBeenRemoved')); |
256 | 256 | } else { |
257 | 257 | Display::display_error_message(get_lang('TheSubLanguageHasNotBeenRemoved')); |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | } |
260 | 260 | // ckeck_if_is_parent_of_sub_language($parent_id)===false |
261 | 261 | // |
262 | -if (isset($_GET['action']) && $_GET['action']=='definenewsublanguage') { |
|
262 | +if (isset($_GET['action']) && $_GET['action'] == 'definenewsublanguage') { |
|
263 | 263 | $text = $language_name; |
264 | 264 | $form = new FormValidator('addsublanguage', 'post', 'sub_language_add.php?id='.Security::remove_XSS($_GET['id']).'&action=definenewsublanguage'); |
265 | - $class='add'; |
|
265 | + $class = 'add'; |
|
266 | 266 | $form->addElement('header', '', $text); |
267 | - $form->addElement('text', 'original_name', get_lang('OriginalName'),'class="input_titles"'); |
|
267 | + $form->addElement('text', 'original_name', get_lang('OriginalName'), 'class="input_titles"'); |
|
268 | 268 | $form->addRule('original_name', get_lang('ThisFieldIsRequired'), 'required'); |
269 | - $form->addElement('text', 'english_name', get_lang('EnglishName'),'class="input_titles"'); |
|
269 | + $form->addElement('text', 'english_name', get_lang('EnglishName'), 'class="input_titles"'); |
|
270 | 270 | $form->addRule('english_name', get_lang('ThisFieldIsRequired'), 'required'); |
271 | 271 | $form->addElement('text', 'isocode', get_lang('ISOCode'), 'class="input_titles"'); |
272 | 272 | $form->addRule('isocode', get_lang('ThisFieldIsRequired'), 'required'); |
@@ -279,18 +279,18 @@ discard block |
||
279 | 279 | $form->setDefaults($values); |
280 | 280 | $form->display(); |
281 | 281 | } else { |
282 | - if (isset($_GET['action']) && $_GET['action']=='deletesublanguage') { |
|
283 | - $text=$language_name; |
|
282 | + if (isset($_GET['action']) && $_GET['action'] == 'deletesublanguage') { |
|
283 | + $text = $language_name; |
|
284 | 284 | $form = new FormValidator('deletesublanguage', 'post', 'sub_language_add.php?id='.Security::remove_XSS($_GET['id']).'&sub_language_id='.Security::remove_XSS($_GET['sub_language_id'])); |
285 | - $class='minus'; |
|
285 | + $class = 'minus'; |
|
286 | 286 | $form->addElement('header', '', $text); |
287 | - $form->addElement('static', '', get_lang('OriginalName'),$original_name); |
|
288 | - $form->addElement('static', '', get_lang('EnglishName'),$english_name); |
|
289 | - $form->addElement('static', '', get_lang('PlatformCharsetTitle'),$isocode); |
|
287 | + $form->addElement('static', '', get_lang('OriginalName'), $original_name); |
|
288 | + $form->addElement('static', '', get_lang('EnglishName'), $english_name); |
|
289 | + $form->addElement('static', '', get_lang('PlatformCharsetTitle'), $isocode); |
|
290 | 290 | $form->addButtonCreate(get_lang('DeleteSubLanguage'), 'SubmitAddDeleteLanguage'); |
291 | 291 | $form->display(); |
292 | 292 | } |
293 | - if (isset($_GET['action']) && $_GET['action']=='definenewsublanguage') { |
|
293 | + if (isset($_GET['action']) && $_GET['action'] == 'definenewsublanguage') { |
|
294 | 294 | Display::display_normal_message(get_lang('TheSubLanguageForThisLanguageHasBeenAdded')); |
295 | 295 | } |
296 | 296 | } |
@@ -286,7 +286,7 @@ |
||
286 | 286 | * This function defines globals. |
287 | 287 | * @param int $userId |
288 | 288 | * |
289 | -* @return bool False on failure, redirection on success |
|
289 | +* @return false|null False on failure, redirection on success |
|
290 | 290 | * @author Evie Embrechts |
291 | 291 | * @author Yannick Warnier <[email protected]> |
292 | 292 | */ |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | function display_advanced_search_form () { |
107 | 107 | if ($("#advanced_search_form").css("display") == "none") { |
108 | 108 | $("#advanced_search_form").css("display","block"); |
109 | - $("#img_plus_and_minus").html(\' '.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
109 | + $("#img_plus_and_minus").html(\' '.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
110 | 110 | } else { |
111 | 111 | $("#advanced_search_form").css("display","none"); |
112 | - $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
112 | + $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | |
186 | 186 | // adding the filter to see the user's only of the current access_url |
187 | 187 | if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) { |
188 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
189 | - $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)"; |
|
188 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
189 | + $sql .= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)"; |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | $keywordList = array( |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | if (isset($keyword_extra_data) && !empty($keyword_extra_data)) { |
218 | 218 | $extra_info = UserManager::get_extra_field_information_by_name($keyword_extra_data); |
219 | 219 | $field_id = $extra_info['id']; |
220 | - $sql.= " INNER JOIN user_field_values ufv ON u.id=ufv.user_id AND ufv.field_id=$field_id "; |
|
220 | + $sql .= " INNER JOIN user_field_values ufv ON u.id=ufv.user_id AND ufv.field_id=$field_id "; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | if (isset($_GET['keyword']) && !empty($_GET['keyword'])) { |
224 | - $keywordFiltered = Database::escape_string("%". $_GET['keyword'] ."%"); |
|
224 | + $keywordFiltered = Database::escape_string("%".$_GET['keyword']."%"); |
|
225 | 225 | $sql .= " WHERE ( |
226 | 226 | u.firstname LIKE '$keywordFiltered' OR |
227 | 227 | u.lastname LIKE '$keywordFiltered' OR |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | $sql .= " $query_admin_table |
254 | 254 | WHERE ( |
255 | - u.firstname LIKE '". Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND |
|
255 | + u.firstname LIKE '".Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND |
|
256 | 256 | u.lastname LIKE '". Database::escape_string("%".$keywordListValues['keyword_lastname']."%")."' AND |
257 | 257 | u.username LIKE '". Database::escape_string("%".$keywordListValues['keyword_username']."%")."' AND |
258 | 258 | u.email LIKE '". Database::escape_string("%".$keywordListValues['keyword_email']."%")."' AND |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | |
265 | 265 | if (isset($keyword_active) && !isset($keyword_inactive)) { |
266 | 266 | $sql .= " AND u.active='1'"; |
267 | - } elseif(isset($keyword_inactive) && !isset($keyword_active)) { |
|
267 | + } elseif (isset($keyword_inactive) && !isset($keyword_active)) { |
|
268 | 268 | $sql .= " AND u.active='0'"; |
269 | 269 | } |
270 | 270 | $sql .= " ) "; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $lastname = $userInfo['lastname']; |
308 | 308 | |
309 | 309 | if (api_is_western_name_order()) { |
310 | - $message = sprintf(get_lang('AttemptingToLoginAs'),$firstname,$lastname, $userId); |
|
310 | + $message = sprintf(get_lang('AttemptingToLoginAs'), $firstname, $lastname, $userId); |
|
311 | 311 | } else { |
312 | 312 | $message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId); |
313 | 313 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | Session::write('login_as', true); |
342 | 342 | |
343 | 343 | $target_url = api_get_path(WEB_PATH)."user_portal.php"; |
344 | - $message .= '<br />'.sprintf(get_lang('LoginSuccessfulGoToX'),'<a href="'.$target_url.'">'.$target_url.'</a>'); |
|
344 | + $message .= '<br />'.sprintf(get_lang('LoginSuccessfulGoToX'), '<a href="'.$target_url.'">'.$target_url.'</a>'); |
|
345 | 345 | Display :: display_header(get_lang('UserList')); |
346 | 346 | Display :: display_normal_message($message, false); |
347 | 347 | Display :: display_footer(); |
@@ -384,11 +384,11 @@ discard block |
||
384 | 384 | $sql .= "AND password LIKE '$easyPassword' "; |
385 | 385 | }*/ |
386 | 386 | |
387 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
387 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
388 | 388 | $direction = 'ASC'; |
389 | 389 | } |
390 | 390 | $column = intval($column); |
391 | - $from = intval($from); |
|
391 | + $from = intval($from); |
|
392 | 392 | $number_of_items = intval($number_of_items); |
393 | 393 | |
394 | 394 | $preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users'); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | |
402 | 402 | $res = Database::query($sql); |
403 | 403 | |
404 | - $users = array (); |
|
404 | + $users = array(); |
|
405 | 405 | $t = time(); |
406 | 406 | while ($user = Database::fetch_row($res)) { |
407 | 407 | $userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL); |
@@ -462,13 +462,13 @@ discard block |
||
462 | 462 | */ |
463 | 463 | function modify_filter($user_id, $url_params, $row) { |
464 | 464 | global $charset, $_admins_list; |
465 | - $is_admin = in_array($user_id,$_admins_list); |
|
465 | + $is_admin = in_array($user_id, $_admins_list); |
|
466 | 466 | $statusname = api_get_status_langvars(); |
467 | 467 | $user_is_anonymous = false; |
468 | 468 | $current_user_status_label = $row['7']; |
469 | 469 | |
470 | 470 | if ($current_user_status_label == $statusname[ANONYMOUS]) { |
471 | - $user_is_anonymous =true; |
|
471 | + $user_is_anonymous = true; |
|
472 | 472 | } |
473 | 473 | $result = ''; |
474 | 474 | if (!$user_is_anonymous) { |
@@ -484,8 +484,8 @@ discard block |
||
484 | 484 | <div class="blackboard_hide" id="div_s_'.$user_id.'"> </div> |
485 | 485 | </a>'; |
486 | 486 | } else { |
487 | - $result .= Display::return_icon('course_na.png',get_lang('Courses')).' '; |
|
488 | - $result .= Display::return_icon('course_na.png',get_lang('Sessions')).' '; |
|
487 | + $result .= Display::return_icon('course_na.png', get_lang('Courses')).' '; |
|
488 | + $result .= Display::return_icon('course_na.png', get_lang('Sessions')).' '; |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | if (api_is_platform_admin()) { |
@@ -521,14 +521,14 @@ discard block |
||
521 | 521 | $editProfileUrl = Display::getProfileEditionLink($user_id, true); |
522 | 522 | |
523 | 523 | if (!$user_is_anonymous && api_global_admin_can_edit_admin($user_id, null, true)) { |
524 | - $result .= '<a href="' . $editProfileUrl . '">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a> '; |
|
524 | + $result .= '<a href="'.$editProfileUrl.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a> '; |
|
525 | 525 | } else { |
526 | 526 | $result .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a> '; |
527 | 527 | } |
528 | 528 | } |
529 | 529 | |
530 | 530 | if ($is_admin) { |
531 | - $result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'),array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL)); |
|
531 | + $result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'), array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL)); |
|
532 | 532 | } else { |
533 | 533 | $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator')); |
534 | 534 | } |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | api_global_admin_can_edit_admin($user_id) |
581 | 581 | ) { |
582 | 582 | // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore. |
583 | - $result .= ' <a href="user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
583 | + $result .= ' <a href="user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
584 | 584 | } else { |
585 | 585 | $result .= Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL); |
586 | 586 | } |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | |
619 | 619 | if ($action == 'edit') { |
620 | 620 | $result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16); |
621 | - } elseif ($row['0']<>$_user['user_id']) { |
|
621 | + } elseif ($row['0'] <> $_user['user_id']) { |
|
622 | 622 | // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore. |
623 | 623 | $result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array('onclick'=>'active_user(this);', 'id'=>'img_'.$row['0']), 16).'</a>'; |
624 | 624 | } |
@@ -640,11 +640,11 @@ discard block |
||
640 | 640 | } |
641 | 641 | |
642 | 642 | if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) { |
643 | - $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
644 | - $interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList')); |
|
643 | + $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
644 | + $interbreadcrumb[] = array("url" => 'user_list.php', "name" => get_lang('UserList')); |
|
645 | 645 | $tool_name = get_lang('SearchUsers'); |
646 | 646 | } else { |
647 | - $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
647 | + $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
648 | 648 | $tool_name = get_lang('UserList'); |
649 | 649 | } |
650 | 650 | |
@@ -657,10 +657,10 @@ discard block |
||
657 | 657 | case 'add_user_to_my_url': |
658 | 658 | $user_id = $_REQUEST["user_id"]; |
659 | 659 | $result = UrlManager::add_user_to_url($user_id, $current_access_url_id); |
660 | - if ($result ) { |
|
660 | + if ($result) { |
|
661 | 661 | $user_info = api_get_user_info($user_id); |
662 | 662 | $message = get_lang('UserAdded').' '.$user_info['firstname'].' '.$user_info['lastname'].' ('.$user_info['username'].')'; |
663 | - $message = Display::return_message($message, 'confirmation'); |
|
663 | + $message = Display::return_message($message, 'confirmation'); |
|
664 | 664 | } |
665 | 665 | break; |
666 | 666 | case 'show_message' : |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | $message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error'); |
695 | 695 | } |
696 | 696 | } else { |
697 | - $message = Display :: return_message(get_lang('CannotDeleteUser'),'error'); |
|
697 | + $message = Display :: return_message(get_lang('CannotDeleteUser'), 'error'); |
|
698 | 698 | } |
699 | 699 | } |
700 | 700 | break; |
@@ -704,8 +704,8 @@ discard block |
||
704 | 704 | $number_of_deleted_users = 0; |
705 | 705 | if (is_array($_POST['id'])) { |
706 | 706 | foreach ($_POST['id'] as $index => $user_id) { |
707 | - if($user_id != $_user['user_id']) { |
|
708 | - if(UserManager :: delete_user($user_id)) { |
|
707 | + if ($user_id != $_user['user_id']) { |
|
708 | + if (UserManager :: delete_user($user_id)) { |
|
709 | 709 | $number_of_deleted_users++; |
710 | 710 | } |
711 | 711 | } |
@@ -738,17 +738,17 @@ discard block |
||
738 | 738 | </a>' |
739 | 739 | ); |
740 | 740 | |
741 | -$actions = ''; |
|
741 | +$actions = ''; |
|
742 | 742 | if (api_is_platform_admin()) { |
743 | 743 | $actions .= '<div style="float:right;">'. |
744 | 744 | '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'. |
745 | - Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'. |
|
745 | + Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>'. |
|
746 | 746 | '</div>'; |
747 | 747 | } |
748 | 748 | $actions .= $form->return_form(); |
749 | 749 | |
750 | 750 | if (isset ($_GET['keyword'])) { |
751 | - $parameters = array ('keyword' => Security::remove_XSS($_GET['keyword'])); |
|
751 | + $parameters = array('keyword' => Security::remove_XSS($_GET['keyword'])); |
|
752 | 752 | } elseif (isset ($_GET['keyword_firstname'])) { |
753 | 753 | $parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']); |
754 | 754 | $parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']); |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | $parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']); |
758 | 758 | $parameters['keyword_status'] = Security::remove_XSS($_GET['keyword_status']); |
759 | 759 | $parameters['keyword_active'] = Security::remove_XSS($_GET['keyword_active']); |
760 | - $parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']); |
|
760 | + $parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']); |
|
761 | 761 | } |
762 | 762 | // Create a sortable table with user-data |
763 | 763 | $parameters['sec_token'] = Security::get_token(); |
@@ -774,15 +774,15 @@ discard block |
||
774 | 774 | // Display Advanced search form. |
775 | 775 | $form = new FormValidator('advanced_search', 'get', '', '', array(), FormValidator::LAYOUT_HORIZONTAL); |
776 | 776 | |
777 | -$form->addElement('html','<div id="advanced_search_form" style="display:none;">'); |
|
777 | +$form->addElement('html', '<div id="advanced_search_form" style="display:none;">'); |
|
778 | 778 | $form->addElement('header', get_lang('AdvancedSearch')); |
779 | -$form->addText('keyword_firstname',get_lang('FirstName'),false); |
|
780 | -$form->addText('keyword_lastname',get_lang('LastName'),false); |
|
779 | +$form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
780 | +$form->addText('keyword_lastname', get_lang('LastName'), false); |
|
781 | 781 | |
782 | -$form->addText('keyword_username',get_lang('LoginName'),false); |
|
783 | -$form->addText('keyword_email',get_lang('Email'),false); |
|
782 | +$form->addText('keyword_username', get_lang('LoginName'), false); |
|
783 | +$form->addText('keyword_email', get_lang('Email'), false); |
|
784 | 784 | |
785 | -$form->addText('keyword_officialcode',get_lang('OfficialCode'),false); |
|
785 | +$form->addText('keyword_officialcode', get_lang('OfficialCode'), false); |
|
786 | 786 | |
787 | 787 | $status_options = array(); |
788 | 788 | $status_options['%'] = get_lang('All'); |
@@ -792,12 +792,12 @@ discard block |
||
792 | 792 | $status_options[SESSIONADMIN] = get_lang('SessionsAdmin'); |
793 | 793 | $status_options[PLATFORM_ADMIN] = get_lang('Administrator'); |
794 | 794 | |
795 | -$form->addElement('select','keyword_status',get_lang('Profile'), $status_options ); |
|
795 | +$form->addElement('select', 'keyword_status', get_lang('Profile'), $status_options); |
|
796 | 796 | |
797 | 797 | $active_group = array(); |
798 | -$active_group[] = $form->createElement('checkbox','keyword_active','', get_lang('Active')); |
|
799 | -$active_group[] = $form->createElement('checkbox','keyword_inactive','', get_lang('Inactive')); |
|
800 | -$form->addGroup($active_group,'',get_lang('ActiveAccount'), '<br/>',false); |
|
798 | +$active_group[] = $form->createElement('checkbox', 'keyword_active', '', get_lang('Active')); |
|
799 | +$active_group[] = $form->createElement('checkbox', 'keyword_inactive', '', get_lang('Inactive')); |
|
800 | +$form->addGroup($active_group, '', get_lang('ActiveAccount'), '<br/>', false); |
|
801 | 801 | |
802 | 802 | $form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords')); |
803 | 803 | |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | $defaults['keyword_active'] = 1; |
809 | 809 | $defaults['keyword_inactive'] = 1; |
810 | 810 | $form->setDefaults($defaults); |
811 | -$form->addElement('html','</div>'); |
|
811 | +$form->addElement('html', '</div>'); |
|
812 | 812 | |
813 | 813 | $form = $form->returnForm(); |
814 | 814 | |
@@ -890,10 +890,10 @@ discard block |
||
890 | 890 | } |
891 | 891 | if ($add_user) { |
892 | 892 | $row_table = array(); |
893 | - $row_table[] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '; |
|
894 | - $row_table[] = $access_info_to_string; |
|
893 | + $row_table[] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '; |
|
894 | + $row_table[] = $access_info_to_string; |
|
895 | 895 | $url = api_get_self().'?action=add_user_to_my_url&user_id='.$user['id'].'&sec_token='.$_SESSION['sec_token']; |
896 | - $row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn')); |
|
896 | + $row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn')); |
|
897 | 897 | |
898 | 898 | foreach ($row_table as $cell) { |
899 | 899 | $table->setCellContents($row, $column, $cell); |
@@ -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 |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | // We are sure that the extra field exists. |
216 | 216 | foreach ($extra_fields as $extras) { |
217 | 217 | if (isset($user[$extras[1]])) { |
218 | - $key = $extras[1]; |
|
219 | - $value = $user[$extras[1]]; |
|
218 | + $key = $extras[1]; |
|
219 | + $value = $user[$extras[1]]; |
|
220 | 220 | UserManager::update_extra_field_value($user_id, $key, $value); |
221 | 221 | } |
222 | 222 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | global $current_tag; |
254 | 254 | switch ($data) { |
255 | 255 | case 'Contact': |
256 | - $user = array (); |
|
256 | + $user = array(); |
|
257 | 257 | break; |
258 | 258 | default: |
259 | 259 | $current_tag = $data; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | |
351 | 351 | if (in_array($ext_import_file, $allowed_file_mimetype)) { |
352 | 352 | if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) { |
353 | - $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
353 | + $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
354 | 354 | $errors = validate_data($users); |
355 | 355 | $error_kind_file = false; |
356 | 356 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | Display::display_error_message($error_message); |
425 | 425 | } |
426 | 426 | |
427 | -$form = new FormValidator('user_update_import','post','user_update_import.php'); |
|
427 | +$form = new FormValidator('user_update_import', 'post', 'user_update_import.php'); |
|
428 | 428 | $form->addElement('header', '', $tool_name); |
429 | 429 | $form->addElement('hidden', 'formSent'); |
430 | 430 | $form->addElement('file', 'import_file', get_lang('ImportFileLocation')); |
@@ -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 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $attendance->set_attendance_qualify_title($_POST['attendance_qualify_title']); |
61 | 61 | $attendance->set_attendance_weight($_POST['attendance_weight']); |
62 | 62 | $link_to_gradebook = false; |
63 | - if ( isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1 ) { |
|
63 | + if (isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1) { |
|
64 | 64 | $link_to_gradebook = true; |
65 | 65 | } |
66 | 66 | $attendance->category_id = $_POST['category_id']; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ) { |
113 | 113 | $link_to_gradebook = true; |
114 | 114 | } |
115 | - $attendance->attendance_edit($attendance_id,$link_to_gradebook); |
|
115 | + $attendance->attendance_edit($attendance_id, $link_to_gradebook); |
|
116 | 116 | Security::clear_token(); |
117 | 117 | header('location:index.php?action=attendance_list&'.api_get_cidreq()); |
118 | 118 | exit; |
@@ -543,17 +543,17 @@ discard block |
||
543 | 543 | } |
544 | 544 | } |
545 | 545 | $max_cols_per_page = 12; //10 dates + 2 name and number |
546 | - $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10 |
|
546 | + $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2; //10 |
|
547 | 547 | $rows = count($data_table); |
548 | 548 | |
549 | 549 | if ($cols > $max_cols_per_page) { |
550 | - $number_tables = round(($cols-2)/$max_dates_per_page); |
|
550 | + $number_tables = round(($cols - 2) / $max_dates_per_page); |
|
551 | 551 | $headers = $data_table[0]; |
552 | 552 | $all = array(); |
553 | 553 | $tables = array(); |
554 | 554 | $changed = 1; |
555 | 555 | |
556 | - for ($i= 0; $i <= $rows; $i++) { |
|
556 | + for ($i = 0; $i <= $rows; $i++) { |
|
557 | 557 | $row = isset($data_table[$i]) ? $data_table[$i] : null; |
558 | 558 | $key = 1; |
559 | 559 | $max_dates_per_page = 10; |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | foreach ($item as $value) { |
565 | 565 | if ($count_j >= $max_dates_per_page) { |
566 | 566 | $key++; |
567 | - $max_dates_per_page = $max_dates_per_page_original*$key; |
|
567 | + $max_dates_per_page = $max_dates_per_page_original * $key; |
|
568 | 568 | //magic hack |
569 | 569 | $tables[$key][$i][] = $tables[1][$i][0]; |
570 | 570 | $tables[$key][$i][] = $tables[1][$i][1]; |
@@ -622,8 +622,8 @@ discard block |
||
622 | 622 | $form = new FormValidator( |
623 | 623 | 'search', |
624 | 624 | 'post', |
625 | - api_get_self() . '?' . api_get_cidreq( |
|
626 | - ) . '&action=calendar_logins' |
|
625 | + api_get_self().'?'.api_get_cidreq( |
|
626 | + ).'&action=calendar_logins' |
|
627 | 627 | ); |
628 | 628 | $form->addDateRangePicker('range', get_lang('DateRange')); |
629 | 629 | $form->addButton('submit', get_lang('Submit')); |
@@ -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() { |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | if (!is_object($PHPCAS_CLIENT)) { |
44 | - phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri); |
|
44 | + phpCAS::client($cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri); |
|
45 | 45 | phpCAS::setNoCasServerValidation(); |
46 | 46 | } |
47 | 47 | $auth = phpCAS::checkAuthentication(); |
48 | 48 | |
49 | 49 | if ($auth) { |
50 | - $login= trim(phpCAS::getUser()); |
|
50 | + $login = trim(phpCAS::getUser()); |
|
51 | 51 | /* |
52 | 52 | Get user attributes. Here are the attributes for crdp platform |
53 | 53 | sn => name |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | default: |
80 | 80 | $status=5; // Student |
81 | 81 | }*/ |
82 | - if (!$logout){ |
|
82 | + if (!$logout) { |
|
83 | 83 | // get user info from username |
84 | 84 | $tab_user_info = api_get_user_info($login); |
85 | 85 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $chamilo_user = extldap_get_chamilo_user($ldapuser); |
93 | 93 | $chamilo_user['user_id'] = $tab_user_info['user_id']; |
94 | 94 | $chamilo_user['status'] = $tab_user_info['status']; |
95 | - UserManager::update_user ($chamilo_user["user_id"], $chamilo_user["firstname"], $chamilo_user["lastname"], $login, null, null, $chamilo_user["email"], $chamilo_user["status"], '', '', '', '', 1, null, 0, null,'') ; |
|
95 | + UserManager::update_user($chamilo_user["user_id"], $chamilo_user["firstname"], $chamilo_user["lastname"], $login, null, null, $chamilo_user["email"], $chamilo_user["status"], '', '', '', '', 1, null, 0, null, ''); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | return $login; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | case PLATFORM_AUTH_SOURCE : |
106 | 106 | // user will have to modify firstname, lastname, email in chamilo profil edit |
107 | 107 | $userdata = get_lang("EditInProfil"); |
108 | - UserManager::create_user($userdata, $userdata, '5', $userdata, $login, 'casplaceholder', '','','','',CAS_AUTH_SOURCE); |
|
108 | + UserManager::create_user($userdata, $userdata, '5', $userdata, $login, 'casplaceholder', '', '', '', '', CAS_AUTH_SOURCE); |
|
109 | 109 | $user_added = $login; |
110 | 110 | break; |
111 | 111 | case LDAP_AUTH_SOURCE : |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @see online_logout() |
165 | 165 | */ |
166 | -function cas_logout($uinfo=null, $location=null) |
|
166 | +function cas_logout($uinfo = null, $location = null) |
|
167 | 167 | { |
168 | 168 | global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri; |
169 | 169 | global $PHPCAS_CLIENT; |
@@ -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; |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | // hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] in IIS |
34 | 34 | // |
35 | 35 | if (!$_SERVER['REQUEST_URI']) { |
36 | - $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']; |
|
36 | + $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // |
40 | 40 | // another one by Vangelis Haniotakis also to make phpCAS work with PHP5 |
41 | 41 | // |
42 | 42 | if (version_compare(PHP_VERSION, '5', '>=')) { |
43 | - require_once (dirname(__FILE__) . '/CAS/domxml-php4-to-php5.php'); |
|
43 | + require_once (dirname(__FILE__).'/CAS/domxml-php4-to-php5.php'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * |
282 | 282 | * @hideinitializer |
283 | 283 | */ |
284 | -$GLOBALS['PHPCAS_INIT_CALL'] = array ( |
|
284 | +$GLOBALS['PHPCAS_INIT_CALL'] = array( |
|
285 | 285 | 'done' => FALSE, |
286 | 286 | 'file' => '?', |
287 | 287 | 'line' => -1, |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * |
295 | 295 | * @hideinitializer |
296 | 296 | */ |
297 | -$GLOBALS['PHPCAS_AUTH_CHECK_CALL'] = array ( |
|
297 | +$GLOBALS['PHPCAS_AUTH_CHECK_CALL'] = array( |
|
298 | 298 | 'done' => FALSE, |
299 | 299 | 'file' => '?', |
300 | 300 | 'line' => -1, |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * |
308 | 308 | * @hideinitializer |
309 | 309 | */ |
310 | -$GLOBALS['PHPCAS_DEBUG'] = array ( |
|
310 | +$GLOBALS['PHPCAS_DEBUG'] = array( |
|
311 | 311 | 'filename' => '/tmp/cas.log', |
312 | 312 | 'indent' => 0, |
313 | 313 | 'unique_id' => '' |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | // ######################################################################## |
321 | 321 | |
322 | 322 | // include client class |
323 | -include_once (dirname(__FILE__) . '/CAS/client.php'); |
|
323 | +include_once (dirname(__FILE__).'/CAS/client.php'); |
|
324 | 324 | |
325 | 325 | // ######################################################################## |
326 | 326 | // INTERFACE CLASS |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | phpCAS :: traceBegin(); |
370 | 370 | if (is_object($PHPCAS_CLIENT)) { |
371 | - phpCAS :: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')'); |
|
371 | + phpCAS :: error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')'); |
|
372 | 372 | } |
373 | 373 | if (gettype($server_version) != 'string') { |
374 | 374 | phpCAS :: error('type mismatched for parameter $server_version (should be `string\')'); |
@@ -385,11 +385,11 @@ discard block |
||
385 | 385 | |
386 | 386 | // store where the initializer is called from |
387 | 387 | $dbg = phpCAS :: backtrace(); |
388 | - $PHPCAS_INIT_CALL = array ( |
|
388 | + $PHPCAS_INIT_CALL = array( |
|
389 | 389 | 'done' => TRUE, |
390 | 390 | 'file' => $dbg[0]['file'], |
391 | 391 | 'line' => $dbg[0]['line'], |
392 | - 'method' => __CLASS__ . '::' . __FUNCTION__ |
|
392 | + 'method' => __CLASS__.'::'.__FUNCTION__ |
|
393 | 393 | ); |
394 | 394 | |
395 | 395 | // initialize the global object $PHPCAS_CLIENT |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | phpCAS :: traceBegin(); |
419 | 419 | if (is_object($PHPCAS_CLIENT)) { |
420 | - phpCAS :: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')'); |
|
420 | + phpCAS :: error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')'); |
|
421 | 421 | } |
422 | 422 | if (gettype($server_version) != 'string') { |
423 | 423 | phpCAS :: error('type mismatched for parameter $server_version (should be `string\')'); |
@@ -434,11 +434,11 @@ discard block |
||
434 | 434 | |
435 | 435 | // store where the initialzer is called from |
436 | 436 | $dbg = phpCAS :: backtrace(); |
437 | - $PHPCAS_INIT_CALL = array ( |
|
437 | + $PHPCAS_INIT_CALL = array( |
|
438 | 438 | 'done' => TRUE, |
439 | 439 | 'file' => $dbg[0]['file'], |
440 | 440 | 'line' => $dbg[0]['line'], |
441 | - 'method' => __CLASS__ . '::' . __FUNCTION__ |
|
441 | + 'method' => __CLASS__.'::'.__FUNCTION__ |
|
442 | 442 | ); |
443 | 443 | |
444 | 444 | // initialize the global object $PHPCAS_CLIENT |
@@ -472,17 +472,17 @@ discard block |
||
472 | 472 | if (empty ($filename)) { |
473 | 473 | if (preg_match('/^Win.*/', getenv('OS'))) { |
474 | 474 | if (isset ($_ENV['TMP'])) { |
475 | - $debugDir = $_ENV['TMP'] . '/'; |
|
475 | + $debugDir = $_ENV['TMP'].'/'; |
|
476 | 476 | } else |
477 | 477 | if (isset ($_ENV['TEMP'])) { |
478 | - $debugDir = $_ENV['TEMP'] . '/'; |
|
478 | + $debugDir = $_ENV['TEMP'].'/'; |
|
479 | 479 | } else { |
480 | 480 | $debugDir = ''; |
481 | 481 | } |
482 | 482 | } else { |
483 | 483 | $debugDir = DEFAULT_DEBUG_DIR; |
484 | 484 | } |
485 | - $filename = $debugDir . 'phpCAS.log'; |
|
485 | + $filename = $debugDir.'phpCAS.log'; |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | if (empty ($PHPCAS_DEBUG['unique_id'])) { |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | return debug_backtrace(); |
510 | 510 | } else { |
511 | 511 | // poor man's hack ... but it does work ... |
512 | - return array (); |
|
512 | + return array(); |
|
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | for ($i = 0; $i < $PHPCAS_DEBUG['indent']; $i++) { |
529 | 529 | $indent_str .= '| '; |
530 | 530 | } |
531 | - error_log($PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str . $str . "\n", 3, $PHPCAS_DEBUG['filename']); |
|
531 | + error_log($PHPCAS_DEBUG['unique_id'].' '.$indent_str.$str."\n", 3, $PHPCAS_DEBUG['filename']); |
|
532 | 532 | } |
533 | 533 | |
534 | 534 | } |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | } |
558 | 558 | } |
559 | 559 | } |
560 | - echo "<br />\n<b>phpCAS error</b>: <font color=\"FF0000\"><b>" . __CLASS__ . "::" . $function . '(): ' . htmlentities($msg) . "</b></font> in <b>" . $file . "</b> on line <b>" . $line . "</b><br />\n"; |
|
560 | + echo "<br />\n<b>phpCAS error</b>: <font color=\"FF0000\"><b>".__CLASS__."::".$function.'(): '.htmlentities($msg)."</b></font> in <b>".$file."</b> on line <b>".$line."</b><br />\n"; |
|
561 | 561 | phpCAS :: trace($msg); |
562 | 562 | phpCAS :: traceExit(); |
563 | 563 | exit (); |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | */ |
569 | 569 | function trace($str) { |
570 | 570 | $dbg = phpCAS :: backtrace(); |
571 | - phpCAS :: log($str . ' [' . basename($dbg[1]['file']) . ':' . $dbg[1]['line'] . ']'); |
|
571 | + phpCAS :: log($str.' ['.basename($dbg[1]['file']).':'.$dbg[1]['line'].']'); |
|
572 | 572 | } |
573 | 573 | |
574 | 574 | /** |
@@ -580,9 +580,9 @@ discard block |
||
580 | 580 | $dbg = phpCAS :: backtrace(); |
581 | 581 | $str = '=> '; |
582 | 582 | if (!empty ($dbg[2]['class'])) { |
583 | - $str .= $dbg[2]['class'] . '::'; |
|
583 | + $str .= $dbg[2]['class'].'::'; |
|
584 | 584 | } |
585 | - $str .= $dbg[2]['function'] . '('; |
|
585 | + $str .= $dbg[2]['function'].'('; |
|
586 | 586 | if (is_array($dbg[2]['args'])) { |
587 | 587 | foreach ($dbg[2]['args'] as $index => $arg) { |
588 | 588 | if ($index != 0) { |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | $str .= str_replace("\n", "", var_export($arg, TRUE)); |
592 | 592 | } |
593 | 593 | } |
594 | - $str .= ') [' . basename($dbg[2]['file']) . ':' . $dbg[2]['line'] . ']'; |
|
594 | + $str .= ') ['.basename($dbg[2]['file']).':'.$dbg[2]['line'].']'; |
|
595 | 595 | phpCAS :: log($str); |
596 | 596 | $PHPCAS_DEBUG['indent']++; |
597 | 597 | } |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | $PHPCAS_DEBUG['indent']--; |
608 | 608 | $dbg = phpCAS :: backtrace(); |
609 | 609 | $str = ''; |
610 | - $str .= '<= ' . str_replace("\n", "", var_export($res, TRUE)); |
|
610 | + $str .= '<= '.str_replace("\n", "", var_export($res, TRUE)); |
|
611 | 611 | phpCAS :: log($str); |
612 | 612 | } |
613 | 613 | |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | function setLang($lang) { |
645 | 645 | global $PHPCAS_CLIENT; |
646 | 646 | if (!is_object($PHPCAS_CLIENT)) { |
647 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
647 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
648 | 648 | } |
649 | 649 | if (gettype($lang) != 'string') { |
650 | 650 | phpCAS :: error('type mismatched for parameter $lang (should be `string\')'); |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | function setHTMLHeader($header) { |
688 | 688 | global $PHPCAS_CLIENT; |
689 | 689 | if (!is_object($PHPCAS_CLIENT)) { |
690 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
690 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
691 | 691 | } |
692 | 692 | if (gettype($header) != 'string') { |
693 | 693 | phpCAS :: error('type mismatched for parameter $header (should be `string\')'); |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | function setHTMLFooter($footer) { |
704 | 704 | global $PHPCAS_CLIENT; |
705 | 705 | if (!is_object($PHPCAS_CLIENT)) { |
706 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
706 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
707 | 707 | } |
708 | 708 | if (gettype($footer) != 'string') { |
709 | 709 | phpCAS :: error('type mismatched for parameter $footer (should be `string\')'); |
@@ -732,13 +732,13 @@ discard block |
||
732 | 732 | |
733 | 733 | phpCAS :: traceBegin(); |
734 | 734 | if (!is_object($PHPCAS_CLIENT)) { |
735 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
735 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
736 | 736 | } |
737 | 737 | if (!$PHPCAS_CLIENT->isProxy()) { |
738 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
738 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
739 | 739 | } |
740 | 740 | if ($PHPCAS_AUTH_CHECK_CALL['done']) { |
741 | - phpCAS :: error('this method should only be called before ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() (called at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ')'); |
|
741 | + phpCAS :: error('this method should only be called before '.$PHPCAS_AUTH_CHECK_CALL['method'].'() (called at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].')'); |
|
742 | 742 | } |
743 | 743 | if (gettype($format) != 'string') { |
744 | 744 | phpCAS :: error('type mismatched for parameter $format (should be `string\')'); |
@@ -770,13 +770,13 @@ discard block |
||
770 | 770 | |
771 | 771 | phpCAS :: traceBegin(); |
772 | 772 | if (!is_object($PHPCAS_CLIENT)) { |
773 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
773 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
774 | 774 | } |
775 | 775 | if (!$PHPCAS_CLIENT->isProxy()) { |
776 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
776 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
777 | 777 | } |
778 | 778 | if ($PHPCAS_AUTH_CHECK_CALL['done']) { |
779 | - phpCAS :: error('this method should only be called before ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() (called at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ')'); |
|
779 | + phpCAS :: error('this method should only be called before '.$PHPCAS_AUTH_CHECK_CALL['method'].'() (called at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].')'); |
|
780 | 780 | } |
781 | 781 | if (gettype($user) != 'string') { |
782 | 782 | phpCAS :: error('type mismatched for parameter $user (should be `string\')'); |
@@ -830,16 +830,16 @@ discard block |
||
830 | 830 | |
831 | 831 | phpCAS :: traceBegin(); |
832 | 832 | if (!is_object($PHPCAS_CLIENT)) { |
833 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
833 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
834 | 834 | } |
835 | 835 | if (!$PHPCAS_CLIENT->isProxy()) { |
836 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
836 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
837 | 837 | } |
838 | 838 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) { |
839 | - phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()'); |
|
839 | + phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling '.__CLASS__.'::checkAuthentication() or '.__CLASS__.'::forceAuthentication()'); |
|
840 | 840 | } |
841 | 841 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) { |
842 | - phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE'); |
|
842 | + phpCAS :: error('authentication was checked (by '.$PHPCAS_AUTH_CHECK_CALL['method'].'() at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].') but the method returned FALSE'); |
|
843 | 843 | } |
844 | 844 | if (gettype($url) != 'string') { |
845 | 845 | phpCAS :: error('type mismatched for parameter $url (should be `string\')'); |
@@ -873,16 +873,16 @@ discard block |
||
873 | 873 | |
874 | 874 | phpCAS :: traceBegin(); |
875 | 875 | if (!is_object($PHPCAS_CLIENT)) { |
876 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
876 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
877 | 877 | } |
878 | 878 | if (!$PHPCAS_CLIENT->isProxy()) { |
879 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
879 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
880 | 880 | } |
881 | 881 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) { |
882 | - phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()'); |
|
882 | + phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling '.__CLASS__.'::checkAuthentication() or '.__CLASS__.'::forceAuthentication()'); |
|
883 | 883 | } |
884 | 884 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) { |
885 | - phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE'); |
|
885 | + phpCAS :: error('authentication was checked (by '.$PHPCAS_AUTH_CHECK_CALL['method'].'() at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].') but the method returned FALSE'); |
|
886 | 886 | } |
887 | 887 | if (gettype($url) != 'string') { |
888 | 888 | phpCAS :: error('type mismatched for parameter $url (should be `string\')'); |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | function setCacheTimesForAuthRecheck($n) { |
919 | 919 | global $PHPCAS_CLIENT; |
920 | 920 | if (!is_object($PHPCAS_CLIENT)) { |
921 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
921 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
922 | 922 | } |
923 | 923 | if (gettype($n) != 'integer') { |
924 | 924 | phpCAS :: error('type mismatched for parameter $header (should be `string\')'); |
@@ -935,18 +935,18 @@ discard block |
||
935 | 935 | |
936 | 936 | phpCAS :: traceBegin(); |
937 | 937 | if (!is_object($PHPCAS_CLIENT)) { |
938 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
938 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
939 | 939 | } |
940 | 940 | |
941 | 941 | $auth = $PHPCAS_CLIENT->checkAuthentication(); |
942 | 942 | |
943 | 943 | // store where the authentication has been checked and the result |
944 | 944 | $dbg = phpCAS :: backtrace(); |
945 | - $PHPCAS_AUTH_CHECK_CALL = array ( |
|
945 | + $PHPCAS_AUTH_CHECK_CALL = array( |
|
946 | 946 | 'done' => TRUE, |
947 | 947 | 'file' => $dbg[0]['file'], |
948 | 948 | 'line' => $dbg[0]['line'], |
949 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
949 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
950 | 950 | 'result' => $auth |
951 | 951 | ); |
952 | 952 | phpCAS :: traceEnd($auth); |
@@ -963,18 +963,18 @@ discard block |
||
963 | 963 | |
964 | 964 | phpCAS :: traceBegin(); |
965 | 965 | if (!is_object($PHPCAS_CLIENT)) { |
966 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
966 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
967 | 967 | } |
968 | 968 | |
969 | 969 | $auth = $PHPCAS_CLIENT->forceAuthentication(); |
970 | 970 | |
971 | 971 | // store where the authentication has been checked and the result |
972 | 972 | $dbg = phpCAS :: backtrace(); |
973 | - $PHPCAS_AUTH_CHECK_CALL = array ( |
|
973 | + $PHPCAS_AUTH_CHECK_CALL = array( |
|
974 | 974 | 'done' => TRUE, |
975 | 975 | 'file' => $dbg[0]['file'], |
976 | 976 | 'line' => $dbg[0]['line'], |
977 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
977 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
978 | 978 | 'result' => $auth |
979 | 979 | ); |
980 | 980 | |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | phpCAS :: trace('user is not authenticated, redirecting to the CAS server'); |
983 | 983 | $PHPCAS_CLIENT->forceAuthentication(); |
984 | 984 | } else { |
985 | - phpCAS :: trace('no need to authenticate (user `' . phpCAS :: getUser() . '\' is already authenticated)'); |
|
985 | + phpCAS :: trace('no need to authenticate (user `'.phpCAS :: getUser().'\' is already authenticated)'); |
|
986 | 986 | } |
987 | 987 | |
988 | 988 | phpCAS :: traceEnd(); |
@@ -997,16 +997,16 @@ discard block |
||
997 | 997 | |
998 | 998 | phpCAS :: traceBegin(); |
999 | 999 | if (!is_object($PHPCAS_CLIENT)) { |
1000 | - phpCAS :: error('this method should not be called before' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1000 | + phpCAS :: error('this method should not be called before'.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1001 | 1001 | } |
1002 | 1002 | |
1003 | 1003 | // store where the authentication has been checked and the result |
1004 | 1004 | $dbg = phpCAS :: backtrace(); |
1005 | - $PHPCAS_AUTH_CHECK_CALL = array ( |
|
1005 | + $PHPCAS_AUTH_CHECK_CALL = array( |
|
1006 | 1006 | 'done' => TRUE, |
1007 | 1007 | 'file' => $dbg[0]['file'], |
1008 | 1008 | 'line' => $dbg[0]['line'], |
1009 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
1009 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
1010 | 1010 | 'result' => $auth |
1011 | 1011 | ); |
1012 | 1012 | |
@@ -1018,7 +1018,7 @@ discard block |
||
1018 | 1018 | * This method has been left from version 0.4.1 for compatibility reasons. |
1019 | 1019 | */ |
1020 | 1020 | function authenticate() { |
1021 | - phpCAS :: error('this method is deprecated. You should use ' . __CLASS__ . '::forceAuthentication() instead'); |
|
1021 | + phpCAS :: error('this method is deprecated. You should use '.__CLASS__.'::forceAuthentication() instead'); |
|
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | /** |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | |
1033 | 1033 | phpCAS :: traceBegin(); |
1034 | 1034 | if (!is_object($PHPCAS_CLIENT)) { |
1035 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1035 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1036 | 1036 | } |
1037 | 1037 | |
1038 | 1038 | // call the isAuthenticated method of the global $PHPCAS_CLIENT object |
@@ -1040,11 +1040,11 @@ discard block |
||
1040 | 1040 | |
1041 | 1041 | // store where the authentication has been checked and the result |
1042 | 1042 | $dbg = phpCAS :: backtrace(); |
1043 | - $PHPCAS_AUTH_CHECK_CALL = array ( |
|
1043 | + $PHPCAS_AUTH_CHECK_CALL = array( |
|
1044 | 1044 | 'done' => TRUE, |
1045 | 1045 | 'file' => $dbg[0]['file'], |
1046 | 1046 | 'line' => $dbg[0]['line'], |
1047 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
1047 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
1048 | 1048 | 'result' => $auth |
1049 | 1049 | ); |
1050 | 1050 | phpCAS :: traceEnd($auth); |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | function isSessionAuthenticated() { |
1061 | 1061 | global $PHPCAS_CLIENT; |
1062 | 1062 | if (!is_object($PHPCAS_CLIENT)) { |
1063 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1063 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1064 | 1064 | } |
1065 | 1065 | return ($PHPCAS_CLIENT->isSessionAuthenticated()); |
1066 | 1066 | } |
@@ -1075,13 +1075,13 @@ discard block |
||
1075 | 1075 | function getUser() { |
1076 | 1076 | global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL; |
1077 | 1077 | if (!is_object($PHPCAS_CLIENT)) { |
1078 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1078 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1079 | 1079 | } |
1080 | 1080 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) { |
1081 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); |
|
1081 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()'); |
|
1082 | 1082 | } |
1083 | 1083 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) { |
1084 | - phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE'); |
|
1084 | + phpCAS :: error('authentication was checked (by '.$PHPCAS_AUTH_CHECK_CALL['method'].'() at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].') but the method returned FALSE'); |
|
1085 | 1085 | } |
1086 | 1086 | return $PHPCAS_CLIENT->getUser(); |
1087 | 1087 | } |
@@ -1096,13 +1096,13 @@ discard block |
||
1096 | 1096 | function getAttributes() { |
1097 | 1097 | global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL; |
1098 | 1098 | if (!is_object($PHPCAS_CLIENT)) { |
1099 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1099 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1100 | 1100 | } |
1101 | 1101 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) { |
1102 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); |
|
1102 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()'); |
|
1103 | 1103 | } |
1104 | 1104 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) { |
1105 | - phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE'); |
|
1105 | + phpCAS :: error('authentication was checked (by '.$PHPCAS_AUTH_CHECK_CALL['method'].'() at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].') but the method returned FALSE'); |
|
1106 | 1106 | } |
1107 | 1107 | return $PHPCAS_CLIENT->getAttributes(); |
1108 | 1108 | } |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | function handleLogoutRequests($check_client = true, $allowed_clients = false) { |
1113 | 1113 | global $PHPCAS_CLIENT; |
1114 | 1114 | if (!is_object($PHPCAS_CLIENT)) { |
1115 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1115 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1116 | 1116 | } |
1117 | 1117 | return ($PHPCAS_CLIENT->handleLogoutRequests($check_client, $allowed_clients)); |
1118 | 1118 | } |
@@ -1126,7 +1126,7 @@ discard block |
||
1126 | 1126 | function getServerLoginURL() { |
1127 | 1127 | global $PHPCAS_CLIENT; |
1128 | 1128 | if (!is_object($PHPCAS_CLIENT)) { |
1129 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1129 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1130 | 1130 | } |
1131 | 1131 | return $PHPCAS_CLIENT->getServerLoginURL(); |
1132 | 1132 | } |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | phpCAS :: traceBegin(); |
1142 | 1142 | if (!is_object($PHPCAS_CLIENT)) { |
1143 | 1143 | phpCAS :: error('this method should only be called after |
1144 | - ' . __CLASS__ . '::client()'); |
|
1144 | + ' . __CLASS__.'::client()'); |
|
1145 | 1145 | } |
1146 | 1146 | if (gettype($url) != 'string') { |
1147 | 1147 | phpCAS :: error('type mismatched for parameter $url (should be |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | phpCAS :: traceBegin(); |
1163 | 1163 | if (!is_object($PHPCAS_CLIENT)) { |
1164 | 1164 | phpCAS :: error('this method should only be called after |
1165 | - ' . __CLASS__ . '::client()'); |
|
1165 | + ' . __CLASS__.'::client()'); |
|
1166 | 1166 | } |
1167 | 1167 | if (gettype($url) != 'string') { |
1168 | 1168 | phpCAS :: error('type mismatched for parameter $url (should be |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | phpCAS :: traceBegin(); |
1184 | 1184 | if (!is_object($PHPCAS_CLIENT)) { |
1185 | 1185 | phpCAS :: error('this method should only be called after |
1186 | - ' . __CLASS__ . '::client()'); |
|
1186 | + ' . __CLASS__.'::client()'); |
|
1187 | 1187 | } |
1188 | 1188 | if (gettype($url) != 'string') { |
1189 | 1189 | phpCAS :: error('type mismatched for parameter $url (should be |
@@ -1203,7 +1203,7 @@ discard block |
||
1203 | 1203 | phpCAS :: traceBegin(); |
1204 | 1204 | if (!is_object($PHPCAS_CLIENT)) { |
1205 | 1205 | phpCAS :: error('this method should only be called after |
1206 | - ' . __CLASS__ . '::client()'); |
|
1206 | + ' . __CLASS__.'::client()'); |
|
1207 | 1207 | } |
1208 | 1208 | if (gettype($url) != 'string') { |
1209 | 1209 | phpCAS :: error('type mismatched for parameter $url (should be |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | function getServerLogoutURL() { |
1223 | 1223 | global $PHPCAS_CLIENT; |
1224 | 1224 | if (!is_object($PHPCAS_CLIENT)) { |
1225 | - phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1225 | + phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()'); |
|
1226 | 1226 | } |
1227 | 1227 | return $PHPCAS_CLIENT->getServerLogoutURL(); |
1228 | 1228 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | phpCAS :: traceBegin(); |
1238 | 1238 | if (!is_object($PHPCAS_CLIENT)) { |
1239 | 1239 | phpCAS :: error('this method should only be called after |
1240 | - ' . __CLASS__ . '::client()'); |
|
1240 | + ' . __CLASS__.'::client()'); |
|
1241 | 1241 | } |
1242 | 1242 | if (gettype($url) != 'string') { |
1243 | 1243 | phpCAS :: error('type mismatched for parameter $url (should be |
@@ -1256,9 +1256,9 @@ discard block |
||
1256 | 1256 | global $PHPCAS_CLIENT; |
1257 | 1257 | phpCAS :: traceBegin(); |
1258 | 1258 | if (!is_object($PHPCAS_CLIENT)) { |
1259 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1259 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1260 | 1260 | } |
1261 | - $parsedParams = array (); |
|
1261 | + $parsedParams = array(); |
|
1262 | 1262 | if ($params != "") { |
1263 | 1263 | if (is_string($params)) { |
1264 | 1264 | phpCAS :: error('method `phpCAS::logout($url)\' is now deprecated, use `phpCAS::logoutWithUrl($url)\' instead'); |
@@ -1286,12 +1286,12 @@ discard block |
||
1286 | 1286 | global $PHPCAS_CLIENT; |
1287 | 1287 | phpCAS :: traceBegin(); |
1288 | 1288 | if (!is_object($PHPCAS_CLIENT)) { |
1289 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1289 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1290 | 1290 | } |
1291 | 1291 | if (!is_string($service)) { |
1292 | 1292 | phpCAS :: error('type mismatched for parameter $service (should be `string\')'); |
1293 | 1293 | } |
1294 | - $PHPCAS_CLIENT->logout(array ( |
|
1294 | + $PHPCAS_CLIENT->logout(array( |
|
1295 | 1295 | "service" => $service |
1296 | 1296 | )); |
1297 | 1297 | // never reached |
@@ -1306,12 +1306,12 @@ discard block |
||
1306 | 1306 | global $PHPCAS_CLIENT; |
1307 | 1307 | phpCAS :: traceBegin(); |
1308 | 1308 | if (!is_object($PHPCAS_CLIENT)) { |
1309 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1309 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1310 | 1310 | } |
1311 | 1311 | if (!is_string($url)) { |
1312 | 1312 | phpCAS :: error('type mismatched for parameter $url (should be `string\')'); |
1313 | 1313 | } |
1314 | - $PHPCAS_CLIENT->logout(array ( |
|
1314 | + $PHPCAS_CLIENT->logout(array( |
|
1315 | 1315 | "url" => $url |
1316 | 1316 | )); |
1317 | 1317 | // never reached |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | global $PHPCAS_CLIENT; |
1328 | 1328 | phpCAS :: traceBegin(); |
1329 | 1329 | if (!is_object($PHPCAS_CLIENT)) { |
1330 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1330 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1331 | 1331 | } |
1332 | 1332 | if (!is_string($service)) { |
1333 | 1333 | phpCAS :: error('type mismatched for parameter $service (should be `string\')'); |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | if (!is_string($url)) { |
1336 | 1336 | phpCAS :: error('type mismatched for parameter $url (should be `string\')'); |
1337 | 1337 | } |
1338 | - $PHPCAS_CLIENT->logout(array ( |
|
1338 | + $PHPCAS_CLIENT->logout(array( |
|
1339 | 1339 | "service" => $service, |
1340 | 1340 | "url" => $url |
1341 | 1341 | )); |
@@ -1353,10 +1353,10 @@ discard block |
||
1353 | 1353 | global $PHPCAS_CLIENT; |
1354 | 1354 | phpCAS :: traceBegin(); |
1355 | 1355 | if (!is_object($PHPCAS_CLIENT)) { |
1356 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
1356 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
1357 | 1357 | } |
1358 | 1358 | if (!$PHPCAS_CLIENT->isProxy()) { |
1359 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
1359 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
1360 | 1360 | } |
1361 | 1361 | if (gettype($url) != 'string') { |
1362 | 1362 | phpCAS :: error('type mismatched for parameter $url (should be `string\')'); |
@@ -1375,7 +1375,7 @@ discard block |
||
1375 | 1375 | global $PHPCAS_CLIENT; |
1376 | 1376 | phpCAS :: traceBegin(); |
1377 | 1377 | if (!is_object($PHPCAS_CLIENT)) { |
1378 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
1378 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
1379 | 1379 | } |
1380 | 1380 | if (gettype($url) != 'string') { |
1381 | 1381 | phpCAS :: error('type mismatched for parameter $url (should be `string\')'); |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | function getServiceURL() { |
1391 | 1391 | global $PHPCAS_CLIENT; |
1392 | 1392 | if (!is_object($PHPCAS_CLIENT)) { |
1393 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
1393 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
1394 | 1394 | } |
1395 | 1395 | return ($PHPCAS_CLIENT->getURL()); |
1396 | 1396 | } |
@@ -1401,7 +1401,7 @@ discard block |
||
1401 | 1401 | function retrievePT($target_service, & $err_code, & $err_msg) { |
1402 | 1402 | global $PHPCAS_CLIENT; |
1403 | 1403 | if (!is_object($PHPCAS_CLIENT)) { |
1404 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); |
|
1404 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()'); |
|
1405 | 1405 | } |
1406 | 1406 | if (gettype($target_service) != 'string') { |
1407 | 1407 | phpCAS :: error('type mismatched for parameter $target_service(should be `string\')'); |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | global $PHPCAS_CLIENT; |
1419 | 1419 | phpCAS :: traceBegin(); |
1420 | 1420 | if (!is_object($PHPCAS_CLIENT)) { |
1421 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1421 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1422 | 1422 | } |
1423 | 1423 | if (gettype($cert) != 'string') { |
1424 | 1424 | phpCAS :: error('type mismatched for parameter $cert (should be `string\')'); |
@@ -1436,7 +1436,7 @@ discard block |
||
1436 | 1436 | global $PHPCAS_CLIENT; |
1437 | 1437 | phpCAS :: traceBegin(); |
1438 | 1438 | if (!is_object($PHPCAS_CLIENT)) { |
1439 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1439 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1440 | 1440 | } |
1441 | 1441 | if (gettype($cert) != 'string') { |
1442 | 1442 | phpCAS :: error('type mismatched for parameter $cert (should be `string\')'); |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | global $PHPCAS_CLIENT; |
1453 | 1453 | phpCAS :: traceBegin(); |
1454 | 1454 | if (!is_object($PHPCAS_CLIENT)) { |
1455 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1455 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1456 | 1456 | } |
1457 | 1457 | $PHPCAS_CLIENT->setNoCasServerValidation(); |
1458 | 1458 | phpCAS :: traceEnd(); |
@@ -1470,7 +1470,7 @@ discard block |
||
1470 | 1470 | global $PHPCAS_CLIENT; |
1471 | 1471 | phpCAS :: traceBegin(); |
1472 | 1472 | if (!is_object($PHPCAS_CLIENT)) { |
1473 | - phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); |
|
1473 | + phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()'); |
|
1474 | 1474 | } |
1475 | 1475 | $PHPCAS_CLIENT->setExtraCurlOption($key, $value); |
1476 | 1476 | phpCAS :: traceEnd(); |