summaryrefslogtreecommitdiff
path: root/app/Http/RequestHandlers/UnconnectedAction.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-11-03 20:03:23 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-11-03 20:03:23 +0000
commit96716c4735cd29561cdf33f324c111f41c544214 (patch)
tree19ec7b3a9a723650caae86b382a5aac74294d8eb /app/Http/RequestHandlers/UnconnectedAction.php
parent3aa29b9734fdb6fae278f43a276b231c61e8112b (diff)
downloadwebtrees-96716c4735cd29561cdf33f324c111f41c544214.tar.gz
webtrees-96716c4735cd29561cdf33f324c111f41c544214.tar.bz2
webtrees-96716c4735cd29561cdf33f324c111f41c544214.zip
Use POST+GET for unconnected individuals
Diffstat (limited to 'app/Http/RequestHandlers/UnconnectedAction.php')
-rw-r--r--app/Http/RequestHandlers/UnconnectedAction.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/app/Http/RequestHandlers/UnconnectedAction.php b/app/Http/RequestHandlers/UnconnectedAction.php
new file mode 100644
index 0000000000..304afea1b2
--- /dev/null
+++ b/app/Http/RequestHandlers/UnconnectedAction.php
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2019 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Http\RequestHandlers;
+
+use Fisharebest\Webtrees\Tree;
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\ServerRequestInterface;
+use Psr\Http\Server\RequestHandlerInterface;
+
+use function assert;
+
+/**
+ * Find groups of unrelated individuals.
+ */
+class UnconnectedAction implements RequestHandlerInterface
+{
+ /** @var string */
+ protected $layout = 'layouts/administration';
+
+ /**
+ * @param ServerRequestInterface $request
+ *
+ * @return ResponseInterface
+ */
+ public function handle(ServerRequestInterface $request): ResponseInterface
+ {
+ $tree = $request->getAttribute('tree');
+ assert($tree instanceof Tree);
+
+ $associates = $request->getParsedBody()['associates'] ?? '';
+
+ return redirect(route(UnconnectedPage::class, ['tree' => $tree->name(), 'associates' => $associates]));
+ }
+}