. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fisharebest\Webtrees\Http\ViewResponseTrait; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Validator; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; /** * Add a user. */ class UserAddPage implements RequestHandlerInterface { use ViewResponseTrait; /** * @param ServerRequestInterface $request * * @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { $this->layout = 'layouts/administration'; $email = Validator::queryParams($request)->string('email', ''); $real_name = Validator::queryParams($request)->string('real_name', ''); $username = Validator::queryParams($request)->string('username', ''); $title = I18N::translate('Add a user'); return $this->viewResponse('admin/users-create', [ 'email' => $email, 'real_name' => $real_name, 'title' => $title, 'username' => $username, ]); } }