Skip to content

Commit

Permalink
Merge branch 'm26_MDL-40200_Notices_When_Viewing_Profile_Invalid_User…
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jun 24, 2013
2 parents e2eccd0 + 243ab45 commit 7541305
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions user/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7541305

Please sign in to comment.