Skip to content

Commit

Permalink
Don't let guests ever be edited
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Sep 3, 2007
1 parent 62e3b9d commit 277fe19
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion user/edit.php
Expand Up @@ -27,15 +27,22 @@
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$personalcontext = get_context_instance(CONTEXT_USER, $user->id);

// Guest can not edit
if (isguestuser()) {
print_error('guestnoeditprofile');
}

// The user profile we are editing
if (!$user = get_record('user', 'id', $userid)) {
error('User ID was incorrect');
}

//user interests separated by commas
// Guest can not be edited
if (isguestuser($user)) {
print_error('guestnoeditprofile');
}

// User interests separated by commas
if (!empty($CFG->usetags)) {
require_once($CFG->dirroot.'/tag/lib.php');
$user->interests = tag_names_csv(get_item_tags('user',$userid));
Expand Down

0 comments on commit 277fe19

Please sign in to comment.