diff options
| author | Thomas Hackl <hackl@data-quest.de> | 2025-12-19 08:44:03 +0100 |
|---|---|---|
| committer | Thomas Hackl <hackl@data-quest.de> | 2025-12-19 08:44:03 +0100 |
| commit | 1c78a3b0a73e72d34714fa749aff293dbda6b4d2 (patch) | |
| tree | a6638fb62ef5e672b0e326ebeb204e8f47afafeb /app/controllers/u.php | |
| parent | 4e8a808e1a3a0c6698afaacf50173051bcf1dcee (diff) | |
Resolve "Deeplinks und Definition von Kurz-URLs"
Closes #5896
Merge request studip/studip!4570
Diffstat (limited to 'app/controllers/u.php')
| -rw-r--r-- | app/controllers/u.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/u.php b/app/controllers/u.php new file mode 100644 index 0000000..76cd35e --- /dev/null +++ b/app/controllers/u.php @@ -0,0 +1,17 @@ +<?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(_('Dieser Kurzlink existiert nicht.')); + $this->redirect($this->url_for('start')); + return; + } + + $this->redirect(URLHelper::getURL($short_url->path, ['from_short_url' => $short_url->id])); + } +} |
