Author Topic: Cpanel password plugin update  (Read 15305 times)

Offline Nick1472

  • Newbie
  • *
  • Posts: 1
    • http://www.unnamedapps.com
Cpanel password plugin update
« 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:

  • It requires your admin password to be put in the config file
  • It passes the new password in the url with a GET


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.

Code: [Select]

//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

Offline mmaraghy

  • Jr. Member
  • **
  • Posts: 28
patched file
« Reply #1 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.

Offline Yann

  • Jr. Member
  • **
  • Posts: 46
Cpanel password plugin update
« Reply #2 on: January 04, 2010, 09:25:34 PM »
Quote from: mmaraghy;24404
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.


do I have to replace just the existing cpanel.php file with this one?

Offline Yann

  • Jr. Member
  • **
  • Posts: 46
Cpanel password plugin update
« Reply #3 on: January 04, 2010, 09:27:08 PM »
never mind, I've got it

Offline blair.sawler

  • Jr. Member
  • **
  • Posts: 34
Cpanel password plugin update
« Reply #4 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

Offline nevets007

  • Newbie
  • *
  • Posts: 0
I'm having trouble activating this plugin
« Reply #5 on: February 21, 2010, 02:47:45 PM »
Quote from: mmaraghy;24404
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.


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

Offline blair.sawler

  • Jr. Member
  • **
  • Posts: 34
Config Question
« Reply #6 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

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cpanel password plugin update
« Reply #7 on: April 24, 2010, 08:13:35 AM »
You need to change the configuration file:
Quote
Code: [Select]
//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';

Offline blair.sawler

  • Jr. Member
  • **
  • Posts: 34
Cpanel password plugin update
« Reply #8 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';

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cpanel password plugin update
« Reply #9 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.

Offline blair.sawler

  • Jr. Member
  • **
  • Posts: 34
Cpanel password plugin update
« Reply #10 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....

Offline Frazospazo

  • Jr. Member
  • **
  • Posts: 15
Hmm
« Reply #11 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...

Offline snetts

  • Newbie
  • *
  • Posts: 1
Could not save new password
« Reply #12 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:
Code: [Select]
// 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.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cpanel password plugin update
« Reply #13 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.

Offline ruburu

  • Newbie
  • *
  • Posts: 1
for webmail running on port 80 with other sites running on same host
« Reply #14 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;