Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes | Static Protected Attributes | Private Member Functions

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 <smeyer@databay.de>
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 $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.

Referenced by ilAuthMultiple::__construct(), ilAuthUtils::_getAuthModeOfUser(), ilObjAuthSettingsGUI::initAuthModeDetermination(), read(), ilStartUpGUI::showLogin(), and ilObjAuthSettingsGUI::updateAuthModeDeterminationObject().

        {
                if(self::$instance)
                {
                        return 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.

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.

        {
                return $this->kind == self::TYPE_MANUAL;
        }

ilAuthModeDetermination::read (  )  [private]

Read settings.

private

Parameters:
 

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

References ilLDAPServer::_getFirstActiveServer(), and _getInstance().

Referenced by __construct().

        {
                $this->kind = $this->settings->get('kind',self::TYPE_MANUAL);
                
                include_once('Services/LDAP/classes/class.ilLDAPServer.php');
                $ldap_active = ilLDAPServer::_getFirstActiveServer();
                
                include_once('Services/Radius/classes/class.ilRadiusSettings.php');
                $rad_settings = ilRadiusSettings::_getInstance();
                $rad_active = $rad_settings->isActive();
                
                
                // Check if active
                for($i = 0; $i < 3; $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;
                                                
                                        case AUTH_RADOIUS:
                                                if($rad_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;
                        }
                        
                }
        }

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:
array position => 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:
int TYPE_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 [static, protected]

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

ilAuthModeDetermination::$kind = 0 [protected]

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

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.

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

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


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