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'))
55 $this->
getLogger()->info(
'Apache auth disabled.');
61 !$this->
getSettings()->
get(
'apache_auth_indicator_name') ||
62 !$this->
getSettings()->
get(
'apache_auth_indicator_value')
65 $this->
getLogger()->warning(
'Apache auth indicator match failure.');
73 array_filter(array_map(
'trim', str_getcsv($this->
getSettings()->
get(
'apache_auth_indicator_value'))))
77 $this->
getLogger()->warning(
'Apache authentication failed (indicator name <-> value');
82 include_once
'./Services/Utilities/classes/class.ilUtil.php';
92 $this->
getLogger()->info(
'No username given');
98 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
113 $this->
getLogger()->info(
'Cannot find user id for external account: ' . $this->
getCredentials()->getUsername());
131 $this->force_new_account =
true;
132 if($this->
getSettings()->
get(
'apache_enable_ldap'))
144 $this->force_new_account =
true;
145 if($this->
getSettings()->
get(
'apache_enable_ldap'))
151 $this->
getSettings()->
get(
'apache_enable_local') &&
152 $this->
getSettings()->
get(
'apache_local_autocreate')
155 $this->
getLogger()->info(
'Creating new apache auth account');
156 include_once
'./Services/User/classes/class.ilObjUser.php';
160 $user->setLogin($login);
161 $user->setExternalAccount($this->
getCredentials()->getUsername());
162 $user->setProfileIncomplete(
true);
164 $user->setAuthMode(
'apache');
167 $user->setLastPasswordChangeTS(
time());
168 $user->setTimeLimitUnlimited(1);
174 $GLOBALS[
'DIC']->rbac()->admin()->assignUser(
175 $this->
getSettings()->
get(
'apache_default_role', 4),
201 $this->migration_account = $a_name;
219 return 'ldap_'.(string) $this->
getSettings()->get(
'apache_ldap_sid');
231 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
236 $this->
getLogger()->debug(
'Using ldap data source with server configuration: ' .
$server->getName());
238 include_once
'./Services/LDAP/classes/class.ilLDAPUserSynchronisation.php';
241 $sync->setUserData(
array());
242 $sync->forceCreation($this->force_new_account);
243 $sync->forceReadLdapData(
true);
246 $internal_account = $sync->sync();
247 $this->
getLogger()->debug(
'Internal account: ' . $internal_account);
250 $this->
getLogger()->info(
'Login failed with message: ' . $e->getMessage());
256 $this->
getLogger()->info(
'Login failed with message: ' . $e->getMessage());
263 $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.
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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.
setExternalAccount($a_ext)
Set external account (unique for each auth mode)
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.
Create styles array
The data for the language used.
getUserAuthModeName()
Get user auth mode name.
const STATUS_AUTHENTICATED
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
doAuthentication(\ilAuthStatus $status)
const APACHE_AUTH_TYPE_BY_FUNCTION
handleAuthenticationFail(ilAuthStatus $status, $a_reason)
Handle failed authentication.
const APACHE_AUTH_TYPE_EXTENDED_MAPPING
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Auth status implementation.
setExternalAccountName($a_name)
Set external account name.
const STATUS_ACCOUNT_MIGRATION_REQUIRED