Jump to content

Change Login To Plesk button in client area to auto login


magga

Recommended Posts

If you want your Login To Plesk button to automatically log the client into plesk rather than just load the plesk login screen, follow the instructions below:

 

In the client area > hosting accounts > view details (clientarea.php?action=productdetails) there is a "Login To Plesk" button if you are using Plesk or Pleskreseller.

 

For normal Plesk Module:

 

In the clientareproductdetails.tpl file:

 

Find:

 

{$serverdetails}

 

and replace this with:

 

<form method="post" action="https://{$server.name}:8443/login_up.php3" target="_blank" >
<input type="hidden" name="login_name" id="login_name" value="{$username}"/>
<input type="hidden" name="passwd" id="fid-passwd" value="{$password}"/>
<input type="submit" class="button" value="{$LANG.clientareaplesklink}" />
</form>

 

Then in your /lang/English.txt file, add the line:

 

$_LANG["clientareaplesklink"] = "Login to Plesk";

 

For Plesk Reseller Module:

 

In the clientareproductdetails.tpl file:

 

Find:

 

{$serverdetails}

 

and replace this with:

 

<form method="post" action="https://{$server.name}:8443/login_up.php3" target="_blank" >
<input type="hidden" name="login_name" id="login_name" value="{$domain}"/>
<input type="hidden" name="passwd" id="fid-passwd" value="{$password}"/>
<input type="submit" class="button" value="{$LANG.clientareaplesklink}" />
</form>

 

Then in your /lang/English.txt file, add the line:

 

$_LANG["clientareaplesklink"] = "Login to Plesk";

 

This will automatically log the client into Plesk using the password stored in WHMCS.

 

If you use this in conjunction with my "Script to automatically update Plesk passwords in WHMCS" then the client will always have the correct password listed in product details and always be able to use the automatic login link.

 

This has been tested with Plesk 8.2.1 but should work with most Plesk versions.

Link to comment
Share on other sites

  • 2 weeks later...

Assuming you are using the latest template I would have thought you should have.

 

If you go into view hosting packages > view details do you see username and password for the server ?

 

The Login to Plesk button should be next to this.

 

If not, you can still use the code I provided as this will put the button there for you.

Link to comment
Share on other sites

Maybe it is different if you are using the plesk module rather than reseller ?

 

In any case... using that code will put the login button on that page, it doesn't matter exactly where you put it, it will still work.

 

I have sent it to Matt yes, does that count as officially "submitting" it ?

 

Cheers

Link to comment
Share on other sites

  • 3 months later...

Maybe the default file has changed recently but you simply need to remove whatever code brings up the "Log into Plesk" and in it's place put the code I provided.

 

It used to be the {$serverdetails} variable that displayed this information but it may be something else now.

 

In any case, it will still work whether you replace existing code or not, it just might mean you have 2 login to Plesk buttons (one of which you need to remove).

Link to comment
Share on other sites

I was mistaken, it says "login to cpanel"

 

<form method="post" action="https://{$server.name}:8443/login.php3" target="_blank" >
<input type="hidden" name="login_name" id="login_name" value="{$username}"/>
<input type="hidden" name="passwd" id="fid-passwd" value="{$password}"/>
<input type="submit" class="button" value="{$LANG.clientareaplesklink}" />
</form>

 

I tried using the above code and {$server.name} is placing the current server (where WHMCS is installed) not the server that the client account is on.

 

Also, can I test to see what server this account is on to determine which button to display? Say {if $server.name = Plesk} or something? (Just as an example.)

Link to comment
Share on other sites

I assume you have different servers with different control panels on.. i.e. cPanel and Plesk ?

 

I'm not really sure if there is a variable you can use instead of {$server.name} which will give you the server that the client as actually on. I would imagine there probably is and once you find this out, you can then do some if statements to work out whether it is a Plesk or cPanel server and display the correct button accordingly.

Link to comment
Share on other sites

That's what I ended up doing:

 

In clientareaproductdetails.tpl, I replaced...

{$serverclientarea}

 

with...

{if $groupname == "Plesk Hosting Plans"}
<form method="post" action="https://**IP ADDRESS**:8443/login.php3" target="_blank" >
<input type="hidden" name="login_name" id="login_name" value="{$domain}"/>
<input type="hidden" name="passwd" id="fid-passwd" value="{$password}"/>
<input type="submit" class="button" value="Login to Plesk" />
</form>

{else}
{$serverclientarea}
{/if}

 

We have our Plesk servers in one group (Plesk Hosting Plans) and cPanel in another (cPanel Hosting Plans,) so I just used a if statement to determine which was being being viewed and it shows the proper login button. Works fine.

 

Now I just need to get WHMCS to be able to change passwords on plesk through the client/admin side. :/

Link to comment
Share on other sites

where are you going to display FTP passwords in WHMCS though ? There is only space for one password. Do you mean to display the FTP password here instead of the domain administrator password?

 

If so, it should be fairly easy to do this assuming the password is stored in the psa database.

Link to comment
Share on other sites

  • 3 months later...

I changed the code from nolageek a bit to be more flexible and to work with Plesk 8.4.0 on Linux

 

{if $groupname == "Plesk Hosting"}

<form method="post" action="https://{$domain}:8443/login_up.php3" target="_blank" >

<input type="hidden" name="login_name" id="login_name" value="{$domain}"/>

<input type="hidden" name="passwd" id="fid-passwd" value="{$password}"/>

<input type="submit" class="button" value="Login bij Plesk" />

</form>

 

{else}

{$serverclientarea}

{/if}

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