• R/O
  • SSH
  • HTTPS

jinrousiki: 提交


Commit MetaInfo

修訂2297 (tree)
時間2018-12-09 18:45:32
作者umethyl

Log Message

UserDB::Insert()

Change Summary

差異

--- trunk/include/controller/room_manager_class.php (revision 2296)
+++ trunk/include/controller/room_manager_class.php (revision 2297)
@@ -271,8 +271,8 @@
271271 'uname' => GM::DUMMY_BOY,
272272 'handle_name' => $dummy_boy_handle_name,
273273 'password' => $dummy_boy_password,
274+ 'icon_no' => RQ::Get()->gerd ? UserIconConfig::GERD : 0,
274275 'sex' => Sex::MALE,
275- 'icon_no' => RQ::Get()->gerd ? UserIconConfig::GERD : 0,
276276 'profile' => Message::DUMMY_BOY_PROFILE,
277277 'last_words' => Message::DUMMY_BOY_LAST_WORDS
278278 ];
--- trunk/include/database/user_db_class.php (revision 2296)
+++ trunk/include/database/user_db_class.php (revision 2297)
@@ -66,26 +66,17 @@
6666
6767 //ユーザ登録処理
6868 public static function Insert(array $list) {
69- extract($list);
70- $crypt_password = Text::Crypt($password);
71- $items = 'room_no, user_no, uname, handle_name, icon_no, sex, password, live';
72- $values = "{$room_no}, {$user_no}, '{$uname}', '{$handle_name}', {$icon_no}, '{$sex}', " .
73- "'{$crypt_password}', 'live'";
74-
75- if ($uname != GM::DUMMY_BOY) {
76- $session_id = Session::GetUniqID();
77- $ip_address = Security::GetIP();
78- $last_load_scene = RoomScene::BEFORE;
69+ $list['live'] = UserLive::LIVE;
70+ $list['password'] = Text::Crypt($list['password']);
71+ if ($list['uname'] != GM::DUMMY_BOY) {
72+ $list['session_id'] = Session::GetUniqID();
73+ $list['ip_address'] = Security::GetIP();
74+ $list['last_load_scene'] = RoomScene::BEFORE;
7975 }
76+ $query = Query::Init()->Table('user_entry')->Insert()->Into(array_keys($list));
8077
81- $stack = ['profile', 'role', 'session_id', 'last_words', 'ip_address', 'last_load_scene'];
82- foreach ($stack as $value) {
83- if (isset($$value)) {
84- $items .= ", {$value}";
85- $values .= ", '{$$value}'";
86- }
87- }
88- return DB::Insert('user_entry', $items, $values);
78+ DB::Prepare($query->Build(), array_values($list));
79+ return DB::Execute();
8980 }
9081
9182 //更新処理 (汎用)
Show on old repository browser