First pass to add new user SQL model

This commit is contained in:
leosw
2018-09-03 22:46:26 +02:00
parent 52f82cfe78
commit 228cacb664
6 changed files with 92 additions and 59 deletions

View File

@@ -12,11 +12,10 @@ if(isset($controller->splitted_url[1])) {
if (isset($_POST['submit'])) {
// PROCESS DATA FROM FORM
$user = new User();
$user->login($_POST['login'], $_POST['password']);
if($user->id != 0) {
if($user->login($_POST['login'], $_POST['password'])) {
// SUCESSFULL LOGIN
$_SESSION['userid'] = $user->id;
$_SESSION['userid'] = $user->get_id();
header('Location: '.$_SERVER['HTTP_REFERER']);
}
else {