ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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)
 
 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/shib_login_button.svg"
 
const DEFAULT_ORGANISATION_SELECTION = "external_wayf"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

array ilShibbolethSettings::__construct ( )

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

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

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

Member Function Documentation

◆ adminMustActivate()

ilShibbolethSettings::adminMustActivate ( )

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

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

◆ get()

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

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

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

◆ getAll()

ilShibbolethSettings::getAll ( )
Returns
mixed[]

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

References $data.

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

◆ getDefaultRole()

ilShibbolethSettings::getDefaultRole ( )

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

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

◆ getFederationName()

ilShibbolethSettings::getFederationName ( )

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

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

◆ getIdPList()

ilShibbolethSettings::getIdPList ( )

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

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

◆ getLoginButton()

ilShibbolethSettings::getLoginButton ( )

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

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

◆ getOrganisationSelectionType()

ilShibbolethSettings::getOrganisationSelectionType ( )

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

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

◆ getUserFields()

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

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

References $user_fields.

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

◆ isActive()

ilShibbolethSettings::isActive ( )

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

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

◆ isLocalAuthAllowed()

ilShibbolethSettings::isLocalAuthAllowed ( )

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

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

◆ read()

ilShibbolethSettings::read ( )

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

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

Referenced by __construct().

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

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

◆ setActive()

ilShibbolethSettings::setActive ( bool  $status)

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

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

◆ setAdminMustActivate()

ilShibbolethSettings::setAdminMustActivate ( bool  $status)

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

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

◆ setAllowLocalAuth()

ilShibbolethSettings::setAllowLocalAuth ( bool  $status)

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

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

◆ setDefaultRole()

ilShibbolethSettings::setDefaultRole ( int  $role_id)

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

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

◆ setFederationName()

ilShibbolethSettings::setFederationName ( string  $federation)

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

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

◆ setIdPList()

ilShibbolethSettings::setIdPList ( string  $list)

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

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

◆ setLoginButton()

ilShibbolethSettings::setLoginButton ( string  $login_button)

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

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

◆ setOrganisationSelectionType()

ilShibbolethSettings::setOrganisationSelectionType ( string  $type)

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

References $type.

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

◆ store()

ilShibbolethSettings::store ( )

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

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

108  : void
109  {
110  foreach ($this->data as $key => $value) {
111  $this->settings->set(self::PREFIX . $key, (string) $value);
112  }
113  }
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 35 of file class.ilShibbolethSettings.php.

Referenced by getAll().

◆ $settings

ilSetting ilShibbolethSettings::$settings
protected

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

◆ $user_fields

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

Definition at line 38 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 30 of file class.ilShibbolethSettings.php.

◆ DEFAULT_LOGIN_BUTTON

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

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

◆ DEFAULT_ORGANISATION_SELECTION

const ilShibbolethSettings::DEFAULT_ORGANISATION_SELECTION = "external_wayf"
private

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

◆ PREFIX

const ilShibbolethSettings::PREFIX = 'shib_'
private

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


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