Browse Source

Fixing PHP warnings.

Julio Montoya 11 years ago
parent
commit
75a0de0357

+ 2 - 2
main/admin/access_url_edit_courses_to_url.php

@@ -92,7 +92,7 @@ $errorMsg='';
 $UserList=$SessionList=array();
 $users=$sessions=array();
 
-if($_POST['form_sent']) {
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
 	$form_sent=$_POST['form_sent'];
 	$course_list=$_POST['course_list'];
 
@@ -119,7 +119,7 @@ echo '</div>';
 
 api_display_tool_title($tool_name);
 
-if ($_GET['action'] == 'show_message')
+if (isset($_GET['action']) && $_GET['action'] == 'show_message')
 	Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
 
 $no_course_list = $course_list = array();

+ 3 - 2
main/admin/access_url_edit_users_to_url.php

@@ -92,7 +92,7 @@ $UserList = array();
 
 $message = '';
 
-if ($_POST['form_sent']) {
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
     $form_sent = $_POST['form_sent'];
     $UserList = $_POST['sessionUsersList'];
 
@@ -102,6 +102,7 @@ if ($_POST['form_sent']) {
     if ($form_sent == 1) {
         if ($access_url_id == 0) {
             header('Location: access_url_edit_users_to_url.php?action=show_message&message=' . get_lang('SelectURL'));
+            exit;
         } elseif (is_array($UserList)) {
             $result = UrlManager::update_urls_rel_user($UserList, $access_url_id);
             $url_info = UrlManager::get_url_data_from_id($access_url_id);
@@ -156,7 +157,7 @@ echo '</div>';
 
 api_display_tool_title($tool_name);
 
-if ($_GET['action'] == 'show_message')
+if (isset($_GET['action']) && $_GET['action'] == 'show_message') {
     Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
 
 $nosessionUsersList = $sessionUsersList = array();