Fix for bug MDL-8708 "Debug, multiple warnings in admin/uploaduser.php and user.php"

This commit is contained in:
nfreear 2007-03-01 12:08:38 +00:00
parent dbcf4d014b
commit 34d4b268c7
2 changed files with 6 additions and 4 deletions

View File

@ -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'),

View File

@ -355,7 +355,9 @@
. get_string($changeaccessto, 'mnet') . " access</a>)";
}
// mnet info in edit column
$editbutton = $mnethosts[$user->mnethostid]->name;
if (isset($mnethosts[$user->mnethostid])) {
$editbutton = $mnethosts[$user->mnethostid]->name;
}
}
if ($user->lastaccess) {