1. Go to this page and download the library: Download sandstorm/usermanagement library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace Your\Package\Domain\Service;
use Neos\Flow\Mvc\ActionRequest;
use Neos\Flow\Mvc\Controller\ControllerContext;
use Neos\Flow\Security\Exception\AuthenticationRequiredException;
class ExampleService
{
public function onAuthenticationSuccess(ControllerContext $controllerContext, ActionRequest $originalRequest = null)
{
// Do custom stuff here
}
public function onAuthenticationFailure(ControllerContext $controllerContext, AuthenticationRequiredException $exception = null)
{
// Do custom stuff here
}
public function onLogout(ControllerContext $controllerContext)
{
// Do custom stuff here
}
}
class RegistrationFlowValidationService implements RegistrationFlowValidationServiceInterface {
/**
* @param RegistrationFlow $registrationFlow
* @param RegistrationFlowValidator $validator
* @return void
*/
public function validateRegistrationFlow(RegistrationFlow $registrationFlow, RegistrationFlowValidator $validator) {
// This is an example of your own custom validation logic.
if ($registrationFlow->getAttributes()['agb'] !== '1') {
$validator->getResult()->forProperty('attributes.terms')->addError(new \Neos\Flow\Validation\Error('You need to accept the terms and conditions.'));
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.