| 1 | <?php |
| 2 | |
| 3 | require_once __DIR__ . "/lib/NO_AUTORIZADO.php"; |
| 4 | require_once __DIR__ . "/lib/ProblemDetailsException.php"; |
| 5 | require_once __DIR__ . "/protege.php"; |
| 6 | |
| 7 | function protegeLogin(array $rolIdsPermitidos) |
| 8 | { |
| 9 | |
| 10 | list($san, $rolIds, $usuId) = protege($rolIdsPermitidos); |
| 11 | |
| 12 | if ($san !== "") |
| 13 | throw new ProblemDetailsException([ |
| 14 | "status" => NO_AUTORIZADO, |
| 15 | "type" => "/errors/sesioniniciada.html", |
| 16 | "title" => "Sesión iniciada.", |
| 17 | "detail" => "La sesión ya está iniciada.", |
| 18 | ]); |
| 19 | |
| 20 | return [$san, $rolIds, $usuId]; |
| 21 | } |
| 22 | |