public function __construct()
 {
     parent::__construct();
     $this->model_text = D('Text');
     $this->model_image = D('Imagetext');
     $this->logic_purv = D('Purview', 'Logic');
 }
 public function changepassword()
 {
     if (IS_POST) {
         $password = I('post.password', '');
         $newpassword = I('post.newpassword', '');
         $confirmnewpassword = I('post.confirmnewpassword', '');
         if (strlen($newpassword) < 6 || strlen($newpassword) > 20) {
             $this->ajaxReturn(ReturnValue::faild('密码长度6--20位'));
         }
         if ($newpassword != $confirmnewpassword) {
             $this->ajaxReturn(ReturnValue::faild('两次密码输入不一致'));
         }
         $adminId = BaseController::get_login_userid();
         $admin = M('admin');
         $entity = $admin->find($adminId);
         if ($entity && $entity['password'] == $password) {
             $data['password'] = $newpassword;
             $admin->where('id=' . $adminId)->save($data);
             $this->ajaxReturn(ReturnValue::success("ok"));
         } else {
             $this->ajaxReturn(ReturnValue::faild('密码验证错误!'));
         }
     } else {
         $this->display();
     }
 }
 public static function get_login_userid()
 {
     if (BaseController::is_login()) {
         return session('uid');
     }
     return 0;
 }
 function __construct()
 {
     parent::__construct();
     if (!session('?admin_id') || !session('?admin_expire')) {
         $this->error('抱歉,登录超时!请重新登录!', '/');
         exit;
     }
     $expire = session('admin_expire');
     if ($this->time > (int) $expire) {
         $this->error('抱歉,登录超时!请重新登录!', '/');
         exit;
     }
     session('admin_expire', $this->time + $this->EXPIRE);
 }
Example #5
0
 public function _initialize()
 {
     parent::_initialize();
 }
 function __construct()
 {
     parent::__construct();
 }
 protected function _initialize()
 {
     parent::_initialize();
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->model = D('Article');
     $this->modelCate = M('cate');
 }
 public function __construct()
 {
     parent::__construct();
     $this->obj_menu = D('Menus');
     $this->obj_purview = D('Purview');
 }
Example #10
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->is_login();
 }
 public function __construct()
 {
     parent::__construct();
     session('flash_error', null);
     // var_p(session('site_info'));
 }
Example #12
0
 public function _initialize()
 {
     parent::_initialize();
     $this->model = M('adpos');
 }
Example #13
0
 public function __construct()
 {
     parent::__construct();
     $this->model_user = D('User');
     $this->logic_purv = D('Purview', 'Logic');
 }
 public function logout()
 {
     BaseController::logout();
     $this->redirect('Account/login');
 }
 public function __construct()
 {
     parent::__construct();
     session('flash_error', null);
     session('flash_success', null);
 }
Example #16
0
 public function __construct()
 {
     parent::__construct();
     $this->model_role = D('Role');
     $this->logic_purv = D('Purview', 'Logic');
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->model = D('Comments');
 }