From 67a8f982cc290f036e4cc1874c7cd385c29a5faa Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 29 Oct 2018 14:14:42 +0000 Subject: [PATCH] Exception -> \Exception git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4657 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- authsession.php | 12 ++++++------ ratelimit.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/authsession.php b/authsession.php index e0f08ad..2307de1 100644 --- a/authsession.php +++ b/authsession.php @@ -12,7 +12,7 @@ class authsession extends auth function __construct () { if (!isset ($_SESSION)) - throw new Exception ("No session previously opened", 401); + throw new \Exception ("No session previously opened", 401); } /** No connection to session */ @@ -29,11 +29,11 @@ class authsession extends auth { if (!isset ($_SESSION["domframework"]["auth"]["email"]) || !isset ($_SESSION["domframework"]["auth"]["password"])) - throw new Exception ("No previous email in session", 401); + throw new \Exception ("No previous email in session", 401); if ($_SESSION["domframework"]["auth"]["email"] !== $email) - throw new Exception ("Unable to authenticate user '$email'", 401); + throw new \Exception ("Unable to authenticate user '$email'", 401); if ($_SESSION["domframework"]["auth"]["password"] !== $password) - throw new Exception ("Bad password for '$email'", 401); + throw new \Exception ("Bad password for '$email'", 401); } /** Return all the parameters recorded for the authenticate user */ @@ -55,7 +55,7 @@ class authsession extends auth */ public function changepassword ($oldpassword, $newpassword) { - throw new Exception (dgettext("domframework", + throw new \Exception (dgettext("domframework", "The password can't be change for SESSION users"), 405); } @@ -68,7 +68,7 @@ class authsession extends auth */ public function overwritepassword ($email, $newpassword) { - throw new exception (dgettext("domframework", + throw new \Exception (dgettext("domframework", "The password can't be overwrite for SESSION users"), 405); } diff --git a/ratelimit.php b/ratelimit.php index d3db0a5..93125c2 100644 --- a/ratelimit.php +++ b/ratelimit.php @@ -18,7 +18,7 @@ class ratelimit */ public function set ($name) { - throw new Exception (dgettext("domframework", + throw new \Exception (dgettext("domframework", "ratelimit : no valid ratelimiter available"), 500); } @@ -29,7 +29,7 @@ class ratelimit */ public function del ($name) { - throw new Exception (dgettext("domframework", + throw new \Exception (dgettext("domframework", "ratelimit : no valid ratelimiter available"), 500); } @@ -39,7 +39,7 @@ class ratelimit */ public function clean () { - throw new Exception (dgettext("domframework", + throw new \Exception (dgettext("domframework", "ratelimit : no valid ratelimiter available"), 500); }