ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

Reimplemented in Auth_Container_File, Auth_Container_DB, Auth_Container_MDB, Auth_Container_MDB2, and Auth_Container_SMBPasswd.

Definition at line 201 of file Container.php.

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

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

+ Here is the call graph for this function:

◆ Auth_Container()

Auth_Container::Auth_Container ( )

Constructor.

Has to be overwritten by each storage class

@access 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

Reimplemented in Auth_Container_DB, Auth_Container_File, Auth_Container_MDB, Auth_Container_MDB2, and Auth_Container_SMBPasswd.

Definition at line 230 of file Container.php.

231 {
232 $this->log('Auth_Container::changePassword() called.', AUTH_LOG_DEBUG);
234 }

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

+ 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

@access public

Reimplemented in ilAuthContainerCAS, ilAuthContainerOpenId, ilAuthContainerSOAP, Auth_Container_RADIUS, ilAuthContainerDatabase, ilAuthContainerMDB2, Auth_Container_DB, Auth_Container_MDB, and Auth_Container_MDB2.

Definition at line 82 of file Container.php.

83 {
84 $this->log('Auth_Container::fetchData() called.', AUTH_LOG_DEBUG);
85 }

References AUTH_LOG_DEBUG, and log().

+ Here is the call graph for this function:

◆ getCryptType()

Auth_Container::getCryptType ( )

Returns the crypt current crypt type of the container.

Returns
string

Reimplemented in Auth_Container_DB, Auth_Container_MDB, and Auth_Container_MDB2.

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

Reimplemented in ilAuthContainerDatabase.

Definition at line 174 of file Container.php.

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 }
listUsers()
List all users that are available from the storage container.
Definition: Container.php:158

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

+ Here is the call graph for this function:

◆ listUsers()

Auth_Container::listUsers ( )

List all users that are available from the storage container.

Reimplemented in Auth_Container_Array, Auth_Container_DB, Auth_Container_File, Auth_Container_MDB, Auth_Container_MDB2, and Auth_Container_SMBPasswd.

Definition at line 158 of file Container.php.

159 {
160 $this->log('Auth_Container::listUsers() called.', AUTH_LOG_DEBUG);
162 }

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

Referenced by getUser().

+ 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.

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 }

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_File\addUser(), Auth_Container_DB\addUser(), Auth_Container_MDB\addUser(), Auth_Container_MDB2\addUser(), Auth_Container_SMBPasswd\addUser(), addUser(), changePassword(), Auth_Container_DB\changePassword(), Auth_Container_File\changePassword(), Auth_Container_MDB\changePassword(), Auth_Container_MDB2\changePassword(), Auth_Container_SMBPasswd\changePassword(), ilAuthContainerMultiple\checkAuthObserver(), ilAuthContainerLDAP\checkGroup(), Auth_Container_LDAP\checkGroup(), ilAuthContainerMultiple\failedLoginObserver(), ilAuthContainerECS\failedLoginObserver(), ilAuthContainerMultiple\fetchData(), Auth_Container_Array\fetchData(), Auth_Container_File\fetchData(), Auth_Container_Multiple\fetchData(), ilAuthContainerLDAP\fetchData(), Auth_Container_DBLite\fetchData(), Auth_Container_IMAP\fetchData(), Auth_Container_KADM5\fetchData(), Auth_Container_LDAP\fetchData(), Auth_Container_Vpopmaild\fetchData(), Auth_Container_Pear\fetchData(), Auth_Container_POP3\fetchData(), Auth_Container_SAP\fetchData(), Auth_Container_SMBPasswd\fetchData(), Auth_Container_SOAP\fetchData(), Auth_Container_SOAP5\fetchData(), Auth_Container_vpopmail\fetchData(), Auth_Container_RADIUS\fetchData(), fetchData(), Auth_Container_DB\fetchData(), Auth_Container_MDB\fetchData(), Auth_Container_MDB2\fetchData(), getUser(), listUsers(), Auth_Container_Array\listUsers(), Auth_Container_DB\listUsers(), Auth_Container_File\listUsers(), Auth_Container_MDB\listUsers(), Auth_Container_MDB2\listUsers(), Auth_Container_SMBPasswd\listUsers(), ilAuthContainerMultiple\loginObserver(), ilAuthContainerLDAP\loginObserver(), ilAuthContainerECS\loginObserver(), Auth_Container_MDB\query(), Auth_Container_MDB2\query(), Auth_Container_File\removeUser(), removeUser(), Auth_Container_DB\removeUser(), Auth_Container_MDB\removeUser(), Auth_Container_MDB2\removeUser(), Auth_Container_SMBPasswd\removeUser(), and verifyPassword().

+ Here is the caller graph for this function:

◆ removeUser()

Auth_Container::removeUser (   $username)

Remove user from the storage container.

Parameters
stringUsername

Reimplemented in Auth_Container_File, Auth_Container_DB, Auth_Container_MDB, Auth_Container_MDB2, and Auth_Container_SMBPasswd.

Definition at line 215 of file Container.php.

216 {
217 $this->log('Auth_Container::removeUser() called.', AUTH_LOG_DEBUG);
219 }

References AUTH_LOG_DEBUG, AUTH_METHOD_NOT_SUPPORTED, and log().

+ Here is the call graph for this function:

◆ supportsChallengeResponse()

Auth_Container::supportsChallengeResponse ( )

Returns true if the container supports Challenge Response password authentication.

Reimplemented in Auth_Container_DB, Auth_Container_MDB, and Auth_Container_MDB2.

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.

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 }

References AUTH_LOG_DEBUG, and log().

Referenced by Auth_Container_Array\fetchData(), Auth_Container_DBLite\fetchData(), Auth_Container_DB\fetchData(), Auth_Container_MDB\fetchData(), and Auth_Container_MDB2\fetchData().

+ 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.

@access 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.

@access public

Definition at line 49 of file Container.php.


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