Block

Páginas: 2 (278 palabras) Publicado: 31 de enero de 2013
<?php

require_once "global.php";

if (LOGGED_IN)
{
header("Location: " . WWW . "/me");
exit;
}

$tpl->Init();

$tpl->SetParam('page_title', 'Bienvenido al hotel.');$tpl->SetParam('credentials_username', '');

$tpl->AddGeneric('head-init');
$tpl->AddIncludeSet('frontpage');
$tpl->WriteIncludeFiles();
$tpl->AddGeneric('head-overrides-fp');$tpl->AddGeneric('head-bottom');

$frontpage = new Template('page-fp');
$frontpage->SetParam('login_result', '');

if (isset($_POST['credentials_username']) &&isset($_POST['credentials_password']))
{
$frontpage->SetParam('credentials_username', $_POST['credentials_username']);

$credUser = filter($_POST['credentials_username']);
$credPass =$core->UberHash($_POST['credentials_password']);

$errors = array();

if (strlen($_POST['credentials_username']) < 1)
{
$errors[] = "Por favor inserte su nombre";
}

if (strlen($_POST['credentials_password']) < 1){
$errors[] = "Por favor inserte su clave";
}

if (count($errors) == 0)
{
if ($users->ValidateUser($credUser, $credPass))
{
if (isset($_POST['page']))
{
$reqPage =filter($_POST['page']);
$pos = strrpos($reqPage, WWW);

if ($pos === false || $pos != 0)
{
die("<b>Seguridad!</b> Una

solicitud malintencionada se detectó queintentó dirija a un sitio externo. Por favor, adelante

con precaución, esto puede haber sido un intento para robar sus datos de acceso. <a href='" . WWW . "'>Volver atras</a>");
}else
{
$_SESSION['page-redirect'] = $reqPage;
}
}

$_SESSION['UBER_USER_N'] = $users->GetUserVar($users->Name2id($credUser), 'username');
$_SESSION['UBER_USER_H'] =$credPass;

if (isset($_POST['_login_remember_me']))
{
$_SESSION['set_cookies'] = true;
}

header("Location: " . WWW . "/security_check");
exit;
}
else
{...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • El Block
  • block
  • BLOCK
  • Block
  • Block
  • block
  • Block
  • Block

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS