Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
2d8dc9b8
Commit
2d8dc9b8
authored
Jul 04, 2013
by
Bertrand Gauthier
Browse files
Suppression services jamais utilisés.
parent
0ba8e633
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Authentication/Service/StrategyService.php
deleted
100644 → 0
View file @
0ba8e633
<?php
namespace
UnicaenAuth\Authentication\Service
;
use
UnicaenAuth\Authentication\Strategy\StrategyInterface
;
use
Zend\EventManager\EventManager
;
use
Zend\EventManager\EventManagerAwareInterface
;
use
Zend\EventManager\EventManagerInterface
;
use
Zend\ServiceManager\ServiceManager
;
use
Zend\ServiceManager\ServiceManagerAwareInterface
;
use
ZfcUser\Authentication\Adapter\AbstractAdapter
;
use
ZfcUser\Authentication\Adapter\AdapterChainEvent
;
/**
*
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
StrategyService
extends
AbstractAdapter
implements
ServiceManagerAwareInterface
,
EventManagerAwareInterface
{
/**
* @var StrategyInterface
*/
protected
$strategy
;
/**
* @var ServiceManager
*/
protected
$serviceManager
;
/**
* @var EventManager
*/
protected
$eventManager
;
/**
*
* @param StrategyInterface $strategy
*/
public
function
__construct
(
StrategyInterface
$strategy
=
null
)
{
$this
->
setStrategy
(
$strategy
);
}
/**
*
* @param AdapterChainEvent $e
* @return boolean
*/
public
function
authenticate
(
AdapterChainEvent
$e
)
{
$casAdapter
->
getEventManager
()
->
attach
(
'userAuthenticated'
,
array
(
$userService
,
'userAuthenticated'
),
1
);
$this
->
getStrategy
()
->
authenticate
(
$e
);
die
(
__METHOD__
);
}
/**
*
*
* @return StrategyInterface
*/
public
function
getStrategy
()
{
return
$this
->
strategy
;
}
/**
*
*
* @param StrategyInterface $strategy
* @return StrategyService
*/
public
function
setStrategy
(
StrategyInterface
$strategy
)
{
$this
->
strategy
=
$strategy
;
return
$this
;
}
/**
* Retrieve service manager instance
*
* @return ServiceManager
*/
public
function
getServiceManager
()
{
return
$this
->
serviceManager
;
}
/**
* Set service manager
*
* @param ServiceManager $serviceManager
* @return StrategyService
*/
public
function
setServiceManager
(
ServiceManager
$serviceManager
)
{
$this
->
serviceManager
=
$serviceManager
;
return
$this
;
}
/**
* Retrieve EventManager instance
*
* @return EventManagerInterface
*/
public
function
getEventManager
()
{
return
$this
->
eventManager
;
}
/**
* Inject an EventManager instance
*
* @param EventManagerInterface $eventManager
* @return StrategyService
*/
public
function
setEventManager
(
EventManagerInterface
$eventManager
)
{
$this
->
eventManager
=
$eventManager
;
return
$this
;
}
}
\ No newline at end of file
src/UnicaenAuth/Authentication/Service/StrategyServiceFactory.php
deleted
100644 → 0
View file @
0ba8e633
<?php
namespace
UnicaenAuth\Authentication\Service
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
/**
*
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
StrategyServiceFactory
implements
FactoryInterface
{
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return mixed
*/
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
{
$strategy
=
$serviceLocator
->
get
(
'UnicaenAuth\Authentication\Strategy\Strategy'
);
return
new
StrategyService
(
$strategy
);
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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