From a9b4a030d159738f59e1d782dbf0d17b1a90115f Mon Sep 17 00:00:00 2001 From: alec Date: Tue, 2 Nov 2010 07:09:57 +0000 Subject: - hMail driver: Add possibility to connect to remote host (patch from Roland Liebl) git-svn-id: https://svn.roundcube.net/trunk@4165 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/password/README | 24 ++++++++++++++---------- plugins/password/config.inc.php.dist | 14 ++++++++++++++ plugins/password/drivers/hmail.php | 11 ++++++++--- plugins/password/package.xml | 22 +++++++++++++++++++--- 4 files changed, 55 insertions(+), 16 deletions(-) (limited to 'plugins/password') diff --git a/plugins/password/README b/plugins/password/README index 830a14074..a31a0e076 100644 --- a/plugins/password/README +++ b/plugins/password/README @@ -60,7 +60,7 @@ ------------------- You can specify which database to connect by 'password_db_dsn' option and - what SQL query to execute by 'password_query'. See main.inc.php file for + what SQL query to execute by 'password_query'. See main.inc.php.dist file for more info. Example implementations of an update_passwd function: @@ -165,20 +165,20 @@ ------------------------------------- You can specify which host to connect to via 'password_pop_host' and - what port via 'password_pop_port'. See config.inc.php file for more info. + what port via 'password_pop_port'. See config.inc.php.dist file for more info. 2.4. LDAP (ldap) ---------------- - See config.inc.php file. Requires PEAR::Net_LDAP2 package. + See config.inc.php.dist file. Requires PEAR::Net_LDAP2 package. 2.5. DirectAdmin Control Panel (directadmin) -------------------------------------------- - You can specify which host to connect to via 'password_directadmin_host' - and what port via 'password_direactadmin_port'. See config.inc.php file + You can specify which host to connect to via 'password_directadmin_host' + and what port via 'password_direactadmin_port'. See config.inc.php.dist file for more info. @@ -186,14 +186,14 @@ -------------------- You can specify parameters for HTTP connection to cPanel's admin - interface. See config.inc.php file for more info. + interface. See config.inc.php.dist file for more info. 2.7. XIMSS/Communigate (ximms) ------------------------------ You can specify which host and port to connect to via 'password_ximss_host' - and 'password_ximss_port'. See config.inc.php file for more info. + and 'password_ximss_port'. See config.inc.php.dist file for more info. 2.8. Virtualmin (virtualmin) @@ -207,7 +207,9 @@ 2.9. hMailServer (hmail) ------------------------ - Requires PHP COM (Windows only). + Requires PHP COM (Windows only). For access to hMail server on remote host + you'll need to define 'hmailserver_remote_dcom' and 'hmailserver_server'. + See config.inc.php.dist file for more info. 2.10. PAM (pam) @@ -221,7 +223,7 @@ ------------------------- Driver that adds functionality to change the systems user password via - the 'chpasswd' command. See config.inc.php file. + the 'chpasswd' command. See config.inc.php.dist file. Attached wrapper script (chpass-wrapper.py) restricts password changes to uids >= 1000 and can deny requests based on a blacklist. @@ -245,7 +247,8 @@ 2.13. XMail (xmail) ----------------------------------- - Driver for XMail (www.xmailserver.org). See config.inc.php file for configuration description. + Driver for XMail (www.xmailserver.org). See config.inc.php.dist file + for configuration description. 3. Driver API @@ -256,3 +259,4 @@ may return PASSWORD_SUCCESS on success or any of PASSWORD_CONNECT_ERROR, PASSWORD_CRYPT_ERROR, PASSWORD_ERROR when driver was unable to change password. See existing drivers in drivers/ directory for examples. + diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist index cf8c4f3d3..b412663ba 100644 --- a/plugins/password/config.inc.php.dist +++ b/plugins/password/config.inc.php.dist @@ -256,3 +256,17 @@ $rcmail_config['xmail_user'] = 'YourXmailControlUser'; $rcmail_config['xmail_pass'] = 'YourXmailControlPass'; $rcmail_config['xmail_port'] = 6017; + +// hMail Driver options +// ----------------------- +// Remote hMailServer configuration +// true: HMailserver is on a remote box (php.ini: com.allow_dcom = true) +// false: Hmailserver is on same box as PHP +$rcmail_config['hmailserver_remote_dcom'] = false; +// Windows credentials +$rcmail_config['hmailserver_server'] = array( + 'Server' => 'localhost', // hostname or ip address + 'Username' => 'administrator', // windows username + 'Password' => 'password' // windows user password +); + diff --git a/plugins/password/drivers/hmail.php b/plugins/password/drivers/hmail.php index 764b744fe..f7bddfd08 100644 --- a/plugins/password/drivers/hmail.php +++ b/plugins/password/drivers/hmail.php @@ -3,7 +3,7 @@ /** * hMailserver password driver * - * @version 1.1 + * @version 1.2 - 31.10.2010 * @author Roland 'rosali' Liebl * */ @@ -16,10 +16,15 @@ function password_save($curpass, $passwd) return PASSWORD_ERROR; try { - $obApp = new COM('hMailServer.Application'); + $remote = $rcmail->config->get('hmailserver_remote_dcom', false); + if ($remote) + $obApp = new COM("hMailServer.Application", $rcmail->config->get('hmailserver_server')); + else + $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):" . $e->getMessage() + . ". 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 38aa9c12a..862fdd341 100644 --- a/plugins/password/package.xml +++ b/plugins/password/package.xml @@ -15,10 +15,10 @@ alec@alec.pl yes - 2010-10-07 + 2010-11-02 - 2.0 + 2.1 1.6 @@ -27,7 +27,7 @@ GNU GPLv2 -- Fixed SQL Injection in SQL driver when using %p or %o variables in query (#1487034) +- hMail driver: Add possibility to connect to remote host @@ -200,5 +200,21 @@ - Added password_ldap_lchattr option (#1486927) + + 2010-10-07 + + + 2.0 + 1.6 + + + stable + stable + + GNU GPLv2 + +- Fixed SQL Injection in SQL driver when using %p or %o variables in query (#1487034) + + -- cgit v1.2.3