diff options
| author | Ron Lucke <lucke@elan-ev.de> | 2022-06-24 08:34:28 +0000 |
|---|---|---|
| committer | Ron Lucke <lucke@elan-ev.de> | 2022-06-24 08:34:28 +0000 |
| commit | b11152c9e53633e708cb71d76699c47faba63518 (patch) | |
| tree | cb4896ca303f14264f8aaf64cb9f456da3a8b561 /app/controllers/courseware | |
| parent | 573bbd21cc4c6e07c3134dd42e8d8dffe0664f33 (diff) | |
StEP00363: Externer Ansicht als Link für Courseware-Seiten
Closes #918
Merge request studip/studip!638
Diffstat (limited to 'app/controllers/courseware')
| -rw-r--r-- | app/controllers/courseware/public.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/controllers/courseware/public.php b/app/controllers/courseware/public.php new file mode 100644 index 0000000..aa5a309 --- /dev/null +++ b/app/controllers/courseware/public.php @@ -0,0 +1,28 @@ +<?php + +use Courseware\PublicLink; + +class Courseware_PublicController extends StudipController +{ + public function before_filter(&$action, &$args) + { + parent::before_filter($action, $args); + PageLayout::setTitle(_('Courseware')); + PageLayout::setHelpKeyword('Basis.Courseware'); + } + + public function index_action() + { + $this->invalid = true; + $this->link_id = Request::option('link'); + if ($this->link_id) { + $publicLink = PublicLink::find($this->link_id); + $this->invalid = $publicLink === null; + if (!$this->invalid) { + $this->expired = $publicLink->isExpired(); + $this->link_pass = $publicLink->password; + $this->entry_element_id = $publicLink->structural_element_id; + } + } + } +} |
