Beispiel #1
0
 public function getMembers($id, Request $request)
 {
     $forward = GlobalTools::get_forward();
     $data = $request->input();
     $mkforward = $data['forward'];
     $name = isset($data['u']) ? $data['u'] : '';
     $query = DataGroupManager::where('group_id', $id);
     if (!empty($name)) {
         $user = DataManager::where('username', $name)->first();
         if (isset($user->id)) {
             $uid = $user->id;
         } else {
             $uid = 0;
         }
         $query->where('manager_id', $uid);
     }
     $res = $query->orderBy('id', 'desc')->paginate(50);
     $roles = DataRole::where('status', Config::get('hthou.status_normal'))->get();
     return view('admin.group_members', ['mkforward' => $mkforward, 'roles' => $roles, 'name' => $name, 'forward' => $forward, 'groupid' => $id, 'data' => $res, 'url' => $this->url]);
 }
Beispiel #2
0
 public function do_login(Request $request)
 {
     $data = $request->input();
     if (empty($data['username'])) {
         $this->hht_alert('message', 'danger', '请输入用户名');
         $this->hht_response_execute();
     }
     if (empty($data['password'])) {
         $this->hht_alert('message', 'danger', '请输入密码');
         $this->hht_response_execute();
     }
     $manager_db = new DataManager();
     $info = $manager_db->getUserByUsername($data['username']);
     if (!isset($info->id)) {
         $this->hht_alert('message', 'danger', '该用户不存在');
         $this->hht_response_execute();
     }
     if ($info->password != $manager_db->password_encode($data['password'])) {
         $this->hht_alert('message', 'danger', '密码不正确');
         $this->hht_response_execute();
     }
     Session::put('manager', $info);
     $this->hht_redirect('/admin/menu/');
     $this->hht_response_execute();
 }