ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\User\StaticURLHandler Class Reference
+ Inheritance diagram for ILIAS\User\StaticURLHandler:
+ Collaboration diagram for ILIAS\User\StaticURLHandler:

Public Member Functions

 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

 legalDocuments ()
 
 user ()
 
 startingPointRepository ()
 
 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

LegalDocumentsConductor $legal_documents = null
 
ilObjUser $user = null
 
StartingPointRepository $starting_point_repository = null
 

Detailed Description

Definition at line 40 of file StaticURLHandler.php.

Member Function Documentation

◆ buildChangeEmailUrl()

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

Definition at line 129 of file StaticURLHandler.php.

129 : string
130 {
131 $ctrl->setParameterByClass(PersonalProfileGUI::class, 'token', $token);
132 $link = $ctrl->getLinkTargetByClass([\ilDashboardGUI::class, PersonalProfileGUI::class], PersonalProfileGUI::CHANGE_EMAIL_CMD);
133 $ctrl->clearParameterByClass(PersonalProfileGUI::class, 'token');
134 return $link;
135 }
$token
Definition: xapitoken.php:69

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 153 of file StaticURLHandler.php.

155 : string {
156 if ($context->getUserId() !== ANONYMOUS_USER_ID
157 && $this->user()->hasDeletionFlag()) {
158 $context->ctrl()->setTargetScript('ilias.php');
159 return $context->ctrl()->getLinkTargetByClass(
160 [\ilDashboardGUI::class, PersonalSettingsGUI::class, DeleteAccountGUI::class],
161 'deleteOwnAccountStep2'
162 );
163 }
164
165 $context->mainTemplate()->setOnScreenMessage(
166 'failure',
167 $context->lng()->txt('account_not_flagged_for_deletion'),
168 true
169 );
170 return $this->startingPointRepository()->getValidAndAccessibleStartingPointAsUrl();
171 }
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 205 of file StaticURLHandler.php.

209 : string {
210 if ($target_user_id === null) {
211 return $ctrl->getLinkTargetByClass(
212 [\ilDashboardGUI::class],
213 'jumpToProfile'
214 );
215 }
216 $ctrl->setParameterByClass(PublicProfileGUI::class, 'user_id', $target_user_id->toInt());
217 return $ctrl->getLinkTargetByClass([\ilPublicProfileBaseClassGUI::class, PublicProfileGUI::class], $cmd);
218 }

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 137 of file StaticURLHandler.php.

140 : string {
141 $target = (new StandardURIBuilder(new StaticURLConfig()))->buildTarget(
142 $request->getNamespace(),
143 $request->getReferenceId(),
144 $request->getAdditionalParameters()
145 );
146
147 return '/login.php?target='
148 . str_replace('/', '_', rtrim($target, '/'))
149 . '&cmd=force_login&lang=' . $context->getUserLanguage();
150
151 }
$request
@ilCtrl_Calls ilObjLearningSequenceContentGUI: ilObjLearningSequenceConditionsGUI
Definition: ltiauth.php:39

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 79 of file StaticURLHandler.php.

79 : string
80 {
81 return self::NAMESPACE;
82 }

References ILIAS\User\StaticURLHandler\NAMESPACE.

◆ getRedirectToOtherComponentsOrProfile()

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

Definition at line 173 of file StaticURLHandler.php.

177 : string {
178 if (str_starts_with($cmd, '_bdg')) {
179 return $ctrl->getLinkTargetByClass(\ilDashboardGUI::class, 'jumpToBadges');
180 }
181
182 $legal_documents_target = $this->legalDocuments()->findGotoLink($cmd);
183 if ($legal_documents_target->isOK()) {
184 $ctrl->setTargetScript('ilias.php');
185 foreach ($legal_documents_target->value()->queryParams() as $key => $value) {
186 $ctrl->setParameterByClass(
187 $legal_documents_target->value()->guiName(),
188 (string) $key,
189 $value
190 );
191 }
192 return $ctrl->getLinkTargetByClass(
193 $legal_documents_target->value()->guiPath(),
194 $legal_documents_target->value()->command()
195 );
196 }
197
198 return $this->buildProfileUrl(
199 $ctrl,
200 $target_user_id,
202 );
203 }
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 84 of file StaticURLHandler.php.

88 : Response {
89 $additional_params = $request->getAdditionalParameters();
90 $cmd = $additional_params[0] ?? '';
91
92 $uri = match ($cmd) {
93 self::CHANGE_EMAIL_OPERATION => $context->isUserLoggedIn()
94 ? $this->buildChangeEmailUrl($additional_params[1], $context->ctrl())
95 : $this->getLoginUrl($request, $context),
96 self::REGISTRATION_OPERATION => $context->ctrl()->redirectByClass(
97 [\ilStartUpGUI::class, \ilAccountRegistrationGUI::class],
98 ''
99 ),
100 self::USERNAME_ASSIST_OPERATION => $context->ctrl()->redirectByClass(
101 [\ilStartUpGUI::class, \ilPasswordAssistanceGUI::class],
102 'showUsernameAssistanceForm'
103 ),
104 self::PASSWORD_ASSIST_OPERATION => $context->ctrl()->redirectByClass(
105 [\ilStartUpGUI::class, \ilPasswordAssistanceGUI::class],
106 ''
107 ),
109 $context->ctrl(),
110 $request->getReferenceId(),
111 'approveContactRequest'
112 ),
114 $context->ctrl(),
115 $request->getReferenceId(),
116 'ignoreContactRequest'
117 ),
118 self::DEL_OWN_ACCOUNT_OPERATION => $this->buildDeleteUsrUrl($context),
120 $context->ctrl(),
121 $request->getReferenceId(),
122 $cmd
123 )
124 };
125
126 return $response_factory->can($uri);
127 }
can(string $uri_path, bool $shift=false)
The Handler successfully resolved the target.
Definition: Factory.php:88
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 $request, ILIAS\User\StaticURLHandler\buildChangeEmailUrl(), ILIAS\User\StaticURLHandler\buildDeleteUsrUrl(), ILIAS\User\StaticURLHandler\buildProfileUrl(), ILIAS\StaticURL\Context\ctrl(), ILIAS\User\StaticURLHandler\getLoginUrl(), ILIAS\User\StaticURLHandler\getRedirectToOtherComponentsOrProfile(), and ILIAS\StaticURL\Context\isUserLoggedIn().

+ Here is the call graph for this function:

◆ legalDocuments()

ILIAS\User\StaticURLHandler::legalDocuments ( )
private

Definition at line 55 of file StaticURLHandler.php.

55 : LegalDocumentsConductor
56 {
57 if ($this->legal_documents === null) {
58 global $DIC;
59 $this->legal_documents = $DIC['legalDocuments'];
60 }
62 }
LegalDocumentsConductor $legal_documents
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\User\StaticURLHandler\$legal_documents.

◆ startingPointRepository()

ILIAS\User\StaticURLHandler::startingPointRepository ( )
private

Definition at line 73 of file StaticURLHandler.php.

73 : StartingPointRepository
74 {
75 $this->starting_point_repository ??= LocalDIC::dic()[StartingPointRepository::class];
77 }
StartingPointRepository $starting_point_repository

References ILIAS\User\StaticURLHandler\$starting_point_repository, and ILIAS\User\LocalDIC\dic().

+ Here is the call graph for this function:

◆ user()

ILIAS\User\StaticURLHandler::user ( )
private

Definition at line 64 of file StaticURLHandler.php.

65 {
66 if ($this->user === null) {
67 global $DIC;
68 $this->user = $DIC['ilUser'];
69 }
70 return $this->user;
71 }
User class.

References $DIC, ILIAS\User\StaticURLHandler\$user, and ILIAS\User\StaticURLHandler\user().

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

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

Field Documentation

◆ $legal_documents

LegalDocumentsConductor ILIAS\User\StaticURLHandler::$legal_documents = null
private

Definition at line 51 of file StaticURLHandler.php.

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

◆ $starting_point_repository

StartingPointRepository ILIAS\User\StaticURLHandler::$starting_point_repository = null
private

◆ $user

ilObjUser ILIAS\User\StaticURLHandler::$user = null
private

Definition at line 52 of file StaticURLHandler.php.

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

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