X-Git-Url: https://git.llucax.com/z.facultad/75.43/tp1.git/blobdiff_plain/0a253cede072778391c1359f146ef56c60f40364..67a8494965128063251f7084fee7d8076d5f19e4:/src/lib/pagina.php diff --git a/src/lib/pagina.php b/src/lib/pagina.php index 1fbb194..8df27be 100644 --- a/src/lib/pagina.php +++ b/src/lib/pagina.php @@ -12,10 +12,10 @@ require_once 'lib/Usuario.php'; // Arranca la sesiĆ³n session_start(); -//TODO - verificar si existe el id y reconstruirlo function pagina_cabecera($titulo = '') { + header('Content-type: text/html; charset=ISO-8859-1'); ?> @@ -53,4 +53,15 @@ function ok($msg) printf('
%s
', $msg); } +function pagina_check_login($redirect = true) +{ + if (!@$_SESSION['user']) + { + // Avisamos a donde hay que volver + if ($redirect) $_SESSION['login_redirect'] = basename($_SERVER['PHP_SELF']); + include 'admin.login.php'; // Mostramos el login + exit; + } +} + ?> \ No newline at end of file