From bd911ba8143f07fa4f14b682ddcd559a69a208e8 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 29 Sep 2010 04:30:56 -0400
Subject: [PATCH] Pool some code for command line tools; avoid displaying password on shell (#1486947); fix msgexport now using the new imap wrapper
---
program/include/rcube_user.php | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/program/include/rcube_user.php b/program/include/rcube_user.php
index b1263ca..6a222e2 100644
--- a/program/include/rcube_user.php
+++ b/program/include/rcube_user.php
@@ -4,8 +4,8 @@
+-----------------------------------------------------------------------+
| program/include/rcube_user.inc |
| |
- | This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland |
+ | This file is part of the Roundcube Webmail client |
+ | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -74,9 +74,11 @@
if ($part == 'local') {
return $local;
}
- // if no domain was provided use the default if available
- if (empty($domain))
- $domain = $this->data['mail_host'];
+ // if no domain was provided...
+ if (empty($domain)) {
+ $rcmail = rcmail::get_instance();
+ $domain = $rcmail->config->mail_domain($this->data['mail_host']);
+ }
if ($part == 'domain') {
return $domain;
@@ -385,7 +387,7 @@
$user_email = is_array($email_list[0]) ? $email_list[0]['email'] : $email_list[0];
}
- $data = $rcmail->plugins->exec_hook('create_user',
+ $data = $rcmail->plugins->exec_hook('user_create',
array('user'=>$user, 'user_name'=>$user_name, 'user_email'=>$user_email));
// plugin aborted this operation
@@ -404,7 +406,7 @@
strip_newlines($user),
strip_newlines($host),
strip_newlines($data['alias'] ? $data['alias'] : $user_email),
- $_SESSION['language']);
+ strip_newlines($data['language'] ? $data['language'] : $_SESSION['language']));
if ($user_id = $dbh->insert_id('users')) {
// create rcube_user instance to make plugin hooks work
@@ -444,7 +446,7 @@
$record['user_id'] = $user_id;
$record['standard'] = $standard;
- $plugin = $rcmail->plugins->exec_hook('create_identity',
+ $plugin = $rcmail->plugins->exec_hook('identity_create',
array('login' => true, 'record' => $record));
if (!$plugin['abort'] && $plugin['record']['email']) {
--
Gitblit v1.9.1