aboutsummaryrefslogtreecommitdiff
path: root/public/seminar_main.php
blob: 0e7eed1e9ea862658a3c2fe8d81c08719fcb88b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
# Lifter001: DONE
# Lifter002: TODO
# Lifter007: TODO
# Lifter003: TEST
# Lifter010: TODO
/*
seminar_main.php - Die Eingangs- und Uebersichtsseite fuer ein Seminar
Copyright (C) 2000 Stefan Suchi <suchi@gmx.de>, Ralf Stockmann <rstockm@gwdg.de>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/


require '../lib/bootstrap.php';

ob_start();
page_open(["sess" => "Seminar_Session", "auth" => "Seminar_Default_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User"]);
$auth->login_if(Request::get('again') && ($auth->auth["uid"] == "nobody"));

if (Request::option('auswahl')) {
    Request::set('cid', Request::option('auswahl'));
}

include ('lib/seminar_open.php'); // initialise Stud.IP-Session

// -- here you have to put initialisations for the current page

$course_id = Context::getId();

if (!$course_id && Request::get('cid')) {
    $archive_id = Request::get('cid');
    $archived = ArchivedCourse::find($archive_id);
    if ($archived) {
        header('Location: ' . URLHelper::getURL('dispatch.php/search/archive', [
            'criteria' => $archived->name,
        ]));
        die;
    }
}

if (!$course_id) {
    throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
}

//set visitdate for course, when coming from my_courses
if (Request::get('auswahl')) {
   object_set_visit($course_id, 0);
}


// gibt es eine Anweisung zur Umleitung?
$redirect_to = Request::get('redirect_to');
if ($redirect_to) {
    if (!is_internal_url($redirect_to)) {
        throw new Exception('Invalid redirection');
    }

    header('Location: '.URLHelper::getURL($redirect_to, ['cid' => $course_id]));
    die;
}

// der Nutzer zum ersten
//Reiter der Veranstaltung weiter geleitet.
if (Navigation::hasItem("/course")) {
    foreach (Navigation::getItem("/course")->getSubNavigation() as $navigation) {
        header('Location: ' . URLHelper::getURL($navigation->getURL()));
        die;
    }
}