Commit cdb4f7f8 by Juan Montilla

Login2

parent ba7f75cd
......@@ -48,7 +48,7 @@ class User extends BaseController
$session->set('user', $user);
return redirect()->to(base_url('/logged'));
} else {
$session->setFlashdata('msg', 'Wrong credentials');
$session->setFlashdata('msg', 'Credenciales');
}
} else {
$data["errors"] = $validation->getErrors();
......
......@@ -21,8 +21,6 @@ class UserModel extends Model
public function authenticate($email, $password)
{
$user = $this->where('email', $email)->first();
echo $password;
echo $user->password;
if ($user && password_verify($password, $user->password))
return $user;
return FALSE;
......
......@@ -201,7 +201,7 @@
<li class="nav-item dropdown pe-3">
<a class="nav-link nav-profile d-flex align-items-center pe-0" href="#" data-bs-toggle="dropdown">
<img src="<?= base_url("imagenes/perfilTemporal.png") ?>" alt="Profile" class="rounded-circle">
<img src="<?= base_url("imagenes/profile.png") ?>" alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">Bob Esponja</span>
</a><!-- End Profile Iamge Icon -->
......
<form action=<?= base_url('/login'); ?> method="post">
<h1 class="h3 mb-3 fw-normal">Please sign in</h1>
<div class="form-floating">
<input type="email" class="form-control" name="email" value="">
<label for="email">Email address</label>
</div>
<div class="form-floating">
<input type="password" class="form-control" name="password" value="">
<label for="password">Password</label>
</div>
<span class="error">
<?= \Config\Services::validation()->listErrors(); ?>
</span>
<span class="error">
<?php if (session()->getFlashdata('msg')): ?>
<div class="alert alert-danger">
<?= session()->getFlashdata('msg') ?>
</div>
<?php endif; ?>
</span>
<button class="w-100 btn btn-lg btn-primary" type="submit">Sign in</button>
</form>
\ No newline at end of file
......@@ -46,3 +46,8 @@ INFO - 2023-03-24 09:02:22 --> Session: Class initialized using 'CodeIgniter\Ses
INFO - 2023-03-24 09:02:44 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-03-24 09:04:39 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-03-24 09:04:45 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-03-24 11:15:23 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-03-24 11:15:26 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-03-24 11:15:35 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-03-24 11:23:01 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-03-24 11:27:07 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
__ci_last_regenerate|i:1679656981;_ci_previous_url|s:32:"http://localhost/index.php/login";logged_in|b:1;user|O:8:"stdClass":3:{s:5:"email";s:14:"admin@admin.es";s:8:"username";s:13:"Pruebausuario";s:8:"password";s:60:"$2y$10$cg2bjfW6UXlmOPMgwB2Ate.uGnpGzInHeACcN0sDEz.TJcS3LZCiO";}msg|s:17:"Wrong credentials";__ci_vars|a:1:{s:3:"msg";s:3:"new";}
\ No newline at end of file
__ci_last_regenerate|i:1679656526;_ci_previous_url|s:27:"http://localhost/index.php/";
\ No newline at end of file
__ci_last_regenerate|i:1679656981;_ci_previous_url|s:27:"http://localhost/index.php/";logged_in|b:1;user|O:8:"stdClass":3:{s:5:"email";s:14:"admin@admin.es";s:8:"username";s:13:"Pruebausuario";s:8:"password";s:60:"$2y$10$cg2bjfW6UXlmOPMgwB2Ate.uGnpGzInHeACcN0sDEz.TJcS3LZCiO";}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment