ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAuthContainerMDB2 Class Reference

Authentication against ILIAS database. More...

+ Inheritance diagram for ilAuthContainerMDB2:
+ Collaboration diagram for ilAuthContainerMDB2:

Public Member Functions

 __construct ()
 Constructor.
 loginObserver ($a_username, $a_auth)
 Called from fetchData after successful login.
- Public Member Functions inherited from Auth_Container_MDB2
 Auth_Container_MDB2 ($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
 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.

Static Public Member Functions

static toUsernameWithoutDomain ($username)
 Static function removes Microsoft domain name from username.

Additional Inherited Members

- Data Fields inherited from Auth_Container_MDB2
 $options = array()
 $db = null
 $dsn = ''
 $activeUser = ''

Detailed Description

Authentication against ILIAS database.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 35 of file class.ilAuthContainerMDB2.php.

Constructor & Destructor Documentation

ilAuthContainerMDB2::__construct ( )

Constructor.

Definition at line 41 of file class.ilAuthContainerMDB2.php.

References $_POST, $ilIliasIniFile, and Auth_Container_MDB2\$options.

{
global $ilClientIniFile, $ilDB, $ilIliasIniFile;
$options['dsn'] = $ilDB->getDSN();
$options['table'] = $ilClientIniFile->readVariable('auth', 'table');
$options['usernamecol'] = $ilClientIniFile->readVariable('auth', 'usercol');
$options['passwordcol'] = $ilClientIniFile->readVariable('auth', 'passcol');
// studip mode: check against submitted md5 password for ilSoapUserAdministration::login()
// todo: check whether we should put this to another place
if (isset($_POST['password']) && preg_match('/^[a-f0-9]{32,32}$/i', $_POST['password']))
{
if ($ilIliasIniFile->readVariable('server', 'studip'))
{
$options['cryptType'] = 'none';
}
}
}

Member Function Documentation

ilAuthContainerMDB2::loginObserver (   $a_username,
  $a_auth 
)

Called from fetchData after successful login.

Parameters
stringusername

Reimplemented from ilAuthContainerBase.

Definition at line 90 of file class.ilAuthContainerMDB2.php.

References $GLOBALS, $usr_id, ilAuthUtils\_getAuthMode(), ilObjUser\_lookupAuthMode(), ilObjUser\_lookupId(), AUTH_APACHE, AUTH_LOCAL, AUTH_WRONG_LOGIN, and ilAuthUtils\isPasswordModificationEnabled().

{
$usr_id = ilObjUser::_lookupId($a_username);
$auth_id = ilAuthUtils::_getAuthMode($auth_mode);
$GLOBALS['ilLog']->write(__METHOD__.': auth id = ' . $auth_id);
switch($auth_id)
{
case AUTH_LOCAL:
return true;
default:
{
return true;
}
}
$a_auth->status = AUTH_WRONG_LOGIN;
$a_auth->logout();
return false;
}

+ Here is the call graph for this function:

static ilAuthContainerMDB2::toUsernameWithoutDomain (   $username)
static

Static function removes Microsoft domain name from username.

Definition at line 67 of file class.ilAuthContainerMDB2.php.

Referenced by ilObjUser\getLoginFromAuth().

{
// Remove all characters including the last slash or the last backslash
// in the username
$pos = strrpos($username, '/');
$pos2 = strrpos($username, '\\');
if ($pos === false || $pos < $pos2)
{
$pos = $pos2;
}
if ($pos !== false)
{
$username = substr($username, $pos + 1);
}
return $username;
}

+ Here is the caller graph for this function:


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