Jump to content

Sync issues with cPanel Password


nkthen

Recommended Posts

I am having issues with trying to update the client's cPanel login ID and password via WHMCS.

 

I cannot update the password for cPanel login at all, even though WHMCS said that the password is updated but still reflecting the old password in the console.

 

Can I know what happened?

 

 

 

Also, I wanted to know if I change the password DIRECTLY at cPanel, will WHMCS know about it?

Link to comment
Share on other sites

No, WHMCS does not sync the cPanel password if the user changes it in cPanel. What we did was just remove the change password button in cPanel so if they ever need to change the password they have to login to WHMCS to do it. Only way at the moment to control it.

Link to comment
Share on other sites

No, WHMCS does not sync the cPanel password if the user changes it in cPanel. What we did was just remove the change password button in cPanel so if they ever need to change the password they have to login to WHMCS to do it. Only way at the moment to control it.

Remove password button at cPanel... Good idea.

 

But I still have the problems of updating password from WHMCS to cPanel.

 

Any help?

Link to comment
Share on other sites

Remove password button at cPanel... Good idea.

 

But I still have the problems of updating password from WHMCS to cPanel.

 

Any help?

 

1. Open product details

2. Change the password in the box

3. Click save changes

4. Click change password

Link to comment
Share on other sites

1. Open product details

2. Change the password in the box

3. Click save changes

4. Click change password

 

Hi, that's what I've tried. The problem faced is: the password remains unchanged in WHMCS and the password is not change in cPanel side.

 

But WHMCS gave a message that says "Password changed". Hmm...

Link to comment
Share on other sites

  • 3 weeks later...
What we did was just remove the change password button in cPanel so if they ever need to change the password they have to login to WHMCS to do it. Only way at the moment to control it.

 

Even so, this is a good idea, cause then the client can see important notices which he may have missed on email, but are published in WHMCS. And he's also one click away from the knowledge base, and ticket system if he gets stuck

Link to comment
Share on other sites

In the 'manage features' option in WHM uncheck 'Change Password'

 

My question is, is there a way to ADD a button in their cPanel that says "Change Password" but takes them to WHMCS?

 

You would have to visit cPanel for this, as you may be able to create this type of function using a cpanel plugin:

http://www.cpanel.net/plugins/devel/

 

I've been looking at this myself for a few other ideas I want to implement but haven't had time to investigate.

Link to comment
Share on other sites

Yay... now that I know how to disable the cPanel "Change Password" button, my following script makes sense and can sync your user's WHMCS and cPanel password stores. I've received a lot of help in general from this forum so far and this is me attempting to give back a little. Man, I hope that there wasn't an easier way to do this that I missed. :roll:

 

First of all, I found the attached zip on PHPClasses.org after some serious googling. This solution uses the cPanel XMLAPI that they provide us.

 

DISCALIMER: Please make backups of your code and since I'm just recently a PHP programmer (I'm an MSSQL DBA by day), don't cry to me if this breaks your code. Although, I'm sure there are folks here who can help if I can't. THIS ONLY WORKS WITH cPanel/WHM SERVERS. If you need this to work for Helm and resellers you can check http://forum.whmcs.com/showthread.php?t=6475 for tips on changing step 3. Also, this is just a first draft and it could use some logging/error handling... please feel free to contribute to this cause if you like.

 

STEPS:

1) As stated before, log into WHM and under 'Feature Manager' option select the appropriate feature list(s) and then uncheck 'Password Change'. (has to be done since I only know how to sync one direction... WHMCS to cPanel)

2) Upload whm.php to your "whmcs/includes" folder from the attached .zip file.

3) Open clientareaproductdetails.tpl for editing and FIND :

 

{$serverclientarea}

 

AND REPLACE WITH...

 

 

<td width="50%" align="center">

<input class="button" type="button" onclick="window.open('https://{$server.name}:2083/login?user={$username}&pass={$password}')" value="Login to cPanel"/>

<input class="button" type="button" onclick="window.open('https://{$server.name}:2096/login?user={$username}&pass={$password}')" value="Login to Webmail"/>

</td>

 

 

 

If you don't do step 3 the password changes will occur but the login buttons will be out of sync until the page is refreshed... which will give the impression the update didn't make it to cPanel. I only consider https because you should have SSL for changing passwords.

 

4) Add the following code to the very beginning of your clientareaproductdetails.tpl file and be sure to update

the access hash and whm_user with your info:

 

 

{php}

global $serverchangepassword;

if (isset($serverchangepassword)) {

 

require("includes/whm.php");

 

// create a new instance of whm class

$whm = new whm;

 

//capture available php variables

global $server;

global $username;

global $newserverpassword1;

 

//locate appropriate ipaddress or server name-- whm object will use either

$get_ip = "SELECT ipaddress FROM tblservers WHERE id = $server LIMIT 1";

$data = mysql_query($get_ip) or die(mysql_error());

$info = mysql_fetch_array( $data );

$ipaddress = $info['ipaddress'];

 

 

//initilize the whm object

$whm->init($ipaddress,'whm_user',

'0a3800e67f3b05954e3ec4b7a7c4d...

------------------------------------

YOUR VERY LONG ACCESS HASH CODE

------------------------------------

...188bee9c1cf6954378bd7d87ab2d4');

 

 

$result = $whm->passwd($username,$newserverpassword1);

 

//Error Handling and Logging should be added here.

 

}

 

 

{/php}

 

 

 

//----------------------------------------------------------

 

Hope this helps some folks. I'm planning on doing some more custom stuff along these lines to help differentiate us... but I thought this would be a good thing to share with the class since I couldn't find any other methods to do this in the forums. I'd be curious to know if it works for everyone else or not. :)

test.zip

Link to comment
Share on other sites

Really? LOL... figures Is there a setting required to enable it? Although I could change passwords in WHMCS, they never affected cPanel for me. I was under impression from this thread that the functionality didn't include actually updating cPanel.

Link to comment
Share on other sites

  • 2 weeks later...
Really? LOL... figures Is there a setting required to enable it? Although I could change passwords in WHMCS, they never affected cPanel for me. I was under impression from this thread that the functionality didn't include actually updating cPanel.

 

I have exact same problem. When i am in admin area of WHMCS and i try to open a clients Cpanel using the link provided in the profile area it will not work. Changing password does nothing, and the link address it provides is different then the link address sent in the confirmation email.

 

the correct link to my cpanel should be

 

https://mydomain:2082

 

but in whm it takes me to

 

https://mydomain:2087

 

Not sure if these are related or not.

Link to comment
Share on other sites

The link provided is correct - it's not a link to cPanel, it's a link to WHM where it will then automatically log you into the right account. It's the same as clicking the little cPanel icon in the accounts list in WHM.

Link to comment
Share on other sites

You need to have logged into WHM through your browser as root/your reseller first then it will work

 

I have tried this and it still doesn't work. I log into my WHM and WHMCS as root using same browser and when i click the link it asks me for the USER and PASS which when i type in never works

Link to comment
Share on other sites

Looking back i made a mistake in my original post.

 

i had written that my links should be

 

the correct link to my cpanel should be

 

https://mydomain:2082

 

but in whm it takes me to

 

https://mydomain:2087

 

Not sure if these are related or not.

 

It should have been

 

the correct link to my cpanel should be

 

http://mydomain:2082

 

but in whm it takes me to

 

https://mydomain:2087

 

Not sure if these are related or not.

 

Notice my WHM points to a http address and the WHMCS wants to send me to a https address.

 

Did i set something up wrong?

Link to comment
Share on other sites

Found the setting to change WHMCS to not use SSL and also found that in the Server Settings if i use the IP address instead of the domain name i get the problems.

 

for example what i found was WHM uses the address.

 

http://mydomain.net:2086/xfercpanel/i3wired

 

and if you put the ip address instead of the domain in the server settings of WHMCS it takes me to

 

http://(ip address):2086/xfercpanel/i3wired

 

which wont work for me.

 

Question is, did i set something up on my server wrong by chance? Should WHM be using the IP instead of the server domain name?

 

Seems strange that i have to put the DOMAIN name in the IP setting box for it to work when its labled IP address.

 

Will this make a difference?

Link to comment
Share on other sites

I'm just using the ssl connection in the servers part, as that works fine.

But if i put in a ssl link for whmcs entirely, my whmcs will just not work cause i only have one ipaddress i think.

 

But this is a good compromise as in this way my whmcs does work fine but my whm connection is secured.

Link to comment
Share on other sites

A compromise in security is never a good compromise. Try telling your customers that when someone has stolen the password or session you're sending in the clear to your WHMCS installation and steals all their details.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated