Oops - only update the session user id for the newly created user if it's the same account and the same conference as the one doing the user creation

This commit is contained in:
jacob 2011-01-28 20:16:43 +00:00
parent 8714fe7a1d
commit 347b12ab2e

View File

@ -228,7 +228,12 @@ function account_add_role($accounts_id, $roles_id, $conferences_id, $password =
}else{
// They're not actually connected to this conference, let's hook 'em up
$u = user_create($accounts_id, $conferences_id);
$_SESSION['users_id'] = $users_id = $u['id'];
$users_id = $u['id'];
// if this applies to their current session, update their session user id
if($_SESSION['accounts_id'] == $accounts_id && $_SESSION['conferences_id'] == $conferences_id){
$_SESSION['users_id'] = $users_id;
}
}
// we now have the user id that we need, let's check to see whether or not they