X-Git-Url: https://git.llucax.com/z.facultad/75.43/tp1.git/blobdiff_plain/361af2383cce7b9311a8446a173bb9a0b7b3838f..67a8494965128063251f7084fee7d8076d5f19e4:/src/lib/pagina.php diff --git a/src/lib/pagina.php b/src/lib/pagina.php index 2427a76..8df27be 100644 --- a/src/lib/pagina.php +++ b/src/lib/pagina.php @@ -8,11 +8,14 @@ // // $Id$ +require_once 'lib/Usuario.php'; + // Arranca la sesiĆ³n session_start(); function pagina_cabecera($titulo = '') { + header('Content-type: text/html; charset=ISO-8859-1'); ?> @@ -40,4 +43,25 @@ function pagina_pie($autor, $mail) %s
', $msg); +} + +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