From 9a244e508260387846d537d295cfc9119c50831a Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 26 Jan 2015 20:08:01 +0000 Subject: [PATCH] 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 --- authparams.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/authparams.php b/authparams.php index 996d337..e633dd5 100644 --- a/authparams.php +++ b/authparams.php @@ -66,9 +66,10 @@ class authparams "Restricted access"); if (!isset($_SERVER['PHP_AUTH_USER'])) { - header("WWW-Authenticate: Basic realm=\"$realm\""); - header("HTTP/1.0 401 Unauthorized"); - die ($realm); + throw new Exception ("No user defined in HTTP header", 401); + //header("WWW-Authenticate: Basic realm=\"$realm\""); + //header("HTTP/1.0 401 Unauthorized"); + //die ($realm); } else {