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

Public Member Functions

 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

 $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 39 of file Container.php.

Member Function Documentation

◆ addUser()

Auth_Container::addUser (   $username,
  $password,
  $additional = null 
)

Add a new user to the storage container.

Parameters
stringUsername
stringPassword
arrayAdditional information
Returns
boolean

Definition at line 201 of file Container.php.

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

202  {
203  $this->log('Auth_Container::addUser() called.', AUTH_LOG_DEBUG);
205  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
const AUTH_METHOD_NOT_SUPPORTED
Returned if a container method is not supported.
Definition: Auth.php:42
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:

◆ Auth_Container()

Auth_Container::Auth_Container ( )

Constructor.

Has to be overwritten by each storage class

public

Definition at line 68 of file Container.php.

69  {
70  }

◆ changePassword()

Auth_Container::changePassword (   $username,
  $password 
)

Change password for user in the storage container.

Parameters
stringUsername
stringThe new password

Definition at line 230 of file Container.php.

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

231  {
232  $this->log('Auth_Container::changePassword() called.', AUTH_LOG_DEBUG);
234  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
const AUTH_METHOD_NOT_SUPPORTED
Returned if a container method is not supported.
Definition: Auth.php:42
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:

◆ fetchData()

Auth_Container::fetchData (   $username,
  $password,
  $isChallengeResponse = false 
)

Fetch data from storage container.

Has to be overwritten by each storage class

public

Definition at line 82 of file Container.php.

References AUTH_LOG_DEBUG, and log().

Referenced by ilAuthContainerApache\forceCreation().

83  {
84  $this->log('Auth_Container::fetchData() called.', AUTH_LOG_DEBUG);
85  }
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:
+ Here is the caller graph for this function:

◆ getCryptType()

Auth_Container::getCryptType ( )

Returns the crypt current crypt type of the container.

Returns
string

Definition at line 147 of file Container.php.

148  {
149  return('');
150  }

◆ getUser()

Auth_Container::getUser (   $username)

Returns a user assoc array.

Containers which want should overide this

Parameters
stringThe username

Definition at line 174 of file Container.php.

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, listUsers(), and log().

175  {
176  $this->log('Auth_Container::getUser() called.', AUTH_LOG_DEBUG);
177  $users = $this->listUsers();
178  if ($users === AUTH_METHOD_NOT_SUPPORTED) {
180  }
181  for ($i=0; $c = count($users), $i<$c; $i++) {
182  if ($users[$i]['username'] == $username) {
183  return $users[$i];
184  }
185  }
186  return false;
187  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
listUsers()
List all users that are available from the storage container.
Definition: Container.php:158
const AUTH_METHOD_NOT_SUPPORTED
Returned if a container method is not supported.
Definition: Auth.php:42
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::listUsers ( )

List all users that are available from the storage container.

Definition at line 158 of file Container.php.

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

Referenced by getUser().

159  {
160  $this->log('Auth_Container::listUsers() called.', AUTH_LOG_DEBUG);
162  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
const AUTH_METHOD_NOT_SUPPORTED
Returned if a container method is not supported.
Definition: Auth.php:42
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:
+ Here is the caller graph for this function:

◆ log()

Auth_Container::log (   $message,
  $level = AUTH_LOG_DEBUG 
)

Log a message to the Auth log.

Parameters
stringThe message
int
Returns
boolean

Definition at line 246 of file Container.php.

Referenced by ilAuthContainerECS\__construct(), ilAuthContainerLDAP\__construct(), Auth_Container_IMAP\_checkServer(), Auth_Container_DB\_connect(), Auth_Container_MDB\_connect(), Auth_Container_MDB2\_connect(), Auth_Container_DBLite\_connect(), Auth_Container_LDAP\_connect(), Auth_Container_LDAP\_disconnect(), Auth_Container_LDAP\_getBaseDN(), Auth_Container_File\_load(), Auth_Container_SMBPasswd\addUser(), Auth_Container_File\addUser(), addUser(), Auth_Container_MDB2\addUser(), Auth_Container_MDB\addUser(), Auth_Container_DB\addUser(), Auth_Container_SMBPasswd\changePassword(), Auth_Container_File\changePassword(), changePassword(), Auth_Container_MDB2\changePassword(), Auth_Container_MDB\changePassword(), Auth_Container_DB\changePassword(), ilAuthContainerMultiple\checkAuthObserver(), ilAuthContainerLDAP\checkGroup(), Auth_Container_LDAP\checkGroup(), ilAuthContainerMultiple\failedLoginObserver(), ilAuthContainerECS\failedLoginObserver(), Auth_Container_vpopmail\fetchData(), fetchData(), ilAuthContainerMultiple\fetchData(), ilAuthContainerLDAP\fetchData(), Auth_Container_SMBPasswd\fetchData(), Auth_Container_File\fetchData(), Auth_Container_Vpopmaild\fetchData(), Auth_Container_KADM5\fetchData(), Auth_Container_SAP\fetchData(), Auth_Container_Pear\fetchData(), Auth_Container_RADIUS\fetchData(), Auth_Container_POP3\fetchData(), Auth_Container_Array\fetchData(), Auth_Container_Multiple\fetchData(), Auth_Container_SOAP\fetchData(), Auth_Container_SOAP5\fetchData(), Auth_Container_IMAP\fetchData(), Auth_Container_DBLite\fetchData(), Auth_Container_MDB\fetchData(), Auth_Container_MDB2\fetchData(), Auth_Container_DB\fetchData(), Auth_Container_LDAP\fetchData(), getUser(), Auth_Container_SMBPasswd\listUsers(), Auth_Container_File\listUsers(), Auth_Container_Array\listUsers(), listUsers(), Auth_Container_MDB2\listUsers(), Auth_Container_MDB\listUsers(), Auth_Container_DB\listUsers(), ilAuthContainerMultiple\loginObserver(), ilAuthContainerECS\loginObserver(), Auth_Container_MDB\query(), Auth_Container_MDB2\query(), Auth_Container_SMBPasswd\removeUser(), Auth_Container_File\removeUser(), removeUser(), Auth_Container_MDB2\removeUser(), Auth_Container_MDB\removeUser(), Auth_Container_DB\removeUser(), ilAuthContainerMDB2\supportsCaptchaVerification(), and verifyPassword().

246  {
247 
248  if (is_null($this->_auth_obj)) {
249 
250  return false;
251 
252  } else {
253 
254  return $this->_auth_obj->log($message, $level);
255 
256  }
257 
258  }
+ Here is the caller graph for this function:

◆ removeUser()

Auth_Container::removeUser (   $username)

Remove user from the storage container.

Parameters
stringUsername

Definition at line 215 of file Container.php.

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

216  {
217  $this->log('Auth_Container::removeUser() called.', AUTH_LOG_DEBUG);
219  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
const AUTH_METHOD_NOT_SUPPORTED
Returned if a container method is not supported.
Definition: Auth.php:42
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:

◆ supportsChallengeResponse()

Auth_Container::supportsChallengeResponse ( )

Returns true if the container supports Challenge Response password authentication.

Definition at line 134 of file Container.php.

135  {
136  return(false);
137  }

◆ verifyPassword()

Auth_Container::verifyPassword (   $password1,
  $password2,
  $cryptType = "md5" 
)

Crypt and verfiy the entered password.

Parameters
stringEntered password
stringPassword from the data container (usually this password is already encrypted.
stringType of algorithm with which the password from the container has been crypted. (md5, crypt etc.) Defaults to "md5".
Returns
bool True, if the passwords match

Definition at line 101 of file Container.php.

References AUTH_LOG_DEBUG, and log().

Referenced by Auth_Container_Array\fetchData(), Auth_Container_DBLite\fetchData(), Auth_Container_MDB\fetchData(), Auth_Container_MDB2\fetchData(), Auth_Container_DB\fetchData(), ilAuthContainerSOAP\loginObserver(), and ilAuthContainerMDB2\supportsCaptchaVerification().

102  {
103  $this->log('Auth_Container::verifyPassword() called.', AUTH_LOG_DEBUG);
104  switch ($cryptType) {
105  case "crypt" :
106  return ((string)crypt($password1, $password2) === (string)$password2);
107  break;
108  case "none" :
109  case "" :
110  return ((string)$password1 === (string)$password2);
111  break;
112  case "md5" :
113  return ((string)md5($password1) === (string)$password2);
114  break;
115  default :
116  if (function_exists($cryptType)) {
117  return ((string)$cryptType($password1) === (string)$password2);
118  } elseif (method_exists($this,$cryptType)) {
119  return ((string)$this->$cryptType($password1) === (string)$password2);
120  } else {
121  return false;
122  }
123  break;
124  }
125  }
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:
+ Here is the caller graph for this function:

Field Documentation

◆ $_auth_obj

Auth_Container::$_auth_obj = null

The Auth object this container is attached to.

public

Definition at line 56 of file Container.php.

Referenced by ilAuthContainerMultiple\fetchData(), and Auth_Container_Multiple\fetchData().

◆ $activeUser

Auth_Container::$activeUser = ""

User that is currently selected from the storage container.

public

Definition at line 49 of file Container.php.


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