View file blackgbs/auth.php

File size: 806B
<?php
session_start();
if (empty($_GET['id']))
{
$pass=$_GET['pass'];
$file=file("./admin/config.dat");
$adminpassword=trim($file[0]);
if ($pass==$adminpassword)
{
$_SESSION['adminpass']=$pass;
}
$site='http://'.$_SERVER['HTTP_HOST'].''.str_replace('auth.php','index.php',$_SERVER['PHP_SELF']);
header ("Location: $site");
}
else
{
if (!empty($_GET['pass']) and !empty($_GET['id']))
{
$id=$_GET['id'];
$pass=$_GET['pass'];
}
else
{
exit();
}//Если нет пароля и ид
if (file_exists("./users/$id.dat"))
{
$file=file("./users/$id.dat");
$userpassword=trim($file[0]);
}
if ($pass==$userpassword)
{
$_SESSION['userpass']=$pass;
}
$site='http://'.$_SERVER['HTTP_HOST'].''.str_replace('auth.php','index.php',$_SERVER['PHP_SELF']).'?id='.$id;
header ("Location: $site");
}//Если есть ид
?>