From d6e1a89be9e0ca0841e6fe320949543d22a236e1 Mon Sep 17 00:00:00 2001 From: Phyks Date: Mon, 28 Oct 2013 21:24:01 +0100 Subject: [PATCH] Bug correction in token regeneration --- index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 55a1402..3eeb8d9 100644 --- a/index.php +++ b/index.php @@ -210,7 +210,7 @@ if(check_token(600, 'edit_users')) { $user = new User(); if(!empty($_POST['user_id'])) { - $user->load(array('id' => $_POST['user_id'])); + $user = $user->load(array('id' => $_POST['user_id']), true); } else { $user->newJsonToken(); @@ -286,7 +286,9 @@ $user = $user->load(array('id'=>$user_id), true); $user->newJsonToken(); $user->save(); - $_SESSION['current_user'] = $user->sessionStore(); + + if(empty($_GET['user_id'])) + $_SESSION['current_user'] = $user->sessionStore(); if(!empty($_GET['user_id'])) header('location: index.php?do=edit_users&user_id='.$user_id);