27 require_once
"Auth/Container.php";
31 require_once
"PEAR.php";
109 if (!is_array($options)) {
110 PEAR::raiseError(
'The options for Auth_Container_Multiple must be an array');
112 if (count($options) < 1) {
113 PEAR::raiseError(
'You must define at least one sub container to use in Auth_Container_Multiple');
115 foreach ($options as $option) {
116 if (!isset($option[
'type'])) {
142 foreach ($this->options as $key => $options) {
144 $this->
log(
'Using Container '.$key.
' of type '.$options[
'type'].
'.',
AUTH_LOG_DEBUG);
146 if (isset($this->containers[$key]) && is_a($this->containers[$key],
'Auth_Container')) {
148 $container = &$this->containers[$key];
152 $this->containers[$key] = &$this->_auth_obj->_factory($options[
'type'], $options[
'options']);
154 $container = &$this->containers[$key];
162 $this->
log(
'Container '.$key.
': '.
$result->getMessage(), AUTH_LOG_ERR);
167 $this->
log(
'Container '.$key.
': Authentication successful.', AUTH_LOG_DEBUG);
172 $this->
log(
'Container '.$key.
': Authentication failed.', AUTH_LOG_DEBUG);
178 $this->
log(
'Auth_Container_Multiple: All containers rejected user credentials.',
AUTH_LOG_DEBUG);
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
$containers
The instanciated containers.
Auth_Container_Multiple($options)
Constructor for Array Container.
$options
The options for each container.
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
fetchData($user, $pass)
Get user information from array.
$_auth_obj
The Auth object this container is attached to.
isError($data, $code=null)
Tell whether a value is a PEAR error.