Add files via upload

This commit is contained in:
Fernando Méndez 2021-06-02 09:36:59 +02:00 committed by GitHub
parent 51032e2630
commit 3087940f70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 4 deletions

View File

@ -1,6 +1,5 @@
<?php
class DAO {
//Atributes:
public $mysqli;

View File

@ -19,9 +19,14 @@
//Encrypt password with SHA254.
private function encryptPass($password){
//$password = hash('sha256', $password);
$password = password_hash($password, PASSWORD_DEFAULT);
/* Una rica ensalada salada */
/* $SALAD = [
'cost' => 11,
'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM), //Hay que tener activado el módulo mcrypt para usar esta función.
]; */
$password = password_hash($password, PASSWORD_DEFAULT); //Actualmente en PHP PASSWORD_DEFAULT equivale a PASSWORD_BCRYPT.
return $password;
}

View File

@ -13,9 +13,19 @@
}
static function panel(){
include_once('../assets/php/includes/user.php');
$name = strtoupper(unserialize($_SESSION['user'])->getName());
$email = unserialize($_SESSION['user'])->getEmail();
$userPic = USER_PICS.strtolower($name).".jpg";
return $reply= '<div class="code info">
<h1>Bienvenido al Panel de Administrador.</h1>
<hr />
<img src='.$userPic.' alt="user_profile_picture"/>
<h3>'.strftime("%A %e de %B de %Y | %H:%M").'</h3>
<p>Administrador: '.$name.'</p>
<p>Email empresarial: '.$email.'</p>
</div>'."\n";
}

View File

@ -7,7 +7,7 @@
require_once('../assets/php/includes/manager.php');
require_once('../assets/php/includes/user.php');
if($_SESSION["login"] && $_SESSION["lastRol"] === "admin" && $_SESSION["rol"] === "manager") {
if($_SESSION["login"] && isset($_SESSION["lastRol"]) && ($_SESSION["lastRol"] === "admin" || $_SESSION["rol"] === "manager")) {
$manager = new Manager(null, null, null, null, null);
if(isset($_POST['changecinema']))$_SESSION['cinema'] = $_POST['cinema'];
if(!is_null($_SESSION['cinema'])) $manager->setIdcinema($_SESSION['cinema']);

View File

@ -20,11 +20,13 @@
$c_tel = $cinema->getPhone();
}
$name = strtoupper($_SESSION["nombre"]);
$userPic = USER_PICS.strtolower($name).".jpg";
$cinema = strtoupper( $manager->getIdcinema());
$panel = '<div class="code info">
<h1>Bienvenido '.$name.' a tu Panel de Manager.</h1>
<hr />
<img src='.$userPic.' alt="user_profile_picture"/>
<p>Usuario: '.$name.'</p> <br>
<p>Cine: '.$c_name.'</p>
<p>Dirección: '.$c_dir.'</p>