ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\User\Profile\ChangeMailToken Class Reference
+ Collaboration diagram for ILIAS\User\Profile\ChangeMailToken:

Public Member Functions

 __construct (private readonly int $user_id, private readonly string $current_email, private readonly string $new_email, private readonly int $created_timestamp, private readonly ChangeMailStatus $status=ChangeMailStatus::Login, private ?string $token=null)
 
 getToken ()
 
 getUserId ()
 
 getCurrentEmail ()
 
 getNewEmail ()
 
 getCreatedTimestamp ()
 
 getStatus ()
 
 isTokenValidForCurrentStatus (\ilSetting $settings)
 
 getUriForStatus (URIBuilder $uri_builder)
 

Private Member Functions

 buildValidToken ()
 

Detailed Description

Definition at line 27 of file ChangeMailToken.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Profile\ChangeMailToken::__construct ( private readonly int  $user_id,
private readonly string  $current_email,
private readonly string  $new_email,
private readonly int  $created_timestamp,
private readonly ChangeMailStatus  $status = ChangeMailStatus::Login,
private ?string  $token = null 
)

Definition at line 29 of file ChangeMailToken.php.

References ILIAS\User\Profile\ChangeMailToken\buildValidToken().

36  {
37  $this->token ??= $this->buildValidToken();
38  }
+ Here is the call graph for this function:

Member Function Documentation

◆ buildValidToken()

ILIAS\User\Profile\ChangeMailToken::buildValidToken ( )
private

Definition at line 88 of file ChangeMailToken.php.

Referenced by ILIAS\User\Profile\ChangeMailToken\__construct(), and ILIAS\User\Profile\ChangeMailToken\isTokenValidForCurrentStatus().

88  : string
89  {
90  return hash('md5', "{$this->created_timestamp}-{$this->user_id}-{$this->current_email}-{$this->status->value}");
91  }
+ Here is the caller graph for this function:

◆ getCreatedTimestamp()

ILIAS\User\Profile\ChangeMailToken::getCreatedTimestamp ( )

Definition at line 60 of file ChangeMailToken.php.

Referenced by ILIAS\User\Profile\ChangeMailTokenDBRepository\storeChangeMailToken().

60  : int
61  {
62  return $this->created_timestamp;
63  }
+ Here is the caller graph for this function:

◆ getCurrentEmail()

ILIAS\User\Profile\ChangeMailToken::getCurrentEmail ( )

Definition at line 50 of file ChangeMailToken.php.

Referenced by ILIAS\User\Profile\ChangeMailTokenDBRepository\moveToNextStep().

50  : string
51  {
52  return $this->current_email;
53  }
+ Here is the caller graph for this function:

◆ getNewEmail()

ILIAS\User\Profile\ChangeMailToken::getNewEmail ( )

Definition at line 55 of file ChangeMailToken.php.

Referenced by ILIAS\User\Profile\ChangeMailTokenDBRepository\moveToNextStep(), and ILIAS\User\Profile\ChangeMailTokenDBRepository\storeChangeMailToken().

55  : string
56  {
57  return $this->new_email;
58  }
+ Here is the caller graph for this function:

◆ getStatus()

ILIAS\User\Profile\ChangeMailToken::getStatus ( )

Definition at line 65 of file ChangeMailToken.php.

Referenced by ILIAS\User\Profile\ChangeMailTokenDBRepository\moveToNextStep(), and ILIAS\User\Profile\ChangeMailTokenDBRepository\storeChangeMailToken().

66  {
67  return $this->status;
68  }
+ Here is the caller graph for this function:

◆ getToken()

ILIAS\User\Profile\ChangeMailToken::getToken ( )

Definition at line 40 of file ChangeMailToken.php.

References $token.

Referenced by ILIAS\User\Profile\ChangeMailTokenDBRepository\moveToNextStep(), and ILIAS\User\Profile\ChangeMailTokenDBRepository\storeChangeMailToken().

40  : string
41  {
42  return $this->token;
43  }
$token
Definition: xapitoken.php:70
+ Here is the caller graph for this function:

◆ getUriForStatus()

ILIAS\User\Profile\ChangeMailToken::getUriForStatus ( URIBuilder  $uri_builder)

Definition at line 79 of file ChangeMailToken.php.

References ILIAS\StaticURL\Builder\URIBuilder\build(), ILIAS\User\StaticURLHandler\NAMESPACE, and null.

79  : URI
80  {
81  return $uri_builder->build(
83  null,
84  [StaticUrlHandler::CHANGE_EMAIL_OPERATIONS, $this->token]
85  );
86  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getUserId()

ILIAS\User\Profile\ChangeMailToken::getUserId ( )

Definition at line 45 of file ChangeMailToken.php.

References $user_id.

Referenced by ILIAS\User\Profile\ChangeMailTokenDBRepository\moveToNextStep(), and ILIAS\User\Profile\ChangeMailTokenDBRepository\storeChangeMailToken().

45  : int
46  {
47  return $this->user_id;
48  }
+ Here is the caller graph for this function:

◆ isTokenValidForCurrentStatus()

ILIAS\User\Profile\ChangeMailToken::isTokenValidForCurrentStatus ( \ilSetting  $settings)

Definition at line 70 of file ChangeMailToken.php.

References ILIAS\User\Profile\ChangeMailToken\buildValidToken().

70  : bool
71  {
72  if ($this->buildValidToken() === $this->token
73  && time() < $this->created_timestamp + $this->status->getValidity($settings)) {
74  return true;
75  }
76  return false;
77  }
+ Here is the call graph for this function:

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