Redistribución de periodo a periodo_id

This commit is contained in:
2023-08-15 15:58:14 +00:00
parent 60256ec460
commit e1f3d21b83
21 changed files with 762 additions and 1731 deletions

View File

@@ -19,7 +19,7 @@ require_once($ruta ?? '') . "vendor/autoload.php";
class Login
{
public string $acceso;
public function __construct(public array $user, public array $facultad, public array $rol, public bool $admin, public ?int $periodo, public bool $supervisor, public bool $jefe_carrera, public bool $profesor)
public function __construct(public array $user, public array $facultad, public array $rol, public bool $admin, public ?int $periodo_id, public bool $supervisor, public bool $jefe_carrera, public bool $profesor)
{
}
public function print_to_log(string $desc, array $old = null, array $new = null): void
@@ -111,7 +111,7 @@ class Login
$periodo = $fs_validaclaveulsa["periodo_id"];
return new Login($user, $facultad, $rol, $admin, $periodo, $supervisor, $jefe_carrera, false);
} else if ($db->where('profesor_clave', preg_replace('/^do0*/', '', $user), 'ilike')->has("profesor")) {
} else if ($db->where('profesor_clave', preg_replace('/^do0*/', '', $user), 'ilike')->has("profesor")) {
$profesor = $db->where('profesor_clave', preg_replace('/^do0*/', '', $user), 'ilike')->getOne("profesor");
$user = array(
'id' => $profesor["profesor_clave"],
@@ -128,7 +128,7 @@ class Login
// CREATE A COOKIE FOR THE REST OF THE day for example: 23:00 then duration will be 1 hour
setcookie("profesor", $user["id"], strtotime('today midnight') + 86400, "/");
return new Login($user, $facultad, $rol, admin: false, periodo: null, supervisor: false, jefe_carrera: false, profesor: true);
return new Login($user, $facultad, $rol, admin: false, periodo_id: null, supervisor: false, jefe_carrera: false, profesor: true);
} else
return [
'error' => true,