From 2479bc45748559bf4a700d44a1eb623e2a4b0480 Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Tue, 5 Sep 2023 18:53:16 +0000 Subject: [PATCH] =?UTF-8?q?Prevenir=20reiniciar=20la=20sesi=C3=B3n=20y=20c?= =?UTF-8?q?onvertir=20el=20usuario=20a=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/c_login.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/class/c_login.php b/class/c_login.php index a8dec6d..1c925e5 100644 --- a/class/c_login.php +++ b/class/c_login.php @@ -122,7 +122,7 @@ class Login public static function log_out(): void { - session_start(); + // session_start(); session_destroy(); } @@ -139,4 +139,18 @@ class Login { return isset($_SESSION["user"]); } + + public function __toString(): string + { + return "Login Object:\n" . + "User: " . json_encode($this->user) . "\n" . + "Acceso: " . $this->acceso . "\n" . + "Profesor ID: " . ($this->profesor ?? "No definido") . "\n" . + "Es Jefe de Carrera: " . ($this->jefe_carrera ? "Sí" : "No") . "\n" . + "Periodo ID: " . $this->periodo_id . "\n" . + "Es Administrador: " . ($this->admin ? "Sí" : "No") . "\n" . + "Facultad: " . json_encode($this->facultad) . "\n" . + "Rol: " . json_encode($this->rol); + } + } \ No newline at end of file