From 6fa344f5b19fa183b822397513fa8b0cd8537f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 3 Sep 2007 14:13:58 +0000 Subject: #172265 by chx: fix user id problems on mysql, when inserting the first two special users --- install.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index b3e2fbcbf..63a0e146f 100644 --- a/install.php +++ b/install.php @@ -969,8 +969,13 @@ function install_configure_form_submit($form, &$form_state) { variable_set('user_email_verification', FALSE); $form_state['old_values'] = $form_state['values']; $form_state['values'] = $form_state['values']['account']; - user_register_submit($form, $form_state); - db_query("INSERT INTO {users} (uid, name, mail) VALUES(%d, '%s', '%s')", 0, '', ''); + + // We precreated user 1 with placeholder values. Let's save the real values. + $account = user_load(1); + $merge_data = array('init' => $form_state['values']['mail'], 'roles' => array(), 'status' => 1); + user_save($account, array_merge($form_state['values'], $merge_data)); + // Log in the first user. + user_authenticate($form_state['values']['name'], trim($form_state['values']['pass'])); $form_state['values'] = $form_state['old_values']; unset($form_state['old_values']); variable_set('user_email_verification', TRUE); -- cgit v1.2.3