-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindexSession.php
More file actions
27 lines (22 loc) · 834 Bytes
/
Copy pathindexSession.php
File metadata and controls
27 lines (22 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
include_once 'includes/user.php';
include_once 'includes/userSession.php';
$userSession = new UserSession();
$user = new User();
if(isset($_SESSION['user'])){
$user->setUser($userSession->getCurrentUser());
include_once 'layout/navbar-user.php';
}else if(isset($_POST['email']) && isset($_POST['password'])){
$emailForm = $_POST['email'];
$passwordForm = $_POST['password'];
if($user->userExist($emailForm, $passwordForm)){
$userSession -> setCurrentUser($emailForm);
$user->setUser($emailForm);
include_once 'layout/navbar-user.php';;
}else{
$mensaje = "Nombre de usuario o contraseña incorrectos";
}
}else{
include_once 'layout/regis-user.php';
}
?>