diff --git a/html/includes/authenticate.inc.php b/html/includes/authenticate.inc.php
index d58e9c79f..fa014a24e 100644
--- a/html/includes/authenticate.inc.php
+++ b/html/includes/authenticate.inc.php
@@ -31,11 +31,6 @@ if (isset($_GET['logout']) && $_SESSION['authenticated'])
$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']))
{
$_SESSION['username'] = mres($_GET['username']);
@@ -65,9 +60,18 @@ else
$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['user_id'] = get_userid($_SESSION['username']);
diff --git a/poller.php b/poller.php
index 2cfa7f62d..82d1254cd 100755
--- a/poller.php
+++ b/poller.php
@@ -88,9 +88,11 @@ if (isset($options['d']))
echo("Starting polling run:\n\n");
$polled_devices = 0;
if(!isset($query))
+{
$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);
+}
print mysql_error();
while ($device = mysql_fetch_assoc($device_query))