57                $this->sub_status = $a_sub_status;
 
   76                return $this->storage;
 
   88                $this->enableLogging = 
false;
 
   91                if ($this->enableLogging)
 
   95                $this->setLoginCallback(array($this,
'loginObserver'));
 
   96                $this->setFailedLoginCallback(array($this,
'failedLoginObserver'));
 
   97                $this->setCheckAuthCallback(array($this,
'checkAuthObserver'));
 
   98                $this->setLogoutCallback(array($this,
'logoutObserver'));
 
  100                include_once(
'Services/Authentication/classes/class.ilAuthLogObserver.php');
 
  118                        include_once 
"Services/User/classes/class.ilObjUser.php";
 
  120                        if($user_id != ANONYMOUS_USER_ID)
 
  125                                include_once 
"Services/User/classes/class.ilUserProfile.php";
 
  128                                        $user->setProfileIncomplete(
true);
 
  145                                if(!$user->getActive())
 
  153                                if(!$user->checkTimeLimit())
 
  157                                        $this->exceeded_user_name = $this->getUserName();
 
  163                                $clientip = $user->getClientIP();
 
  164                                if (trim($clientip) != 
"")
 
  166                                        $clientip = preg_replace(
"/[^0-9.?*,:]+/",
"",$clientip);
 
  167                                        $clientip = str_replace(
".",
"\\.",$clientip);
 
  168                                        $clientip = str_replace(Array(
"?",
"*",
","), Array(
"[0-9]",
"[0-9]*",
"|"), $clientip);
 
  169                                        if (!preg_match(
"/^".$clientip.
"$/", 
$_SERVER[
"REMOTE_ADDR"]))
 
  178                                if(
$ilSetting->get(
'ps_prevent_simultaneous_logins') &&
 
  186                                include_once 
'Services/Tracking/classes/class.ilOnlineTracking.php';
 
  187                                ilOnlineTracking::addUser($user_id);
 
  189                                include_once 
'Modules/Forum/classes/class.ilObjForum.php';
 
  190                                ilObjForum::_updateOldAccess($user_id);
 
  192                                require_once 
'Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
 
  198                                if($security_settings->isPasswordChangeOnFirstLoginEnabled() &&
 
  199                                        $user->getLastLogin() == 
null 
  202                                        $user->resetLastPasswordChange();
 
  205                                $user->refreshLogin();
 
  213                                'logged in as '. $a_auth->getUsername() . 
 
  220                        $ilAppEventHandler->raise(
 
  221                                'Services/Authentication', 
'afterLogin',
 
  222                                array(
'username' => $a_auth->getUsername())
 
  233                if(in_array($user->
getId(), array(ANONYMOUS_USER_ID, SYSTEM_USER_ID)))
 
  244                require_once 
'Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
 
  246                $maxLoginAttempts = $security->getLoginMaxAttempts();
 
  248                if(!(
int)$maxLoginAttempts)
 
  255                return $numLoginAttempts < $maxLoginAttempts;
 
  269                        ': login failed for user '.$a_username.
 
  270                        ', remote:'.$_SERVER[
'REMOTE_ADDR'].
':'.
$_SERVER[
'REMOTE_PORT'].
 
  271                        ', server:'.$_SERVER[
'SERVER_ADDR'].
':'.
$_SERVER[
'SERVER_PORT']
 
  277                        if(!in_array($usr_id, array(ANONYMOUS_USER_ID, SYSTEM_USER_ID)))
 
  282                                require_once 
'Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
 
  284                                $max_attempts = $security->getLoginMaxAttempts();
 
  286                                if((
int)$max_attempts && $login_attempts >= $max_attempts)
 
  293                return $this->
getContainer()->failedLoginObserver($a_username,$a_auth);
 
  304                return $this->
getContainer()->checkAuthObserver($a_username,$a_auth);
 
  315                global 
$ilLog, $ilAppEventHandler;
 
  321                $ilAppEventHandler->raise(
 
  322                        'Services/Authentication', 
'afterLogout',
 
  323                        array(
'username' => $a_auth->getUsername())
 
  326                return $this->
getContainer()->logoutObserver($a_username,$a_auth);
 
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
const AUTH_USER_SIMULTANEOUS_LOGIN
const AUTH_USER_INACTIVE_LOGIN_ATTEMPTS
const AUTH_USER_TIME_LIMIT_EXCEEDED
@classDescription Base class for all PEAR and ILIAS auth classes.
initAuth()
Init auth object Enable logging, set callbacks...
getContainer()
Get container object.
checkExceededLoginAttempts(\ilObjUser $user)
setSubStatus($a_sub_status)
Set sub status.
failedLoginObserver($a_username, $a_auth)
Called after failed login.
getSubStatus()
Get sub status.
loginObserver($a_username, $a_auth)
Called after successful login.
supportsRedirects()
Returns true, if the current auth mode allows redirects to e.g the login screen, public section ....
logoutObserver($a_username, $a_auth)
Called after logout.
checkAuthObserver($a_username, $a_auth)
Called after each check auth request.
static getLogger($a_component_id)
Get component logger.
static _resetLoginAttempts($a_usr_id)
getActive()
get user active state @access public
static _incrementLoginAttempts($a_usr_id)
static hasActiveSession($a_user_id)
Check for simultaneous login.
static _lookupId($a_user_str)
Lookup id by login.
static _setUserInactive($a_usr_id)
static _getLoginAttempts($a_usr_id)
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
getId()
get object id @access public
static _getInstance()
Get instance of ilSecuritySettings.
static handleLogoutEvent()
reset sessions type to unknown
static initSession()
mark session with type regarding to the context.
static handleLoginEvent($a_login, $a_auth)
when current session is allowed to be created it marks it with type regarding to the sessions user co...
static isProfileIncomplete($a_user, $a_include_udf=true, $a_personal_data_only=true)
Check if all required personal data fields are set.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']