Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shonenada committed Sep 9, 2014
1 parent dc84863 commit 2b10cac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions szuias/Controller/Admin/SignIn.php
Expand Up @@ -11,6 +11,12 @@ class SignIn extends \Controller\Base {

static public function get () {
$is_captcha = SettingModel::get('admin_signin', 'captcha');
$userid = self::$app->getEncryptedCookie('user_id');
$token = self::$app->getEncryptedCookie('token');
$user = User::find($userid);
if (isset($user) && $user->getToken() == $token) {
return self::redirect('/admin/content');
}
return self::render("admin/signin.html", get_defined_vars());
}

Expand Down
4 changes: 4 additions & 0 deletions szuias/Model/User.php
Expand Up @@ -149,6 +149,10 @@ public function setToken ($token) {
$this->token = $token;
}

public function getToken() {
return $this->token;
}

public function isActivity() {
return ($this->is_deleted == 0);
}
Expand Down
2 changes: 0 additions & 2 deletions szuias/templates/base.html
Expand Up @@ -82,9 +82,7 @@
<ul>
<li><a href="{{ siteUrl('article/494') }}">{{ trans('About us') }}</a></li>
<li><a href="{{ siteUrl('article/501') }}">{{ trans('Contact us') }}</a></li>
{% if loggedUser.hasPermission('/admin', 'GET') %}
<li><a href="{{ siteUrl('admin') }}">{{ trans('Admin Login') }}</a></li>
{% endif %}
</ul>
</div>

Expand Down
1 change: 1 addition & 0 deletions szuias/translations/zh/message.php
Expand Up @@ -23,6 +23,7 @@
'Counts' => '浏览数',
'Edit' => '编辑',
'More' => '更多',
'Admin Login' => '管理员登陆',
'SZU Career Development Center' => '深圳大学就业指导中心',
'Institute for Advanced Study, Shenzhen University, Nanshan District Shenzhen, Guangdong, China 518060' => '深圳市南山区南海大道 3688 号办公楼 313 深圳大学高等研究院院长办公室 518060',
);

0 comments on commit 2b10cac

Please sign in to comment.