summaryrefslogtreecommitdiff
path: root/plugins/password
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-11-05 07:47:41 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-11-05 07:47:41 +0000
commiteaff968037c6b4462a6a134b312a162385e95dd5 (patch)
treeb59903d2df0b7e20521531db60c24826e9695adf /plugins/password
parentb81ff702c28592ab86f5abbb3c277e0ee899b4d5 (diff)
- hMail driver: add username_domain detection (#1487100)
- hMail driver: HTML tags in logged messages should be stripped off (#1487099) git-svn-id: https://svn.roundcube.net/trunk@4183 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password')
-rw-r--r--plugins/password/drivers/hmail.php30
-rw-r--r--plugins/password/package.xml25
2 files changed, 42 insertions, 13 deletions
diff --git a/plugins/password/drivers/hmail.php b/plugins/password/drivers/hmail.php
index f7bddfd08..39a87ab34 100644
--- a/plugins/password/drivers/hmail.php
+++ b/plugins/password/drivers/hmail.php
@@ -3,7 +3,7 @@
/**
* hMailserver password driver
*
- * @version 1.2 - 31.10.2010
+ * @version 1.3 - 05.11.2010
* @author Roland 'rosali' Liebl <myroundcube@mail4us.net>
*
*/
@@ -12,7 +12,7 @@ function password_save($curpass, $passwd)
{
$rcmail = rcmail::get_instance();
- if($curpass == '' || $passwd == '')
+ if ($curpass == '' || $passwd == '')
return PASSWORD_ERROR;
try {
@@ -23,16 +23,27 @@ function password_save($curpass, $passwd)
$obApp = new COM("hMailServer.Application");
}
catch (Exception $e) {
- write_log('errors', "Plugin password (hmail driver):" . $e->getMessage()
- . ". This problem is often caused by DCOM permissions not being set.");
+ write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage())));
+ write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set.");
return PASSWORD_ERROR;
}
$username = $rcmail->user->data['username'];
- $temparr = explode('@', $username);
- $domain = $temparr[1];
- $obApp->Authenticate($username, $curpass);
+ if (strstr($username,'@')){
+ $temparr = explode('@', $username);
+ $domain = $temparr[1];
+ }
+ else {
+ $domain = $rcmail->config->get('username_domain',false);
+ if (!$domain) {
+ write_log('errors','Plugin password (hmail driver): $rcmail_config[\'username_domain\'] is not defined.');
+ write_log('errors','Plugin password (hmail driver): Hint: Use hmail_login plugin (http://myroundcube.googlecode.com');
+ return PASSWORD_ERROR;
+ }
+ $username = $username . "@" . $domain;
+ }
+ $obApp->Authenticate($username, $curpass);
try {
$obDomain = $obApp->Domains->ItemByName($domain);
$obAccount = $obDomain->Accounts->ItemByAddress($username);
@@ -40,8 +51,9 @@ function password_save($curpass, $passwd)
$obAccount->Save();
return PASSWORD_SUCCESS;
}
- catch(Exception $e) {
- write_log('errors', "Plugin password (hmail driver):" . $e->getMessage());
+ catch (Exception $e) {
+ write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage())));
+ write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set.");
return PASSWORD_ERROR;
}
}
diff --git a/plugins/password/package.xml b/plugins/password/package.xml
index 862fdd341..a14fb0c0c 100644
--- a/plugins/password/package.xml
+++ b/plugins/password/package.xml
@@ -15,10 +15,10 @@
<email>alec@alec.pl</email>
<active>yes</active>
</lead>
- <date>2010-11-02</date>
- <time>09:00:00</time>
+ <date></date>
+ <time></time>
<version>
- <release>2.1</release>
+ <release>2.2</release>
<api>1.6</api>
</version>
<stability>
@@ -27,7 +27,8 @@
</stability>
<license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license>
<notes>
-- hMail driver: Add possibility to connect to remote host
+- hMail driver: add username_domain detection (#1487100)
+- hMail driver: HTML tags in logged messages should be stripped off (#1487099)
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@@ -216,5 +217,21 @@
- Fixed SQL Injection in SQL driver when using %p or %o variables in query (#1487034)
</notes>
</release>
+ <release>
+ <date>2010-11-02</date>
+ <time>09:00:00</time>
+ <version>
+ <release>2.1</release>
+ <api>1.6</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license>
+ <notes>
+- hMail driver: Add possibility to connect to remote host
+ </notes>
+ </release>
</changelog>
</package>