Select Git revision
UsersIndex.php
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
-
Marcus Eibrink-Lunzenauer authoredMarcus Eibrink-Lunzenauer authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
overview.php 6.45 KiB
<?php
# Lifter010: TODO
/*
* Copyright (C) 2014 - Arne Schröder <schroeder@data-quest.de>
*
* formerly institut_main.php - Die Eingangsseite fuer ein Institut
*
* 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.
*/
class Institute_OverviewController extends AuthenticatedController
{
protected $allow_nobody = true;
function before_filter(&$action, &$args) {
//Check if anonymous access is really allowed:
$config = Config::get();
if (($config->ENABLE_FREE_ACCESS && ($config->ENABLE_FREE_ACCESS == 'courses_only'))) {
$this->allow_nobody = false;
}
if (Request::option('auswahl')) {
Request::set('cid', Request::option('auswahl'));
}
parent::before_filter($action, $args);
checkObject();
$this->institute = Institute::findCurrent();
if (!$this->institute) {
throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
}
$this->institute_id = $this->institute->id;
//set visitdate for institute, when coming from meine_seminare
if (Request::option('auswahl')) {
object_set_visit($this->institute_id, 0);
}
//gibt es eine Anweisung zur Umleitung?
if (Request::get('redirect_to')) {
$query_parts = explode('&', mb_stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to'));
list( , $where_to) = explode('=', array_shift($query_parts));
$new_query = $where_to . '?' . join('&', $query_parts);
page_close();
$new_query = preg_replace('/[^:0-9a-z+_.#?&=\/-]/i', '', $new_query);
header('Location: '.URLHelper::getURL($new_query, ['cid' => $this->institute_id]));
die;
}
PageLayout::setHelpKeyword("Basis.Einrichtungen");
PageLayout::setTitle($this->institute->getFullName() . " - " ._("Kurzinfo"));
Navigation::activateItem('/course/main/info');
}
/**
* show institute overview page
*
* @return void
*/
function index_action()
{
$this->sidebar = Sidebar::get();