ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAuthBase Class Reference

Base class for all PEAR and ILIAS auth classes. More...

+ Inheritance diagram for ilAuthBase:
+ Collaboration diagram for ilAuthBase:

Public Member Functions

 supportRedirects ()
 Returns true, if the current auth mode allows redirects to e.g the login screen, public section ...
 getContainer ()
 Get container object.

Protected Member Functions

 initAuth ()
 Init auth object Enable logging, set callbacks...
 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 each check auth request.
 logoutObserver ($a_username, $a_auth)
 Called after logout.

Protected Attributes

 $sub_status = null

Detailed Description

Base class for all PEAR and ILIAS auth classes.

Enables logging, observers.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 33 of file class.ilAuthBase.php.

Member Function Documentation

ilAuthBase::checkAuthObserver (   $a_username,
  $a_auth 
)
protected

Called after each check auth request.

Returns
Parameters
array$a_username
object$a_auth

Definition at line 168 of file class.ilAuthBase.php.

References getContainer().

{
#$GLOBALS['ilLog']->write(__METHOD__.': Check auth observer called');
return $this->getContainer()->checkAuthObserver($a_username,$a_auth);
}

+ Here is the call graph for this function:

ilAuthBase::failedLoginObserver (   $a_username,
  $a_auth 
)
protected

Called after failed login.

Returns
Parameters
array$a_username
object$a_auth

Reimplemented in ilAuthHTTP.

Definition at line 130 of file class.ilAuthBase.php.

References $ilLog, $usr_id, ilSecuritySettings\_getInstance(), ilObjUser\_getLoginAttempts(), ilObjUser\_incrementLoginAttempts(), ilObjUser\_lookupId(), ilObjUser\_setUserInactive(), ilSecuritySettings\ACCOUNT_SECURITY_MODE_CUSTOMIZED, and getContainer().

{
global $ilLog;
$ilLog->write(__METHOD__.': login failed for user '.$a_username.
', remote:'.$_SERVER['REMOTE_ADDR'].':'.$_SERVER['REMOTE_PORT'].
', server:'.$_SERVER['SERVER_ADDR'].':'.$_SERVER['SERVER_PORT']
);
require_once 'Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
if($a_username &&
$security->getAccountSecurityMode() == ilSecuritySettings::ACCOUNT_SECURITY_MODE_CUSTOMIZED
)
{
$usr_id = ilObjUser::_lookupId($a_username);
if(!in_array($usr_id, array(ANONYMOUS_USER_ID, SYSTEM_USER_ID)))
{
$max_attempts = $security->getLoginMaxAttempts();
if((int)$max_attempts && $login_attempts >= $max_attempts)
{
}
}
}
return $this->getContainer()->failedLoginObserver($a_username,$a_auth);
}

+ Here is the call graph for this function:

ilAuthBase::getContainer ( )
final

Get container object.

Returns
object ilAuthContainerBase

Definition at line 53 of file class.ilAuthBase.php.

Referenced by checkAuthObserver(), failedLoginObserver(), loginObserver(), and logoutObserver().

{
return $this->storage;
}

+ Here is the caller graph for this function:

ilAuthBase::initAuth ( )
finalprotected

Init auth object Enable logging, set callbacks...

Returns
void

Definition at line 63 of file class.ilAuthBase.php.

References $GLOBALS, AUTH_LOG_DEBUG, and ilSessionControl\initSession().

Referenced by ilAuthOpenId\__construct(), ilAuthCAS\__construct(), ilAuthSOAP\__construct(), ilAuthWeb\__construct(), ilAuthHTTP\__construct(), ilAuthCalendarToken\__construct(), ilAuthCron\__construct(), ilAuthApache\__construct(), and ilAuthECS\__construct().

{
//$this->enableLogging = true;
$this->enableLogging = false;
if ($this->enableLogging)
{
$GLOBALS['ilLog']->write(__METHOD__.': Init callbacks');
}
$this->setLoginCallback(array($this,'loginObserver'));
$this->setFailedLoginCallback(array($this,'failedLoginObserver'));
$this->setCheckAuthCallback(array($this,'checkAuthObserver'));
$this->setLogoutCallback(array($this,'logoutObserver'));
include_once('Services/Authentication/classes/class.ilAuthLogObserver.php');
$this->attachLogObserver(new ilAuthLogObserver(AUTH_LOG_DEBUG));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthBase::loginObserver (   $a_username,
  $a_auth 
)
protected

Called after successful login.

Returns
Parameters
array$a_username
object$a_auth

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

References $ilLog, ilObjUser\_loginExists(), getContainer(), ilSessionControl\handleLoginEvent(), and ilUserProfile\isProfileIncomplete().

{
ilSessionControl::handleLoginEvent($a_username, $a_auth);
global $ilLog, $ilAppEventHandler;
if($this->getContainer()->loginObserver($a_username,$a_auth))
{
$ilAppEventHandler->raise("Services/Authentication", "afterLogin",
array("username" => $a_auth->getUsername()));
// check if profile is complete
include_once "Services/User/classes/class.ilObjUser.php";
$user_id = ilObjUser::_loginExists($a_auth->getUsername());
if($user_id != ANONYMOUS_USER_ID)
{
$user = new ilObjUser($user_id);
include_once "Services/User/classes/class.ilUserProfile.php";
{
$user->setProfileIncomplete(true);
$user->update();
}
}
$ilLog->write(__METHOD__.': logged in as '.$a_auth->getUsername().
', remote:'.$_SERVER['REMOTE_ADDR'].':'.$_SERVER['REMOTE_PORT'].
', server:'.$_SERVER['SERVER_ADDR'].':'.$_SERVER['SERVER_PORT']
);
}
}

+ Here is the call graph for this function:

ilAuthBase::logoutObserver (   $a_username,
  $a_auth 
)
protected

Called after logout.

Returns
Parameters
array$a_username
object$a_auth

Definition at line 180 of file class.ilAuthBase.php.

References $GLOBALS, getContainer(), and ilSessionControl\handleLogoutEvent().

{
$GLOBALS['ilLog']->write(__METHOD__.': Logout observer called');
$this->getContainer()->logoutObserver($a_username,$a_auth);
}

+ Here is the call graph for this function:

ilAuthBase::supportRedirects ( )

Returns true, if the current auth mode allows redirects to e.g the login screen, public section ...

Returns

Definition at line 44 of file class.ilAuthBase.php.

{
return true;
}

Field Documentation

ilAuthBase::$sub_status = null
protected

Definition at line 37 of file class.ilAuthBase.php.


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