Permalink
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...
2 parents 7991637 + da0c3ea commit 3e6f11b240b3e607edfae40aec50863bc533483b @stronk7 stronk7 committed Jun 24, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 user/profile.php
View
@@ -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;
}

0 comments on commit 3e6f11b

Please sign in to comment.