Skip to content
Snippets Groups Projects
Commit 7cd72d0c authored by André Noack's avatar André Noack
Browse files

Resolve #5087 "Meine Veranstaltungen verlinkt noch auf seminar_main.php"

Closes #5087

Merge request studip/studip!3802
parent fd3abc4f
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,9 @@ class Course_GoController extends AuthenticatedController ...@@ -50,7 +50,9 @@ class Course_GoController extends AuthenticatedController
if (!is_internal_url($redirect_to)) { if (!is_internal_url($redirect_to)) {
throw new Exception('Invalid redirection'); throw new Exception('Invalid redirection');
} }
if (str_starts_with($redirect_to, '#')) {
$redirect_to = 'dispatch.php/course/go' . $redirect_to;
}
$this->redirect(URLHelper::getURL($redirect_to, ['cid' => $course_id])); $this->redirect(URLHelper::getURL($redirect_to, ['cid' => $course_id]));
return; return;
} }
......
...@@ -16,17 +16,20 @@ class Institute_OverviewController extends AuthenticatedController ...@@ -16,17 +16,20 @@ class Institute_OverviewController extends AuthenticatedController
{ {
protected $allow_nobody = true; protected $allow_nobody = true;
function before_filter(&$action, &$args) { public function __construct(\Trails\Dispatcher $dispatcher)
{
if (Request::option('auswahl')) {
Request::set('cid', Request::option('auswahl'));
}
//Check if anonymous access is really allowed: //Check if anonymous access is really allowed:
$config = Config::get(); $config = Config::get();
if (($config->ENABLE_FREE_ACCESS && ($config->ENABLE_FREE_ACCESS == 'courses_only'))) { if (($config->ENABLE_FREE_ACCESS && ($config->ENABLE_FREE_ACCESS == 'courses_only'))) {
$this->allow_nobody = false; $this->allow_nobody = false;
} }
parent::__construct($dispatcher);
}
if (Request::option('auswahl')) { public function before_filter(&$action, &$args) {
Request::set('cid', Request::option('auswahl'));
}
parent::before_filter($action, $args); parent::before_filter($action, $args);
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
{{ course.number }} {{ course.number }}
</td> </td>
<td :class="{'subcourse-indented': isChild(course)}"> <td :class="{'subcourse-indented': isChild(course)}">
<a :href="urlFor('seminar_main.php', {to: course.id})"> <a :href="urlFor('dispatch.php/course/go', {to: course.id})">
{{ getCourseName(course, getConfig('sem_number') && responsiveDisplay) }} {{ getCourseName(course, getConfig('sem_number') && responsiveDisplay) }}
<span v-if="course.is_deputy">{{ $gettext('[Vertretung]') }}</span> <span v-if="course.is_deputy">{{ $gettext('[Vertretung]') }}</span>
</a> </a>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
></studip-action-menu> ></studip-action-menu>
</span> </span>
<a :href="urlFor('seminar_main.php', {to: course.id})" class="tiles-grid-element-header-content" :title="getCourseName(course, getConfig('sem_number'))"> <a :href="urlFor('dispatch.php/course/go', {to: course.id})" class="tiles-grid-element-header-content" :title="getCourseName(course, getConfig('sem_number'))">
<span :style="{backgroundImage: `url(${course.avatar})`}" class="tiles-grid-element-header-image"></span> <span :style="{backgroundImage: `url(${course.avatar})`}" class="tiles-grid-element-header-image"></span>
<span class="tiled-grid-element-header-title"> <span class="tiled-grid-element-header-title">
{{ getCourseName(course, getConfig('sem_number')) }} {{ getCourseName(course, getConfig('sem_number')) }}
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
result.icon.role = 'clickable'; result.icon.role = 'clickable';
} }
result.url = this.urlFor('seminar_main.php', { result.url = this.urlFor('dispatch.php/course/go', {
to: course.id, to: course.id,
redirect_to: result.url, redirect_to: result.url,
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment