If the authentication is incorrect, return an Exception instead of die : can be catched by the routing engine to display the authentication page if needed

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1929 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-01-26 20:08:01 +00:00
parent 117341590d
commit 9a244e5082

View File

@@ -66,9 +66,10 @@ class authparams
"Restricted access"); "Restricted access");
if (!isset($_SERVER['PHP_AUTH_USER'])) if (!isset($_SERVER['PHP_AUTH_USER']))
{ {
header("WWW-Authenticate: Basic realm=\"$realm\""); throw new Exception ("No user defined in HTTP header", 401);
header("HTTP/1.0 401 Unauthorized"); //header("WWW-Authenticate: Basic realm=\"$realm\"");
die ($realm); //header("HTTP/1.0 401 Unauthorized");
//die ($realm);
} }
else else
{ {