Просмотр файла clikus/config/panel.php

Размер файла: 2.53Kb
<?php
//make for clikus.ru
//Admin icq 91531

if(isset($_POST['img_code']) and $_SESSION['codes'] == $_POST['img_code']) $_SESSION['is_auth'] = 1;

if(!empty($_SESSION['codes']) and empty($_SESSION['is_auth']))
{
 if(preg_match("#enter#",$_SERVER['REQUEST_URI']))
 $_GET['mode'] = 'enter';
 else
 {
	header('location: enter.php?mode=enter');
	exit;
 }
}

if(empty($_SESSION['time'])) 
	$_SESSION['time'] = time() + 5400;

if($_SESSION['time'] < time()) 
	//session_destroy();


//эмуляция сессий =)
//в переменной $_GET['sid'] будут передаваться закодированные параметры: login,password
 $pass='asdasdas';
$_enter=false;
$_zapros="?";
$_SESSION['time'] = time() + 5400;

$login = '';
$password = '';
If (isset($_SESSION['pwd']) and !isset($_GET['login']))
{

	$login=$_SESSION['lg'];
	$password=$_SESSION['pwd'];
	

}
else
{
	if (!isset($_GET['login']) || !isset($_GET['password']) || !$click_club->is_login($_GET['login']) || !$click_club->is_password($_GET['password'])) 
	{
	
	}
	else
	{
		$login=$_GET['login'];
		$password=$_GET['password'];
	}
}
//аутентификация
$result=@mysql_query("SELECT * FROM `".prefix."users` WHERE `login`='".$login."' and password='".$password."' limit 1");
If (mysql_num_rows($result)==1) 
{
	$_SESSION['lg'] = $login;
	$_SESSION['pwd'] = $password;

	if(isset($_GET['login']) and isset($_GET['password']) and
	$_SESSION['lg'] == @$_GET['login'] and $_SESSION['pwd'] == @$_GET['password']) 
	header('location: enter.php?mode=enter');
	
	mysql_data_seek($result,0);
	$_USER=mysql_fetch_array($result);
	$_enter=true;
	$_zapros='?';
}



If (!defined("anybody")){
If (!$_enter){
include "config/online.php";
echo '
<div class="header_rek">Ошибка!!!</div>
<b>Вы не авторизованы!</b><br/>
---<br/>
<form action="" method="get"><br/>
Логин:<br/>
<input type="text" name="login" class="do_button" maxlength="'.lenght_login.'" value=""/><br/>
Пароль:<br/>
<input type="password" name="password" class="do_button" maxlength="'.lenght_password.'" value=""/><br/>
<input type="submit" class="button" value="Вход" />';
echo '<br/>';
echo '---<br/>';
echo '<a href="reg.php">[Регистрация]</a><br/>';
include "config/end.php";
}
}
//exit;

function xoring($String,$Seq)
{
    $Salt='QwErTyUiOpAsDf123%#';
    $StrLen = strlen($String);
    $Gamma = '';
    while (strlen($Gamma)<$StrLen)
    {
        $Seq = pack("H*",sha1($Gamma.$Seq.$Salt));
        $Gamma.=substr($Seq,0,8);
    }

    return $String^$Gamma;
}

//make for clikus.ru
//Admin icq 91531
?>