summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/hmail.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-04-22 11:35:14 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-04-22 11:35:14 +0000
commit56a8a546892343550974483077ae46769bd438fe (patch)
tree6d95dcce2793e356b919ccf03e90b2102e474429 /plugins/password/drivers/hmail.php
parent8877c8c2925e6d67d4c4022b359fd3d65d76b0b9 (diff)
- Password: added hMailserver (hmail) driver
git-svn-id: https://svn.roundcube.net/trunk@3531 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/drivers/hmail.php')
-rw-r--r--plugins/password/drivers/hmail.php37
1 files changed, 37 insertions, 0 deletions
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 @@
+<?php
+
+/**
+ * hMailserver password driver
+ *
+ * @version 1.0
+ * @author Roland 'rosali' Liebl <myroundcube@mail4us.net>
+ *
+ */
+
+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;
+}
+
+?>