<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
if ($_POST[pokas] != 1 )
{
?>
<form name="login" action="<?php echo $_SERVSR[self];?>" method="post">
Введите имя:<br /> <input name="vh_login" type="text" value=""><br />
Введите пароль:<br /> <input name="vh_pass" type="password" value=""><br />
<input name="pokas" type="hidden" value="1">
<input type="submit" value="Войти">
</form>
<?php
}
else
{
$vh_log = $_POST[vh_login];
$vh_pas = $_POST[vh_pass];
if (($vh_log != "")and($vh_pas != ""))
{
$vh_log=strtr($vh_log,"абвгдеёзийклмнопрстуфхъыэ_",
"abvgdeeziyklmnoprstufh'iei");
$vh_log=strtr($vh_log,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ_",
"ABVGDEEZIYKLMNOPRSTUFH'IEI");
$vh_log=strtr($vh_log,
array(
"ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
"щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
"Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
"Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
"ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
)); // очистка строки имени
$vh_log = str_replace(" ","_",$vh_log);
$vh_log = str_replace("\\","_",$vh_log);
$vh_log = str_replace("\"","_",$vh_log);
$vh_log = str_replace("'","_",$vh_log);
$vh_log = str_replace(".","_",$vh_log);
$vh_log = str_replace("-","_",$vh_log);
$vh_log = str_replace("/","_",$vh_log);
$vh_log = str_replace("#","_",$vh_log);
$vh_log = str_replace("=","_",$vh_log);
$vh_log = str_replace("|","I",$vh_log);
$vh_log = str_replace(">","_",$vh_log);
$vh_log = str_replace("<","_",$vh_log);
// очистка строки пароля
$vh_pas = str_replace(" ","_",$vh_pas);
$vh_pas = str_replace(">","_",$vh_pas);
$vh_pas = str_replace("<","_",$vh_pas);
$vh_pas = str_replace("\\","_",$vh_pas);
$vh_pas = str_replace("\"","_",$vh_pas);
$vh_pas = str_replace("'","_",$vh_pas);
$vh_pas = str_replace(".","_",$vh_pas);
$vh_pas = str_replace("-","_",$vh_pas);
$vh_pas = str_replace("/","_",$vh_pas);
$vh_pas = str_replace("#","_",$vh_pas);
$vh_pas = str_replace("=","_",$vh_pas);
$vh_pas = md5(md5(md5($vh_pas)));
if (is_file("use/$vh_log.php"))
{
include ("use/$vh_log.php");
if ($vh_pas == $us_pass)
{
$_SESSION[is_name] = $us_name;
$_SESSION[status] = $us_status;
$_SESSION[login] = $vh_log;
$_SESSION[mailto] = $us_mail;
$_SESSION[tema] = $us_tema;
echo 'Вы успешно вошли!<br /> <META HTTP-EQUIV="Refresh" CONTENT="2; URL=/"> ';
}
else
{
echo 'Вы ввели неверные данные! Вход не выполнен!';
};
}
else
{
echo 'Вы ввели неверные данные! Вход не выполнен!';
};
}
else
{
echo 'Вы не ввели данные! Вход не выполнен!';
};
};
?>