/
teachers.php
42 lines (33 loc) · 853 Bytes
/
teachers.php
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
<?php
class Controller_Teachers extends Controller_Base
{
public function before(){
parent::before();
$this->template = View::forge("teachers/template");
$this->auth = Auth::instance();
// logout
if((int)Input::get("logout", 0) == 1){
$this->auth->logout();
Response::redirect('teachers/signin');
}
// check login
if($this->auth_status){
if($this->user->group_id == 100){
Response::redirect('admin/');
}else if($this->user->group_id == 1){
Response::redirect('students/');
}else{
$this->template->name = $this->user->firstname;
}
}else{
Response::redirect('teachers/signin');
}
$this->template->user = $this->user;
$this->template->auth_status = $this->auth_status;
$this->template->title = "Teachers";
}
public function action_index()
{
Response::redirect('teachers/top');
}
}