TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\View\ViewInterface;
|
||||
use TYPO3\CMS\FrontendLogin\Controller\LoginController;
|
||||
|
||||
/**
|
||||
* A confirmation notification when an login/logout action has successfully arrived at the plugin, via the view and the controller, multiple
|
||||
* information can be overridden in Event Listeners.
|
||||
*/
|
||||
abstract class AbstractConfirmedEvent
|
||||
{
|
||||
public function __construct(
|
||||
protected readonly LoginController $controller,
|
||||
private ViewInterface $view,
|
||||
protected readonly ServerRequestInterface $request
|
||||
) {}
|
||||
|
||||
public function getController(): LoginController
|
||||
{
|
||||
return $this->controller;
|
||||
}
|
||||
|
||||
public function getView(): ViewInterface
|
||||
{
|
||||
return $this->view;
|
||||
}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Notification before a redirect is made, which also allows to modify
|
||||
* the actual redirect URL. Setting the redirect to an empty string
|
||||
* will avoid triggering a redirect.
|
||||
*/
|
||||
final class BeforeRedirectEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $loginType,
|
||||
private string $redirectUrl,
|
||||
private readonly ServerRequestInterface $request,
|
||||
) {}
|
||||
|
||||
public function getLoginType(): string
|
||||
{
|
||||
return $this->loginType;
|
||||
}
|
||||
|
||||
public function getRedirectUrl(): string
|
||||
{
|
||||
return $this->redirectUrl;
|
||||
}
|
||||
|
||||
public function setRedirectUrl(string $redirectUrl): void
|
||||
{
|
||||
$this->redirectUrl = $redirectUrl;
|
||||
}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
/**
|
||||
* A notification when a log in has successfully arrived at the plugin, via the view and the controller, multiple
|
||||
* information can be overridden in Event Listeners.
|
||||
*/
|
||||
final class LoginConfirmedEvent extends AbstractConfirmedEvent {}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* A notification if something went wrong while trying to log in a user.
|
||||
*/
|
||||
final readonly class LoginErrorOccurredEvent
|
||||
{
|
||||
public function __construct(
|
||||
private ServerRequestInterface $request
|
||||
) {}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
/**
|
||||
* A notification when a log out has successfully arrived at the plugin, via the view and the controller, multiple
|
||||
* information can be overridden in Event Listeners.
|
||||
*/
|
||||
final class LogoutConfirmedEvent extends AbstractConfirmedEvent {}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\View\ViewInterface;
|
||||
|
||||
/**
|
||||
* Allows to inject custom variables into the login form.
|
||||
*/
|
||||
final readonly class ModifyLoginFormViewEvent
|
||||
{
|
||||
public function __construct(
|
||||
private ViewInterface $view,
|
||||
private ServerRequestInterface $request
|
||||
) {}
|
||||
|
||||
public function getView(): ViewInterface
|
||||
{
|
||||
return $this->view;
|
||||
}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Allows to modify the result of the redirect URL validation (e.g. allow redirect to specific external URLs).
|
||||
*/
|
||||
final class ModifyRedirectUrlValidationResultEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $redirectUrl,
|
||||
private bool $validationResult,
|
||||
private readonly ServerRequestInterface $request,
|
||||
) {}
|
||||
|
||||
public function getRedirectUrl(): string
|
||||
{
|
||||
return $this->redirectUrl;
|
||||
}
|
||||
|
||||
public function getValidationResult(): bool
|
||||
{
|
||||
return $this->validationResult;
|
||||
}
|
||||
|
||||
public function setValidationResult(bool $validationResult): void
|
||||
{
|
||||
$this->validationResult = $validationResult;
|
||||
}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Informal event that contains information about the password which was set, and is about to be stored in the database.
|
||||
*/
|
||||
final readonly class PasswordChangeEvent
|
||||
{
|
||||
public function __construct(
|
||||
private array $user,
|
||||
private string $passwordHash,
|
||||
private string $rawPassword,
|
||||
private ServerRequestInterface $request
|
||||
) {}
|
||||
|
||||
public function getUser(): array
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getHashedPassword(): string
|
||||
{
|
||||
return $this->passwordHash;
|
||||
}
|
||||
|
||||
public function getRawPassword(): string
|
||||
{
|
||||
return $this->rawPassword;
|
||||
}
|
||||
|
||||
public function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use TYPO3\CMS\Core\Attribute\AsEventListener;
|
||||
use TYPO3\CMS\Core\Authentication\Event\BeforeRequestTokenProcessedEvent;
|
||||
use TYPO3\CMS\Core\Security\RequestToken;
|
||||
use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
|
||||
|
||||
/**
|
||||
* Process request token.
|
||||
*/
|
||||
final class ProcessRequestTokenListener
|
||||
{
|
||||
#[AsEventListener('felogin-process-request-token')]
|
||||
public function __invoke(BeforeRequestTokenProcessedEvent $event): void
|
||||
{
|
||||
$user = $event->getUser();
|
||||
$requestToken = $event->getRequestToken();
|
||||
if (!$user instanceof FrontendUserAuthentication || !$requestToken instanceof RequestToken) {
|
||||
return;
|
||||
}
|
||||
$pidParam = (string)($requestToken->params['pid'] ?? '');
|
||||
if ($user->checkPid) {
|
||||
$user->checkPid_value = $pidParam;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\FrontendLogin\Event;
|
||||
|
||||
use TYPO3\CMS\Core\Mail\FluidEmail;
|
||||
|
||||
/**
|
||||
* Event that contains the email to be sent to the user when they request a new password.
|
||||
* More
|
||||
*
|
||||
* Additional validation can happen here.
|
||||
*/
|
||||
final readonly class SendRecoveryEmailEvent
|
||||
{
|
||||
public function __construct(private FluidEmail $email, private array $user) {}
|
||||
|
||||
public function getUserInformation(): array
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getEmail(): FluidEmail
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user