-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingup.php
50 lines (37 loc) · 1.69 KB
/
singup.php
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
require_once 'include/user.php';
require_once 'include/user_session.php';
$userSession = new UserSession();
$user = new User();
if(isset($_SESSION['user'])){
//echo "hay sesion";
$user->setUser($userSession->getCurrentUser());
//include_once 'home/index.php';
//<?php echo constant('URL'); ?home>;
}else if(isset($_POST['username']) && isset($_POST['seguridad'])){
$userForm = $_POST['username'];
$passForm = $_POST['seguridad'];
$user = new User();
if($user->userExists($userForm, $passForm)){
//echo "Existe el usuario";
$userSession->setCurrentUser($userForm);
$user->setUser($userForm);
//echo constant('URL');home;
//require_once 'views/home/index.php';
}else{
//echo "No existe el usuario";
$errorLogin = "Nombre de usuario y/o password incorrecto";
//require_once 'views/login/index.php';
//echo constant('URL');login;
//require 'views/' . $login . '.php';
function render()
{
$this->view->render('home/index');
}
}
}else{
//echo "login";
//include_once 'login/index.php';
//<?php echo constant('URL'); ?login>;
}
?>