bugfix: editing own user account caused errors

This commit is contained in:
Savetheinternet 2011-12-10 13:40:48 +11:00
parent c83d192103
commit 4fd91e4523

View File

@ -1186,7 +1186,8 @@
header('Location: ?/users', true, $config['redirect_http']);
} else {
// Edit user
if(!hasPermission($config['mod']['editusers']) && !hasPermission($config['mod']['change_password'])) error($config['error']['noaccess']);
if(!hasPermission($config['mod']['editusers']) && !hasPermission($config['mod']['change_password']))
error($config['error']['noaccess']);
$query = prepare("SELECT * FROM `mods` WHERE `id` = :id");
$query->bindValue(':id', $modID, PDO::PARAM_INT);
@ -1236,10 +1237,14 @@
if($_mod['id'] == $mod['id']) {
// Changed own password. Update cookies
login($mod['username'], $_POST['password']);
if(!login($_mod['username'], $_mod['password'], false, true))
error('Could not re-login after changing password. (?)');
setCookies();
}
header('Location: ?/users', true, $config['redirect_http']);
exit;
}
$__boards = '<ul style="list-style:none;padding:2px 5px">';