<html>
<head>
<title>Login!</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
</head>
<body>
<?php
$str="";
if((isset($_POST["auth_name"]))and(isset($_POST["auth_pass"])))
	{
	if($_POST["auth_name"]=='admin')
		{
		if($_POST["auth_pass"]=='1')
			{
			session_cache_limiter("private");
			session_start();
			session_cache_limiter("private");
			$_SESSION['user']='admin';
			header("Location: index.php");
			}
		else
			{
			$str="<p>Вы ввели неверный пароль</p><br/>";
			}
		}
	elseif($_POST["auth_name"]=='technolog')
		{
		if($_POST["auth_pass"]=='2')
			{
			session_cache_limiter("private");
			session_start();
			session_cache_limiter("private");
			$_SESSION['user']='technolog';
			header("Location: index.php");
			}
		else
			{
			$str="<p>Вы ввели неверный пароль</p><br/>";
			}
		}
	elseif($_POST["auth_name"]=='expert')
		{
		if($_POST["auth_pass"]=='3')
			{
			session_cache_limiter("private");
			session_start();
			session_cache_limiter("private");
			$_SESSION['user']='expert';
			header("Location: index.php");
			}
		else
			{
			$str="<p>Вы ввели неверный пароль</p><br/>";
			}
		}
	elseif($_POST["auth_name"]=='rab')
		{
		if($_POST["auth_pass"]=='4')
			{
			session_cache_limiter("private");
			session_start();
			session_cache_limiter("private");
			$_SESSION['user']='rab';
			header("Location: index.php");
			}
		else
			{
			$str="<p>Вы ввели неверный пароль</p><br/>";
			}
		}
	}
if(isset($_GET["logoff"]))
	{
	session_start();
	unset($_SESSION['user']);
	session_destroy();
	}
echo $str;
?>
<form method="POST" action="login.php">
<table border=1><tr><td>Логин</td><td>
<select name="auth_name"><option value='admin'>admin</option><option value='technolog'>technolog</option><option value='expert'>expert</option><option value='rab'>rab</option></select><br></td></tr><tr><td>Пароль</td><td>
<input type="password" name="auth_pass" size="10"><br></td></td></table>
<input type="submit" value='Войти'><br>
</form>
<a href="user_objects.php">Users object</a><br/>
<a href="http://host.iu4.bmstu.ru/~paskokv/install/install.html">Install package</a>
</body>
</html>