xref: /webtrees/app/Http/RequestHandlers/UnconnectedAction.php (revision d11be7027e34e3121be11cc025421873364403f9)
196716c47SGreg Roach<?php
296716c47SGreg Roach
396716c47SGreg Roach/**
496716c47SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
696716c47SGreg Roach * This program is free software: you can redistribute it and/or modify
796716c47SGreg Roach * it under the terms of the GNU General Public License as published by
896716c47SGreg Roach * the Free Software Foundation, either version 3 of the License, or
996716c47SGreg Roach * (at your option) any later version.
1096716c47SGreg Roach * This program is distributed in the hope that it will be useful,
1196716c47SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1296716c47SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1396716c47SGreg Roach * GNU General Public License for more details.
1496716c47SGreg Roach * You should have received a copy of the GNU General Public License
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
1696716c47SGreg Roach */
1796716c47SGreg Roach
1896716c47SGreg Roachdeclare(strict_types=1);
1996716c47SGreg Roach
2096716c47SGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers;
2196716c47SGreg Roach
22b55cbc6bSGreg Roachuse Fisharebest\Webtrees\Validator;
2396716c47SGreg Roachuse Psr\Http\Message\ResponseInterface;
2496716c47SGreg Roachuse Psr\Http\Message\ServerRequestInterface;
2596716c47SGreg Roachuse Psr\Http\Server\RequestHandlerInterface;
2696716c47SGreg Roach
2796716c47SGreg Roach/**
2896716c47SGreg Roach * Find groups of unrelated individuals.
2996716c47SGreg Roach */
3096716c47SGreg Roachclass UnconnectedAction implements RequestHandlerInterface
3196716c47SGreg Roach{
32c4943cffSGreg Roach    protected string $layout = 'layouts/administration';
3396716c47SGreg Roach
3496716c47SGreg Roach    /**
3596716c47SGreg Roach     * @param ServerRequestInterface $request
3696716c47SGreg Roach     *
3796716c47SGreg Roach     * @return ResponseInterface
3896716c47SGreg Roach     */
3996716c47SGreg Roach    public function handle(ServerRequestInterface $request): ResponseInterface
4096716c47SGreg Roach    {
41f925fcc4SGreg Roach        return redirect(route(UnconnectedPage::class, [
42748dbe15SGreg Roach            'aliases'    => Validator::parsedBody($request)->boolean('aliases', false),
43748dbe15SGreg Roach            'associates' => Validator::parsedBody($request)->boolean('associates', false),
44748dbe15SGreg Roach            'tree'       => Validator::attributes($request)->tree()->name(),
45f925fcc4SGreg Roach        ]));
4696716c47SGreg Roach    }
4796716c47SGreg Roach}
48