aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/AuthenticatedController.php
blob: 6ed5c20bf28bbfb701ac2d3105bb1054ac85d44a (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
<?php
/**
 * @author Marcus Lunzenauer <mlunzena@uos.de>
 * @copyright 2009 - Marcus Lunzenauer <mlunzena@uos.de>
 * @license GPL2 or any later version
 *
 * @property Trails_Flash $flash
 */
class AuthenticatedController extends StudipController
{
    protected $with_session = true;  //we do need to have a session for this controller
    protected $allow_nobody = false; //nobody is not allowed and always gets a login-screen

    public function before_filter(&$action, &$args)
    {
        parent::before_filter($action, $args);

        // Restore request if present
        if (isset($this->flash['request'])) {
            foreach ($this->flash['request'] as $key => $value) {
                Request::set($key, $value);
            }
        }
    }

    protected function keepRequest()
    {
        $this->flash['request'] = Request::getInstance()->getIterator()->getArrayCopy();
    }
}