more auth fixes from lenwe.

git-svn-id: http://www.observium.org/svn/observer/trunk@2222 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-03 14:10:21 +00:00
parent 6f26110c7d
commit c5aee9205b
2 changed files with 8 additions and 12 deletions

View File

@ -60,18 +60,9 @@ else
$auth_success = 0;
if (isset($_SESSION['username']) or ($config['auth_mechanism'] == 'http-auth' and !isset($_GET['logout'])))
if (isset($_SESSION['username']))
{
if($config['auth_mechanism'] == 'http-auth')
{
$authenticateResult = authenticate(false,false);
}
else
{
$authenticateResult = authenticate($_SESSION['username'],$_SESSION['password']);
}
if ($authenticateResult)
if (authenticate($_SESSION['username'],$_SESSION['password']))
{
$_SESSION['userlevel'] = get_userlevel($_SESSION['username']);
$_SESSION['user_id'] = get_userid($_SESSION['username']);

View File

@ -1,5 +1,10 @@
<?php
if(!isset($_SESSION['username']))
{
$_SESSION['username'] = '';
}
function authenticate($username,$password)
{
global $config;
@ -71,4 +76,4 @@ function deluser($username)
return 0;
}
?>
?>