Hello,
I need help with plugin change password , i'm using Roundcube Webmail 1.0.2 & cPanel Version 11.44.1
I have try with cPanel Driver options & sql Driver options but both doesn't work & get error An error occurred! ,Could not save new password
// cPanel Driver options
// --------------------------
// The cPanel Host name
$config['password_cpanel_host'] = 'xxxxx.com';
// The cPanel admin username
$config['password_cpanel_username'] = 'user of cpanel';
// The cPanel admin password
$config['password_cpanel_password'] = 'password of cpanel';
// The cPanel port to use
$config['password_cpanel_port'] = 2082;
---------------------------------------------
// SQL Driver options
// ------------------
// PEAR database DSN for performing the query. By default
// Roundcube DB settings are used.
$config['password_db_dsn'] = 'mysql://username:password@localhost/database';
// The SQL query used to change the password.
// Default: "SELECT update_passwd(%c, %u)"
$config['password_query'] = 'SELECT update_passwd(%c, %u)';
$config['password_crypt_hash'] = 'md5';
$config['password_idn_ascii'] = false;
$config['password_dovecotpw_method'] = 'CRAM-MD5';
$config['password_dovecotpw_with_method'] = false;
$config['password_hash_algorithm'] = 'sha1';
$config['password_hash_base64'] = false;
----------------------------------------------------------
wish to help to activation options of change password with any driver options
Did you follow the steps in the README in the password plugin directory?
Quote from: SKaero on September 11, 2014, 04:33:43 AM
Did you follow the steps in the README in the password plugin directory?
Yes , I did
OK then what is in the error log?
Message of error is "Could not save new password." when I try to change the Password
Error log as below :
[13-Sep-2014 02:26:02 -0500]: DB Error: [1305] FUNCTION db_mail.update_passwd does not exist (SQL Query: SELECT update_passwd('xxx', '
[email protected]')) in /home/acco/public_html/mail/program/lib/Roundcube/rcube_db.php on line 467 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)
Its trying to use the sql driver, if your server is using cPanel you need to use the cPanel driver.
I am grateful to you for your help
I have try with cPanel driver option but it doesn't work also , and nothing in Error log , But I get same error ("Could not save new password.") when I try to change password .
Information of cPanel Driver options as below :
Quote
$config['password_cpanel_host'] = 'xxxxx.com';
$config['password_cpanel_username'] = 'user_cpanel';
$config['password_cpanel_password'] = 'password_cpanel';
$config['password_cpanel_port'] = 2082;
I have also Installed cPanel XMLAPI Client Class into Roundcube program/lib directory
Information of xmlapi.php as below :
Quote
// should debugging statements be printed?
private $debug = false;
// The host to connect to
private $host = 'xxxxx.com';
// the port to connect to
private $port = '2082';
// should be the literal strings http or https
private $protocol = 'http';
// output that should be given by the xml-api
private $output = 'simplexml';
// literal strings hash or password
private $auth_type = null;
// the actual password or hash
private $auth = null;
// username to authenticate as
private $user = null;
// The HTTP Client to use
private $http_client = 'curl';
Note : The old Roundcube Version 0.8.1 which was working with cPanel Driver options it has some difference with the new Roundcube 1.0.2 as below :
1- It was have two config extra
Quote$rcmail_config['password_cpanel_ssl'] = false;
$rcmail_config['password_cpanel_theme'] = 'x3'; .
2- It wasn't need to Installe cPanel XMLAPI Client Class .
Now the plugin doesn't work in Roundcube 1.0.2 , Please help me to make it work
:'(
Any help please
Can anyone help me in my issues please :'(
There should be an error log somewhere that would have useful information in it. Without an error log I can't tell anything else without having access to the server.
When I use cPanel driver options it doesn't wrote any error in logs errors of roundcube , suport of hostgator told me I should to use sql driver options , So can u help me to correction my config of sql driver options please
My config of sql driver options
Quote// PEAR database DSN for performing the query. By default
// Roundcube DB settings are used.
$config['password_db_dsn'] = 'mysql://username:password@localhost/database';
// The SQL query used to change the password.
// Default: "SELECT update_passwd(%c, %u)"
$config['password_query'] = 'SELECT update_passwd(%c, %u)';
$config['password_crypt_hash'] = 'md5';
$config['password_idn_ascii'] = false;
$config['password_dovecotpw_method'] = 'CRAM-MD5';
$config['password_dovecotpw_with_method'] = false;
$config['password_hash_algorithm'] = 'sha1';
$config['password_hash_base64'] = false;
The error in logs errors is
QuoteDB Error: [1305] FUNCTION dbmail.update_passwd does not exist (SQL Query: SELECT update_passwd('xxxx', '[email protected]')) in /home/projects/public_html/x_mail/lib/Roundcube/rcube_db.php on line 467 (POST /?_task=settings&_action=plugin.password-save?_task=&_action=)
I'm tired with this issue
If your hosted on HostGator then you can't use the SQL option you have to use the cPanel option. Also if I had to guess you need to set the protocol to https but I can't say for sure without being able to look at it myself.
Thanks for ur help
I will try again with cPanel driver options and will ask host supports to check it
Hi i dont know if you got the solution already, but if you still need, I think i have solution for that
Yes I have the same problem that you had before. here some informations
1. I hosted on bluehost ( i do not know where did you host yours)
2. using cpanel
3. I installed the new version of roundcube 1.0.5
4. I used plugin_manager from myroundcube.com
before I have a problem in changing and saving a new password, it went to white blank page. To make work i did like this.
1. registed the password plugin in the config.inc.php it is located in config folder in order to activate it. it looks like this:
$config['plugins'] = array('plugin_manager','password');
2. I was not using the cpanel driver ( plugins/password/drivers/cpanel.php ) from the roundcube version 1.0.5. which is @version 3.0 * @author Christian Chech <christian-chechfr>
But i still used the previous on from the version 0.8 or 0.9 that is the @version 2.0 * @author Fulvio Venturelli <
[email protected]>
I just simple replace it with the version 2.0
3. edit the config.inc.php (" located in plugins/password/ ")
change the plugin option from sql (default) to cpanel like below
$config['password_driver'] = 'cpanel';
then scroll down find the cpanel driver option,it looks like this:
// cPanel Driver options
// --------------------------
// The cPanel Host name
$config['password_cpanel_host'] = 'box804.bluehost.com'; <---this host cpanel of bluehost
// The cPanel admin username
$config['password_cpanel_username'] = 'xxxxxxx'; <------------your Cpanel's username
// The cPanel admin password
$config['password_cpanel_password'] = 'xxxxxx';<---------------------your password
// The cPanel port to use
$config['password_cpanel_port'] = 2083; <--------the port that using to access your cpanel
in the new configuration in roundcube version 1.0.5 its end here, but i was still adding the two lines just like in the previous version as below:
-------------------------------------------------------------------------------------------------------
the previous version was look like this
// Using ssl for cPanel connections?
$rcmail_config['password_cpanel_ssl'] = true;
// The cPanel theme in use
$rcmail_config['password_cpanel_theme'] = 'rsx3';
BUT I CHANGE to THIS (change the $rcmail_config to $config)
// Using ssl for cPanel connections?
$config['password_cpanel_ssl'] = true;
// The cPanel theme in use
$config['password_cpanel_theme'] = 'rsx3';
I don not know if it gonna work with you but mine is working just find
Hi raflie, I have the same problem(The could not save password).
I did try your instruction above but did not solve my problem.
Any tips please..
When i try to manually run the url for change password in the browser address bar, below is the error message.
Sorry, the password you selected cannot be used because it is too weak and would be too easy to guess. Please select a password with strength rating of 50 or higher.
url: https://box450.bluehost.com:2083/cpsess3548139985/frontend/bluehost/mail/dopasswdpop.html?email=bryan&domain=mydomain.com&password=Something!23
Anyone could help me? Thanks
It seems like the password your trying to use is too week, pick a stronger password.
Thanks for the reply,SKaero.. ;D
I tried a lot password, but still. I even used their(bluehost) password generator.
I used the write_log method and the result is below. could check it if there is something wrong.
Quote[11-Mar-2015 19:48:43 -0600]: <jo61r1eg> Response:HTTP/1.1 401 Access Denied
Set-Cookie: cprelogin=no; HttpOnly; path=/; port=2083; secure
Set-Cookie: cpsession=%3ai2Ld9CTSzlcDYHYY9rX_NbQBs6PoqE74an8sLc_FOvn9NfpVncx36a4fER4AHTUN%2cf5eb6d560110054f39353ceb1df9e16941e3a06678cb19b189be71013fc25d81; HttpOnly; path=/; port=2083; secure
Server: cpsrvd/11.44.2.4
Content-type: text/html; charset="utf-8"
Connection: close
Date: Thu, 12 Mar 2015 01:48:43 GMT
Content-Length: 2572
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="/cPanel_magic_revision_1263758030/unprotected/cpanel/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cPanel® 11</title>
<link rel="stylesheet" href="/cPanel_magic_revision_1355099890/unprotected/cpanel/style_optimized.css" type="text/css" />
<!--[if IE]>
<style type="text/css">
#mid{
height:300px;
}
</style>
<![endif]-->
<meta name="robots" content="noindex, nofollow" />
</head>
<body>
<div id="wrap">
<div id="top"></div>
<div id="mid">
<div id="content-wrap" align="center">
<script type="text/javascript">
var url = "https://my.bluehost.com/cgi/account/cpanel";
var query = window.location.search;
var c = query.indexOf("failurl=");
if (c >= 0) {
var s = query.substring(c + 8);
if (s.indexOf("&") >= 1)
s = s.substring(0, s.indexOf("&"));
url = unescape(s);
}
else {
url = url + "?goto_uri=" + window.location.pathname;
}
window.location.href = url;
</script>
<noscript>
<meta http-equiv="refresh" content="0;url=https://my.bluehost.com/cgi/account/cpanel">
</noscript>
<form action="/login/" method="post" >
<input type="hidden" name="login_theme" value="cpanel" />
<table width="200px" class="login" cellpadding="0" cellspacing="0">
<tr>
<td align="left" colspan="2"><strong>Login</strong></td>
</tr>
<tr>
<td class="login_lines">Username </td>
<td class="login_lines"><input autofocus="autofocus" id="user" type="text" name="user" size="16" tabindex="1" /></td>
</tr>
<tr class="row2">
<td class="login_lines">Password </td>
<td class="login_lines"><input id="pass" type="password" name="pass" size="16" tabindex="2" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center"><input type="submit" value="Login" class="input-button" tabindex="3" /></td>
</tr>
</table>
<input type="hidden" name="goto_uri" value="/frontend/rsx3/mail/dopasswdpop.html?email=bryan&domain=aaz-univ.com&password=bryanbulan123456789" />
</form>
<script type="text/javascript">
//<![CDATA[
/* Must not include external javascript -jnk 06.20.09 */
document.getElementById("user").focus();
//]]>
</script>
</div>
</div>
<div id="bot">
</div>
© cPanel, Inc. 2011
</div>
</body>
</html>
Where did you put the log statement?
I put it after this
Quote$response = $this->HTTP->getData('mail/dopasswdpop.html', $data);
Your not using the latest version of the password plugin. Update Roundcube and the password plugin and try again.
I also did it, but same error.
The line you posted that you put the debug line after is not in the current version of the plugin.
Does below is the latest version?
Quote<?php
/**
* cPanel Password Driver
*
* Driver that adds functionality to change the users cPanel password.
* Originally written by Fulvio Venturelli <[email protected]>
*
* Completely rewritten using the cPanel API2 call Email::passwdpop
* as opposed to the original coding against the UI, which is a fragile method that
* makes the driver to always return a failure message for any language other than English
* see http://trac.roundcube.net/ticket/1487015
*
* This driver has been tested with o2switch hosting and seems to work fine.
*
* @version 3.0
* @author Christian Chech <[email protected]>
*
* Copyright (C) 2005-2013, 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_cpanel_password
{
public function save($curpas, $newpass)
{
require_once 'xmlapi.php';
$rcmail = rcmail::get_instance();
$this->cuser = $rcmail->config->get('password_cpanel_username');
// Setup the xmlapi connection
$this->xmlapi = new xmlapi($rcmail->config->get('password_cpanel_host'));
$this->xmlapi->set_port($rcmail->config->get('password_cpanel_port'));
$this->xmlapi->password_auth($this->cuser, $rcmail->config->get('password_cpanel_password'));
$this->xmlapi->set_output('json');
$this->xmlapi->set_debug(0);
if ($this->setPassword($_SESSION['username'], $newpass)) {
return PASSWORD_SUCCESS;
}
else {
return PASSWORD_ERROR;
}
}
/**
* Change email account password
*
* Returns true on success or false on failure.
* @param string $password email account password
* @return bool
*/
function setPassword($address, $password)
{
if (strpos($address, '@')) {
list($data['email'], $data['domain']) = explode('@', $address);
}
else {
list($data['email'], $data['domain']) = array($address, '');
}
$data['password'] = $password;
$query = $this->xmlapi->api2_query($this->cuser, 'Email', 'passwdpop', $data);
$query = json_decode($query, true);
if ($query['cpanelresult']['data'][0]['result'] == 1) {
return true;
}
return false;
}
}
Yes that looks to be the current version.
I did try it also, still not working. The message is could not save the password.
Whats in the error log?
There is no error log..
Please see my attached file.
There is no error log file.
Add a log statement after:
$query = $this->xmlapi->api2_query($this->cuser, 'Email', 'passwdpop', $data);
You mean the code below?
write_log('sample','reponse:', $query);
If you mean the above code, below is the result.
Quote[12-Mar-2015 18:40:08 -0600]: <701n7aad> reponse: