From 34d4b268c7f35d6af299b8a7058b2023bd8dc4f0 Mon Sep 17 00:00:00 2001 From: nfreear Date: Thu, 1 Mar 2007 12:08:38 +0000 Subject: [PATCH] Fix for bug MDL-8708 "Debug, multiple warnings in admin/uploaduser.php and user.php" --- admin/uploaduser.php | 6 +++--- admin/user.php | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/uploaduser.php b/admin/uploaduser.php index 377498a8de9..5a5ecfe6c67 100755 --- a/admin/uploaduser.php +++ b/admin/uploaduser.php @@ -131,10 +131,10 @@ if ($um->preprocess_files() && confirm_sesskey()) { // check for valid field names foreach ($header as $i => $h) { $h = trim($h); $header[$i] = $h; // remove whitespace - if (!($required[$h] or $optionalDefaults[$h] or $optional[$h])) { + if (!(isset($required[$h]) or isset($optionalDefaults[$h]) or isset($optional[$h]))) { error(get_string('invalidfieldname', 'error', $h), 'uploaduser.php?sesskey='.$USER->sesskey); } - if ($required[$h]) { + if (isset($required[$h])) { $required[$h] = 0; } } @@ -173,7 +173,7 @@ if ($um->preprocess_files() && confirm_sesskey()) { // add fields to object $user foreach ($record as $name => $value) { // check for required values - if ($required[$name] and !$value) { + if (isset($required[$name]) and !$value) { error(get_string('missingfield', 'error', $name). " ". get_string('erroronline', 'error', $linenum) .". ". get_string('processingstops', 'error'), diff --git a/admin/user.php b/admin/user.php index df6b274a798..9a16a17dcb1 100644 --- a/admin/user.php +++ b/admin/user.php @@ -355,7 +355,9 @@ . get_string($changeaccessto, 'mnet') . " access)"; } // mnet info in edit column - $editbutton = $mnethosts[$user->mnethostid]->name; + if (isset($mnethosts[$user->mnethostid])) { + $editbutton = $mnethosts[$user->mnethostid]->name; + } } if ($user->lastaccess) {