ILIAS
release_4-3 Revision
|
Public Member Functions | |
Auth_Container_DB ($dsn) | |
Constructor of the container class. | |
_connect ($dsn) | |
Connect to database by using the given DSN string. | |
_prepare () | |
Prepare database connection. | |
query ($query) | |
Prepare query to the database. | |
_setDefaults () | |
Set some default options. | |
_parseOptions ($array) | |
Parse options passed to the container class. | |
_quoteDBFields () | |
Quote the db_fields option to avoid the possibility of SQL injection. | |
fetchData ($username, $password, $isChallengeResponse=false) | |
Get user information from database. | |
listUsers () | |
Returns a list of users from the container. | |
addUser ($username, $password, $additional="") | |
Add user to the storage container. | |
removeUser ($username) | |
Remove user from the storage container. | |
changePassword ($username, $password) | |
Change password for user in the storage container. | |
supportsChallengeResponse () | |
Determine if this container supports password authentication with challenge response. | |
getCryptType () | |
Returns the selected crypt type for this container. | |
Public Member Functions inherited from Auth_Container | |
Auth_Container () | |
Constructor. | |
verifyPassword ($password1, $password2, $cryptType="md5") | |
Crypt and verfiy the entered password. | |
getUser ($username) | |
Returns a user assoc array. | |
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() | |
$db = null | |
$dsn = '' | |
$activeUser = '' | |
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. |
Auth_Container_DB::_connect | ( | $dsn | ) |
Connect to database by using the given DSN string.
private
string | DSN string |
Definition at line 110 of file DB.php.
References $dsn, AUTH_LOG_DEBUG, PEAR\isError(), Auth_Container\log(), PEAR_ERROR_RETURN, and PEAR\raiseError().
Referenced by _prepare().
Auth_Container_DB::_parseOptions | ( | $array | ) |
Parse options passed to the container class.
private
array |
Definition at line 230 of file DB.php.
Referenced by Auth_Container_DB().
Auth_Container_DB::_prepare | ( | ) |
Prepare database connection.
This function checks if we have already opened a connection to the database. If that's not the case, a new connection is opened.
private
Definition at line 148 of file DB.php.
References $res, $t, _connect(), and PEAR\isError().
Referenced by addUser(), changePassword(), fetchData(), listUsers(), query(), and removeUser().
Auth_Container_DB::_quoteDBFields | ( | ) |
Quote the db_fields option to avoid the possibility of SQL injection.
private
Definition at line 249 of file DB.php.
Referenced by fetchData(), and listUsers().
Auth_Container_DB::_setDefaults | ( | ) |
Set some default options.
private
Definition at line 208 of file DB.php.
Referenced by Auth_Container_DB().
Auth_Container_DB::addUser | ( | $username, | |
$password, | |||
$additional = "" |
|||
) |
Add user to the storage container.
public
string | Username |
string | Password |
mixed | Additional information that are stored in the DB |
Reimplemented from Auth_Container.
Definition at line 452 of file DB.php.
References $additional, $query, $res, _prepare(), AUTH_LOG_DEBUG, Auth_Container\log(), query(), and PEAR\raiseError().
Auth_Container_DB::Auth_Container_DB | ( | $dsn | ) |
Constructor of the container class.
Save the initial options passed to the container. Initiation of the DB connection is no longer performed here and is only done when needed.
string | Connection data or DB object |
Definition at line 85 of file DB.php.
References $dsn, _parseOptions(), _setDefaults(), and PEAR\raiseError().
Auth_Container_DB::changePassword | ( | $username, | |
$password | |||
) |
Change password for user in the storage container.
string | Username |
string | The new password (plain text) |
Reimplemented from Auth_Container.
Definition at line 562 of file DB.php.
References $query, $res, _prepare(), AUTH_LOG_DEBUG, Auth_Container\log(), query(), and PEAR\raiseError().
Auth_Container_DB::fetchData | ( | $username, | |
$password, | |||
$isChallengeResponse = false |
|||
) |
Get user information from database.
This function uses the given username to fetch the corresponding login data from the database table. If an account that matches the passed username and password is found, the function returns true. Otherwise it returns false.
string | Username |
string | Password |
boolean | If true password is secured using a md5 hash the frontend and auth are responsible for making sure the container supports challenge response password authentication |
Reimplemented from Auth_Container.
Definition at line 295 of file DB.php.
References $query, $res, _prepare(), _quoteDBFields(), AUTH_LOG_DEBUG, DB_FETCHMODE_ASSOC, Auth_Container\log(), PEAR\raiseError(), and Auth_Container\verifyPassword().
Auth_Container_DB::getCryptType | ( | ) |
Returns the selected crypt type for this container.
Reimplemented from Auth_Container.
Definition at line 631 of file DB.php.
Auth_Container_DB::listUsers | ( | ) |
Returns a list of users from the container.
Reimplemented from Auth_Container.
Definition at line 389 of file DB.php.
References $query, $res, _prepare(), _quoteDBFields(), AUTH_LOG_DEBUG, DB_FETCHMODE_ASSOC, Auth_Container\log(), and PEAR\raiseError().
Auth_Container_DB::query | ( | $query | ) |
Prepare query to the database.
This function checks if we have already opened a connection to the database. If that's not the case, a new connection is opened. After that the query is passed to the database.
public
string | Query string |
Definition at line 190 of file DB.php.
References $query, and _prepare().
Referenced by addUser(), changePassword(), and removeUser().
Auth_Container_DB::removeUser | ( | $username | ) |
Remove user from the storage container.
public
string | Username |
Reimplemented from Auth_Container.
Definition at line 518 of file DB.php.
References $query, $res, _prepare(), AUTH_LOG_DEBUG, Auth_Container\log(), query(), and PEAR\raiseError().
Auth_Container_DB::supportsChallengeResponse | ( | ) |
Determine if this container supports password authentication with challenge response.
Reimplemented from Auth_Container.
Definition at line 620 of file DB.php.
Auth_Container_DB::$dsn = '' |
Definition at line 65 of file DB.php.
Referenced by _connect(), and Auth_Container_DB().