ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
Auth_Container_Array Class Reference
+ Inheritance diagram for Auth_Container_Array:
+ Collaboration diagram for Auth_Container_Array:

Public Member Functions

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

Data Fields

 $users
 The users and their password to authenticate against. More...
 
 $cryptType = 'none'
 The cryptType used on the passwords. More...
 
- Data Fields inherited from Auth_Container
 $activeUser = ""
 User that is currently selected from the storage container. More...
 
 $_auth_obj = null
 The Auth object this container is attached to. More...
 

Detailed Description

Definition at line 71 of file Array.php.

Member Function Documentation

◆ Auth_Container_Array()

Auth_Container_Array::Auth_Container_Array (   $data)

Constructor for Array Container.

Parameters
array$dataOptions for the container
Returns
void

Definition at line 98 of file Array.php.

References $data, and PEAR\raiseError().

99  {
100  if (!is_array($data)) {
101  PEAR::raiseError('The options for Auth_Container_Array must be an array');
102  }
103  if (isset($data['users']) && is_array($data['users'])) {
104  $this->users = $data['users'];
105  } else {
106  $this->users = array();
107  PEAR::raiseError('Auth_Container_Array: no user data found in options array');
108  }
109  if (isset($data['cryptType'])) {
110  $this->cryptType = $data['cryptType'];
111  }
112  }
& 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...
Definition: PEAR.php:524
+ Here is the call graph for this function:

◆ fetchData()

Auth_Container_Array::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 129 of file Array.php.

References $pass, AUTH_LOG_DEBUG, Auth_Container\log(), and Auth_Container\verifyPassword().

130  {
131  $this->log('Auth_Container_Array::fetchData() called.', AUTH_LOG_DEBUG);
132  if ( isset($this->users[$user])
133  && $this->verifyPassword($pass, $this->users[$user], $this->cryptType)) {
134  return true;
135  }
136  return false;
137  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
verifyPassword($password1, $password2, $cryptType="md5")
Crypt and verfiy the entered password.
Definition: Container.php:101
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
+ Here is the call graph for this function:

◆ listUsers()

Auth_Container_Array::listUsers ( )

Returns a list of users available within the container.

Returns
array

Definition at line 147 of file Array.php.

References $ret, AUTH_LOG_DEBUG, and Auth_Container\log().

148  {
149  $this->log('Auth_Container_Array::listUsers() called.', AUTH_LOG_DEBUG);
150  $ret = array();
151  foreach ($this->users as $username => $password) {
152  $ret[]['username'] = $username;
153  }
154  return $ret;
155  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
+ Here is the call graph for this function:

Field Documentation

◆ $cryptType

string Auth_Container_Array::$cryptType = 'none'

The cryptType used on the passwords.

Definition at line 87 of file Array.php.

◆ $users

array Auth_Container_Array::$users

The users and their password to authenticate against.

Definition at line 80 of file Array.php.


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