How to create a login page for DirectAdmin on your website


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin » Skin

How to create a login page for DirectAdmin on your websiteLast Modified: Aug 23, 2014, 3:29 pm
Many webhosts want to make an easy one stop location for logging into DirectAdmin.  This can be accomplished by adding a login form on your webpage.

Replace with your domain.  If you are using https (ssl) instead of http, be sure to set it to https:// instead of http://.

It's fairly simple to do, just add the following code to your website:

<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>



The visible text has been highlighted in green, so you can change it as needed.

Also included in this form are the optional FAIL_URL and LOGOUT_URL values.  You can set them so that if a user enters a wrong usename or password, the login_failed.html will be shown, and when the hit "Logout" from within DirectAdmin, they'll be take to the logged_out.html page.   You can change the values as needed, and if you remove those 2 options, then the default DA settings will take over.  Both the login_failed.html and logged_out.html would be stored on your own website, and not through DA (as set, in this example).

If you want the login page to go straight to a particular page, you can change the "referer" value from "/" to "/CMD_USER_STATS" for example, if you wanted to go straight to the statistics page upon successful login.


Related, to change the DirectAdmin Login page itself:
http://www.directadmin.com/features.php?id=250
 
Related Helpfiles
How to change the appearance of the DirectAdmin login page
Auto-Login from external site

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST