32 include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
60 include_once
"./Services/Administration/classes/class.ilSetting.php";
61 $this->settings =
new ilSetting(
"auth_mode_determination");
76 return self::$instance;
91 return $this->kind == self::TYPE_MANUAL;
114 $this->kind = $a_kind;
125 if(!strlen($a_username))
127 return $this->position ? $this->position : array();
133 foreach($this->position as $auth_key)
135 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
141 if(strlen(
$server->getUsernameFilter()))
144 $pattern = str_replace(
'*',
'.*?',
$server->getUsernameFilter());
146 if(preg_match(
'/^'.$pattern.
'$/', $a_username))
149 array_unshift($sorted, $auth_key);
155 $sorted[] = $auth_key;
160 return (array) $sorted;
171 return count($this->position);
183 $this->position = $a_pos;
195 $this->settings->deleteAll();
197 $this->settings->set(
'kind',$this->
getKind());
200 foreach($this->position as $auth_mode)
202 $this->settings->set((
string) $counter++,$auth_mode);
218 $this->kind = $this->settings->get(
'kind',self::TYPE_MANUAL);
221 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
224 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
226 $rad_active = $rad_settings->isActive();
228 $soap_active = $ilSetting->get(
'soap_auth_active',
false);
231 $apache_settings =
new ilSetting(
'apache_auth');
232 $apache_active = $apache_settings->get(
'apache_enable_auth');
239 $auth_mode = $this->settings->get((
string) $i++,FALSE);
240 if($auth_mode === FALSE)
247 switch((
int) $auth_mode)
250 $this->position[] = $auth_mode;
259 $this->position[] = $auth_mode;
266 $this->position[] = $auth_mode;
273 $this->position[] = $auth_mode;
280 $this->position[] = $auth_mode;
288 if($pl->isAuthActive($auth_mode))
290 $this->position[] = $auth_mode;
312 if(!in_array(
AUTH_LDAP.
'_'.$sid, $this->position))
314 $this->position[] = (
AUTH_LDAP.
'_'.$sid);
345 foreach($pl->getAuthIds() as $auth_id)
347 if($pl->isAuthActive($auth_id))
349 if(!in_array($auth_id, $this->position))
351 $this->position[] = $auth_id;
setAuthModeSequence($a_pos)
set auth mode sequence
static _getActiveServerList()
Get active server list.
static getInstanceByServerId($a_server_id)
Get instance by server id.
isManualSelection()
is manual selection
static getAuthPlugins()
Get active enabled auth plugins.
static _getInstance()
singleton get instance
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
setKind($a_kind)
set kind of determination
__construct()
Constructor (Singleton)
static _getInstance()
Get instance.
getAuthModeSequence($a_username='')
get auth mode sequence
getCountActiveAuthModes()
get number of auth modes
static getLogger($a_component_id)
Get component logger.