ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 canHandle (Request $request)
 

Data Fields

const NAMESPACE = 'user'
 
const CHANGE_EMAIL_OPERATIONS = 'email'
 

Private Member Functions

 buildChangeEmailUrl (string $token, \ilCtrl $ctrl)
 
 getLoginUrl (Request $request, Context $context)
 

Detailed Description

Definition at line 32 of file StaticURLHandler.php.

Member Function Documentation

◆ buildChangeEmailUrl()

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

Definition at line 59 of file StaticURLHandler.php.

References ilPersonalProfileGUI\CHANGE_EMAIL_CMD, ilCtrl\clearParameterByClass(), ilCtrl\getLinkTargetByClass(), and ilCtrl\setParameterByClass().

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

59  : string
60  {
61  $ctrl->setParameterByClass(\ilPersonalProfileGUI::class, 'token', $token);
62  $link = $ctrl->getLinkTargetByClass([\ilDashboardGUI::class, \ilPersonalProfileGUI::class], \ilPersonalProfileGUI::CHANGE_EMAIL_CMD);
63  $ctrl->clearParameterByClass(\ilPersonalProfileGUI::class, 'token');
64  return $link;
65  }
$token
Definition: xapitoken.php:70
+ 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 67 of file StaticURLHandler.php.

References ILIAS\StaticURL\Request\Request\getAdditionalParameters(), ILIAS\StaticURL\Request\Request\getNamespace(), ILIAS\StaticURL\Request\Request\getReferenceId(), and ILIAS\StaticURL\Context\getUserLanguage().

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

70  : string {
71  $target = (new StandardURIBuilder(ILIAS_HTTP_PATH, false))->buildTarget(
72  $request->getNamespace(),
73  $request->getReferenceId(),
74  $request->getAdditionalParameters()
75  );
76 
77  return '/login.php?target='
78  . str_replace('/', '_', rtrim($target, '/'))
79  . '&cmd=force_login&lang=' . $context->getUserLanguage();
80 
81  }
$context
Definition: webdav.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNamespace()

ILIAS\User\StaticURLHandler::getNamespace ( )

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 37 of file StaticURLHandler.php.

37  : string
38  {
39  return self::NAMESPACE;
40  }

◆ handle()

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

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 42 of file StaticURLHandler.php.

References ILIAS\User\StaticURLHandler\buildChangeEmailUrl(), ILIAS\StaticURL\Response\Factory\can(), ILIAS\StaticURL\Context\ctrl(), ILIAS\StaticURL\Request\Request\getAdditionalParameters(), ILIAS\User\StaticURLHandler\getLoginUrl(), and ILIAS\StaticURL\Context\isUserLoggedIn().

46  : Response {
47  $additional_params = $request->getAdditionalParameters();
48 
49  $uri = match ($additional_params[0] ?? 'default') {
50  self::CHANGE_EMAIL_OPERATIONS => $context->isUserLoggedIn()
51  ? $this->buildChangeEmailUrl($additional_params[1], $context->ctrl())
52  : $this->getLoginUrl($request, $context),
53  default => $context->ctrl()->getLinkTargetByClass([\ilDashboardGUI::class], 'jumpToProfile'),
54  };
55 
56  return $response_factory->can($uri);
57  }
$context
Definition: webdav.php:31
buildChangeEmailUrl(string $token, \ilCtrl $ctrl)
getLoginUrl(Request $request, Context $context)
+ Here is the call graph for this function:

Field Documentation

◆ CHANGE_EMAIL_OPERATIONS

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

Definition at line 35 of file StaticURLHandler.php.

◆ NAMESPACE

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

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