Bug correction in login form
This commit is contained in:
parent
ad6b4462c8
commit
eda37541b3
1
TODO
1
TODO
@ -3,6 +3,7 @@
|
||||
* htmlspecialchars => on users objects
|
||||
* handle negative amounts
|
||||
* Refactor load method to avoir load_* methods !
|
||||
* Test remember_me
|
||||
|
||||
install.php :
|
||||
=============
|
||||
|
15
index.php
15
index.php
@ -36,13 +36,6 @@
|
||||
// Handle current user status
|
||||
if(session_id() == '') session_start();
|
||||
|
||||
// If IP has changed, logout
|
||||
if(user_ip() != $_SESSION['ip']) {
|
||||
session_destroy();
|
||||
header('location: index.php?do=connect');
|
||||
exit();
|
||||
}
|
||||
|
||||
$current_user = new User();
|
||||
if(isset($_SESSION['current_user'])) {
|
||||
$current_user->sessionRestore($_SESSION['current_user'], true);
|
||||
@ -57,6 +50,13 @@
|
||||
header('location: index.php?do=connect');
|
||||
exit();
|
||||
}
|
||||
|
||||
// If IP has changed, logout
|
||||
if($current_user !== false && user_ip() != $_SESSION['ip']) {
|
||||
session_destroy();
|
||||
header('location: index.php?do=connect');
|
||||
exit();
|
||||
}
|
||||
|
||||
// Initialize empty $_GET['do'] if required to avoid error
|
||||
if(empty($_GET['do'])) {
|
||||
@ -102,6 +102,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
$tpl->assign('connection', true);
|
||||
$tpl->assign('user_post', (!empty($_POST['login'])) ? htmlspecialchars($_POST['login']) : '');
|
||||
$tpl->assign('token', generate_token('connection'));
|
||||
$tpl->draw('connection');
|
||||
|
Loading…
Reference in New Issue
Block a user