<?php
/*
WebShop MD5-Like Login Checker + Password Checker
*/
$GLOBALS['mu_user'] = secure($_COOKIE['WebShopUsername']);
$mu_pass = secure($_COOKIE['WebShopPassword']);
if ((isset($GLOBALS['mu_user'])) && (isset($mu_pass))) {
$query = mssql_query("SELECT [memb__pwd], [bloc_code] FROM ".$webshop['mssq']['dbacc'].".dbo.[MEMB_INFO] WHERE [memb___id]='".$GLOBALS['mu_user']."'");
$result = mssql_fetch_row($query);
if ($webshop['mssq']['use_md5'])
$mupass = bin2hex($result[0]);
else
$mupass = md5($result[0]);
if ($mupass!=$mu_pass) {
setcookie("WebShopUsername", "", "0");
setcookie("WebShopPassword", "", "0");
unset($GLOBALS['mu_user'], $mu_pass);
die("Access Refused<br><a href=login.php>Click here to login</a>");
}
if ($result[1]==1)
die("I am sorry mate, your account has been blocked and you cannot afford to use this function!");
}
else {
header("Location: login.php");
die("Access Refused");
}
?>