From eaff968037c6b4462a6a134b312a162385e95dd5 Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 5 Nov 2010 07:47:41 +0000 Subject: - 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 --- plugins/password/drivers/hmail.php | 30 +++++++++++++++++++++--------- plugins/password/package.xml | 25 +++++++++++++++++++++---- 2 files changed, 42 insertions(+), 13 deletions(-) (limited to 'plugins') 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 * */ @@ -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 @@ alec@alec.pl yes - 2010-11-02 - + + - 2.1 + 2.2 1.6 @@ -27,7 +27,8 @@ GNU GPLv2 -- 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) @@ -216,5 +217,21 @@ - Fixed SQL Injection in SQL driver when using %p or %o variables in query (#1487034) + + 2010-11-02 + + + 2.1 + 1.6 + + + stable + stable + + GNU GPLv2 + +- hMail driver: Add possibility to connect to remote host + + -- cgit v1.2.3