Newer
Older
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
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Authentication extends Controller {
public function before() {
parent::before();
if(UTF8::strcasecmp($this->request->action(), 'logout'))
{
if(Auth::isLoggedIn())
{
$account = Auth::getData();
$page = Request::factory($account['Type'].'/index')->execute();
$this->response->body($page);
}
}
}
public function action_sign()
{
if(!Auth::isLoggedIn())
{
$type = $this->request->param('type');
if(empty($type)) $type = 'in';
$twig = Twig::factory('sign/'.$type);
$this->response->body($twig);
}
}
public function action_remind()
{
if(!Auth::isLoggedIn())
{
$twig = Twig::factory('sign/remindpass');
$this->response->body($twig);
}
}
public function action_logout()
{
Auth::logout();
$this->action_sign();
}
} // End Welcome