Bug correction in token regeneration

This commit is contained in:
Phyks 2013-10-28 21:24:01 +01:00
parent 97dbd3d330
commit d6e1a89be9

View File

@ -210,7 +210,7 @@
if(check_token(600, 'edit_users')) { if(check_token(600, 'edit_users')) {
$user = new User(); $user = new User();
if(!empty($_POST['user_id'])) { if(!empty($_POST['user_id'])) {
$user->load(array('id' => $_POST['user_id'])); $user = $user->load(array('id' => $_POST['user_id']), true);
} }
else { else {
$user->newJsonToken(); $user->newJsonToken();
@ -286,7 +286,9 @@
$user = $user->load(array('id'=>$user_id), true); $user = $user->load(array('id'=>$user_id), true);
$user->newJsonToken(); $user->newJsonToken();
$user->save(); $user->save();
$_SESSION['current_user'] = $user->sessionStore();
if(empty($_GET['user_id']))
$_SESSION['current_user'] = $user->sessionStore();
if(!empty($_GET['user_id'])) if(!empty($_GET['user_id']))
header('location: index.php?do=edit_users&user_id='.$user_id); header('location: index.php?do=edit_users&user_id='.$user_id);