Example #1
0
 public function updateLoginData($user, $type = 0, $ver = '')
 {
     if (!$user) {
         return false;
     }
     $data = array();
     $data["login_times"] = $user->login_times + 1;
     $data['login_ip'] = Util::getIP();
     $data['login_date'] = TIMESTAMP;
     Model::factory("Sys")->updateUser($user->uid, $data);
     CacheManager::removeUser($user->uid);
     Model::factory("App")->logUserLogin(array('uid' => $user->uid, 'utype' => $type, 'ldate' => TIMESTAMP, 'ip' => Util::getIP(), 'ver' => $ver));
 }
Example #2
0
 public function action_user_delete()
 {
     $this->checkFunction('UserManage', "delete");
     $user_id = intval($this->request->query('uid'));
     if ($user_id < 1) {
         return $this->msg("参数错误! <a href='javascript:void()' onclick='history.go(-1);'>返回</a>");
     }
     Model::factory('Sys')->deleteUser($user_id);
     Model::factory('Sys')->deleteAdmin($user_id);
     CacheManager::removeUser($user_id);
     return $this->redirect('admin/sys/user_list');
 }