summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-10-18 14:24:04 +0200
committerAleksander Machniak <alec@alec.pl>2012-10-18 14:24:04 +0200
commit540de577de25338d727bddf85537e1679dd49eb5 (patch)
treee22579d3f072c9545d877ac7c34d6e32d8d2d0c7 /program
parent22c67d0ec28f4c9488d26aa35151392a18c74c45 (diff)
Skip redundant SELECT on new user creation
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_user.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/program/include/rcube_user.php b/program/include/rcube_user.php
index 5a65a519d..b92187ad4 100644
--- a/program/include/rcube_user.php
+++ b/program/include/rcube_user.php
@@ -449,6 +449,7 @@ class rcube_user
'user_name' => $user_name,
'user_email' => $user_email,
'email_list' => $email_list,
+ 'language' => $_SESSION['language'],
));
// plugin aborted this operation
@@ -462,13 +463,17 @@ class rcube_user
" VALUES (".$dbh->now().", ".$dbh->now().", ?, ?, ?)",
strip_newlines($data['user']),
strip_newlines($data['host']),
- strip_newlines($data['language'] ? $data['language'] : $_SESSION['language']));
+ strip_newlines($data['language']));
if ($user_id = $dbh->insert_id('users')) {
// create rcube_user instance to make plugin hooks work
- $user_instance = new rcube_user($user_id);
- $rcube->user = $user_instance;
-
+ $user_instance = new rcube_user($user_id, array(
+ 'user_id' => $user_id,
+ 'username' => $data['user'],
+ 'mail_host' => $data['host'],
+ 'language' => $data['language'],
+ ));
+ $rcube->user = $user_instance;
$mail_domain = $rcube->config->mail_domain($data['host']);
$user_name = $data['user_name'];
$user_email = $data['user_email'];