ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_Container_Multiple Class Reference
+ Inheritance diagram for Auth_Container_Multiple:
+ Collaboration diagram for Auth_Container_Multiple:

Public Member Functions

 Auth_Container_Multiple ($options)
 Constructor for Array Container.
 fetchData ($user, $pass)
 Get user information from array.
- Public Member Functions inherited from Auth_Container
 Auth_Container ()
 Constructor.
 fetchData ($username, $password, $isChallengeResponse=false)
 Fetch data from storage container.
 verifyPassword ($password1, $password2, $cryptType="md5")
 Crypt and verfiy the entered password.
 supportsChallengeResponse ()
 Returns true if the container supports Challenge Response password authentication.
 getCryptType ()
 Returns the crypt current crypt type of the container.
 listUsers ()
 List all users that are available from the storage container.
 getUser ($username)
 Returns a user assoc array.
 addUser ($username, $password, $additional=null)
 Add a new user to the storage container.
 removeUser ($username)
 Remove user from the storage container.
 changePassword ($username, $password)
 Change password for user in the storage container.
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message to the Auth log.
- Public Member Functions inherited from ilAuthContainerBase
 loginObserver ($a_username, $a_auth)
 Called after successful login.
 failedLoginObserver ($a_username, $a_auth)
 Called after failed login.
 checkAuthObserver ($a_username, $a_auth)
 Called after check auth requests.
 logoutObserver ($a_username, $a_auth)
 Called after logout.

Data Fields

 $options = array()
 The options for each container.
 $containers = array()
 The instanciated containers.
- Data Fields inherited from Auth_Container
 $activeUser = ""
 User that is currently selected from the storage container.
 $_auth_obj = null
 The Auth object this container is attached to.

Detailed Description

Definition at line 80 of file Multiple.php.

Member Function Documentation

Auth_Container_Multiple::Auth_Container_Multiple (   $options)

Constructor for Array Container.

Parameters
array$dataOptions for the container
Returns
void

Definition at line 107 of file Multiple.php.

References $options, and PEAR\raiseError().

{
if (!is_array($options)) {
PEAR::raiseError('The options for Auth_Container_Multiple must be an array');
}
if (count($options) < 1) {
PEAR::raiseError('You must define at least one sub container to use in Auth_Container_Multiple');
}
foreach ($options as $option) {
if (!isset($option['type'])) {
PEAR::raiseError('No type defined for sub container');
}
}
$this->options = $options;
}

+ Here is the call graph for this function:

Auth_Container_Multiple::fetchData (   $user,
  $pass 
)

Get user information from array.

This function uses the given username to fetch the corresponding login data from the array. If an account that matches the passed username and password is found, the function returns true. Otherwise it returns false.

Parameters
stringUsername
stringPassword
Returns
boolean|PEAR_Error Error object or boolean

Definition at line 138 of file Multiple.php.

References Auth_Container\$_auth_obj, $options, $pass, $result, AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

{
$this->log('Auth_Container_Multiple::fetchData() called.', AUTH_LOG_DEBUG);
foreach ($this->options as $key => $options) {
$this->log('Using Container '.$key.' of type '.$options['type'].'.', AUTH_LOG_DEBUG);
if (isset($this->containers[$key]) && is_a($this->containers[$key], 'Auth_Container')) {
$container = &$this->containers[$key];
} else {
$this->containers[$key] = &$this->_auth_obj->_factory($options['type'], $options['options']);
$this->containers[$key]->_auth_obj = &$this->_auth_obj;
$container = &$this->containers[$key];
}
$result = $container->fetchData($user, $pass);
$this->log('Container '.$key.': '.$result->getMessage(), AUTH_LOG_ERR);
return $result;
} elseif ($result == true) {
$this->log('Container '.$key.': Authentication successful.', AUTH_LOG_DEBUG);
return true;
} else {
$this->log('Container '.$key.': Authentication failed.', AUTH_LOG_DEBUG);
}
}
$this->log('Auth_Container_Multiple: All containers rejected user credentials.', AUTH_LOG_DEBUG);
return false;
}

+ Here is the call graph for this function:

Field Documentation

array Auth_Container_Multiple::$containers = array()

The instanciated containers.

Definition at line 96 of file Multiple.php.

array Auth_Container_Multiple::$options = array()

The options for each container.

Definition at line 89 of file Multiple.php.

Referenced by Auth_Container_Multiple(), and fetchData().


The documentation for this class was generated from the following file: