ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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

 __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()

ilShibbolethSettings::__construct ( )

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

71 {
72 global $DIC;
73
74 $this->settings = $DIC->settings();
75 $this->read();
76 }
global $DIC
Definition: shib_login.php:26

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

+ 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 99 of file class.ilShibbolethSettings.php.

99 : string
100 {
101 $a_keyword = str_replace(self::PREFIX, '', $a_keyword);
102
103 return (string) ($this->data[$a_keyword] ?? $a_default_value);
104 }

◆ getAccountCreation()

ilShibbolethSettings::getAccountCreation ( )

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

184 : string
185 {
186 return $this->data['account_creation'] ?? self::ACCOUNT_CREATION_ENABLED;
187 }

References ACCOUNT_CREATION_ENABLED.

◆ getAll()

ilShibbolethSettings::getAll ( )

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

106 : array
107 {
108 return $this->data;
109 }

References $data.

◆ getDefaultRole()

ilShibbolethSettings::getDefaultRole ( )

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

124 : int
125 {
126 return $this->data['user_default_role'] ?? 4;
127 }

◆ getFederationName()

ilShibbolethSettings::getFederationName ( )

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

194 : string
195 {
196 return ($this->data['federation_name'] ?? '');
197 }

◆ getIdPList()

ilShibbolethSettings::getIdPList ( )

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

134 : string
135 {
136 return $this->data['idp_list'] ?? self::DEFAULT_IDP_LIST;
137 }

References DEFAULT_IDP_LIST.

◆ getLoginButton()

ilShibbolethSettings::getLoginButton ( )

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

144 : string
145 {
146 return $this->data['login_button'] ?? self::DEFAULT_LOGIN_BUTTON;
147 }

References DEFAULT_LOGIN_BUTTON.

◆ getOrganisationSelectionType()

ilShibbolethSettings::getOrganisationSelectionType ( )

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

154 : string
155 {
156 return $this->data['hos_type'] ?? self::DEFAULT_ORGANISATION_SELECTION;
157 }

References DEFAULT_ORGANISATION_SELECTION.

◆ getUserFields()

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

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

81 : array
82 {
83 return $this->user_fields;
84 }

References $user_fields.

◆ isActive()

ilShibbolethSettings::isActive ( )

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

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

◆ isLocalAuthAllowed()

ilShibbolethSettings::isLocalAuthAllowed ( )

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

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

◆ read()

ilShibbolethSettings::read ( )

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

86 : void
87 {
88 $filtered_data = array_filter(
89 $this->settings->getAll(),
90 static fn($value, string $key): bool => str_starts_with($key, self::PREFIX),
91 ARRAY_FILTER_USE_BOTH
92 );
93
94 array_walk($filtered_data, function ($v, string $k): void {
95 $this->data[str_replace(self::PREFIX, '', $k)] = $v === '' ? null : $v;
96 });
97 }

References ILIAS\Repository\settings().

Referenced by __construct().

+ 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 111 of file class.ilShibbolethSettings.php.

111 : void
112 {
113 $a_key = str_replace(self::PREFIX, '', $a_key);
114 $this->data[$a_key] = $a_val;
115 }

◆ setAccountCreation()

ilShibbolethSettings::setAccountCreation ( string  $value)

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

189 : void
190 {
191 $this->data['account_creation'] = $value;
192 }

◆ setActive()

ilShibbolethSettings::setActive ( bool  $status)

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

169 : void
170 {
171 $this->data['active'] = $status;
172 }

◆ setAllowLocalAuth()

ilShibbolethSettings::setAllowLocalAuth ( bool  $status)

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

179 : void
180 {
181 $this->data['auth_allow_local'] = $status;
182 }

◆ setDefaultRole()

ilShibbolethSettings::setDefaultRole ( int  $role_id)

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

129 : void
130 {
131 $this->data['user_default_role'] = $role_id;
132 }

◆ setFederationName()

ilShibbolethSettings::setFederationName ( string  $federation)

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

199 : void
200 {
201 $this->data['federation_name'] = $federation;
202 }

◆ setIdPList()

ilShibbolethSettings::setIdPList ( string  $list)

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

139 : void
140 {
141 $this->data['idp_list'] = $list;
142 }

◆ setLoginButton()

ilShibbolethSettings::setLoginButton ( string  $login_button)

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

149 : void
150 {
151 $this->data['login_button'] = $login_button;
152 }

◆ setOrganisationSelectionType()

ilShibbolethSettings::setOrganisationSelectionType ( string  $type)

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

159 : void
160 {
161 $this->data['hos_type'] = $type;
162 }

◆ store()

ilShibbolethSettings::store ( )

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

117 : void
118 {
119 foreach ($this->data as $key => $value) {
120 $this->settings->set(self::PREFIX . $key, (string) $value);
121 }
122 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

Field Documentation

◆ $data

array ilShibbolethSettings::$data = []
protected

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

Referenced by getAll().

◆ $settings

ilSetting ilShibbolethSettings::$settings
protected

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

◆ $user_fields

array ilShibbolethSettings::$user_fields
protected
Initial value:
= [
'firstname' => true,
'lastname' => true,
'email' => true,
'title' => false,
'gender' => false,
'institution' => false,
'department' => false,
'zipcode' => false,
'city' => false,
'country' => false,
'street' => false,
'phone_office' => false,
'phone_home' => false,
'phone_mobile' => false,
'language' => false,
'matriculation' => false,
]

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

Referenced by getIdPList().

◆ DEFAULT_LOGIN_BUTTON

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

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

Referenced by getLoginButton().

◆ DEFAULT_ORGANISATION_SELECTION

const ilShibbolethSettings::DEFAULT_ORGANISATION_SELECTION = "external_wayf"
private

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

Referenced by getOrganisationSelectionType().

◆ 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: