Jump to content
SolusVM Community
Sign in to follow this  
Koby

How to add Login link in WHMCS Client Area next to Reboot, Shutdown, Boot

Recommended Posts

Please excuse me if this has already been done somewhere as I've only been running Solusvm for a couple of days.

 

Reason: I created my first VM through WHMCS today and in the Client Area, I found the Username / Password listed in text below the Reboot, Shutdown, Boot buttons, but no easy way for the Customer to know where the login to the Solusvm Control Panel like they can in the cPanel Client Area.

 

Disclaimer: I assume it is ok to modify/add the code in solusvmpro.php for the WHMCSV2 module that is owned by Solusvm? I am also not claiming that this is the best way to do this by any means. If someone knows the param for the master server URL, it would be much cleaner. Bit too tired here to keep digging for it in the WHMCS documentation.

 

Simple Modification:

 

Find the Following Code in the solusvmpro.php for WHMCS:

function solusvmpro_ClientArea($params)
{
$code = '<input type="button" value="Reboot" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=reboot\'" />
    <input type="button" value="Shutdown" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=shutdown\'" />
    <input type="button" value="Boot" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=boot\'" />
    ';
return $code;
}

 

Replace with the following:

NOTE: Be sure you replace HOST.YOURHOSTNAME.COM with the name of your master server

function solusvmpro_ClientArea($params)
{
$code = '
<form action="https://HOST.YOURHOSTNAME.COM:5656/login.php" method="post" target="_blank">
<input type="hidden" name="username" value="' . $params["username"] . '" />
<input type="hidden" name="password" value="' . $params["password"] . '" />
<input type="submit" name="Submit" value="Login" class="button" />

<input type="button" value="Reboot" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=reboot\'" />
    <input type="button" value="Shutdown" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=shutdown\'" />
    <input type="button" value="Boot" onClick="window.location=\'clientarea.php?action=productdetails&id=' . $params[serviceid] . '&serveraction=custom&a=boot\'" />
    ';
return $code;
}

 

Hope someone else finds this useful.

Share this post


Link to post
Share on other sites

Figured out how to do this. Simple by using the info found here. No need to even edit files, but in V3 of the module, you can add customizations by renaming custom-example.php to custom.php and adding your edits in there.

Share this post


Link to post
Share on other sites

Add a login to control panel button to the clientarea controls.

put bellow code in WHMCS >> Setup >> Products and Servcies >> server >> Access Hash section

 

<controlpanelbutton>Link to control panel</controlpanelbutton>

Share this post


Link to post
Share on other sites
Add a login to control panel button to the clientarea controls.

put bellow code in WHMCS >> Setup >> Products and Servcies >> server >> Access Hash section

 

<controlpanelbutton>Link to control panel</controlpanelbutton>

 

I second that again!. It would be awesome if we had a button to log into the Client Control Panel!

:)

Share this post


Link to post
Share on other sites
Add a login to control panel button to the clientarea controls.

put bellow code in WHMCS >> Setup >> Products and Servcies >> server >> Access Hash section

 

<controlpanelbutton>Link to control panel</controlpanelbutton>

 

Thanks so much bud this works perfect that's been annoying me to no end

Also is there a way to pass the user variables so its single sign on via clicking it?

 

does this trick work for all the other buttons?

Edited by spyngamerman

Share this post


Link to post
Share on other sites
Thanks so much bud this works perfect that's been annoying me to no end

Also is there a way to pass the user variables so its single sign on via clicking it?

 

does this trick work for all the other buttons?

 

Its possible but, You can get problem if your client's have multiple vps in same whmcs account

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.