Changeset 17681


Ignore:
Timestamp:
04/22/14 23:31:05 (11 years ago)
Author:
tbretz
Message:
Some updated to the authentication code to make the result more logical; a minor update to handling interrupts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/smartfact/index.php

    r17378 r17681  
    1818    $username = $_SERVER['PHP_AUTH_USER'];
    1919    $password = $_SERVER['PHP_AUTH_PW'];
     20
     21    if (!isset($username) || !isset($password))
     22        return "Unauthorized";
    2023
    2124    $con = @ldap_connect($ldaphost);
     
    201204// --------------------------------------------------------------------
    202205
    203 if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']))
    204 {
    205     header('WWW-Authenticate: Basic realm="SmartFACT++"');
    206     header('HTTP/1.0 401 Unauthorized');
    207     return;
    208 }
    209 
    210206$rc = login();
    211207if ($rc!="")
    212     return header('HTTP/1.0 401 '.$rc);
     208{
     209    header('WWW-Authenticate: Basic realm="SmartFACT++"');
     210    header('HTTP/1.0 401 '.$rc);
     211    return;
     212}
    213213
    214214// --------------------------------------------------------------------
     
    285285if (isset($_GET['interrupt']))
    286286{
     287    $irq = $_GET['interrupt'];
    287288    unset($_GET['interrupt']);
    288 
    289     $irq = "";
    290     if (isset($_GET['irq']))
    291     {
    292         $irq = $_GET['irq'];
    293         unset($_GET['irq']);
    294     }
    295289
    296290    $args = "";
Note: See TracChangeset for help on using the changeset viewer.