Esempio n. 1
0
 private function validatePassword()
 {
     $username = Http::getPOST('username');
     $password = md5(Http::getPOST('password'));
     $user = new User();
     if (!$user->validatePassword($username, $password)) {
         Http::redirect(GAPP_PASSWORD_VERIFY_FAILED);
     }
 }
Esempio n. 2
0
 function execute()
 {
     $id = Http::getGET('id', 0);
     if ($id) {
         $model = new User();
         $info = $model->getRowById($id);
         $this->setRenderValues('info', $info);
         $this->render('index/user_info.php');
     }
 }
Esempio n. 3
0
 function getAdmin_idTexts()
 {
     $user = new User();
     $params = array(array('field' => 'type', 'sign' => '=', 'value' => '1'), array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $allUser = $user->getAll($params, array());
     $res = array();
     foreach ($allUser as $user) {
         $res[$user['id']] = $user['username'] . '(' . $user['nickname'] . ')';
     }
     return $res;
 }
Esempio n. 4
0
 function execute()
 {
     /*
     if(5 != $_SESSION['_USER_INFO']['type']){
     
     }
     */
     if ($this->isPost) {
     } else {
         $id = Http::getGET('id');
         $user = new User();
         $userInfo = $user->getRowById($id);
         $this->setRenderValues('postData', $userInfo);
         $this->addToken();
         $this->render('index/user_add.php');
     }
 }
Esempio n. 5
0
 function formatListForList($params)
 {
     $user = new User();
     $model = $this->getModelForList();
     foreach ($params as $key => $row) {
         $params[$key]['locationText'] = $model->getLocationText($row['location']);
         $admin_ids = explode(',', $row['admin_ids']);
         $admins = array();
         $adminTexts = array();
         foreach ($admin_ids as $admin_id) {
             $admins[$admin_id] = $user->getRowById($admin_id);
             $adminTexts[$admin_id] = $admins[$admin_id]['username'];
         }
         $params[$key]['adminTexts'] = $adminTexts;
     }
     return $params;
 }
Esempio n. 6
0
 function execute()
 {
     $this->setRenderValues('listName', '概况管理');
     $count = array();
     $user = new User();
     $params = array(array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['user_all'] = $user->getCount($params);
     $params = array(array('field' => 'type', 'sign' => '=', 'value' => 1), array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['user_type1'] = $user->getCount($params);
     $params[0]['value'] = 2;
     $count['user_type2'] = $user->getCount($params);
     $params[0]['value'] = 3;
     $count['user_type3'] = $user->getCount($params);
     $equipment = new Equipment();
     $params = array(array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['equipment_all'] = $equipment->getCount($params);
     $params = array(array('field' => 'state', 'sign' => '=', 'value' => 1), array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['equipment_state1'] = $equipment->getCount($params);
     $params[0]['value'] = 2;
     $count['equipment_state2'] = $equipment->getCount($params);
     $params[0]['value'] = 3;
     $count['equipment_state3'] = $equipment->getCount($params);
     $params[0]['value'] = 4;
     $count['equipment_state4'] = $equipment->getCount($params);
     $params = array(array('field' => 'type', 'sign' => '=', 'value' => 2), array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['equipment_type2'] = $equipment->getCount($params);
     $params[0]['value'] = 3;
     $count['equipment_type3'] = $equipment->getCount($params);
     $params[0]['value'] = 4;
     $count['equipment_type4'] = $equipment->getCount($params);
     $place = new Place();
     $params = array(array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['place_all'] = $place->getCount($params);
     $this->setRenderValues('count', $count);
     $this->render('index/index_list.php');
 }