ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Certificate\StaticUrlHandler Class Reference
+ Inheritance diagram for ILIAS\Certificate\StaticUrlHandler:
+ Collaboration diagram for ILIAS\Certificate\StaticUrlHandler:

Public Member Functions

 __construct (?ilCtrlInterface $ctrl=null, ?ilSetting $certificate_settings=null, ?ilObjUser $user=null)
 
 getNamespace ()
 
 handle (Request $request, Context $context, Factory $response_factory)
 
- Public Member Functions inherited from ILIAS\StaticURL\Handler\BaseHandler
 __construct ()
 
 canHandle (Request $request)
 
- Public Member Functions inherited from ILIAS\StaticURL\Handler\Handler
 __construct ()
 
 getNamespace ()
 
 canHandle (Request $request)
 
 handle (Request $request, Context $context, Factory $response_factory)
 

Private Attributes

readonly ilCtrlInterface $ctrl
 
readonly ilSetting $certificate_settings
 
readonly ilObjUser $user
 

Detailed Description

Definition at line 36 of file StaticUrlHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Certificate\StaticUrlHandler::__construct ( ?ilCtrlInterface  $ctrl = null,
?ilSetting  $certificate_settings = null,
?ilObjUser  $user = null 
)

Definition at line 42 of file StaticUrlHandler.php.

46 {
47 global $DIC;
48
49 $this->ctrl = $ctrl ?? $DIC->ctrl();
50 $this->certificate_settings = $certificate_settings ?? new ilSetting('certificate');
51 $this->user = $user ?? $DIC->user();
52
54 }
readonly ilCtrlInterface $ctrl
ILIAS Setting Class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References ILIAS\Certificate\StaticUrlHandler\$certificate_settings, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getNamespace()

ILIAS\Certificate\StaticUrlHandler::getNamespace ( )

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 56 of file StaticUrlHandler.php.

56 : string
57 {
58 return 'cert';
59 }

◆ handle()

ILIAS\Certificate\StaticUrlHandler::handle ( Request  $request,
Context  $context,
Factory  $response_factory 
)

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 61 of file StaticUrlHandler.php.

61 : Response
62 {
63 if ($this->user->isAnonymous() || !$this->user->getId()) {
64 return $response_factory->loginFirst();
65 }
66
67 if (!$this->certificate_settings->get('active', '0')) {
68 return $response_factory->cannot();
69 }
70
71 $additional_params = implode('/', $request->getAdditionalParameters() ?? []);
72
73 return match ($additional_params) {
74 'list' => $response_factory->can($this->ctrl->getLinkTargetByClass(
75 [
76 ilDashboardGUI::class,
77 ilAchievementsGUI::class,
78 ilUserCertificateGUI::class,
79 ],
80 "listCertificates",
81 )),
82 default => $response_factory->cannot(),
83 };
84 }

References ILIAS\StaticURL\Response\Factory\can(), ILIAS\StaticURL\Response\Factory\cannot(), ILIAS\Repository\ctrl(), ILIAS\StaticURL\Request\Request\getAdditionalParameters(), ILIAS\StaticURL\Response\Factory\loginFirst(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $certificate_settings

readonly ilSetting ILIAS\Certificate\StaticUrlHandler::$certificate_settings
private

Definition at line 39 of file StaticUrlHandler.php.

Referenced by ILIAS\Certificate\StaticUrlHandler\__construct().

◆ $ctrl

readonly ilCtrlInterface ILIAS\Certificate\StaticUrlHandler::$ctrl
private

Definition at line 38 of file StaticUrlHandler.php.

◆ $user

readonly ilObjUser ILIAS\Certificate\StaticUrlHandler::$user
private

Definition at line 40 of file StaticUrlHandler.php.


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