39 include_once(
'Auth/Auth.php');
63 if (is_array($options))
65 $options = array_merge($this->ldap_server->toPearAuthArray(), $options);
69 $options = $this->ldap_server->toPearAuthArray();
71 parent::Auth($this->ldap_container,$options,
'',
false);
89 $this->force_creation =
true;
101 $ilLog->write(__METHOD__.
': logged in as '.$a_username.
102 ', remote:'.$_SERVER[
'REMOTE_ADDR'].
':'.$_SERVER[
'REMOTE_PORT'].
103 ', server:'.$_SERVER[
'SERVER_ADDR'].
':'.$_SERVER[
'SERVER_PORT']
106 $ilBench->start(
'Auth',
'LDAPLoginObserver');
107 $user_data = array_change_key_case($this->getAuthData(),CASE_LOWER);
112 $users[$a_username] = $user_data;
115 if($this->ldap_server->enabledSyncOnLogin())
117 if(!$user_data[
'ilInternalAccount'] and $this->ldap_server->isAccountMigrationEnabled() and !
$this->force_creation)
121 $_SESSION[
'tmp_external_account'] = $a_username;
122 $_SESSION[
'tmp_pass'] = $_POST[
'password'];
124 include_once(
'./Services/LDAP/classes/class.ilLDAPRoleAssignments.php');
126 $role_inf = $role_ass->assignedRoles($a_username,$user_data);
128 foreach($role_inf as $info)
132 $ilBench->stop(
'Auth',
'LDAPLoginObserver');
133 ilUtil::redirect(
'ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&cmd=showAccountMigration');
137 $ilBench->start(
'Auth',
'LDAPUserSynchronization');
140 #$GLOBALS['ilLog']->write(__METHOD__.': Starting update');
142 $this->ldap_attr_to_user->setUserData($users);
143 $this->ldap_attr_to_user->refresh();
151 $ilBench->stop(
'Auth',
'LDAPUserSynchronization');
154 if(!$user_data[
'ilInternalAccount'])
159 $ilBench->stop(
'Auth',
'LDAPLoginObserver');
163 $this->setAuth($user_data[
'ilInternalAccount']);
164 $ilBench->stop(
'Auth',
'LDAPLoginObserver');
177 $ilLog->write(__METHOD__.
': login failed'.
178 ', remote:'.$_SERVER[
'REMOTE_ADDR'].
':'.$_SERVER[
'REMOTE_PORT'].
179 ', server:'.$_SERVER[
'SERVER_ADDR'].
':'.$_SERVER[
'SERVER_PORT']
182 if(!$this->ldap_container->enabledOptionalGroupCheck() and $this->ldap_server->isMembershipOptional())
185 $this->ldap_container->enableOptionalGroupCheck();
198 include_once(
'Services/LDAP/classes/class.ilLDAPAttributeToUser.php');
204 include_once
'Services/LDAP/classes/class.ilLDAPServer.php';
206 $this->ldap_server->doConnectionCheck();
218 include_once(
'Services/LDAP/classes/class.ilAuthContainerLDAP.php');
219 $this->ldap_container =
new ilAuthContainerLDAP($this->ldap_server,$this->ldap_server->toPearAuthArray());
228 $this->setLoginCallback(array($this,
'loginObserver'));
229 $this->setFailedLoginCallback(array($this,
'failedLoginObserver'));
243 if(!method_exists($this,
'attachLogObserver'))
245 $ilLog->write(__METHOD__.
': PEAR Auth < 1.5 => disabling logging.');
249 if(@include_once(
'Log.php'))
251 if(@include_once(
'Log/observer.php'))
253 $ilLog->write(__METHOD__.
': Attached Logging observer.');
254 include_once(
'Services/LDAP/classes/class.ilAuthLDAPLogObserver.php');
259 $ilLog->write(__METHOD__.
': PEAR Log not installed. Logging disabled');
270 $a_username = isset($a_user_data[strtolower($this->ldap_server->getUserAttribute())]) ?
271 $a_user_data[strtolower($this->ldap_server->getUserAttribute())] :
275 if(!is_array($a_username))
279 foreach($a_username as $name)
288 return $a_username[0];
303 include_once
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php';