57 return $this->storage;
69 $this->enableLogging =
false;
72 if ($this->enableLogging)
74 $GLOBALS[
'ilLog']->write(__METHOD__.
': Init callbacks');
76 $this->setLoginCallback(array($this,
'loginObserver'));
77 $this->setFailedLoginCallback(array($this,
'failedLoginObserver'));
78 $this->setCheckAuthCallback(array($this,
'checkAuthObserver'));
79 $this->setLogoutCallback(array($this,
'logoutObserver'));
81 include_once(
'Services/Authentication/classes/class.ilAuthLogObserver.php');
99 include_once
"Services/User/classes/class.ilObjUser.php";
101 if($user_id != ANONYMOUS_USER_ID)
106 include_once
"Services/User/classes/class.ilUserProfile.php";
109 $user->setProfileIncomplete(
true);
119 if(!$user->getActive())
127 if(!$user->checkTimeLimit())
131 $this->exceeded_user_name = $this->getUserName();
137 $clientip = $user->getClientIP();
138 if (trim($clientip) !=
"")
140 $clientip = preg_replace(
"/[^0-9.?*,:]+/",
"",$clientip);
141 $clientip = str_replace(
".",
"\\.",$clientip);
142 $clientip = str_replace(Array(
"?",
"*",
","), Array(
"[0-9]",
"[0-9]*",
"|"), $clientip);
143 if (!preg_match(
"/^".$clientip.
"$/", $_SERVER[
"REMOTE_ADDR"]))
152 if($ilSetting->get(
'ps_prevent_simultaneous_logins') &&
160 include_once
'Services/Tracking/classes/class.ilOnlineTracking.php';
161 ilOnlineTracking::addUser($user_id);
163 include_once
'Modules/Forum/classes/class.ilObjForum.php';
164 ilObjForum::_updateOldAccess($user_id);
166 require_once
'Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
172 if($security_settings->isPasswordChangeOnFirstLoginEnabled() &&
173 $user->getLastLogin() == null
176 $user->resetLastPasswordChange();
179 $user->refreshLogin();
188 __METHOD__ .
': logged in as ' . $a_auth->getUsername() .
189 ', remote:' . $_SERVER[
'REMOTE_ADDR'] .
':' . $_SERVER[
'REMOTE_PORT'] .
190 ', server:' . $_SERVER[
'SERVER_ADDR'] .
':' . $_SERVER[
'SERVER_PORT']
195 $ilAppEventHandler->raise(
196 'Services/Authentication',
'afterLogin',
197 array(
'username' => $a_auth->getUsername())
212 $ilLog->write(__METHOD__.
': login failed for user '.$a_username.
213 ', remote:'.$_SERVER[
'REMOTE_ADDR'].
':'.$_SERVER[
'REMOTE_PORT'].
214 ', server:'.$_SERVER[
'SERVER_ADDR'].
':'.$_SERVER[
'SERVER_PORT']
220 if(!in_array(
$usr_id, array(ANONYMOUS_USER_ID, SYSTEM_USER_ID)))
225 require_once
'Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
227 $max_attempts = $security->getLoginMaxAttempts();
229 if((
int)$max_attempts && $login_attempts >= $max_attempts)
236 return $this->
getContainer()->failedLoginObserver($a_username,$a_auth);
247 #$GLOBALS['ilLog']->write(__METHOD__.': Check auth observer called');
248 return $this->
getContainer()->checkAuthObserver($a_username,$a_auth);
261 $ilLog->write(__METHOD__.
': Logout observer called');
265 return $this->
getContainer()->logoutObserver($a_username,$a_auth);