Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'm25_MDL-40200_Notices_When_Viewing_Profile_Invalid_User…

…Id' of https://github.com/scara/moodle into MOODLE_25_STABLE
  • Loading branch information...
commit 3e6f11b240b3e607edfae40aec50863bc533483b 2 parents 7991637 + da0c3ea
@stronk7 stronk7 authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 user/profile.php
View
10 user/profile.php
@@ -56,12 +56,14 @@
}
$userid = $userid ? $userid : $USER->id; // Owner of the page
-$user = $DB->get_record('user', array('id' => $userid));
-
-if ($user->deleted) {
+if ((!$user = $DB->get_record('user', array('id' => $userid))) || ($user->deleted)) {
$PAGE->set_context(context_system::instance());
echo $OUTPUT->header();
- echo $OUTPUT->notification(get_string('userdeleted'));
+ if (!$user) {
+ echo $OUTPUT->notification(get_string('invaliduser', 'error'));
+ } else {
+ echo $OUTPUT->notification(get_string('userdeleted'));
+ }
echo $OUTPUT->footer();
die;
}
Please sign in to comment.
Something went wrong with that request. Please try again.