From 4bfe0eacacdb38a3b484e69e1cb1a79bbac41268 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 4 Apr 2025 16:01:29 +0200 Subject: [PATCH] usergroups: Add fallback route which redirects to contactgroups --- .../controllers/UsergroupsController.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 application/controllers/UsergroupsController.php diff --git a/application/controllers/UsergroupsController.php b/application/controllers/UsergroupsController.php new file mode 100644 index 00000000..306a69f7 --- /dev/null +++ b/application/controllers/UsergroupsController.php @@ -0,0 +1,28 @@ +getRequest()->getUrl(); + $url->setPath(preg_replace( + '~^icingadb/usergroups(?=/|$)~', + 'icingadb/contactgroups', + $url->getPath() + )); + + $this->getResponse() + ->setHttpResponseCode(301) + ->setHeader('Location', $url->getAbsoluteUrl()) + ->sendResponse(); + } +}