aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/u.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/u.php')
-rw-r--r--app/controllers/u.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/controllers/u.php b/app/controllers/u.php
new file mode 100644
index 0000000..29a77b8
--- /dev/null
+++ b/app/controllers/u.php
@@ -0,0 +1,16 @@
+<?php
+
+class UController extends AuthenticatedController
+{
+ public function r_action(string $short_url_alias): void
+ {
+ $short_url = ShortUrl::findOneBySQL('alias = ?', [$short_url_alias]);
+
+ if (!$short_url) {
+ PageLayout::postError(_('Diese Kurz-URL existiert nicht.'));
+ $this->redirect($this->url_for('start'));
+ return;
+ }
+ $this->redirect(URLHelper::getURL($short_url->path));
+ }
+}