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); }