Commit 3ea205b0 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Correction problème : plantait si aucune base de données 'default' n'était définie.

parent 18052557
......@@ -2,6 +2,7 @@
namespace UnicaenAuth\Authentication\Adapter;
use PDOException;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use UnicaenAuth\Options\ModuleOptions;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
......@@ -37,6 +38,9 @@ class Db extends \ZfcUser\Authentication\Adapter\Db implements ServiceManagerAwa
catch (PDOException $e) {
return false;
}
catch (ServiceNotFoundException $e) {
return false;
}
return $result;
}
......
......@@ -2,6 +2,8 @@
namespace UnicaenAuth\Authentication\Storage;
use PDOException;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\Authentication\Exception\InvalidArgumentException;
/**
......@@ -26,13 +28,17 @@ class Db extends \ZfcUser\Authentication\Storage\Db
try {
$identity = parent::read();
}
catch (\PDOException $pdoe) {
catch (PDOException $pdoe) {
// throw new \UnicaenApp\Exception(
// "Erreur lors de la recherche de l'utilisateur $id dans la base de données : " . $pdoe->getMessage(),
// null,
// $pdoe);
$identity = null;
}
catch (ServiceNotFoundException $e) {
$identity = null;
}
if ($identity && !is_scalar($identity)) {
return $identity;
}
......@@ -50,6 +56,9 @@ class Db extends \ZfcUser\Authentication\Storage\Db
// $pdoe);
$identity = null;
}
catch (ServiceNotFoundException $e) {
$identity = null;
}
}
if ($identity) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment