Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: Nick1472 on December 30, 2009, 09:35:47 AM

Title: Cpanel password plugin update
Post by: Nick1472 on December 30, 2009, 09:35:47 AM
Hey all,

First off, this is unofficial, I am not the writer of the password plugin. I did not like how the cpanel driver works because:


So, I modified the plugin to work like the old v2 plugin, which uses the credentials of the user who is changing the password to log in instead of the admin password.

I attached the diff file to this post, all you have to do is patch the cpanel.php file found at 'roundcubemail-0.3.1/plugins/password/drivers/cpanel.php'

Also, please note these differences in the config file for the password plugin.


//SAME
$rcmail_config['password_cpanel_host'] = 'domain.com';

// No Longer used
$rcmail_config['password_cpanel_username'] = 'username';

// No Longer Used
$rcmail_config['password_cpanel_password'] = 'password';

// This is now the webmail port, not the admin port
// I have bluehost and they use 2095(non-ssl) and 2096(ssl)
// I believe hostmonster is the same
$rcmail_config['password_cpanel_port'] = 2096;

// SAME
$rcmail_config['password_cpanel_ssl'] = true;

// The cPanel theme in use - SAME
$rcmail_config['password_cpanel_theme'] = 'bluehost';


I am not sure who maintains the password plugin, but please feel free to add it to the plugin as an option if you want.

Enjoy!
Nick
Title: patched file
Post by: mmaraghy on January 04, 2010, 05:23:32 PM
I had trouble patching the cpanel.php file using your DIFF so I had to do it manually. I attached the updated cpanel.php file for anyone else who just wants to copy and replace the original with this one. Modify your config file as described above and it works like a charm.

Enjoy.
Title: Cpanel password plugin update
Post by: Yann on January 04, 2010, 09:25:34 PM
Quote from: mmaraghy;24404I had trouble patching the cpanel.php file using your DIFF so I had to do it manually. I attached the updated cpanel.php file for anyone else who just wants to copy and replace the original with this one. Modify your config file as described above and it works like a charm.

Enjoy.

do I have to replace just the existing cpanel.php file with this one?
Title: Cpanel password plugin update
Post by: Yann on January 04, 2010, 09:27:08 PM
never mind, I've got it
Title: Cpanel password plugin update
Post by: blair.sawler on January 05, 2010, 08:02:42 AM
I have been struggling to get this plugin to work with cpanel, I will try this one out. Thanks
Title: I'm having trouble activating this plugin
Post by: nevets007 on February 21, 2010, 02:47:45 PM
Quote from: mmaraghy;24404I had trouble patching the cpanel.php file using your DIFF so I had to do it manually. I attached the updated cpanel.php file for anyone else who just wants to copy and replace the original with this one. Modify your config file as described above and it works like a charm.

Enjoy.

I use bluehost, I have had trouble getting this plugin to work. I've tried different things but this one seems easy. I used the file attached and I think I have all the setting right. I think I"m just not getting the plugin activated right. I dont even show the tabs in settings.

In the main.inc.php file I tried different things but it didn't work. What do I need to write in XXX?

$rcmail_config['plugins'] = 'XXX';

Your help is greatly appreciated. Thanks
Title: Config Question
Post by: blair.sawler on April 24, 2010, 07:53:39 AM
Hi

I am not sure what I am missing with this plug in. I have installed the cpanel driver (over wrote the old one with this one), and have configured the config file. I still cannot change the password with this plug in. Here is what I have:

=====

// Password Plugin options
$rcmail_config['password_driver'] = 'cpanel';

// Determine whether current password is required to change password.
$rcmail_config['password_confirm_current'] = true;

// Require the new password to be a certain length.
// set to blank to allow passwords of any length
$rcmail_config['password_minimum_length'] = 0;

// Require the new password to contain a letter and punctuation character
// Change to false to remove this check.
$rcmail_config['password_require_nonalpha'] = false;

// cPanel Driver options
// The cPanel Host name
$rcmail_config['password_cpanel_host'] = 'hostxxx.hostmonster.com';

// The cPanel admin username
// $rcmail_config['password_cpanel_username'] = 'username';

// The cPanel admin password
// $rcmail_config['password_cpanel_password'] = 'password';

// The cPanel port to use
//$rcmail_config['password_cpanel_port'] = 2082;
$rcmail_config['password_cpanel_port'] = 2083;

// Using ssl for cPanel connections?
$rcmail_config['password_cpanel_ssl'] = true;

// The cPanel theme in use
$rcmail_config['password_cpanel_theme'] = 'hostmonster';

=====

I am not sure why the p/w change will not take, it just comes back with the "password could not be changed" error.

Thanks
Title: Cpanel password plugin update
Post by: SKaero on April 24, 2010, 08:13:35 AM
You need to change the configuration file:
Quote//SAME
$rcmail_config['password_cpanel_host'] = 'domain.com';

// No Longer used
$rcmail_config['password_cpanel_username'] = 'username';

// No Longer Used
$rcmail_config['password_cpanel_password'] = 'password';

// This is now the webmail port, not the admin port
// I have bluehost and they use 2095(non-ssl) and 2096(ssl)
// I believe hostmonster is the same
$rcmail_config['password_cpanel_port'] = 2096;

// SAME
$rcmail_config['password_cpanel_ssl'] = true;

// The cPanel theme in use - SAME
$rcmail_config['password_cpanel_theme'] = 'bluehost';
Title: Cpanel password plugin update
Post by: blair.sawler on April 24, 2010, 08:24:00 AM
Hi

Not sure what you mean, I have changed the configuration file to this:


// cPanel Driver options
// The cPanel Host name
$rcmail_config['password_cpanel_host'] = 'hostxxx.hostmonster.com';

// The cPanel admin username
// $rcmail_config['password_cpanel_username'] = 'username';

// The cPanel admin password
// $rcmail_config['password_cpanel_password'] = 'password';

// The cPanel port to use
//$rcmail_config['password_cpanel_port'] = 2082;
$rcmail_config['password_cpanel_port'] = 2083;

// Using ssl for cPanel connections?
$rcmail_config['password_cpanel_ssl'] = true;

// The cPanel theme in use
$rcmail_config['password_cpanel_theme'] = 'hostmonster';
Title: Cpanel password plugin update
Post by: SKaero on April 24, 2010, 08:38:36 AM
Ok, check that your web mail port is correct, the port you have right now is your cpanel port.
Title: Cpanel password plugin update
Post by: blair.sawler on April 24, 2010, 09:18:06 AM
Ah yes that is what it was. Thanks I was changing different things, and forgot to change that back. Thanks so much.

Now I need to the the Vacation Auto Responder to work....
Title: Hmm
Post by: Frazospazo on May 17, 2010, 04:55:54 AM
Okay. I'm having quite a bit of trouble with this one.
Is it possible for you to send me an up-to-date password folder in which I can just upload and edit.

God knows why...
Title: Could not save new password
Post by: snetts on July 06, 2010, 10:58:51 AM
Hello guys I am kinda new to these stuff and I have tried out everything you have posted on this thread but I can't seem to get the plugin to work. Is there something I am missing.

My config.inc.php is as follows:
// cPanel Driver options
// --------------------------
// The cPanel Host name
$rcmail_config['password_cpanel_host'] = 'cso-network.org';

// The cPanel admin username
//$rcmail_config['password_cpanel_username'] = '';

// The cPanel admin password
//$rcmail_config['password_cpanel_password'] = '';

// The cPanel port to use
$rcmail_config['password_cpanel_port'] = 2082;

// Using ssl for cPanel connections?
$rcmail_config['password_cpanel_ssl'] = false;

// The cPanel theme in use
$rcmail_config['password_cpanel_theme'] = 'x3';


I have 2082 for the cpanel login and 2095 for the webmail login. Please help.
Title: Cpanel password plugin update
Post by: SKaero on July 06, 2010, 01:00:26 PM
My guess is the theme is wrong, can you post the url of CPanels main page when your logged in.
Title: for webmail running on port 80 with other sites running on same host
Post by: ruburu on January 29, 2012, 09:47:54 AM
If webmail is running port 80 with other sites running on same host(Name based virtual hosting), then the plugin will fail to save password.
You need to pass hostname in the POST data

  $out = "POST " . $url . "  HTTP/1.1\r\n";
        $out .= "Host: ".$this->host."\r\n";
        $out .= 'Authorization: Basic ' . $this->auth . "\r\n";
        $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $out .= "Content-Length: ".strlen($dataurl)."\r\n";
        $out .= "Connection: close\r\n\r\n";
        $out .= $dataurl;
Title: Cpanel password plugin update
Post by: rmillcmanagement on February 02, 2012, 04:02:57 AM
Ah yes that is what it was. Thanks I was changing different things, and forgot to change that back. Thanks so much.

    Now I need to the the Vacation Auto Responder to work....