diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 9d50cf438b8849f7432e19e807964dca6a8929b2..2c081d414a5ea2ec0f19907412fdb4033e370586 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -118,6 +118,9 @@ $config = array( ), 'service_manager' => array( 'factories' => array( + 'VuFind\AuthManager' => function ($sm) { + return new \VuFind\Auth\Manager(\VuFind\Config\Reader::getConfig()); + }, 'VuFind\Cart' => function ($sm) { $config = \VuFind\Config\Reader::getConfig(); $active = isset($config->Site->showBookBag) @@ -204,7 +207,6 @@ $config = array( }, ), 'invokables' => array( - 'VuFind\AuthManager' => 'VuFind\Auth\Manager', 'VuFind\CacheManager' => 'VuFind\Cache\Manager', 'VuFind\Mailer' => 'VuFind\Mailer', 'VuFind\RecordLoader' => 'VuFind\Record\Loader', diff --git a/module/VuFind/src/VuFind/Auth/Manager.php b/module/VuFind/src/VuFind/Auth/Manager.php index 4afc1d8aeeafbc1d48999fc7c534f371ab1c2dce..2e2ee560ae9464698baf629a81c846c775bf596d 100644 --- a/module/VuFind/src/VuFind/Auth/Manager.php +++ b/module/VuFind/src/VuFind/Auth/Manager.php @@ -26,11 +26,9 @@ * @link http://www.vufind.org Main Page */ namespace VuFind\Auth; -use VuFind\Config\Reader as ConfigReader, - VuFind\Exception\Auth as AuthException, VuFind\Exception\ILS as ILSException, +use VuFind\Exception\Auth as AuthException, VuFind\Exception\ILS as ILSException, Zend\ServiceManager\ServiceLocatorAwareInterface, - Zend\ServiceManager\ServiceLocatorInterface, - Zend\Session\Container as SessionContainer; + Zend\ServiceManager\ServiceLocatorInterface; /** * Wrapper class for handling logged-in user in session. @@ -43,9 +41,32 @@ use VuFind\Config\Reader as ConfigReader, */ class Manager implements ServiceLocatorAwareInterface { + /** + * Authentication module (false if uninitialized) + * + * @var \VuFind\Auth\AbstractBase|bool + */ protected $auth = false; + + /** + * VuFind configuration + * + * @var \Zend\Config\Config + */ protected $config; + + /** + * Session container + * + * @var \Zend\Session\Container + */ protected $session; + + /** + * ILS account information (false if uninitialized) + * + * @var array|bool + */ protected $ilsAccount = false; /** @@ -57,11 +78,13 @@ class Manager implements ServiceLocatorAwareInterface /** * Constructor + * + * @param \Zend\Config\Config $config VuFind configuration */ - public function __construct() + public function __construct(\Zend\Config\Config $config) { - $this->config = ConfigReader::getConfig(); - $this->session = new SessionContainer('Account'); + $this->config = $config; + $this->session = new \Zend\Session\Container('Account'); } /**