How to create a login page for DirectAdmin on your website

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

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

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

 
login/create.txt · Last modified: 2010/02/28 16:46 by muscardin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Please visit Automatic Backlinks to start earning free backlinks Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki