ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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)
 
 adminMustActivate ()
 
 setAdminMustActivate (bool $status)
 
 getFederationName ()
 
 setFederationName (string $federation)
 

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 = "templates/default/images/auth/shib_login_button.svg"
 
const DEFAULT_ORGANISATION_SELECTION = "external_wayf"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

array ilShibbolethSettings::__construct ( )

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

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

59  {
60  global $DIC;
61 
62  $this->settings = $DIC->settings();
63  $this->read();
64  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ adminMustActivate()

ilShibbolethSettings::adminMustActivate ( )

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

176  : bool
177  {
178  return (bool) ($this->data['activate_new'] ?? false);
179  }

◆ get()

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

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

87  : string
88  {
89  $a_keyword = str_replace(self::PREFIX, '', $a_keyword);
90 
91  return (string) ($this->data[$a_keyword] ?? $a_default_value);
92  }

◆ getAll()

ilShibbolethSettings::getAll ( )
Returns
mixed[]

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

References $data.

98  : array
99  {
100  return $this->data;
101  }

◆ getDefaultRole()

ilShibbolethSettings::getDefaultRole ( )

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

116  : int
117  {
118  return $this->data['user_default_role'] ?? 4;
119  }

◆ getFederationName()

ilShibbolethSettings::getFederationName ( )

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

186  : string
187  {
188  return ($this->data['federation_name'] ?? '');
189  }

◆ getIdPList()

ilShibbolethSettings::getIdPList ( )

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

126  : string
127  {
128  return $this->data['idp_list'] ?? self::DEFAULT_IDP_LIST;
129  }

◆ getLoginButton()

ilShibbolethSettings::getLoginButton ( )

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

136  : string
137  {
138  return $this->data['login_button'] ?? self::DEFAULT_LOGIN_BUTTON;
139  }

◆ getOrganisationSelectionType()

ilShibbolethSettings::getOrganisationSelectionType ( )

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

146  : string
147  {
148  return $this->data['hos_type'] ?? self::DEFAULT_ORGANISATION_SELECTION;
149  }

◆ getUserFields()

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

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

References $user_fields.

69  : array
70  {
71  return $this->user_fields;
72  }

◆ isActive()

ilShibbolethSettings::isActive ( )

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

156  : bool
157  {
158  return (bool) ($this->data['active'] ?? false);
159  }

◆ isLocalAuthAllowed()

ilShibbolethSettings::isLocalAuthAllowed ( )

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

166  : bool
167  {
168  return (bool) ($this->data['auth_allow_local'] ?? false);
169  }

◆ read()

ilShibbolethSettings::read ( )

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

References ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\settings().

Referenced by __construct().

74  : void
75  {
76  $filtered_data = array_filter(
77  $this->settings->getAll(),
78  static fn ($value, string $key): bool => strpos($key, self::PREFIX) === 0,
79  ARRAY_FILTER_USE_BOTH
80  );
81 
82  array_walk($filtered_data, function ($v, string $k): void {
83  $this->data[str_replace(self::PREFIX, '', $k)] = $v === '' ? null : $v;
84  });
85  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ 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 103 of file class.ilShibbolethSettings.php.

103  : void
104  {
105  $a_key = str_replace(self::PREFIX, '', $a_key);
106  $this->data[$a_key] = $a_val;
107  }

◆ setActive()

ilShibbolethSettings::setActive ( bool  $status)

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

161  : void
162  {
163  $this->data['active'] = $status ? '1' : '0';
164  }

◆ setAdminMustActivate()

ilShibbolethSettings::setAdminMustActivate ( bool  $status)

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

181  : void
182  {
183  $this->data['activate_new'] = $status ? '1' : '0';
184  }

◆ setAllowLocalAuth()

ilShibbolethSettings::setAllowLocalAuth ( bool  $status)

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

171  : void
172  {
173  $this->data['auth_allow_local'] = $status ? '1' : '0';
174  }

◆ setDefaultRole()

ilShibbolethSettings::setDefaultRole ( int  $role_id)

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

121  : void
122  {
123  $this->data['user_default_role'] = $role_id;
124  }

◆ setFederationName()

ilShibbolethSettings::setFederationName ( string  $federation)

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

191  : void
192  {
193  $this->data['federation_name'] = $federation;
194  }

◆ setIdPList()

ilShibbolethSettings::setIdPList ( string  $list)

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

131  : void
132  {
133  $this->data['idp_list'] = $list;
134  }

◆ setLoginButton()

ilShibbolethSettings::setLoginButton ( string  $login_button)

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

141  : void
142  {
143  $this->data['login_button'] = $login_button;
144  }

◆ setOrganisationSelectionType()

ilShibbolethSettings::setOrganisationSelectionType ( string  $type)

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

151  : void
152  {
153  $this->data['hos_type'] = $type;
154  }

◆ store()

ilShibbolethSettings::store ( )

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

References ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\settings().

109  : void
110  {
111  foreach ($this->data as $key => $value) {
112  $this->settings->set(self::PREFIX . $key, (string) $value);
113  }
114  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

Field Documentation

◆ $data

array ilShibbolethSettings::$data = []
protected

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

Referenced by getAll().

◆ $settings

ilSetting ilShibbolethSettings::$settings
protected

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

◆ $user_fields

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

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

Referenced by getUserFields().

◆ 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 31 of file class.ilShibbolethSettings.php.

◆ DEFAULT_LOGIN_BUTTON

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

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

◆ DEFAULT_ORGANISATION_SELECTION

const ilShibbolethSettings::DEFAULT_ORGANISATION_SELECTION = "external_wayf"
private

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

◆ PREFIX

const ilShibbolethSettings::PREFIX = 'shib_'
private

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


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