From 30515b04bae17fd85c7f78c837e7f6d53ee2405a Mon Sep 17 00:00:00 2001 From: roundcube Date: Mon, 3 Oct 2005 20:17:04 +0000 Subject: Minor bugfixes and SMTP support git-svn-id: https://svn.roundcube.net/trunk@16 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/main.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'roundcubemail/program/include') diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index ebf2f2685..7b34bf632 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/program/include/main.inc @@ -303,15 +303,17 @@ function rcmail_create_user($user, $host) if ($user_id = $DB->insert_id()) { + $user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $host); + $user_name = $user!=$user_email ? $user : ''; + // also create a new identity record $DB->query(sprintf("INSERT INTO %s (user_id, `default`, name, email) - VALUES (%d, '1', '%s', '%s@%s')", + VALUES (%d, '1', '%s', '%s')", get_table_name('identities'), $user_id, - $user, - $user, - $host)); + $user_name, + $user_email)); // get existing mailboxes $a_mailboxes = $IMAP->list_mailboxes(); -- cgit v1.2.3