WHMCS login to cpanel button custom template

1.5k views Asked by At

I this question is addressed to people who have made some WHMCS custom templates.

I recently changed the theme of my site and have a problem Under services for hosting you have the button for Login to cPanel and now its not working, the one next to him Login to Webmail is functioning correctly.

Here is the view page source for that segment.

<form action="https://server:2083/login/" method="post" target="_blank">
<input type="hidden" name="token" value="xxxxxxxxxxxxx" />
        <input type="hidden" name="user" value="username" />
        <input type="hidden" name="pass" value="PasswordForUser" />
        <input type="submit" value="Login to cPanel" class="btn" />
        <input type="button" value="Login to Webmail" onClick="window.open('https://server:2096/')" class="btn" />
        </form>
   

As you can see the field for cPanel is missing the onClick option and the problem is that I cannot find it anywhere in the code.

this is the line from the template filename: clientareaproductdetails.tpl

{if $moduleclientarea}<div class="moduleoutput">{$moduleclientarea|replace:'modulebutton':'btn'}</div>{/if}

if somebody can help me locate the file that contains that form I would be very very great full I have been stuck for a few days now and run out of ideas.

3

There are 3 answers

0
Danyal On

Replace this line

{if $moduleclientarea}<div class="moduleoutput">{$moduleclientarea|replace:'modulebutton':'btn'}</div>{/if}

with

{if $moduleclientarea}<div class="moduleoutput">{$moduleclientarea|replace:'modulebutton':'btn'|replace:'form':'form id="form-cpanel-clientarea"'|replace:'<input type="submit"':'<input type="submit" onclick="document.getElementById(\'form-cpanel-clientarea\').submit();"'}</div>{/if}

The above will add an id to the form and and onclick on the input element to submit the form.

0
Ashutosh Vyas On

Under Modules > Servers

Find your specific server (Example - cpanel)

Within that folder you would see clientarea.tpl.

Thats where you find your said file.

0
j.otero On

If you are working with Bootstrap, make sure you do not have an additional bootstrap js call in the footer.tpl(or header.tpl). Removing the call to that script will fix you're issue.