Thank you Alec for your reply,
i´ve changed line 6 to a wrong value. Now it is the original code.
But the password plugin does not work. The behavior is almost the same when i change and save the new emailpassword.
Roundcube stuck with a blank page after I´ve saved the password.
The blank page has following URL:
"
http://127.0.0.1/?_task=settings&_action=plugin.password-save"
Here ist the last XAMP ERR Log:
[27-Feb-2018 07:05:28 UTC] PHP Fatal error: Uncaught Error: Cannot use object of type rcube_config as array in C:\xampp\htdocs\plugins\password\drivers\hmail.php:6
Stack trace:
#0 C:\xampp\htdocs\plugins\password\password.php(322): include_once()
#1 C:\xampp\htdocs\plugins\password\password.php(172): password->_save('pcshop2010', 'KnipS!2000')
#2 C:\xampp\htdocs\program\lib\Roundcube\rcube_plugin_api.php(493): password->password_save()
#3 C:\xampp\htdocs\index.php(289): rcube_plugin_api->exec_action('plugin.password...')
#4 {main}
thrown in C:\xampp\htdocs\plugins\password\drivers\hmail.php on line 6
<?php
this is my Hmail.php in (htdocs\plugins\password\drivers)
// Remote hMailServer configuration
// true: HMailserver is on a remote box (php.ini: com.allow_dcom = true)
// false: Hmailserver is on same box as PHP
$config['hmailserver_remote_dcom'] = false;
// Windows credentials
$config['hmailserver_server'] = array(
'Server' => '127.0.0.1', // hostname or ip address
'Username' => 'administrator', // windows username
'Password' => 'mypassword' // windows user password
);
/**
* hMailserver password driver
*
* @version 2.0
* @author Roland 'rosali' Liebl <myroundcube@mail4us.net>
*
* Copyright (C) 2005-2014, The Roundcube Dev Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
http://www.gnu.org/licenses/.
*/
class rcube_hmail_password
{
public function save($curpass, $passwd)
{
$rcmail = rcmail::get_instance();
if ($curpass == '' || $passwd == '') {
return PASSWORD_ERROR;
}
try {
$remote = $rcmail->config->get('127.0.0.1', false);
if ($remote)
$obApp = new COM("hMailServer.Application", $rcmail->config->get('127.0.0.1'));
else
$obApp = new COM("hMailServer.Application");
}
catch (Exception $e) {
rcube::write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage())));
rcube::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'];
if (strstr($username,'@')){
$temparr = explode('@', $username);
$domain = $temparr[1];
}
else {
$domain = $rcmail->config->get('username_domain',false);
if (!$domain) {
rcube::write_log('errors','Plugin password (hmail driver): $config[\'username_domain\'] is not defined.');
return PASSWORD_ERROR;
}
$username = $username . "@" . $domain;
}
$obApp->Authenticate($username, $curpass);
try {
$obDomain = $obApp->Domains->ItemByName($domain);
$obAccount = $obDomain->Accounts->ItemByAddress($username);
$obAccount->Password = $passwd;
$obAccount->Save();
return PASSWORD_SUCCESS;
}
catch (Exception $e) {
rcube::write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage())));
rcube::write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set.");
return PASSWORD_ERROR;
}
}
}
Thank you for your troubke
Olaf