ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilAuthContainerApache Class Reference

Authentication against ILIAS database. More...

+ Inheritance diagram for ilAuthContainerApache:
+ Collaboration diagram for ilAuthContainerApache:

Public Member Functions

 __construct ()
 Constructor. More...
 

Static Public Member Functions

static forceCreation ($value)
 

Static Public Attributes

static $force_creation = false
 

Protected Member Functions

 updateRequired ($a_username)
 Check if an update is required. More...
 
 handleLDAPDataSource ($a_auth, $ext_account, $settings)
 Handle ldap as data source. More...
 

Private Member Functions

 initLDAPAttributeToUser ()
 Init LDAP attribute mapping private. More...
 

Detailed Description

Authentication against ILIAS database.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 12 of file class.ilAuthContainerApache.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthContainerApache::__construct ( )

Constructor.

Definition at line 22 of file class.ilAuthContainerApache.php.

23  {
24  parent::__construct();
25  }

Member Function Documentation

◆ forceCreation()

◆ handleLDAPDataSource()

ilAuthContainerApache::handleLDAPDataSource (   $a_auth,
  $ext_account,
  $settings 
)
protected

Handle ldap as data source.

Parameters
Auth$auth
string$ext_account

Definition at line 313 of file class.ilAuthContainerApache.php.

References $server, array, AUTH_RADIUS_NO_ILIAS_USER, ilLDAPServer\getInstanceByServerId(), ilLoggerFactory\getLogger(), ilUtil\redirect(), and ilLDAPUserSynchronisation\setExternalAccount().

Referenced by forceCreation().

314  {
315  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
317  $settings->get('apache_ldap_sid')
318  );
319 
320  ilLoggerFactory::getLogger('auth')->debug('Using ldap data source with server configuration: ' . $server->getName());
321 
322  include_once './Services/LDAP/classes/class.ilLDAPUserSynchronisation.php';
323  $sync = new ilLDAPUserSynchronisation('ldap_'.$server->getServerId(), $server->getServerId());
324  $sync->setExternalAccount($ext_account);
325  $sync->setUserData(array());
326  $sync->forceCreation(self::$force_creation);
327  $sync->forceReadLdapData(true);
328 
329  try {
330  $internal_account = $sync->sync();
331  }
332  catch(UnexpectedValueException $e) {
333  ilLoggerFactory::getLogger('auth')->info('Login failed with message: ' . $e->getMessage());
334  $a_auth->status = AUTH_WRONG_LOGIN;
335  $a_auth->logout();
336  return false;
337  }
339  // No syncronisation allowed => create Error
340  ilLoggerFactory::getLogger('auth')->info('Login failed with message: ' . $e->getMessage());
341  $a_auth->status = AUTH_RADIUS_NO_ILIAS_USER;
342  $a_auth->logout();
343  return false;
344  }
346  ilLoggerFactory::getLogger('auth')->debug('Starting account migration');
347  $a_auth->logout();
348  ilUtil::redirect('ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&cmd=showAccountMigration');
349  }
350 
351  $a_auth->setAuth($internal_account);
352  return true;
353  }
Synchronization of user accounts used in auth container ldap, radius , cas,...
const AUTH_RADIUS_NO_ILIAS_USER
setExternalAccount($a_ext)
Set external account (unique for each auth mode)
Description of ilLDAPAccountMigrationRequiredException.
static getInstanceByServerId($a_server_id)
Get instance by server id.
Create styles array
The data for the language used.
$server
static getLogger($a_component_id)
Get component logger.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initLDAPAttributeToUser()

ilAuthContainerApache::initLDAPAttributeToUser ( )
private

Init LDAP attribute mapping private.

Definition at line 301 of file class.ilAuthContainerApache.php.

Referenced by forceCreation().

302  {
303  include_once('Services/LDAP/classes/class.ilLDAPAttributeToUser.php');
304  $this->ldap_attr_to_user = new ilLDAPAttributeToUser($this->server);
305  }
Update/create ILIAS user account by given LDAP attributes according to user attribute mapping setting...
+ Here is the caller graph for this function:

◆ updateRequired()

ilAuthContainerApache::updateRequired (   $a_username)
protected

Check if an update is required.

Returns
Parameters
string$a_username

Definition at line 277 of file class.ilAuthContainerApache.php.

References ilObjUser\_checkExternalAuthAccount(), ilLDAPRoleAssignmentRule\hasRulesForUpdate(), and ilLDAPAttributeMapping\hasRulesForUpdate().

Referenced by forceCreation().

278  {
279  if(!ilObjUser::_checkExternalAuthAccount("ldap_".$this->server->getServerId(), $a_username))
280  {
281  return true;
282  }
283  // Check attribute mapping on login
284  include_once './Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
285  if(ilLDAPAttributeMapping::hasRulesForUpdate($this->server->getServerId()))
286  {
287  return true;
288  }
289  include_once './Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
291  {
292  return true;
293  }
294  return false;
295  }
static hasRulesForUpdate()
Check if there any rule for updates.
static hasRulesForUpdate($a_server_id)
Check if there is ldap attribute -> user data mapping which which is updated on login.
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $force_creation

ilAuthContainerApache::$force_creation = false
static

Definition at line 17 of file class.ilAuthContainerApache.php.


The documentation for this class was generated from the following file: