@@ -16,34 +16,34 @@ discard block |
||
16 | 16 | $is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || $is_courseCoach || $is_sessionAdmin; |
17 | 17 | |
18 | 18 | if (!$is_allowedToTrack) { |
19 | - Display :: display_header(null); |
|
20 | - api_not_allowed(); |
|
21 | - Display :: display_footer(); |
|
19 | + Display :: display_header(null); |
|
20 | + api_not_allowed(); |
|
21 | + Display :: display_footer(); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | $export_to_csv = false; |
25 | 25 | if (isset($_GET['export'])) { |
26 | - $export_to_csv = true; |
|
26 | + $export_to_csv = true; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | if (api_is_platform_admin() ) { |
30 | - $global = true; |
|
30 | + $global = true; |
|
31 | 31 | } else { |
32 | - $global = false; |
|
32 | + $global = false; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($global) { |
36 | - $temp_course_list = CourseManager :: get_courses_list(); |
|
37 | - foreach($temp_course_list as $temp_course_item) { |
|
38 | - $course_item = CourseManager ::get_course_information($temp_course_item['code']); |
|
36 | + $temp_course_list = CourseManager :: get_courses_list(); |
|
37 | + foreach($temp_course_list as $temp_course_item) { |
|
38 | + $course_item = CourseManager ::get_course_information($temp_course_item['code']); |
|
39 | 39 | $course_list[] = array( |
40 | 40 | 'code' => $course_item['code'], |
41 | 41 | 'title' => $course_item['title'], |
42 | 42 | ); |
43 | - } |
|
43 | + } |
|
44 | 44 | } else { |
45 | 45 | $current_course['code'] = $_course['id']; |
46 | - $course_list = array($current_course); |
|
46 | + $course_list = array($current_course); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $new_course_select = array(); |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | $form = new FormValidator('search_simple', 'POST', '', '', null, false); |
55 | 55 | $form->addElement('select','course_code',get_lang('Course'), $new_course_select); |
56 | 56 | if ($global) { |
57 | - $form->addElement('hidden','view','admin'); |
|
57 | + $form->addElement('hidden','view','admin'); |
|
58 | 58 | } else { |
59 | - //Get exam lists |
|
59 | + //Get exam lists |
|
60 | 60 | $course_id = api_get_course_int_id(); |
61 | - $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST); |
|
62 | - $sqlExercices = "SELECT quiz.title,id FROM ".$t_quiz." AS quiz |
|
61 | + $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST); |
|
62 | + $sqlExercices = "SELECT quiz.title,id FROM ".$t_quiz." AS quiz |
|
63 | 63 | WHERE c_id = $course_id AND active='1' |
64 | 64 | ORDER BY quiz.title ASC"; |
65 | - $resultExercices = Database::query($sqlExercices); |
|
66 | - $exercise_list[0] = get_lang('All'); |
|
67 | - while($a_exercices = Database::fetch_array($resultExercices)) { |
|
68 | - $exercise_list[$a_exercices['id']] = $a_exercices['title']; |
|
69 | - } |
|
70 | - $form->addElement('select', 'exercise_id', get_lang('Exercise'), $exercise_list); |
|
65 | + $resultExercices = Database::query($sqlExercices); |
|
66 | + $exercise_list[0] = get_lang('All'); |
|
67 | + while($a_exercices = Database::fetch_array($resultExercices)) { |
|
68 | + $exercise_list[$a_exercices['id']] = $a_exercices['title']; |
|
69 | + } |
|
70 | + $form->addElement('select', 'exercise_id', get_lang('Exercise'), $exercise_list); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | //$form->addElement('submit','submit',get_lang('Filter')); |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | if (!$export_to_csv) { |
84 | - Display :: display_header(get_lang('Reporting')); |
|
85 | - echo '<div class="actions" style ="font-size:10pt;">'; |
|
86 | - if ($global) { |
|
84 | + Display :: display_header(get_lang('Reporting')); |
|
85 | + echo '<div class="actions" style ="font-size:10pt;">'; |
|
86 | + if ($global) { |
|
87 | 87 | |
88 | 88 | echo '<div style="float:right"> <a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exercise_id.'"> |
89 | 89 | '.Display::return_icon('csv.gif').' |
@@ -93,81 +93,81 @@ discard block |
||
93 | 93 | '.get_lang('Print').'</a> |
94 | 94 | </div>'; |
95 | 95 | |
96 | - $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('TeacherInterface').'</a>'; |
|
96 | + $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('TeacherInterface').'</a>'; |
|
97 | 97 | if (api_is_platform_admin()) { |
98 | - $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin">'.get_lang('AdminInterface').'</a>'; |
|
98 | + $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin">'.get_lang('AdminInterface').'</a>'; |
|
99 | 99 | } else { |
100 | 100 | $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=coach">'.get_lang('AdminInterface').'</a>'; |
101 | 101 | } |
102 | - $menu_items[] = get_lang('ExamTracking'); |
|
103 | - $nb_menu_items = count($menu_items); |
|
104 | - if($nb_menu_items>1) { |
|
105 | - foreach($menu_items as $key=> $item) { |
|
106 | - echo $item; |
|
107 | - if($key!=$nb_menu_items-1) { |
|
108 | - echo ' | '; |
|
109 | - } |
|
110 | - } |
|
111 | - echo '<br />'; |
|
112 | - } |
|
113 | - } else { |
|
114 | - echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=true">'.get_lang('StudentsTracking').'</a> | |
|
102 | + $menu_items[] = get_lang('ExamTracking'); |
|
103 | + $nb_menu_items = count($menu_items); |
|
104 | + if($nb_menu_items>1) { |
|
105 | + foreach($menu_items as $key=> $item) { |
|
106 | + echo $item; |
|
107 | + if($key!=$nb_menu_items-1) { |
|
108 | + echo ' | '; |
|
109 | + } |
|
110 | + } |
|
111 | + echo '<br />'; |
|
112 | + } |
|
113 | + } else { |
|
114 | + echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=true">'.get_lang('StudentsTracking').'</a> | |
|
115 | 115 | <a href="courseLog.php?'.api_get_cidreq().'&studentlist=false">'.get_lang('CourseTracking').'</a> | '; |
116 | 116 | echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=resources">'.get_lang('ResourcesTracking').'</a>'; |
117 | - echo ' | '.get_lang('ExamTracking').''; |
|
117 | + echo ' | '.get_lang('ExamTracking').''; |
|
118 | 118 | echo '<a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exercise_id.'"> |
119 | 119 | '.Display::return_icon('excel.gif').' |
120 | 120 | '.get_lang('ExportAsXLS').'</a><br /><br />'; |
121 | 121 | |
122 | - } |
|
122 | + } |
|
123 | 123 | echo '</div>'; |
124 | - echo '<br /><br />'; |
|
125 | - $form->display(); |
|
124 | + echo '<br /><br />'; |
|
125 | + $form->display(); |
|
126 | 126 | } |
127 | 127 | $main_result = array(); |
128 | 128 | $session_id = 0; |
129 | 129 | $user_list = array(); |
130 | 130 | // Getting course list |
131 | 131 | foreach ($course_list as $current_course ) { |
132 | - $course_info = api_get_course_info($current_course['code']); |
|
133 | - $_course = $course_info; |
|
134 | - |
|
135 | - // Getting LP list |
|
136 | - $list = new LearnpathList('', $current_course['code'], $session_id); |
|
137 | - $lp_list = $list->get_flat_list(); |
|
138 | - |
|
139 | - // Looping LPs |
|
140 | - $lps = array(); |
|
141 | - foreach ($lp_list as $lp_id =>$lp) { |
|
142 | - $exercise_list = Event::get_all_exercises_from_lp($lp_id, $course_info['real_id']); |
|
143 | - $attempt_result = array(); |
|
144 | - // Looping Chamilo Exercises in LP |
|
145 | - foreach ($exercise_list as $exercise) { |
|
146 | - $exercise_stats = Event::get_all_exercise_event_from_lp( |
|
147 | - $exercise['path'], |
|
148 | - $course_info['real_id'], |
|
149 | - $session_id |
|
150 | - ); |
|
151 | - // Looping Exercise Attempts |
|
152 | - foreach ($exercise_stats as $stats) { |
|
153 | - $attempt_result[$exercise['id']]['users'][$stats['exe_user_id']][$stats['exe_id']] = $stats; |
|
154 | - $user_list[$stats['exe_user_id']] = $stats['exe_user_id']; |
|
155 | - } |
|
156 | - $exercise_list_name[$exercise['id']] = $exercise['title']; |
|
157 | - } |
|
158 | - $lps[$lp_id] = array('lp_name' =>$lp['lp_name'], 'exercises' =>$attempt_result); |
|
159 | - $lp_list_name[$lp_id] = $lp['lp_name']; |
|
160 | - } |
|
161 | - $main_result[$current_course['code']] = $lps; |
|
132 | + $course_info = api_get_course_info($current_course['code']); |
|
133 | + $_course = $course_info; |
|
134 | + |
|
135 | + // Getting LP list |
|
136 | + $list = new LearnpathList('', $current_course['code'], $session_id); |
|
137 | + $lp_list = $list->get_flat_list(); |
|
138 | + |
|
139 | + // Looping LPs |
|
140 | + $lps = array(); |
|
141 | + foreach ($lp_list as $lp_id =>$lp) { |
|
142 | + $exercise_list = Event::get_all_exercises_from_lp($lp_id, $course_info['real_id']); |
|
143 | + $attempt_result = array(); |
|
144 | + // Looping Chamilo Exercises in LP |
|
145 | + foreach ($exercise_list as $exercise) { |
|
146 | + $exercise_stats = Event::get_all_exercise_event_from_lp( |
|
147 | + $exercise['path'], |
|
148 | + $course_info['real_id'], |
|
149 | + $session_id |
|
150 | + ); |
|
151 | + // Looping Exercise Attempts |
|
152 | + foreach ($exercise_stats as $stats) { |
|
153 | + $attempt_result[$exercise['id']]['users'][$stats['exe_user_id']][$stats['exe_id']] = $stats; |
|
154 | + $user_list[$stats['exe_user_id']] = $stats['exe_user_id']; |
|
155 | + } |
|
156 | + $exercise_list_name[$exercise['id']] = $exercise['title']; |
|
157 | + } |
|
158 | + $lps[$lp_id] = array('lp_name' =>$lp['lp_name'], 'exercises' =>$attempt_result); |
|
159 | + $lp_list_name[$lp_id] = $lp['lp_name']; |
|
160 | + } |
|
161 | + $main_result[$current_course['code']] = $lps; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | if (!empty($user_list)) { |
165 | 165 | foreach($user_list as $user_id) { |
166 | 166 | $user_data = api_get_user_info($user_id); |
167 | - $user_list_name[$user_id] = api_get_person_name( |
|
168 | - $user_data['firstname'], |
|
169 | - $user_data['lastname'] |
|
170 | - ); |
|
167 | + $user_list_name[$user_id] = api_get_person_name( |
|
168 | + $user_data['firstname'], |
|
169 | + $user_data['lastname'] |
|
170 | + ); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | $export_array = array(); |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | $html_result .= Display::tag('td', $result); |
208 | 208 | |
209 | 209 | $html_result .= '</tr>'; |
210 | - $export_array[] = array( |
|
211 | - $course_code, |
|
212 | - $lp_list_name[$lp_id], |
|
213 | - $exercise_list_name[$exercise_id], |
|
214 | - $user_list_name[$user_id], |
|
215 | - $attempt, |
|
216 | - api_get_local_time($attempt_data['exe_date']), |
|
217 | - $result, |
|
218 | - ); |
|
210 | + $export_array[] = array( |
|
211 | + $course_code, |
|
212 | + $lp_list_name[$lp_id], |
|
213 | + $exercise_list_name[$exercise_id], |
|
214 | + $user_list_name[$user_id], |
|
215 | + $attempt, |
|
216 | + api_get_local_time($attempt_data['exe_date']), |
|
217 | + $result, |
|
218 | + ); |
|
219 | 219 | $attempt++; |
220 | 220 | } |
221 | 221 | } |
@@ -226,30 +226,30 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | if (!$export_to_csv) { |
229 | - echo $html_result; |
|
229 | + echo $html_result; |
|
230 | 230 | } |
231 | 231 | $filename = 'learning_path_results-'.date('Y-m-d-h:i:s').'.xls'; |
232 | 232 | if ($export_to_csv) { |
233 | 233 | export_complete_report_csv($filename, $export_array); |
234 | - exit; |
|
234 | + exit; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | function export_complete_report_csv($filename, $array) |
238 | 238 | { |
239 | - $header[] = array( |
|
240 | - get_lang('Course'), |
|
241 | - get_lang('LearningPath'), |
|
242 | - get_lang('Exercise'), |
|
243 | - get_lang('User'), |
|
244 | - get_lang('Attempt'), |
|
245 | - get_lang('Date'), |
|
246 | - get_lang('Results'), |
|
247 | - ); |
|
248 | - if (!empty($array)) { |
|
249 | - $array = array_merge($header, $array); |
|
250 | - Export :: arrayToCsv($array, $filename); |
|
251 | - } |
|
252 | - exit; |
|
239 | + $header[] = array( |
|
240 | + get_lang('Course'), |
|
241 | + get_lang('LearningPath'), |
|
242 | + get_lang('Exercise'), |
|
243 | + get_lang('User'), |
|
244 | + get_lang('Attempt'), |
|
245 | + get_lang('Date'), |
|
246 | + get_lang('Results'), |
|
247 | + ); |
|
248 | + if (!empty($array)) { |
|
249 | + $array = array_merge($header, $array); |
|
250 | + Export :: arrayToCsv($array, $filename); |
|
251 | + } |
|
252 | + exit; |
|
253 | 253 | |
254 | 254 | } |
255 | 255 | Display :: display_footer(); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $tool_name = get_lang('AddSpecificSearchField'); |
28 | 28 | |
29 | 29 | if (isset($_GET['action']) && $_GET['action'] === 'edit') { |
30 | - $tool_name = get_lang('EditSpecificSearchField'); |
|
30 | + $tool_name = get_lang('EditSpecificSearchField'); |
|
31 | 31 | } |
32 | 32 | // Create the form |
33 | 33 | $form = new FormValidator('specific_fields_add'); |
@@ -1875,11 +1875,11 @@ discard block |
||
1875 | 1875 | return $this->locale; |
1876 | 1876 | } |
1877 | 1877 | |
1878 | - /** |
|
1879 | - * @param string $timezone |
|
1880 | - * |
|
1881 | - * @return User |
|
1882 | - */ |
|
1878 | + /** |
|
1879 | + * @param string $timezone |
|
1880 | + * |
|
1881 | + * @return User |
|
1882 | + */ |
|
1883 | 1883 | public function setTimezone($timezone) |
1884 | 1884 | { |
1885 | 1885 | $this->timezone = $timezone; |
@@ -2048,11 +2048,11 @@ discard block |
||
2048 | 2048 | return $this->plainPassword; |
2049 | 2049 | } |
2050 | 2050 | |
2051 | - /** |
|
2052 | - * Returns the user roles |
|
2053 | - * |
|
2054 | - * @return array The roles |
|
2055 | - */ |
|
2051 | + /** |
|
2052 | + * Returns the user roles |
|
2053 | + * |
|
2054 | + * @return array The roles |
|
2055 | + */ |
|
2056 | 2056 | public function getRoles() |
2057 | 2057 | { |
2058 | 2058 | $roles = $this->roles; |
@@ -6,19 +6,19 @@ |
||
6 | 6 | */ |
7 | 7 | class SelectTheme extends HTML_QuickForm_select |
8 | 8 | { |
9 | - /** |
|
10 | - * Class constructor |
|
11 | - */ |
|
12 | - public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
13 | - { |
|
14 | - parent::__construct($elementName, $elementLabel, $options, $attributes); |
|
15 | - // Get all languages |
|
16 | - $themes = api_get_themes(); |
|
17 | - $this->_options = array(); |
|
18 | - $this->_values = array(); |
|
19 | - $this->addOption('--',''); // no theme select |
|
20 | - for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | - $this->addOption($themes[1][$i],$themes[0][$i]); |
|
22 | - } |
|
23 | - } |
|
9 | + /** |
|
10 | + * Class constructor |
|
11 | + */ |
|
12 | + public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
13 | + { |
|
14 | + parent::__construct($elementName, $elementLabel, $options, $attributes); |
|
15 | + // Get all languages |
|
16 | + $themes = api_get_themes(); |
|
17 | + $this->_options = array(); |
|
18 | + $this->_values = array(); |
|
19 | + $this->addOption('--',''); // no theme select |
|
20 | + for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | + $this->addOption($themes[1][$i],$themes[0][$i]); |
|
22 | + } |
|
23 | + } |
|
24 | 24 | } |
@@ -27,22 +27,22 @@ |
||
27 | 27 | |
28 | 28 | if (!empty($_POST)) |
29 | 29 | { |
30 | - foreach ( $_POST as $key => $value ) |
|
31 | - { |
|
32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
33 | - continue; |
|
30 | + foreach ( $_POST as $key => $value ) |
|
31 | + { |
|
32 | + if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
33 | + continue; |
|
34 | 34 | |
35 | - if ( get_magic_quotes_gpc() ) |
|
36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
37 | - else |
|
38 | - $value = htmlspecialchars( (string)$value ); |
|
35 | + if ( get_magic_quotes_gpc() ) |
|
36 | + $value = htmlspecialchars( stripslashes((string)$value) ); |
|
37 | + else |
|
38 | + $value = htmlspecialchars( (string)$value ); |
|
39 | 39 | ?> |
40 | 40 | <tr> |
41 | 41 | <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
43 | 43 | </tr> |
44 | 44 | <?php |
45 | - } |
|
45 | + } |
|
46 | 46 | } |
47 | 47 | ?> |
48 | 48 | </table> |
@@ -26,7 +26,7 @@ |
||
26 | 26 | parent::__construct('1.1', 'Valery Fremaux'); |
27 | 27 | } |
28 | 28 | |
29 | - function pix_url($pixname, $size = 16) { |
|
29 | + function pix_url($pixname, $size = 16) { |
|
30 | 30 | global $_configuration; |
31 | 31 | |
32 | 32 | if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png')){ |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * Security checks |
15 | 15 | */ |
16 | 16 | if (! isset($_SESSION['conditional_login']['uid'])) |
17 | - die("Not Authorised"); |
|
17 | + die("Not Authorised"); |
|
18 | 18 | |
19 | 19 | if (isset($_POST['password'])) { |
20 | 20 | $u = api_get_user_info($_SESSION['conditional_login']['uid']); |
@@ -27,26 +27,26 @@ discard block |
||
27 | 27 | exit(); |
28 | 28 | } |
29 | 29 | $password = $_POST['password']; |
30 | - $updated = UserManager::update_user( |
|
31 | - $u['user_id'], |
|
32 | - $u['firstname'], |
|
33 | - $u['lastname'], |
|
34 | - $u['username'], |
|
35 | - $password, |
|
36 | - $u['auth_source'], |
|
37 | - $u['email'], |
|
38 | - $u['status'], |
|
39 | - $u['official_code'], |
|
40 | - $u['phone'], |
|
41 | - $u['picture_uri'], |
|
42 | - $u['expiration_date'], |
|
43 | - $u['active'], |
|
44 | - $u['creator_id'], |
|
45 | - $u['hr_dept_id'], |
|
46 | - null, |
|
47 | - $u['language'], |
|
48 | - '' |
|
49 | - ); |
|
30 | + $updated = UserManager::update_user( |
|
31 | + $u['user_id'], |
|
32 | + $u['firstname'], |
|
33 | + $u['lastname'], |
|
34 | + $u['username'], |
|
35 | + $password, |
|
36 | + $u['auth_source'], |
|
37 | + $u['email'], |
|
38 | + $u['status'], |
|
39 | + $u['official_code'], |
|
40 | + $u['phone'], |
|
41 | + $u['picture_uri'], |
|
42 | + $u['expiration_date'], |
|
43 | + $u['active'], |
|
44 | + $u['creator_id'], |
|
45 | + $u['hr_dept_id'], |
|
46 | + null, |
|
47 | + $u['language'], |
|
48 | + '' |
|
49 | + ); |
|
50 | 50 | |
51 | 51 | if ($updated !== false) { |
52 | 52 | UserManager::update_extra_field_value($u['user_id'], 'already_logged_in', 'true'); |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | <div id="changepassword-form-box" class="form-box"> |
105 | 105 | <div class="info"> <?php echo custompages_get_lang('FirstLoginChangePassword');?> </div> |
106 | 106 | <?php if (isset($error_message)) { |
107 | - echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>'; |
|
108 | - }?> |
|
107 | + echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>'; |
|
108 | + }?> |
|
109 | 109 | <form id="changepassword-form" class="form" method="post"> |
110 | 110 | <div> |
111 | 111 | <label for="password">*<?php echo custompages_get_lang('Password');?></label> |
@@ -46,10 +46,9 @@ discard block |
||
46 | 46 | - Universite Jean Monet (J Dubois / Michel Courbon) |
47 | 47 | - Michel Panckoucke for reporting and fixing a bug |
48 | 48 | - Patrick Cool: fixing security hole |
49 | - |
|
50 | - * @author Roan Embrechts |
|
51 | - * @version 3.0 |
|
52 | - * @package chamilo.auth.ldap |
|
49 | + * @author Roan Embrechts |
|
50 | + * @version 3.0 |
|
51 | + * @package chamilo.auth.ldap |
|
53 | 52 | * Note: |
54 | 53 | * If you are using a firewall, you might need to check port 389 is open in |
55 | 54 | * order for Chamilo to communicate with the LDAP server. |
@@ -211,8 +210,8 @@ discard block |
||
211 | 210 | $language = api_get_setting('platformLanguage'); |
212 | 211 | if (empty($language)) { $language = 'english'; } |
213 | 212 | $_userId = UserManager::create_user($prenom, $nom, $status, |
214 | - $email, $uname, $password, $official_code, |
|
215 | - $language,'', '', 'ldap'); |
|
213 | + $email, $uname, $password, $official_code, |
|
214 | + $language,'', '', 'ldap'); |
|
216 | 215 | |
217 | 216 | //echo "new user added to Chamilo, id = $_userId"; |
218 | 217 | |
@@ -271,7 +270,7 @@ discard block |
||
271 | 270 | // Open anonymous LDAP connection |
272 | 271 | $result=false; |
273 | 272 | $ldap_bind_res = ldap_handle_bind($ds,$result); |
274 | - // Executing the search with the $filter parametr |
|
273 | + // Executing the search with the $filter parametr |
|
275 | 274 | //error_log('Searching for '.$filter.' on LDAP server',0); |
276 | 275 | $sr=ldap_search($ds,$ldap_basedn,$filter); |
277 | 276 | $info = ldap_get_entries($ds, $sr); |
@@ -564,35 +563,35 @@ discard block |
||
564 | 563 | foreach ($UserList as $enreg_user) { |
565 | 564 | $enreg_user = (int) $enreg_user; |
566 | 565 | Database::query("INSERT IGNORE ". |
567 | - " INTO $tbl_session_rel_course_rel_user ". |
|
568 | - "(session_id,c_id,user_id) VALUES ". |
|
569 | - "('$id_session','$enreg_course','$enreg_user')"); |
|
566 | + " INTO $tbl_session_rel_course_rel_user ". |
|
567 | + "(session_id,c_id,user_id) VALUES ". |
|
568 | + "('$id_session','$enreg_course','$enreg_user')"); |
|
570 | 569 | } |
571 | 570 | $sql = "SELECT COUNT(user_id) as nbUsers ". |
572 | - " FROM $tbl_session_rel_course_rel_user " . |
|
573 | - " WHERE session_id='$id_session' ". |
|
574 | - " AND c_id='$enreg_course'"; |
|
571 | + " FROM $tbl_session_rel_course_rel_user " . |
|
572 | + " WHERE session_id='$id_session' ". |
|
573 | + " AND c_id='$enreg_course'"; |
|
575 | 574 | $rs = Database::query($sql); |
576 | 575 | list($nbr_users) = Database::fetch_array($rs); |
577 | 576 | Database::query("UPDATE $tbl_session_rel_course ". |
578 | - " SET nbr_users=$nbr_users " . |
|
579 | - " WHERE session_id='$id_session' ". |
|
580 | - " AND c_id='$enreg_course'"); |
|
577 | + " SET nbr_users=$nbr_users " . |
|
578 | + " WHERE session_id='$id_session' ". |
|
579 | + " AND c_id='$enreg_course'"); |
|
581 | 580 | } |
582 | 581 | foreach ($UserList as $enreg_user) { |
583 | 582 | $enreg_user = (int) $enreg_user; |
584 | 583 | Database::query("INSERT IGNORE INTO $tbl_session_rel_user ". |
585 | - " (session_id, user_id, registered_at) " . |
|
586 | - " VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')"); |
|
584 | + " (session_id, user_id, registered_at) " . |
|
585 | + " VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')"); |
|
587 | 586 | } |
588 | 587 | // We update the number of users in the session |
589 | 588 | $sql = "SELECT COUNT(user_id) as nbUsers FROM $tbl_session_rel_user ". |
590 | - " WHERE session_id='$id_session' ". |
|
591 | - " AND relation_type<>".SESSION_RELATION_TYPE_RRHH." "; |
|
589 | + " WHERE session_id='$id_session' ". |
|
590 | + " AND relation_type<>".SESSION_RELATION_TYPE_RRHH." "; |
|
592 | 591 | $rs = Database::query($sql); |
593 | 592 | list($nbr_users) = Database::fetch_array($rs); |
594 | 593 | Database::query("UPDATE $tbl_session SET nbr_users=$nbr_users ". |
595 | - " WHERE id='$id_session'"); |
|
594 | + " WHERE id='$id_session'"); |
|
596 | 595 | } |
597 | 596 | |
598 | 597 | function syncro_users() { |
@@ -60,8 +60,8 @@ |
||
60 | 60 | $user['error'] = get_lang('UserNameNotAvailable'); |
61 | 61 | $errors[] = $user; |
62 | 62 | } |
63 | - } |
|
64 | - } |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | 66 | // 3. Check status. |
67 | 67 | if (isset($user['Status']) && !api_status_exists($user['Status'])) { |