Default.class.php
949 Bytes
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
<?php
/**
* 默认控制器
*/
class Controller_Admin_Default extends Controller_Admin_Base
{
/**
* 登录
*/
public function indexAction()
{
//是否登录错误
$error = false ;
$this->_admin = false;
if ($this->_request->isPost())
{
if ( $this->login($this->_request->username , $this->_request->password))
{
return $this->_redirect(url('news/index'));
}
$error = true;
}
if ($this->_admin)
{
return $this->_redirect(url('news/index'));
}
$this->_view['error'] = $error ;
$this->_view['account'] = array('username' => $this->_request->query('username',''), 'password' => $this->_request->query('password',''));
}
public function logoutAction()
{
$this->logout() ;
return $this->_redirect(url('default/index'));
}
}