Index: /trunk/FACT++/www/smartfact/index.php
===================================================================
--- /trunk/FACT++/www/smartfact/index.php	(revision 17680)
+++ /trunk/FACT++/www/smartfact/index.php	(revision 17681)
@@ -18,4 +18,7 @@
     $username = $_SERVER['PHP_AUTH_USER'];
     $password = $_SERVER['PHP_AUTH_PW'];
+
+    if (!isset($username) || !isset($password))
+        return "Unauthorized";
 
     $con = @ldap_connect($ldaphost);
@@ -201,14 +204,11 @@
 // --------------------------------------------------------------------
 
-if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']))
-{
-    header('WWW-Authenticate: Basic realm="SmartFACT++"');
-    header('HTTP/1.0 401 Unauthorized');
-    return;
-}
-
 $rc = login();
 if ($rc!="")
-    return header('HTTP/1.0 401 '.$rc);
+{
+    header('WWW-Authenticate: Basic realm="SmartFACT++"');
+    header('HTTP/1.0 401 '.$rc);
+    return;
+}
 
 // --------------------------------------------------------------------
@@ -285,12 +285,6 @@
 if (isset($_GET['interrupt']))
 {
+    $irq = $_GET['interrupt'];
     unset($_GET['interrupt']);
-
-    $irq = "";
-    if (isset($_GET['irq']))
-    {
-        $irq = $_GET['irq'];
-        unset($_GET['irq']);
-    }
 
     $args = "";
