ILIAS  trunk Revision v11.0_alpha-1871-gde1fee8db3d
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilShibbolethSettings Class Reference

Class ilShibbolethSettings. More...

+ Collaboration diagram for ilShibbolethSettings:

Public Member Functions

array __construct ()
 
 getUserFields ()
 
 read ()
 
 get (string $a_keyword, ?string $a_default_value=null)
 
 getAll ()
 
 set (string $a_key, string $a_val)
 
 store ()
 
 getDefaultRole ()
 
 setDefaultRole (int $role_id)
 
 getIdPList ()
 
 setIdPList (string $list)
 
 getLoginButton ()
 
 setLoginButton (string $login_button)
 
 getOrganisationSelectionType ()
 
 setOrganisationSelectionType (string $type)
 
 isActive ()
 
 setActive (bool $status)
 
 isLocalAuthAllowed ()
 
 setAllowLocalAuth (bool $status)
 
 getAccountCreation ()
 
 setAccountCreation (string $value)
 
 getFederationName ()
 
 setFederationName (string $federation)
 

Data Fields

const ACCOUNT_CREATION_ENABLED = "enabled"
 
const ACCOUNT_CREATION_WITH_APPROVAL = "with_approval"
 
const ACCOUNT_CREATION_DISABLED = "disabled"
 

Protected Attributes

ilSetting $settings
 
array $data = []
 
array $user_fields
 

Private Attributes

const PREFIX = 'shib_'
 
const DEFAULT_IDP_LIST = "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai"
 
const DEFAULT_LOGIN_BUTTON = "assets/images/auth/shib_login_button.svg"
 
const DEFAULT_ORGANISATION_SELECTION = "external_wayf"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

array ilShibbolethSettings::__construct ( )

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

References $DIC, read(), and ILIAS\Repository\settings().

55  {
56  global $DIC;
57 
58  $this->settings = $DIC->settings();
59  $this->read();
60  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ get()

ilShibbolethSettings::get ( string  $a_keyword,
?string  $a_default_value = null 
)

Definition at line 83 of file class.ilShibbolethSettings.php.

83  : string
84  {
85  $a_keyword = str_replace(self::PREFIX, '', $a_keyword);
86 
87  return (string) ($this->data[$a_keyword] ?? $a_default_value);
88  }

◆ getAccountCreation()

ilShibbolethSettings::getAccountCreation ( )

Definition at line 168 of file class.ilShibbolethSettings.php.

168  : string
169  {
170  return $this->data['account_creation'] ?? self::ACCOUNT_CREATION_ENABLED;
171  }

◆ getAll()

ilShibbolethSettings::getAll ( )

Definition at line 90 of file class.ilShibbolethSettings.php.

References $data.

90  : array
91  {
92  return $this->data;
93  }

◆ getDefaultRole()

ilShibbolethSettings::getDefaultRole ( )

Definition at line 108 of file class.ilShibbolethSettings.php.

108  : int
109  {
110  return $this->data['user_default_role'] ?? 4;
111  }

◆ getFederationName()

ilShibbolethSettings::getFederationName ( )

Definition at line 178 of file class.ilShibbolethSettings.php.

178  : string
179  {
180  return ($this->data['federation_name'] ?? '');
181  }

◆ getIdPList()

ilShibbolethSettings::getIdPList ( )

Definition at line 118 of file class.ilShibbolethSettings.php.

118  : string
119  {
120  return $this->data['idp_list'] ?? self::DEFAULT_IDP_LIST;
121  }

◆ getLoginButton()

ilShibbolethSettings::getLoginButton ( )

Definition at line 128 of file class.ilShibbolethSettings.php.

128  : string
129  {
130  return $this->data['login_button'] ?? self::DEFAULT_LOGIN_BUTTON;
131  }

◆ getOrganisationSelectionType()

ilShibbolethSettings::getOrganisationSelectionType ( )

Definition at line 138 of file class.ilShibbolethSettings.php.

138  : string
139  {
140  return $this->data['hos_type'] ?? self::DEFAULT_ORGANISATION_SELECTION;
141  }

◆ getUserFields()

ilShibbolethSettings::getUserFields ( )
Returns
array<string, bool>

Definition at line 65 of file class.ilShibbolethSettings.php.

References $user_fields.

65  : array
66  {
67  return $this->user_fields;
68  }

◆ isActive()

ilShibbolethSettings::isActive ( )

Definition at line 148 of file class.ilShibbolethSettings.php.

148  : bool
149  {
150  return (bool) ($this->data['active'] ?? false);
151  }

◆ isLocalAuthAllowed()

ilShibbolethSettings::isLocalAuthAllowed ( )

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

158  : bool
159  {
160  return (bool) ($this->data['auth_allow_local'] ?? false);
161  }

◆ read()

ilShibbolethSettings::read ( )

Definition at line 70 of file class.ilShibbolethSettings.php.

References null, and ILIAS\Repository\settings().

Referenced by __construct().

70  : void
71  {
72  $filtered_data = array_filter(
73  $this->settings->getAll(),
74  static fn($value, string $key): bool => str_starts_with($key, self::PREFIX),
75  ARRAY_FILTER_USE_BOTH
76  );
77 
78  array_walk($filtered_data, function ($v, string $k): void {
79  $this->data[str_replace(self::PREFIX, '', $k)] = $v === '' ? null : $v;
80  });
81  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set()

ilShibbolethSettings::set ( string  $a_key,
string  $a_val 
)

Definition at line 95 of file class.ilShibbolethSettings.php.

95  : void
96  {
97  $a_key = str_replace(self::PREFIX, '', $a_key);
98  $this->data[$a_key] = $a_val;
99  }

◆ setAccountCreation()

ilShibbolethSettings::setAccountCreation ( string  $value)

Definition at line 173 of file class.ilShibbolethSettings.php.

173  : void
174  {
175  $this->data['account_creation'] = $value;
176  }

◆ setActive()

ilShibbolethSettings::setActive ( bool  $status)

Definition at line 153 of file class.ilShibbolethSettings.php.

153  : void
154  {
155  $this->data['active'] = $status;
156  }

◆ setAllowLocalAuth()

ilShibbolethSettings::setAllowLocalAuth ( bool  $status)

Definition at line 163 of file class.ilShibbolethSettings.php.

163  : void
164  {
165  $this->data['auth_allow_local'] = $status;
166  }

◆ setDefaultRole()

ilShibbolethSettings::setDefaultRole ( int  $role_id)

Definition at line 113 of file class.ilShibbolethSettings.php.

113  : void
114  {
115  $this->data['user_default_role'] = $role_id;
116  }

◆ setFederationName()

ilShibbolethSettings::setFederationName ( string  $federation)

Definition at line 183 of file class.ilShibbolethSettings.php.

183  : void
184  {
185  $this->data['federation_name'] = $federation;
186  }

◆ setIdPList()

ilShibbolethSettings::setIdPList ( string  $list)

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

123  : void
124  {
125  $this->data['idp_list'] = $list;
126  }

◆ setLoginButton()

ilShibbolethSettings::setLoginButton ( string  $login_button)

Definition at line 133 of file class.ilShibbolethSettings.php.

133  : void
134  {
135  $this->data['login_button'] = $login_button;
136  }

◆ setOrganisationSelectionType()

ilShibbolethSettings::setOrganisationSelectionType ( string  $type)

Definition at line 143 of file class.ilShibbolethSettings.php.

143  : void
144  {
145  $this->data['hos_type'] = $type;
146  }

◆ store()

ilShibbolethSettings::store ( )

Definition at line 101 of file class.ilShibbolethSettings.php.

References ILIAS\Repository\settings().

101  : void
102  {
103  foreach ($this->data as $key => $value) {
104  $this->settings->set(self::PREFIX . $key, (string) $value);
105  }
106  }
+ Here is the call graph for this function:

Field Documentation

◆ $data

array ilShibbolethSettings::$data = []
protected

Definition at line 32 of file class.ilShibbolethSettings.php.

Referenced by getAll().

◆ $settings

ilSetting ilShibbolethSettings::$settings
protected

Definition at line 31 of file class.ilShibbolethSettings.php.

◆ $user_fields

array ilShibbolethSettings::$user_fields
protected
Initial value:
= [
'firstname' => true

Definition at line 35 of file class.ilShibbolethSettings.php.

Referenced by getUserFields().

◆ ACCOUNT_CREATION_DISABLED

const ilShibbolethSettings::ACCOUNT_CREATION_DISABLED = "disabled"

◆ ACCOUNT_CREATION_ENABLED

const ilShibbolethSettings::ACCOUNT_CREATION_ENABLED = "enabled"

◆ ACCOUNT_CREATION_WITH_APPROVAL

const ilShibbolethSettings::ACCOUNT_CREATION_WITH_APPROVAL = "with_approval"

◆ DEFAULT_IDP_LIST

const ilShibbolethSettings::DEFAULT_IDP_LIST = "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai"
private

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

◆ DEFAULT_LOGIN_BUTTON

const ilShibbolethSettings::DEFAULT_LOGIN_BUTTON = "assets/images/auth/shib_login_button.svg"
private

Definition at line 21 of file class.ilShibbolethSettings.php.

◆ DEFAULT_ORGANISATION_SELECTION

const ilShibbolethSettings::DEFAULT_ORGANISATION_SELECTION = "external_wayf"
private

Definition at line 25 of file class.ilShibbolethSettings.php.

◆ PREFIX

const ilShibbolethSettings::PREFIX = 'shib_'
private

Definition at line 13 of file class.ilShibbolethSettings.php.


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