diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php
index 9cc05e834f..46146063dd 100755
--- a/main/inc/lib/main_api.lib.php
+++ b/main/inc/lib/main_api.lib.php
@@ -475,7 +475,7 @@ function api_get_path($path_type, $path = null) {
$paths[CONFIGURATION_PATH] = $paths[SYS_CODE_PATH].$paths[CONFIGURATION_PATH];
$paths[WEB_LIBRARY_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_LIBRARY_PATH];
$paths[WEB_AJAX_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_AJAX_PATH];
-
+
$is_this_function_initialized = true;
}
@@ -799,14 +799,14 @@ function api_get_user_info($user_id = '') {
// ideally the names of the fields of the user table are renamed so that they match $_user (or vice versa)
// $_user should also contain every field of the user table (except password maybe). This would make the
// following lines obsolete (and the code cleaner and slimmer !!!
-
+
$user_info['firstname'] = $result_array['firstname'];
$user_info['lastname'] = $result_array['lastname'];
-
+
//Kept for historical reasons
$user_info['firstName'] = $result_array['firstname'];
- $user_info['lastName'] = $result_array['lastname'];
-
+ $user_info['lastName'] = $result_array['lastname'];
+
$user_info['mail'] = $result_array['email'];
$user_info['picture_uri'] = $result_array['picture_uri'];
$user_info['user_id'] = $result_array['user_id'];
@@ -1933,14 +1933,14 @@ function api_display_debug_info($debug_info) {
function api_is_allowed_to_edit($tutor=false,$coach=false,$session_coach = false) {
$my_session_id = api_get_session_id();
- $is_allowed_coach_to_edit = api_is_coach();
+ $is_allowed_coach_to_edit = api_is_coach();
$session_visibility = api_get_session_visibility($my_session_id);
$is_courseAdmin = api_is_course_admin() || api_is_platform_admin();
if (!$is_courseAdmin && $tutor == true) { //if we also want to check if the user is a tutor...
$is_courseAdmin = $is_courseAdmin || api_is_course_tutor();
}
if (!$is_courseAdmin && $coach == true) { //if we also want to check if the user is a coach...';
- // check if session visibility is read only for coachs
+ // check if session visibility is read only for coachs
if ($session_visibility==SESSION_VISIBLE_READ_ONLY) {
$is_allowed_coach_to_edit = false;
}
@@ -1952,24 +1952,24 @@ function api_is_allowed_to_edit($tutor=false,$coach=false,$session_coach = false
}
}
- if (!$is_courseAdmin && $session_coach == true) {
+ if (!$is_courseAdmin && $session_coach == true) {
$is_courseAdmin = $is_courseAdmin || api_is_coach();
}
if (api_get_setting('student_view_enabled') == 'true') { //check if the student_view is enabled, and if so, if it is activated
if (!empty($my_session_id)) {
- // check if session visibility is read only for coachs
+ // check if session visibility is read only for coachs
if ($session_visibility==SESSION_VISIBLE_READ_ONLY) {
$is_allowed_coach_to_edit = false;
- }
+ }
if (api_get_setting('allow_coach_to_edit_course_session') == 'true') { // check if coach is allowed to edit a course
$is_allowed = $is_allowed_coach_to_edit;
} else {
$is_allowed = false;
- }
+ }
} else {
- $is_allowed = $is_courseAdmin && $_SESSION['studentview'] != "studentview";
- }
+ $is_allowed = $is_courseAdmin && $_SESSION['studentview'] != "studentview";
+ }
return $is_allowed;
} else {
return $is_courseAdmin;
@@ -2140,7 +2140,7 @@ function api_not_allowed($print_headers = false) {
$home_url = api_get_path(WEB_PATH);
$user = api_get_user_id();
$course = api_get_course_id();
-
+
global $this_section;
$origin = isset($_GET['origin']) ? $_GET['origin'] : '';
@@ -2177,16 +2177,16 @@ function api_not_allowed($print_headers = false) {
}
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
$form = new FormValidator('formLogin', 'post', api_get_self().'?'.Security::remove_XSS($_SERVER['QUERY_STRING']));
-
- $form->addElement('text', 'login', get_lang('Username'), array('size' => 17));
- $form->addElement('password', 'password', get_lang('Password'), array('size' => 17));
+
+ $form->addElement('text', 'login', get_lang('Username'), array('size' => 17));
+ $form->addElement('password', 'password', get_lang('Password'), array('size' => 17));
$form->addElement('style_submit_button', 'submitAuth', get_lang('Enter'),'class="login"');
if ((!headers_sent() || $print_headers) && $origin != 'learnpath') { Display::display_header(''); }
Display::display_error_message(get_lang('NotAllowed').'
'.get_lang('PleaseLoginAgainFromFormBelow').'
', false);
-
- echo '