mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
patches from lenwe (remove crappy tiny if and fix auth)
git-svn-id: http://www.observium.org/svn/observer/trunk@2221 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -31,11 +31,6 @@ if (isset($_GET['logout']) && $_SESSION['authenticated'])
|
|||||||
$auth_message = "Logged Out";
|
$auth_message = "Logged Out";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($config['auth_mechanism']) and $config['auth_mechanism'] == 'http-auth' and !isset($_GET['logout'])){
|
|
||||||
$_GET['username'] = '';
|
|
||||||
$_GET['password'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['username']) && isset($_GET['password']))
|
if (isset($_GET['username']) && isset($_GET['password']))
|
||||||
{
|
{
|
||||||
$_SESSION['username'] = mres($_GET['username']);
|
$_SESSION['username'] = mres($_GET['username']);
|
||||||
@@ -65,9 +60,18 @@ else
|
|||||||
|
|
||||||
$auth_success = 0;
|
$auth_success = 0;
|
||||||
|
|
||||||
if (isset($_SESSION['username']))
|
if (isset($_SESSION['username']) or ($config['auth_mechanism'] == 'http-auth' and !isset($_GET['logout'])))
|
||||||
{
|
{
|
||||||
if (authenticate($_SESSION['username'],$_SESSION['password']))
|
if($config['auth_mechanism'] == 'http-auth')
|
||||||
|
{
|
||||||
|
$authenticateResult = authenticate(false,false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$authenticateResult = authenticate($_SESSION['username'],$_SESSION['password']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($authenticateResult)
|
||||||
{
|
{
|
||||||
$_SESSION['userlevel'] = get_userlevel($_SESSION['username']);
|
$_SESSION['userlevel'] = get_userlevel($_SESSION['username']);
|
||||||
$_SESSION['user_id'] = get_userid($_SESSION['username']);
|
$_SESSION['user_id'] = get_userid($_SESSION['username']);
|
||||||
|
@@ -88,9 +88,11 @@ if (isset($options['d']))
|
|||||||
echo("Starting polling run:\n\n");
|
echo("Starting polling run:\n\n");
|
||||||
$polled_devices = 0;
|
$polled_devices = 0;
|
||||||
if(!isset($query))
|
if(!isset($query))
|
||||||
|
{
|
||||||
$device_query = mysql_query("SELECT `device_id` FROM `devices` WHERE `disabled` = 0 $where ORDER BY `device_id` ASC");
|
$device_query = mysql_query("SELECT `device_id` FROM `devices` WHERE `disabled` = 0 $where ORDER BY `device_id` ASC");
|
||||||
else
|
} else {
|
||||||
$device_query = mysql_query($query);
|
$device_query = mysql_query($query);
|
||||||
|
}
|
||||||
print mysql_error();
|
print mysql_error();
|
||||||
|
|
||||||
while ($device = mysql_fetch_assoc($device_query))
|
while ($device = mysql_fetch_assoc($device_query))
|
||||||
|
Reference in New Issue
Block a user