Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
84a4f297
Commit
84a4f297
authored
May 23, 2018
by
Bertrand Gauthier
Browse files
Ajout possibilité d'ajouter des storages d'authentification
parent
35f8127d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Authentication/Storage/ChainServiceFactory.php
View file @
84a4f297
...
...
@@ -12,11 +12,15 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/
class
ChainServiceFactory
implements
FactoryInterface
{
pr
otec
te
d
$
s
torages
=
[
pr
iva
te
$
mandatoryS
torages
=
[
200
=>
'UnicaenAuth\Authentication\Storage\Ldap'
,
100
=>
'UnicaenAuth\Authentication\Storage\Db'
,
76
=>
'UnicaenAuth\Authentication\Storage\ShibSimulatorStorage'
,
75
=>
'UnicaenAuth\Authentication\Storage\Shib'
,
];
protected
$storages
=
[];
/**
* Create service
*
...
...
@@ -27,7 +31,10 @@ class ChainServiceFactory implements FactoryInterface
{
$chain
=
new
Chain
();
foreach
(
$this
->
storages
as
$priority
=>
$name
)
{
$storages
=
$this
->
mandatoryStorages
+
$this
->
storages
;
krsort
(
$storages
);
foreach
(
$storages
as
$priority
=>
$name
)
{
$storage
=
$serviceLocator
->
get
(
$name
);
$chain
->
getEventManager
()
->
attach
(
'read'
,
[
$storage
,
'read'
],
$priority
);
$chain
->
getEventManager
()
->
attach
(
'write'
,
[
$storage
,
'write'
],
$priority
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment