Jump to content

Login To Direct Admin Just By Clicking A Button Using PHP


Recommended Posts

Hello,

Anyone having experience with this - 

I want my WHMCS users to click and login to their Direct Admin Account from the services page - however I don't want to do this from  WHMCS System Settings -> Servers 

I want to do this using a Button using  username password / api, which allows an end user to login to his cpanel account just by clicking the button.

Is this possible ? can anyone please help...Thanks 

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @ManagedCloud-Hosting,

DirectAdmin have an API which you could potentially leverage in your custom code: https://help.directadmin.com/item.php?id=523

This isn't currently a function that's implemented in the DirectAdmin module, but is potentially something we can look at if there's demand in future.

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

I was checking with the DA help pages - I found two scripts, how to make them work ? Please help...thanks 

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

https://community.directadmin.com/threads/custom-login-script.37661/

<style>
    *{ FONT-SIZE: 8pt; FONT-FAMILY: verdana; }
    b { FONT-WEIGHT: bold; }
    .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; }
    td.list { BACKGROUND: #EEEEEE; white-space: nowrap; }
</style>
<table cellspacing=1 cellpadding=5>
<tr>
    <td class=listtitle colspan=2>Please enter your Username and Password</td>
</tr>
<form action="" method="POST" name="form">
<input type=hidden name=referer value="/">
<input type=hidden name=FAIL_URL value="http://www.yourdomain.com/login_failed.html">
<input type=hidden name=LOGOUT_URL value="http://www.yourdomain.com/logged_out.html">

<tr>
    <td class=list align=right>Website:</td><td class=list>http://<input type=text name=website id="website">:2222</td>
</tr>
<tr>
    <td class=list align=right>Username:</td><td class=list><input type=text name=username></td>
</tr>
<tr>
    <td class=list align=right>Password:</td><td class=list><input type=password name=password></td>
</tr>
<tr>
    <td class=listtitle align=right colspan=2><input type=submit value='Login' onclick="login();"></td>
</tr>
</form>
</table>

<script type="text/javascript">
function login() {
    website = document.getElementById('website').value;
    document.form.action = 'http://'+website+':2222/CMD_LOGIN';
    document.form.submit();
    return false;
}
</script>

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

https://help.directadmin.com/item.php?id=61

<style>
    *{ FONT-SIZE: 8pt; FONT-FAMILY: verdana; }
    b { FONT-WEIGHT: bold; }
    .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; }
    td.list { BACKGROUND: #EEEEEE; white-space: nowrap; }
</style>
<table cellspacing=1 cellpadding=5>
<tr>
    <td class=listtitle colspan=2>Please enter your Username and Password</td>
</tr>
<form action="http://www.yourdomain.com:2222/CMD_LOGIN" method="POST" name="form">
<input type=hidden name=referer value="/">
<input type=hidden name=FAIL_URL value="http://www.yourdomain.com/login_failed.html">
<input type=hidden name=LOGOUT_URL value="http://www.yourdomain.com/logged_out.html">

<tr>
    <td class=list align=right>Username:</td><td class=list><input type=text name=username></td>
</tr>
<tr>
    <td class=list align=right>Password:</td><td class=list><input type=password name=password></td>
</tr>
<tr>
    <td class=listtitle align=right colspan=2><input type=submit value='Login'></td>
</tr>
</form>
</table>

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

 

 

 

Edited by ManagedCloud-Hosting
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