示例#1
0
 public function signupHandler()
 {
     $username = Util::fetch_post('username');
     $password = Util::fetch_post('password');
     $realname = Util::fetch_post('realname');
     if ($username == null || $password == null || $realname == null) {
         $this->error(2);
     }
     $userTable = new UserTable();
     if ($userTable->is_exist($username)) {
         $this->errorMsg('该用户已存在');
     }
     // 插入数据
     $userTable->insert($username, $password, $realname);
     $result = $userTable->select($username, $password);
     $userExtraTable = new UserExtraTable();
     $userExtraTable->insert($result['user_id']);
     SQLUtil::login($username, $password);
     Util::go(URL . 'manager/');
 }
示例#2
0
文件: user_c.php 项目: Diaosir/ziku
 public function updateUser($id)
 {
     if ($id != SessionUtil::get('user_id')) {
         if (!Util::has_authority(10)) {
             $this->error(3);
         }
     }
     $sex = Util::fetch_post('sex');
     $phone = Util::fetch_post('phone');
     $email = Util::fetch_post('email');
     $qq = Util::fetch_post('qq');
     $department = Util::fetch_post('department');
     $dormitory = Util::fetch_post('dormitory');
     $major = Util::fetch_post('major');
     $birthplace = Util::fetch_post('birthplace');
     $birthday = Util::fetch_post('birthday');
     $user_table = new UserTable();
     $user_table->update($id, $phone, $email, $department);
     $user_extra_table = new UserExtraTable();
     $user_extra_table->update($id, $sex, $dormitory, $birthday, $major, $birthplace, $qq);
     Util::go_back();
 }