ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilShibbolethSettings Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilShibbolethSettings

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

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: shib_login.php:25
+ 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 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  }

◆ getAccountCreation()

ilShibbolethSettings::getAccountCreation ( )

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

172  : string
173  {
174  return $this->data['account_creation'] ?? self::ACCOUNT_CREATION_ENABLED;
175  }

◆ getAll()

ilShibbolethSettings::getAll ( )

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

References $data.

94  : array
95  {
96  return $this->data;
97  }

◆ getDefaultRole()

ilShibbolethSettings::getDefaultRole ( )

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

112  : int
113  {
114  return $this->data['user_default_role'] ?? 4;
115  }

◆ getFederationName()

ilShibbolethSettings::getFederationName ( )

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

182  : string
183  {
184  return ($this->data['federation_name'] ?? '');
185  }

◆ getIdPList()

ilShibbolethSettings::getIdPList ( )

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

122  : string
123  {
124  return $this->data['idp_list'] ?? self::DEFAULT_IDP_LIST;
125  }

◆ getLoginButton()

ilShibbolethSettings::getLoginButton ( )

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

132  : string
133  {
134  return $this->data['login_button'] ?? self::DEFAULT_LOGIN_BUTTON;
135  }

◆ getOrganisationSelectionType()

ilShibbolethSettings::getOrganisationSelectionType ( )

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

142  : string
143  {
144  return $this->data['hos_type'] ?? self::DEFAULT_ORGANISATION_SELECTION;
145  }

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

152  : bool
153  {
154  return (bool) ($this->data['active'] ?? false);
155  }

◆ isLocalAuthAllowed()

ilShibbolethSettings::isLocalAuthAllowed ( )

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

162  : bool
163  {
164  return (bool) ($this->data['auth_allow_local'] ?? false);
165  }

◆ read()

ilShibbolethSettings::read ( )

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

References 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 => str_starts_with($key, self::PREFIX),
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  }
+ 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 99 of file class.ilShibbolethSettings.php.

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

◆ setAccountCreation()

ilShibbolethSettings::setAccountCreation ( string  $value)

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

177  : void
178  {
179  $this->data['account_creation'] = $value;
180  }

◆ setActive()

ilShibbolethSettings::setActive ( bool  $status)

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

157  : void
158  {
159  $this->data['active'] = $status;
160  }

◆ setAllowLocalAuth()

ilShibbolethSettings::setAllowLocalAuth ( bool  $status)

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

167  : void
168  {
169  $this->data['auth_allow_local'] = $status;
170  }

◆ setDefaultRole()

ilShibbolethSettings::setDefaultRole ( int  $role_id)

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

117  : void
118  {
119  $this->data['user_default_role'] = $role_id;
120  }

◆ setFederationName()

ilShibbolethSettings::setFederationName ( string  $federation)

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

187  : void
188  {
189  $this->data['federation_name'] = $federation;
190  }

◆ setIdPList()

ilShibbolethSettings::setIdPList ( string  $list)

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

127  : void
128  {
129  $this->data['idp_list'] = $list;
130  }

◆ setLoginButton()

ilShibbolethSettings::setLoginButton ( string  $login_button)

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

137  : void
138  {
139  $this->data['login_button'] = $login_button;
140  }

◆ setOrganisationSelectionType()

ilShibbolethSettings::setOrganisationSelectionType ( string  $type)

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

147  : void
148  {
149  $this->data['hos_type'] = $type;
150  }

◆ store()

ilShibbolethSettings::store ( )

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

References ILIAS\Repository\settings().

105  : void
106  {
107  foreach ($this->data as $key => $value) {
108  $this->settings->set(self::PREFIX . $key, (string) $value);
109  }
110  }
+ 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().

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

◆ DEFAULT_LOGIN_BUTTON

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

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

◆ DEFAULT_ORGANISATION_SELECTION

const ilShibbolethSettings::DEFAULT_ORGANISATION_SELECTION = "external_wayf"
private

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

◆ PREFIX

const ilShibbolethSettings::PREFIX = 'shib_'
private

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


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