From 68d89ed22b75f876aa495273c72f465f1d9bf6ac Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 29 Apr 2008 08:03:54 +0200 Subject: [PATCH] [svn r15166] Minor: removed notice-level errors --- index.php | 12 ++++++------ main/inc/banner.inc.php | 4 ++-- main/inc/lib/formvalidator/FormValidator.class.php | 5 +++-- main/inc/lib/main_api.lib.php | 9 ++++++--- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/index.php b/index.php index e30a2ec420..64644b59d4 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ /** * @package dokeos.main * @author Patrick Cool , Ghent University, Refactoring -* @version $Id: index.php 15074 2008-04-24 22:47:26Z yannoo $ +* @version $Id: index.php 15166 2008-04-29 06:03:54Z yannoo $ * @todo check the different @todos in this page and really do them * @todo check if the news management works as expected */ @@ -69,7 +69,7 @@ $this_section = SECTION_CAMPUS; * this can be usefull when you are on an open course and you need to log in to edit something and you immediately want to check how anonymous users * will see it. */ -if ($_GET['logout']) +if (!empty($_GET['logout'])) { logout(); } @@ -107,10 +107,10 @@ if (isset ($_user['user_id'])) * @todo This piece of code should probably move to local.inc.php where the actual login / logout procedure is handled. * @todo consider removing this piece of code because does nothing. */ -if ($_GET["submitAuth"] == 1) +if (isset($_GET['submitAuth']) && $_GET['submitAuth'] == 1) { // nice lie!!! - echo "Attempted breakin - sysadmins notified."; + echo 'Attempted breakin - sysadmins notified.'; session_destroy(); die(); } @@ -121,7 +121,7 @@ if ($_GET["submitAuth"] == 1) * the code does the stuff in local.inc.php and then redirects to index.php or user_portal.php depending * on api_get_setting('page_after_login') */ -if ($_POST["submitAuth"]) +if (!empty($_POST["submitAuth"])) { // the user is already authenticated, we now find the last login of the user. if (isset ($_user['user_id'])) @@ -221,7 +221,7 @@ else } // Display System announcements -$announcement = $_GET['announcement'] ? $_GET['announcement'] : -1; +$announcement = isset($_GET['announcement']) ? $_GET['announcement'] : -1; $announcement = intval($announcement); if (isset($_user['user_id'])) diff --git a/main/inc/banner.inc.php b/main/inc/banner.inc.php index fc3eab4db1..f0293573a5 100644 --- a/main/inc/banner.inc.php +++ b/main/inc/banner.inc.php @@ -417,7 +417,7 @@ $chat = strpos(api_get_self(), 'chat_banner.php'); if (!$chat) { include_once (api_get_path(LIBRARY_PATH)."online.inc.php"); - echo $accept; + //echo $accept; $chatcall = chatcall(); if ($chatcall) { @@ -549,4 +549,4 @@ function get_tabs() return $navigation; } ?> - \ No newline at end of file + diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php index 044c1ecdfc..554305aeec 100644 --- a/main/inc/lib/formvalidator/FormValidator.class.php +++ b/main/inc/lib/formvalidator/FormValidator.class.php @@ -38,6 +38,7 @@ define('TEACHER_HTML_FULLPAGE',5); */ class FormValidator extends HTML_QuickForm { + var $with_progress_bar=false; /** * Constructor * @param string $form_name Name of the form @@ -349,7 +350,7 @@ EOT; } $return_value = parent::toHtml(); // Add the div which will hold the progress bar - if($this->with_progress_bar) + if(isset($this->with_progress_bar) && $this->with_progress_bar) { $return_value .= '
'; } @@ -387,4 +388,4 @@ function html_filter_student_fullpage($html) { return html_filter($html,STUDENT_HTML_FULLPAGE); } -?> \ No newline at end of file +?> diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index 1bfbb98399..e7e15014ce 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -1820,7 +1820,10 @@ function api_display_language_form() // retrieve a complete list of all the languages. $language_list = api_get_languages(); // the the current language of the user so that his/her language occurs as selected in the dropdown menu - $user_selected_language = $_SESSION["user_language_choice"]; + if(isset($_SESSION['user_language_choice'])) + { + $user_selected_language = $_SESSION['user_language_choice']; + } if (!isset ($user_selected_language)) $user_selected_language = $platformLanguage; $original_languages = $language_list['name']; @@ -2051,7 +2054,7 @@ function string_2_boolean($string) function api_number_of_plugins($location) { global $_plugins; - if (is_array($_plugins[$location])) + if (isset($_plugins[$location]) && is_array($_plugins[$location])) { return count($_plugins[$location]); } @@ -2066,7 +2069,7 @@ function api_plugin($location) { global $_plugins; - if (is_array($_plugins[$location])) + if (isset($_plugins[$location]) && is_array($_plugins[$location])) { foreach ($_plugins[$location] as $this_plugin) {