]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for bug MDL-8708 "Debug, multiple warnings in admin/uploaduser.php and user.php"
authornfreear <nfreear>
Thu, 1 Mar 2007 12:08:38 +0000 (12:08 +0000)
committernfreear <nfreear>
Thu, 1 Mar 2007 12:08:38 +0000 (12:08 +0000)
admin/uploaduser.php
admin/user.php

index 377498a8de9aab1dfd3c0d3dacaedb61540265fe..5a5ecfe6c676d7e1e7adff2d1b00468a13281a2a 100755 (executable)
@@ -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'),
index df6b274a7985068c3e2d6268b361eaa488ec9bf6..9a16a17dcb11752fe311b38e507b39c71f2ed411 100644 (file)
                             . 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) {