ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ILIAS\User\StaticURLHandler Class Reference
+ Inheritance diagram for ILIAS\User\StaticURLHandler:
+ Collaboration diagram for ILIAS\User\StaticURLHandler:

Public Member Functions

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

Data Fields

const NAMESPACE = 'usr'
 
const CHANGE_EMAIL_OPERATION = 'email'
 
const REGISTRATION_OPERATION = 'registration'
 
const USERNAME_ASSIST_OPERATION = 'nameassist'
 
const PASSWORD_ASSIST_OPERATION = 'pwassist'
 
const DEL_OWN_ACCOUNT_OPERATION = 'delown'
 
const CONTACT_APPROVE_OPERATION = '_contact_approved'
 
const CONTACT_IGNORE_OPERATION = '_contact_ignored'
 

Private Member Functions

 buildChangeEmailUrl (string $token, \ilCtrl $ctrl)
 
 getLoginUrl (Request $request, Context $context)
 
 buildDeleteUsrUrl (Context $context)
 
 getRedirectToOtherComponentsOrProfile (\ilCtrl $ctrl, ?ReferenceId $target_user_id, string $cmd)
 
 buildProfileUrl (\ilCtrl $ctrl, ?ReferenceId $target_user_id, string $cmd)
 

Private Attributes

readonly LegalDocumentsConductor $legal_documents
 
readonly ilObjUser $user
 
readonly StartingPointRepository $starting_point_repository
 

Detailed Description

Definition at line 40 of file StaticURLHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\StaticURLHandler::__construct ( )

Reimplemented from ILIAS\StaticURL\Handler\BaseHandler.

Definition at line 55 of file StaticURLHandler.php.

56 {
57 global $DIC;
58 $this->legal_documents = $DIC['legalDocuments'];
59 $this->user = $DIC['ilUser'];
60 $this->starting_point_repository = LocalDIC::dic()[StartingPointRepository::class];
61 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\User\LocalDIC\dic(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildChangeEmailUrl()

ILIAS\User\StaticURLHandler::buildChangeEmailUrl ( string  $token,
\ilCtrl  $ctrl 
)
private

Definition at line 113 of file StaticURLHandler.php.

113 : string
114 {
115 $ctrl->setParameterByClass(PersonalProfileGUI::class, 'token', $token);
116 $link = $ctrl->getLinkTargetByClass([\ilDashboardGUI::class, PersonalProfileGUI::class], PersonalProfileGUI::CHANGE_EMAIL_CMD);
117 $ctrl->clearParameterByClass(PersonalProfileGUI::class, 'token');
118 return $link;
119 }
$token
Definition: xapitoken.php:67

References $token, ILIAS\User\Profile\PersonalProfileGUI\CHANGE_EMAIL_CMD, ilCtrl\clearParameterByClass(), ilCtrl\getLinkTargetByClass(), and ilCtrl\setParameterByClass().

Referenced by ILIAS\User\StaticURLHandler\handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildDeleteUsrUrl()

ILIAS\User\StaticURLHandler::buildDeleteUsrUrl ( Context  $context)
private

Definition at line 137 of file StaticURLHandler.php.

139 : string {
140 if ($context->getUserId() !== ANONYMOUS_USER_ID
141 && $this->user->hasDeletionFlag()) {
142 $context->ctrl()->setTargetScript('ilias.php');
143 return $context->ctrl()->getLinkTargetByClass(
144 [\ilDashboardGUI::class, PersonalSettingsGUI::class, DeleteAccountGUI::class],
145 'deleteOwnAccountStep2'
146 );
147 }
148
149 $context->mainTemplate()->setOnScreenMessage(
150 'failure',
151 $context->lng()->txt('account_not_flagged_for_deletion'),
152 true
153 );
154 return $this->starting_point_repository->getValidAndAccessibleStartingPointAsUrl();
155 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References ILIAS\StaticURL\Context\ctrl().

Referenced by ILIAS\User\StaticURLHandler\handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildProfileUrl()

ILIAS\User\StaticURLHandler::buildProfileUrl ( \ilCtrl  $ctrl,
?ReferenceId  $target_user_id,
string  $cmd 
)
private

Definition at line 189 of file StaticURLHandler.php.

193 : string {
194 if ($target_user_id === null) {
195 return $ctrl->getLinkTargetByClass(
196 [\ilDashboardGUI::class],
197 'jumpToProfile'
198 );
199 }
200 $ctrl->setParameterByClass(PublicProfileGUI::class, 'user_id', $target_user_id->toInt());
201 return $ctrl->getLinkTargetByClass([\ilPublicProfileBaseClassGUI::class, PublicProfileGUI::class], $cmd);
202 }

References ilCtrl\getLinkTargetByClass().

Referenced by ILIAS\User\StaticURLHandler\handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLoginUrl()

ILIAS\User\StaticURLHandler::getLoginUrl ( Request  $request,
Context  $context 
)
private

Definition at line 121 of file StaticURLHandler.php.

124 : string {
125 $target = (new StandardURIBuilder(new StaticURLConfig()))->buildTarget(
126 $request->getNamespace(),
127 $request->getReferenceId(),
128 $request->getAdditionalParameters()
129 );
130
131 return '/login.php?target='
132 . str_replace('/', '_', rtrim($target, '/'))
133 . '&cmd=force_login&lang=' . $context->getUserLanguage();
134
135 }

Referenced by ILIAS\User\StaticURLHandler\handle().

+ Here is the caller graph for this function:

◆ getNamespace()

ILIAS\User\StaticURLHandler::getNamespace ( )

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 63 of file StaticURLHandler.php.

63 : string
64 {
65 return self::NAMESPACE;
66 }

References ILIAS\User\StaticURLHandler\NAMESPACE.

◆ getRedirectToOtherComponentsOrProfile()

ILIAS\User\StaticURLHandler::getRedirectToOtherComponentsOrProfile ( \ilCtrl  $ctrl,
?ReferenceId  $target_user_id,
string  $cmd 
)
private

Definition at line 157 of file StaticURLHandler.php.

161 : string {
162 if (str_starts_with($cmd, '_bdg')) {
163 return $ctrl->getLinkTargetByClass(\ilDashboardGUI::class, 'jumpToBadges');
164 }
165
166 $legal_documents_target = $this->legal_documents->findGotoLink($cmd);
167 if ($legal_documents_target->isOK()) {
168 $ctrl->setTargetScript('ilias.php');
169 foreach ($legal_documents_target->value()->queryParams() as $key => $value) {
170 $ctrl->setParameterByClass(
171 $legal_documents_target->value()->guiName(),
172 (string) $key,
173 $value
174 );
175 }
176 return $ctrl->getLinkTargetByClass(
177 $legal_documents_target->value()->guiPath(),
178 $legal_documents_target->value()->command()
179 );
180 }
181
182 return $this->buildProfileUrl(
183 $ctrl,
184 $target_user_id,
186 );
187 }
buildProfileUrl(\ilCtrl $ctrl, ?ReferenceId $target_user_id, string $cmd)

References ilCtrl\getLinkTargetByClass().

Referenced by ILIAS\User\StaticURLHandler\handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle()

ILIAS\User\StaticURLHandler::handle ( Request  $request,
Context  $context,
Factory  $response_factory 
)

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 68 of file StaticURLHandler.php.

72 : Response {
73 $additional_params = $request->getAdditionalParameters();
74 $cmd = $additional_params[0] ?? '';
75
76 $uri = match ($cmd) {
77 self::CHANGE_EMAIL_OPERATION => $context->isUserLoggedIn()
78 ? $this->buildChangeEmailUrl($additional_params[1], $context->ctrl())
79 : $this->getLoginUrl($request, $context),
80 self::REGISTRATION_OPERATION => $context->ctrl()->redirectByClass(
81 [\ilStartUpGUI::class, \ilAccountRegistrationGUI::class],
82 ''
83 ),
84 self::USERNAME_ASSIST_OPERATION => $context->ctrl()->redirectByClass(
85 [\ilStartUpGUI::class, \ilPasswordAssistanceGUI::class],
86 'showUsernameAssistanceForm'
87 ),
88 self::PASSWORD_ASSIST_OPERATION => $context->ctrl()->redirectByClass(
89 [\ilStartUpGUI::class, \ilPasswordAssistanceGUI::class],
90 ''
91 ),
93 $context->ctrl(),
94 $request->getReferenceId(),
95 'approveContactRequest'
96 ),
98 $context->ctrl(),
99 $request->getReferenceId(),
100 'ignoreContactRequest'
101 ),
102 self::DEL_OWN_ACCOUNT_OPERATION => $this->buildDeleteUsrUrl($context),
104 $context->ctrl(),
105 $request->getReferenceId(),
106 $cmd
107 )
108 };
109
110 return $response_factory->can($uri);
111 }
can(string $uri_path, bool $shift=false)
Definition: Factory.php:47
buildChangeEmailUrl(string $token, \ilCtrl $ctrl)
getRedirectToOtherComponentsOrProfile(\ilCtrl $ctrl, ?ReferenceId $target_user_id, string $cmd)
buildDeleteUsrUrl(Context $context)
getLoginUrl(Request $request, Context $context)
@ilCtrl_Calls ilAccountRegistrationGUI:
@ilCtrl_Calls ilStartUpGUI: ilAccountRegistrationGUI, ilPasswordAssistanceGUI, ilLoginPageGUI,...

References ILIAS\User\StaticURLHandler\buildChangeEmailUrl(), ILIAS\User\StaticURLHandler\buildDeleteUsrUrl(), ILIAS\User\StaticURLHandler\buildProfileUrl(), ILIAS\StaticURL\Context\ctrl(), ILIAS\User\StaticURLHandler\getLoginUrl(), ILIAS\User\StaticURLHandler\getRedirectToOtherComponentsOrProfile(), ILIAS\StaticURL\Request\Request\getReferenceId(), and ILIAS\StaticURL\Context\isUserLoggedIn().

+ Here is the call graph for this function:

Field Documentation

◆ $legal_documents

readonly LegalDocumentsConductor ILIAS\User\StaticURLHandler::$legal_documents
private

Definition at line 51 of file StaticURLHandler.php.

◆ $starting_point_repository

readonly StartingPointRepository ILIAS\User\StaticURLHandler::$starting_point_repository
private

Definition at line 53 of file StaticURLHandler.php.

◆ $user

readonly ilObjUser ILIAS\User\StaticURLHandler::$user
private

Definition at line 52 of file StaticURLHandler.php.

◆ CHANGE_EMAIL_OPERATION

const ILIAS\User\StaticURLHandler::CHANGE_EMAIL_OPERATION = 'email'

Definition at line 43 of file StaticURLHandler.php.

◆ CONTACT_APPROVE_OPERATION

const ILIAS\User\StaticURLHandler::CONTACT_APPROVE_OPERATION = '_contact_approved'

Definition at line 48 of file StaticURLHandler.php.

◆ CONTACT_IGNORE_OPERATION

const ILIAS\User\StaticURLHandler::CONTACT_IGNORE_OPERATION = '_contact_ignored'

Definition at line 49 of file StaticURLHandler.php.

◆ DEL_OWN_ACCOUNT_OPERATION

const ILIAS\User\StaticURLHandler::DEL_OWN_ACCOUNT_OPERATION = 'delown'

◆ NAMESPACE

const ILIAS\User\StaticURLHandler::NAMESPACE = 'usr'

◆ PASSWORD_ASSIST_OPERATION

const ILIAS\User\StaticURLHandler::PASSWORD_ASSIST_OPERATION = 'pwassist'

Definition at line 46 of file StaticURLHandler.php.

◆ REGISTRATION_OPERATION

const ILIAS\User\StaticURLHandler::REGISTRATION_OPERATION = 'registration'

Definition at line 44 of file StaticURLHandler.php.

◆ USERNAME_ASSIST_OPERATION

const ILIAS\User\StaticURLHandler::USERNAME_ASSIST_OPERATION = 'nameassist'

Definition at line 45 of file StaticURLHandler.php.


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