summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-10-03 20:17:04 +0000
committerthomascube <thomas@roundcube.net>2005-10-03 20:17:04 +0000
commit52c1f289c288253148bbdb742ff72104c5950dd0 (patch)
treec17454bf371b9c7e911e0224013f8614143304f8 /program
parentd3d42bde2a5d5e2c7915ee30b79dfde132feaed7 (diff)
Minor bugfixes and SMTP support
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index ebf2f2685..7b34bf632 100644
--- a/program/include/main.inc
+++ b/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();