ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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, ?int $target_user_id, string $cmd)
 
 buildProfileUrl (\ilCtrl $ctrl, ?int $target_user_id, string $cmd)
 

Private Attributes

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

Detailed Description

Definition at line 37 of file StaticURLHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\StaticURLHandler::__construct ( )

Reimplemented from ILIAS\StaticURL\Handler\BaseHandler.

Definition at line 52 of file StaticURLHandler.php.

53 {
54 global $DIC;
55 $this->legal_documents = $DIC['legalDocuments'];
56 $this->user = $DIC['ilUser'];
57 $this->starting_point_repository = LocalDIC::dic()[StartingPointRepository::class];
58 }
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 110 of file StaticURLHandler.php.

110 : string
111 {
112 $ctrl->setParameterByClass(PersonalProfileGUI::class, 'token', $token);
113 $link = $ctrl->getLinkTargetByClass([\ilDashboardGUI::class, PersonalProfileGUI::class], PersonalProfileGUI::CHANGE_EMAIL_CMD);
114 $ctrl->clearParameterByClass(PersonalProfileGUI::class, 'token');
115 return $link;
116 }
$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 134 of file StaticURLHandler.php.

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

References $context.

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

+ Here is the caller graph for this function:

◆ buildProfileUrl()

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

Definition at line 186 of file StaticURLHandler.php.

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

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

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

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

60 : string
61 {
62 return self::NAMESPACE;
63 }

References ILIAS\User\StaticURLHandler\NAMESPACE.

◆ getRedirectToOtherComponentsOrProfile()

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

Definition at line 154 of file StaticURLHandler.php.

158 : string {
159 if (substr($cmd, -4) == '_bdg') {
160 return $ctrl->getLinkTargetByClass(\ilDashboardGUI::class, 'jumpToBadges');
161 }
162
163 $legal_documents_target = $this->legal_documents->findGotoLink($cmd);
164 if ($legal_documents_target->isOK()) {
165 $ctrl->setTargetScript('ilias.php');
166 foreach ($legal_documents_target->value()->queryParams() as $key => $value) {
167 $ctrl->setParameterByClass(
168 $legal_documents_target->value()->guiName(),
169 (string) $key,
170 $value
171 );
172 }
173 return $ctrl->getLinkTargetByClass(
174 $legal_documents_target->value()->guiPath(),
175 $legal_documents_target->value()->command()
176 );
177 }
178
179 return $this->buildProfileUrl(
180 $target_user_id->toInt(),
181 $ctrl,
183 );
184 }
buildProfileUrl(\ilCtrl $ctrl, ?int $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 65 of file StaticURLHandler.php.

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

References $context, 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\Request\Request\getReferenceId().

+ Here is the call graph for this function:

Field Documentation

◆ $legal_documents

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

Definition at line 48 of file StaticURLHandler.php.

◆ $starting_point_repository

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

Definition at line 50 of file StaticURLHandler.php.

◆ $user

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

Definition at line 49 of file StaticURLHandler.php.

◆ CHANGE_EMAIL_OPERATION

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

Definition at line 40 of file StaticURLHandler.php.

◆ CONTACT_APPROVE_OPERATION

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

Definition at line 45 of file StaticURLHandler.php.

◆ CONTACT_IGNORE_OPERATION

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

Definition at line 46 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 43 of file StaticURLHandler.php.

◆ REGISTRATION_OPERATION

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

Definition at line 41 of file StaticURLHandler.php.

◆ USERNAME_ASSIST_OPERATION

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

Definition at line 42 of file StaticURLHandler.php.


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