ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjAuthSettings.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 public function __construct(int $a_id = 0, bool $a_call_by_reference = true)
24 {
25 $this->type = 'auth';
26 parent::__construct($a_id, $a_call_by_reference);
27 }
28
29 public function checkAuthSHIB(): bool
30 {
31 $settings = $this->ilias->getAllSettings();
32
33 if (!$settings['shib_hos_type'] || !isset($settings['shib_user_default_role']) || !$settings['shib_login']
34 || !$settings['shib_firstname'] || !$settings['shib_lastname']) {
35 return false;
36 }
37
38 $this->ilias->setSetting('shibboleth_active', '1');
39
40 return true;
41 }
42
43 public function checkAuthScript(): bool
44 {
45 $settings = $this->ilias->getAllSettings();
46
47 if (!$settings['auth_script_name']) {
48 return false;
49 }
50
51 $this->ilias->setSetting('script_active', '1');
52
53 return true;
54 }
55
56 public static function getAuthSettingsRefId(): int
57 {
58 $auth_settings_objects = ilObject::_getObjectsByType('auth');
59 $auth_settings_obj_id = (int) reset($auth_settings_objects)['obj_id'];
60 $auth_settings_ref_ids = ilObject::_getAllReferences($auth_settings_obj_id);
61
62 return (int) reset($auth_settings_ref_ids);
63 }
64}
__construct(int $a_id=0, bool $a_call_by_reference=true)
Class ilObject Basic functions for all objects.
static _getAllReferences(int $id)
get all reference ids for object ID
static _getObjectsByType(string $obj_type="", ?int $owner=null)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ilObjForumAdministration.