75 $this->db =
$GLOBALS[
'DIC']->database();
76 $this->idp_id = $a_idp_id;
78 if ($this->idp_id > 0) {
89 $idps = self::getActiveIdpList();
90 if (count($idps) > 0) {
91 return current($idps);
94 require_once
'Services/Saml/exceptions/class.ilSamlException.php';
95 throw new \ilSamlException(
'No active SAML IDP found');
104 if (!isset(self::$instances[$a_idp_id]) || !(self::$instances[$a_idp_id] instanceof
self)) {
105 self::$instances[$a_idp_id] =
new self($a_idp_id);
108 return self::$instances[$a_idp_id];
116 $query =
'SELECT * FROM saml_idp_settings WHERE idp_id = ' . $this->db->quote($this->
getIdpId(),
'integer');
118 while ($record = $this->db->fetchAssoc(
$res)) {
123 throw new \ilException(
'Could not find idp');
132 $this->
setIdpId($this->db->nextId(
'saml_idp_settings'));
156 public function delete()
158 require_once
'Services/Authentication/classes/External/UserAttributeMapping/class.ilExternalAuthUserAttributeMapping.php';
162 $this->db->manipulateF(
163 'UPDATE usr_data SET auth_mode = %s WHERE auth_mode = %s',
164 array(
'text',
'text'),
168 $this->db->manipulate(
'DELETE FROM saml_idp_settings WHERE idp_id = ' . $this->db->quote($this->getIdpId(),
'integer'));
194 $this->
setIdpId((
int) $record[
'idp_id']);
195 $this->
setActive((
bool) $record[
'is_active']);
221 $this->
setEntityId($metadata->getIdpMetadataParser()->getEntityId());
231 $GLOBALS[
'DIC']->logger()->auth()->write(__METHOD__ .
': No auth mode given..............');
235 $auth_arr = explode(
'_', $a_auth_mode);
236 return count($auth_arr) == 2 && $auth_arr[0] ==
AUTH_SAML && strlen($auth_arr[1]);
245 if (self::isAuthModeSaml($a_auth_mode)) {
246 $auth_arr = explode(
'_', $a_auth_mode);
260 foreach (self::getAllIdps() as
$idp) {
261 if ($idp->isActive()) {
276 $res = $DIC->database()->query(
'SELECT * FROM saml_idp_settings');
279 while (
$row = $DIC->database()->fetchAssoc(
$res)) {
295 $auth_arr = explode(
'_', $a_auth_key);
296 if (count((
array) $auth_arr) > 1) {
297 return 'saml_' . $auth_arr[1];
309 $auth_arr = explode(
'_', $a_auth_mode);
310 if (count((
array) $auth_arr) > 1) {
378 $this->allow_local_auth = (bool) $status;
394 $this->default_role_id = (int) $role_id;
402 $this->uid_claim = $claim;
418 $this->login_claim = $claim;
442 $this->sync_status = (bool)
$sync;
458 $this->account_migration_status = (int) $status;
static getIdpIdByAuthMode($a_auth_mode)
bindDbRecord(array $record)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getInstanceByIdpId($a_idp_id)
$metadata['__DYNAMIC:1__']
setDefaultRoleId($role_id)
Class ilExternalAuthUserAttributeMapping.
foreach($_POST as $key=> $value) $res
if(isset($_POST['submit'])) $form
Create styles array
The data for the language used.
setSynchronizationStatus($sync)
static isAuthModeSaml($a_auth_mode)
static getKeyByAuthMode($a_auth_mode)
static getAuthModeByKey($a_auth_key)
isAccountMigrationEnabled()
$account_migration_status
setLocalLocalAuthenticationStatus($status)
allowLocalAuthentication()
static getActiveIdpList()
isSynchronizationEnabled()
setAccountMigrationStatus($status)
static getFirstActiveIdp()