auth modules! please test http-auth again, i haven't, but i think i got it right...

git-svn-id: http://www.observium.org/svn/observer/trunk@973 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-02-28 13:04:07 +00:00
parent a8be5a36f8
commit b719e22e8e
6 changed files with 114 additions and 68 deletions

View File

@ -0,0 +1,16 @@
<?php
function authenticate($username,$password)
{
$encrypted = md5($password);
$sql = "SELECT username FROM `users` WHERE `username`='".$_SESSION['username']."' AND `password`='".$encrypted."'";
$query = mysql_query($sql);
$row = @mysql_fetch_array($query);
if($row['username'] && $row['username'] == $username)
{
return 1;
}
return 0;
}
?>