Location: PHPKode > scripts > Encaps Gallery > encaps-2.3.22s/admin/catalog_auth.php
<?php 
require_once(dirname(__FILE__).'/../config.ini.php');
$postget = $_POST?$_POST:$_GET;
if(isset($postget['action']) && $postget['action']=='logout')
{
	$_SESSION['encaps']['admin_uname']  = '';
	$_SESSION['encaps']['admin_passwd'] = '';
	unset( $_SESSION['encaps']['admin_uname'] );
	unset( $_SESSION['encaps']['admin_passwd'] );
	header('Location: index.php');
	exit();
}
if(isset($postget['action']) && $postget['action']=='login')
{
	if( ($postget["uname"]==$config["admin_uname"]) && ($postget["passwd"]==$config["admin_passwd"]))
	{
		$_SESSION['encaps']['admin_uname'] = $config['admin_uname'];
		$_SESSION['encaps']['admin_passwd'] = $config['admin_passwd'];
	}	
	else
	{
		sleep(3);
		echo "Login failed";
	}
}

if(
	$config['admin_uname'] && $config['admin_passwd'] 
	&& ( 
	!isset($_SESSION['encaps']['admin_uname']) || !isset($_SESSION['encaps']['admin_passwd'])
	|| $_SESSION['encaps']['admin_uname'] != $config['admin_uname'] || ($config['admin_passwd']!="" && @$_SESSION['encaps']['admin_passwd'] != ($config['admin_passwd']))
	)
)
	{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>EncapsGallery auth</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
* {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
input {
	border: 1px solid #000000;
	margin: 0px;
	padding: 0px;
}
</style>
</head>
<body>
<div align="center">
<table><tr><td>
<form method="post" action="">
<fieldset style="background: #EEEAE6"><legend style="color: #FFF;  background: #004080; font-weight:bold; padding: 0.2em 1em;">Restricted area</legend>
<table border="0" cellpadding="0">
<tr>
	<td><b>User name:</b></td>
	<td><input type="text" name="uname" value="" ></td>
</tr>
<tr>
	<td align="right"><b>Password:</b></td>
	<td><input type="password" name="passwd" value="" ></td>
</tr>
<tr>
	<td></td>
	<td><input type="submit" value="Submit" style="margin-top:0px"></td>
</tr>
</table>
<input type="hidden" name="action" value="login">
</fieldset>
</form>
</td></tr></table>
</div>
</body>
</html>
<?php  die; } ?>
Return current item: Encaps Gallery