From 8b1fc11c7bda3df2c824563d0577666158d702d2 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Tue, 20 Jan 2009 23:29:08 +0100 Subject: [PATCH] [svn r17877] Minor - Logic change - Fixed warning illegal offset type in isset or empty in /var/www/dokeossvn/main/inc/lib/main_api.lib.php on line 747 - see FS#3479 --- main/inc/lib/main_api.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index ef10869be1..bb7a589a8b 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -744,6 +744,7 @@ function api_session_register($variable) { * @param string variable - the variable name to remove from the session */ function api_session_unregister($variable) { + $variable = strval($variable); if(isset($GLOBALS[$variable])) { unset ($GLOBALS[$variable]); } @@ -1438,14 +1439,14 @@ function is_allowed_to_edit() { * @return boolean, true: the user has the rights to edit, false: he does not */ function api_is_allowed_to_edit($tutor=false,$coach=false) { - $is_courseAdmin = api_is_course_admin() || api_is_platform_admin() || api_is_coach(); - if(!$is_courseAdmin && $tutor == true) { //if we also want to check if the user is a tutor... + $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...'; + if (!$is_courseAdmin && $coach == true) { //if we also want to check if the user is a coach...'; $is_courseAdmin = $is_courseAdmin || api_is_course_coach(); } - if(api_get_setting('student_view_enabled') == 'true') { //check if the student_view is enabled, and if so, if it is activated + if (api_get_setting('student_view_enabled') == 'true') { //check if the student_view is enabled, and if so, if it is activated $is_allowed = $is_courseAdmin && $_SESSION['studentview'] != "studentview"; return $is_allowed; } else { @@ -2004,6 +2005,7 @@ function api_send_mail($to, $subject, $message, $additional_headers = null, $add return mail($to, $subject, $message, $additional_headers, $additional_parameters); } + /** * Find the largest sort value in a given user_course_category * This function is used when we are moving a course to a different category