From 56a8a546892343550974483077ae46769bd438fe Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 22 Apr 2010 11:35:14 +0000 Subject: - Password: added hMailserver (hmail) driver git-svn-id: https://svn.roundcube.net/trunk@3531 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/password/README | 7 +++++++ plugins/password/drivers/hmail.php | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 plugins/password/drivers/hmail.php (limited to 'plugins') diff --git a/plugins/password/README b/plugins/password/README index 853e4b38f..1406fb4d5 100644 --- a/plugins/password/README +++ b/plugins/password/README @@ -34,6 +34,7 @@ 2.6. cPanel (cpanel) 2.7. XIMSS/Communigate (ximms) 2.8. Virtualmin (virtualmin) + 2.9 hMailServer (hmail) 3. Driver API @@ -199,6 +200,12 @@ installation instructions. + 2.9. hMailServer (hmail) + ------------------------ + + Requires PHP COM (Windows only). + + 3. Driver API ------------- diff --git a/plugins/password/drivers/hmail.php b/plugins/password/drivers/hmail.php new file mode 100644 index 000000000..11f8440e2 --- /dev/null +++ b/plugins/password/drivers/hmail.php @@ -0,0 +1,37 @@ + + * + */ + +function password_save($curpass, $passwd) +{ + $rcmail = rcmail::get_instance(); + + try { + $obApp = new COM("hMailServer.Application"); + } + catch (Exception $e) { + write_log('errors', 'Plugin password:' . $e->getMessage() . '. 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); + + $obDomain = $obApp->Domains->ItemByName($domain); + $obAccount = $obDomain->Accounts->ItemByAddress($username); + $obAccount->Password = $passwd; + $obAccount->Save(); + + return PASSWORD_SUCCESS; +} + +?> -- cgit v1.2.3