4 include_once
'./Services/Authentication/classes/Provider/class.ilAuthProvider.php';
5 include_once
'./Services/Authentication/interfaces/interface.ilAuthProviderInterface.php';
6 include_once
'./Services/Authentication/interfaces/interface.ilAuthProviderAccountMigrationInterface.php';
32 parent::__construct($credentials);
34 include_once
'./Services/Administration/classes/class.ilSetting.php';
53 if (!$this->
getSettings()->
get(
'apache_enable_auth')) {
54 $this->
getLogger()->info(
'Apache auth disabled.');
60 !$this->
getSettings()->
get(
'apache_auth_indicator_name') ||
61 !$this->
getSettings()->
get(
'apache_auth_indicator_value')
63 $this->
getLogger()->warning(
'Apache auth indicator match failure.');
71 array_filter(array_map(
'trim', str_getcsv($this->
getSettings()->
get(
'apache_auth_indicator_value'))))
74 $this->
getLogger()->warning(
'Apache authentication failed (indicator name <-> value');
79 include_once
'./Services/Utilities/classes/class.ilUtil.php';
87 $this->
getLogger()->info(
'No username given');
93 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
94 if ($this->
getSettings()->
get(
'apache_enable_ldap')) {
101 $this->
getLogger()->info(
'Cannot find user id for external account: ' . $this->
getCredentials()->getUsername());
119 $this->force_new_account =
true;
120 if ($this->
getSettings()->
get(
'apache_enable_ldap')) {
131 $this->force_new_account =
true;
132 if ($this->
getSettings()->
get(
'apache_enable_ldap')) {
152 $this->migration_account = $a_name;
168 if ($this->
getSettings()->
get(
'apache_ldap_sid')) {
169 return 'ldap_' . (string) $this->
getSettings()->get(
'apache_ldap_sid');
181 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
186 $this->
getLogger()->debug(
'Using ldap data source with server configuration: ' .
$server->getName());
188 include_once
'./Services/LDAP/classes/class.ilLDAPUserSynchronisation.php';
191 $sync->setUserData(array());
192 $sync->forceCreation($this->force_new_account);
193 $sync->forceReadLdapData(
true);
196 $internal_account =
$sync->sync();
197 $this->
getLogger()->debug(
'Internal account: ' . $internal_account);
199 $this->
getLogger()->info(
'Login failed with message: ' . $e->getMessage());
204 $this->
getLogger()->info(
'Login failed with message: ' . $e->getMessage());
210 $this->
getLogger()->info(
'Authentication failed: account migration required for external account: ' . $this->
getCredentials()->getUsername());
Description of ilLDAPSyncronisationException.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
Interface of auth credentials.
Description of class interface.
__construct(\ilAuthCredentials $credentials)
Constructor.
handleLDAPDataSource(ilAuthStatus $status)
Handle ldap as data source.
Synchronization of user accounts used in auth container ldap, radius , cas,...
static _lookupId($a_user_str)
Lookup id by login.
migrateAccount(\ilAuthStatus $status)
Migrate existing account Maybe ldap sync has to be performed here.
getSettings()
Get setings.
Description of ilLDAPAccountMigrationRequiredException.
static getInstanceByServerId($a_server_id)
Get instance by server id.
setAuthenticatedUserId($a_id)
createNewAccount(\ilAuthStatus $status)
Create new account for account migration.
Base class for authentication providers (radius, ldap, apache, ...)
Standard interface for auth provider implementations.
setStatus($a_status)
Set auth status.
getTriggerAuthMode()
Get auth mode of current authentication type.
const APACHE_AUTH_TYPE_DIRECT_MAPPING
getExternalAccountName()
Get external account name.
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
getUserAuthModeName()
Get user auth mode name.
const STATUS_AUTHENTICATED
doAuthentication(\ilAuthStatus $status)
const APACHE_AUTH_TYPE_BY_FUNCTION
handleAuthenticationFail(ilAuthStatus $status, $a_reason)
Handle failed authentication.
const APACHE_AUTH_TYPE_EXTENDED_MAPPING
Auth status implementation.
setExternalAccountName($a_name)
Set external account name.
const STATUS_ACCOUNT_MIGRATION_REQUIRED