* finish task #670.

This commit is contained in:
zhujinyong
2012-02-18 03:44:58 +00:00
parent 6f5a27626d
commit 3149328efe
13 changed files with 488 additions and 4 deletions
+68 -3
View File
@@ -12,13 +12,78 @@
class admin extends control
{
/**
* Index page of admin module. Locate to action's trash page.
*
* Index page.
* @access public
* @return void
*/
public function index()
{
$this->locate($this->createLink('extension', 'browse'));
$user = $this->dao->select('value')->from(TABLE_CONFIG)
->where('owner')->eq($this->app->user->account)
->andWhere('`key`')->eq('account')
->fetch('', false);
if($user)
{
$this->view->login = true;
$this->view->account = $user->value;
}
else
{
$this->view->login = false;
$this->view->account = '';
}
if($this->cookie->notice == 'ignore')
{
$this->view->ignore = true;
}
else
{
$this->view->ignore = false;
}
$this->display();
}
/**
* Ignore notice of register and login.
*
* @access public
* @return void
*/
public function ignoreNotice()
{
setcookie('notice', 'ignore');
die(js::locate(inlink('index')));
}
/**
* Register zentao.
*
* @access public
* @return void
*/
public function register()
{
if($_POST)
{
$this->admin->registerByAPI();
}
$this->view->sn = $this->admin->getSN();
$this->display();
}
/**
* Login zentao.
*
* @access public
* @return void
*/
public function login()
{
if($_POST)
{
$this->admin->loginByAPI();
}
$this->view->sn = $this->admin->getSN();
$this->display();
}
}