ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAuthModeDetermination Class Reference
+ Collaboration diagram for ilAuthModeDetermination:

Public Member Functions

 isManualSelection ()
 is manual selection
 getKind ()
 get kind
 setKind ($a_kind)
 set kind of determination
 getAuthModeSequence ()
 get auth mode sequence
 getCountActiveAuthModes ()
 get number of auth modes
 setAuthModeSequence ($a_pos)
 set auth mode sequence
 save ()
 Save settings.

Static Public Member Functions

static _getInstance ()
 Get instance.

Data Fields

const TYPE_MANUAL = 0
const TYPE_AUTOMATIC = 1

Protected Attributes

 $db = null
 $settings = null
 $kind = 0
 $position = array()

Static Protected Attributes

static $instance = null

Private Member Functions

 __construct ()
 Constructor (Singleton)
 read ()
 Read settings.

Detailed Description

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

Definition at line 34 of file class.ilAuthModeDetermination.php.

Constructor & Destructor Documentation

ilAuthModeDetermination::__construct ( )
private

Constructor (Singleton)

private

Definition at line 54 of file class.ilAuthModeDetermination.php.

References $ilDB, $ilSetting, and read().

{
global $ilSetting,$ilDB;
$this->db = $ilDB;
include_once "./Services/Administration/classes/class.ilSetting.php";
$this->settings = new ilSetting("auth_mode_determination");
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilAuthModeDetermination::_getInstance ( )
static

Get instance.

public

Definition at line 72 of file class.ilAuthModeDetermination.php.

References $instance.

Referenced by ilAuthUtils\_getAuthModeOfUser(), ilAuthContainerMultiple\fetchData(), ilObjAuthSettingsGUI\initAuthModeDetermination(), read(), ilStartUpGUI\showLogin(), and ilObjAuthSettingsGUI\updateAuthModeDeterminationObject().

{
if(self::$instance)
{
}
return self::$instance = new ilAuthModeDetermination();
}

+ Here is the caller graph for this function:

ilAuthModeDetermination::getAuthModeSequence ( )

get auth mode sequence

public

Definition at line 123 of file class.ilAuthModeDetermination.php.

{
return $this->position ? $this->position : array();
}
ilAuthModeDetermination::getCountActiveAuthModes ( )

get number of auth modes

public

Definition at line 134 of file class.ilAuthModeDetermination.php.

{
return count($this->position);
}
ilAuthModeDetermination::getKind ( )

get kind

public

Definition at line 100 of file class.ilAuthModeDetermination.php.

References $kind.

Referenced by save().

{
return $this->kind;
}

+ Here is the caller graph for this function:

ilAuthModeDetermination::isManualSelection ( )

is manual selection

public

Parameters

Definition at line 89 of file class.ilAuthModeDetermination.php.

References TYPE_MANUAL.

{
return $this->kind == self::TYPE_MANUAL;
}
ilAuthModeDetermination::read ( )
private

Read settings.

private

Parameters

Definition at line 179 of file class.ilAuthModeDetermination.php.

References $ilSetting, ilLDAPServer\_getFirstActiveServer(), _getInstance(), AUTH_APACHE, AUTH_LDAP, AUTH_LOCAL, AUTH_RADIUS, and AUTH_SOAP.

Referenced by __construct().

{
global $ilSetting;
$this->kind = $this->settings->get('kind',self::TYPE_MANUAL);
include_once('Services/LDAP/classes/class.ilLDAPServer.php');
include_once('Services/Radius/classes/class.ilRadiusSettings.php');
$rad_settings = ilRadiusSettings::_getInstance();
$rad_active = $rad_settings->isActive();
$soap_active = $ilSetting->get('soap_auth_active',false);
// apache settings
$apache_settings = new ilSetting('apache_auth');
$apache_active = $apache_settings->get('apache_enable_auth');
// Check if active
for($i = 0; $i < 5; $i++)
{
if($auth_mode = $this->settings->get((string) $i,0))
{
switch($auth_mode)
{
case AUTH_LOCAL:
$this->position[] = $auth_mode;
break;
case AUTH_LDAP:
if($ldap_active)
{
$this->position[] = $auth_mode;
}
break;
if($rad_active)
{
$this->position[] = $auth_mode;
}
break;
case AUTH_SOAP:
if($soap_active)
{
$this->position[] = $auth_mode;
}
break;
if($apache_active)
{
$this->position[] = $auth_mode;
}
break;
}
}
}
// Append missing active auth modes
if(!in_array(AUTH_LOCAL,$this->position))
{
$this->position[] = AUTH_LOCAL;
}
if($ldap_active)
{
if(!in_array(AUTH_LDAP,$this->position))
{
$this->position[] = AUTH_LDAP;
}
}
if($rad_active)
{
if(!in_array(AUTH_RADIUS,$this->position))
{
$this->position[] = AUTH_RADIUS;
}
}
if($soap_active)
{
if(!in_array(AUTH_SOAP,$this->position))
{
$this->position[] = AUTH_SOAP;
}
}
if($apache_active)
{
if(!in_array(AUTH_APACHE,$this->position))
{
$this->position[] = AUTH_APACHE;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthModeDetermination::save ( )

Save settings.

public

Parameters

Definition at line 158 of file class.ilAuthModeDetermination.php.

References getKind().

{
$this->settings->deleteAll();
$this->settings->set('kind',$this->getKind());
$counter = 0;
foreach($this->position as $auth_mode)
{
$this->settings->set((string) $counter++,$auth_mode);
}
}

+ Here is the call graph for this function:

ilAuthModeDetermination::setAuthModeSequence (   $a_pos)

set auth mode sequence

public

Parameters
arrayposition => AUTH_MODE

Definition at line 146 of file class.ilAuthModeDetermination.php.

{
$this->position = $a_pos;
}
ilAuthModeDetermination::setKind (   $a_kind)

set kind of determination

public

Parameters
intTYPE_MANUAL or TYPE_DETERMINATION

Definition at line 112 of file class.ilAuthModeDetermination.php.

{
$this->kind = $a_kind;
}

Field Documentation

ilAuthModeDetermination::$db = null
protected

Definition at line 41 of file class.ilAuthModeDetermination.php.

ilAuthModeDetermination::$instance = null
staticprotected

Definition at line 39 of file class.ilAuthModeDetermination.php.

Referenced by _getInstance().

ilAuthModeDetermination::$kind = 0
protected

Definition at line 44 of file class.ilAuthModeDetermination.php.

Referenced by getKind().

ilAuthModeDetermination::$position = array()
protected

Definition at line 45 of file class.ilAuthModeDetermination.php.

ilAuthModeDetermination::$settings = null
protected

Definition at line 42 of file class.ilAuthModeDetermination.php.

const ilAuthModeDetermination::TYPE_AUTOMATIC = 1

Definition at line 37 of file class.ilAuthModeDetermination.php.

const ilAuthModeDetermination::TYPE_MANUAL = 0

Definition at line 36 of file class.ilAuthModeDetermination.php.

Referenced by isManualSelection().


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