aquí dejo el index:
Código PHP:
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[] = "Please enter your username";
}
if (strlen($_POST['credentials_password']) < 1)
{
$errors[] = "Please enter your password";
}
if (count($errors) == 0)
{
$check = $users->ValidateLogin($credUser, $credPass);
if ($check[0])
{
if (isset($_POST['page']))
{
$reqPage = filter($_POST['page']);
$pos = strrpos($reqPage, WWW);
if ($pos === false || $pos != 0)
{
die("<b>Advertencia de seguridad</b> Una petición malicioso fue detectado que intentó redirigir a un sitio externo. Por favor proceda con precaución, esto puede haber sido un intento para robar sus datos de acceso. <a href='" . WWW . "'>Regresar al sitio.</a>");
}
else
{
$_SESSION['page-redirect'] = $reqPage;
}
}
if (!$check[1])
$_SESSION['UBER_USER_N'] = $users->GetUserVar($users->Name2id($credUser), 'username');
else
{
$_SESSION['UBER_USER_N'] = $users->GetUserVar($users->Email2id($credUser), 'username');
if ($check[2] > 1)
$_SESSION['page-redirect'] = "identity/avatars";
}
$_SESSION['UBER_USER_H'] = $credPass;
if (isset($_POST['_login_remember_me']))
{
$_SESSION['set_cookies'] = true;
}
$_SESSION['jjp']['login']['user'] = $_SESSION['UBER_USER_N'];
$_SESSION['jjp']['login']['email'] = $users->GetUserVar($users->Name2id($_SESSION['jjp']['login']['user']), 'mail');
$_SESSION['jjp']['login']['name'] = $users->GetUserVar($users->Name2id($_SESSION['jjp']['login']['user']), 'real_name');
header("Location: " . WWW . "/beveilegings_check.php");
exit;
}
else
{
$errors[] = "Incorrect password";
}
}
Saludos