Remote Login forms for DirectAdmin v1.12 or better

ProWebUK

Verified User
Joined
Jun 9, 2003
Messages
2,326
Location
UK
Here they are :cool:


#################################


Type: CSS based simple login (html version)
Information just use the code to make a page, or strip it down and include it within your site :)

Code
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DirectAdmin Login Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.tablestyle {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	border: 1px solid #000000;
	font-size: 12px;
}

</style>
<style type="text/css">

.buttonstyle {
	border: 1px solid <?php echo "border"; ?>;
}

</style>
</head>

<body>
<form action="http://domain.com:2222/CMD_LOGIN" method="post" name="login">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"><font color="#003366" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>DIRECTADMIN 
          LOGIN</strong></font></div></td>
    </tr>
    <tr> 
      <td width="50%" height="50" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Username:</font></td>
      <td width="50%" valign="middle"> <input name="username" type="text" class="tablestyle" value="username" maxlength="26"></td>
    </tr>
    <tr> 
      <td height="48" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Password:</font></td>
      <td><input name="password" type="password" class="tablestyle" value="password"></td>
    </tr>
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"> 
          <p><br>
            <input name="Submit" type="submit" class="buttonstyle" value="Login">
            <br>
            <br>
          </p>
        </div></td>
    </tr>
  </table>
  <div align="center"></div>
</form>
</body>
</html>


#################################


Type: CSS based simple login (php version)
Information just use the code to make a page, or strip it down and include it within your site :)

Code
Code:
<?php

// change the below settings to anything you want :)

$pagetitle = "DirectAdmin Login Page";                  // Title of this page
$username = "username";                                 // Default value of username field
$password = "password";                                 // Default value of password field
$submit = "login";                                      // Text displayed on the login button

?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo "$pagetitle"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.tablestyle {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	border: 1px solid #000000;
	font-size: 12px;
}

</style>
<style type="text/css">

.buttonstyle {
	border: 1px solid <?php echo "border"; ?>;
}

</style>
</head>

<body>
<form name="login">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"><font color="#003366" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>DIRECTADMIN 
          LOGIN</strong></font></div></td>
    </tr>
    <tr> 
      <td width="50%" height="50" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Username:</font></td>
      <td width="50%" valign="middle"> <input name="username" type="text" class="tablestyle" value="<?php echo "$username"; ?>" maxlength="26"></td>
    </tr>
    <tr> 
      <td height="48" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Password:</font></td>
      <td><input name="password" type="password" class="tablestyle" value="<?php echo "$password"; ?>"></td>
    </tr>
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"> 
          <p><br>
            <input name="button" type="button" class="buttonstyle" value="<?php echo "$submit"; ?>">
            <br>
            <br>
          </p>
        </div></td>
    </tr>
  </table>
  <div align="center"></div>
</form>
</body>
</html>


#################################


Type: CSS based simple login with image based submit button (html version)
Information just use the code to make a page, or strip it down and include it within your site :)

Code
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DirectAdmin Login Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.tablestyle {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	border: 1px solid #000000;
	font-size: 12px;
}

</style>
<style type="text/css">

.buttonstyle {
	border: 1px solid <?php echo "border"; ?>;
}

</style>
</head>

<body>
<form action="http://domain.com:2222/CMD_LOGIN" method="post" name="login">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"><font color="#003366" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>DIRECTADMIN 
          LOGIN</strong></font></div></td>
    </tr>
    <tr> 
      <td width="50%" height="50" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Username:</font></td>
      <td width="50%" valign="middle"> <input name="username" type="text" class="tablestyle" value="username" maxlength="26"></td>
    </tr>
    <tr> 
      <td height="48" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Password:</font></td>
      <td><input name="password" type="password" class="tablestyle" value="password"></td>
    </tr>
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"> 
          <p><br>
            <input name="Submit" type="image" class="buttonstyle" value="Login" SRC="http://link.to/image.ext>
            <br>
            <br>
          </p>
        </div></td>
    </tr>
  </table>
  <div align="center"></div>
</form>
</body>
</html>


#################################


Type: CSS based simple login with image based submit button (php version)
Information just use the code to make a page, or strip it down and include it within your site :)

Code
Code:
<?php

// change the below settings to anything you want :)

$pagetitle = "DirectAdmin Login Page";                  // Title of this page
$username = "username";                                 // Default value of username field
$password = "password";                                 // Default value of password field
$submit = "http://link.to/image.ext";                   // Link to submit image


?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo "$pagetitle"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.tablestyle {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	border: 1px solid #000000;
	font-size: 12px;
}

</style>
<style type="text/css">

.buttonstyle {
	border: 1px solid <?php echo "border"; ?>;
}

</style>
</head>

<body>
<form name="login">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"><font color="#003366" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>DIRECTADMIN 
          LOGIN</strong></font></div></td>
    </tr>
    <tr> 
      <td width="50%" height="50" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Username:</font></td>
      <td width="50%" valign="middle"> <input name="username" type="text" class="tablestyle" value="<?php echo "$username"; ?>" maxlength="26"></td>
    </tr>
    <tr> 
      <td height="48" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Password:</font></td>
      <td><input name="password" type="password" class="tablestyle" value="<?php echo "$password"; ?>"></td>
    </tr>
    <tr> 
      <td colspan="2" class="tablestyle"><div align="center"> 
          <p><br>
            <input name="button" type="image" class="buttonstyle" SRC="<?php echo "$submit"; ?>" value="submit">
            <br>
            <br>
          </p>
        </div></td>
    </tr>
  </table>
  <div align="center"></div>
</form>
</body>
</html>


#################################

Any problems post below and i will edit this post with the fixes :)

Chris
 
login form idea...

hey fellow DA users... :cool:

ok... when using a remote login page with a username and password field that posts to the DA login form, some users are becoming confused if their login fails... the reason is that they get redirected to a *unfamilar* DA login page...

so why not make the DA login accept an optional hidden field with a URL that redirects the user back to the remote login page if the login fails...

does my attempt at an explanation make sense here...?
am I the only one that thinks this would be useful?



here's an example of what I'm trying to say:


<form action="http://domain.com:2222/CMD_LOGIN" method="post" name="login">

<input name="username" type="text" class="tablestyle" value="username" maxlength="26">

<input name="password" type="password" class="tablestyle" value="password">

<input name="FAIL_URL" type="hidden" value="http://www.domain.com?DA_LOGIN=FAILED">

<input name="Submit" type="submit" class="buttonstyle" value="Login">

</form>




Thanks,
Matt MacAdams
[email protected]
866-732-0292

Casslin Web Services
www.casslin.com
 
LOGOUT_URL will be available for 1.192. It's function is similar to FAIL_URL except that it is used when the user logs out. *Ooo.. Ahh..*:D

John
 
hi folks,

New DA owner, was looking for a way to create my own login and found this thread.

Unfortunately using the listed code in a previous message here, on a failed login the page goes to the default DA login.

I am using the latest as of this date: 1.22.4

any ideas?

here is the code that is placed within a normal html page
---
<form action="http://ehome.net:2222/CMD_LOGIN" method="post" name="login">

<input name="username" type="text" class="tablestyle" value="username" maxlength="26">

<input name="password" type="password" class="tablestyle" value="password">

<input name="FAIL_URL" type="hidden" value="http://www.ehome.net/test.html">
<input name="LOGOUT_URL" type="hidden" value="http://www.ehome.net">


<input name="Submit" type="submit" class="buttonstyle" value="Login">

</form>
---
 
It would just be a matter of adding that form field and then modifying the action to use the domain the user entered adding the :2222 to the end as well as the username and password from the other fields.
 
hello,

the script work great,

but what if I got many directadmin server ?

I want the client able to select which server that they want to login.

Thank you
 
hi folks,

New DA owner, was looking for a way to create my own login and found this thread.

Unfortunately using the listed code in a previous message here, on a failed login the page goes to the default DA login.

I am using the latest as of this date: 1.22.4

any ideas?

here is the code that is placed within a normal html page
---
<form action="http://ehome.net:2222/CMD_LOGIN" method="post" name="login">

<input name="username" type="text" class="tablestyle" value="username" maxlength="26">

<input name="password" type="password" class="tablestyle" value="password">

<input name="FAIL_URL" type="hidden" value="http://www.ehome.net/test.html">
<input name="LOGOUT_URL" type="hidden" value="http://www.ehome.net">


<input name="Submit" type="submit" class="buttonstyle" value="Login">

</form>
---
The same story for me here:(
 
Multiple Server Login Form

Hi Guys,

I've seen few people wondering how to get their clients to login to the correct server if they are running multiple DA servers.

Here's what I've done. It's not exactly the coolest or best script in the world, but it works for what I'm doing. You can figure out how to do your own form validation. I simply make sure all three fields are filled in before the form is submitted.

The script will 'build' the form action when the submit button is pressed to create a form action like this...

http://www.somedomain.com:2222/CMD_LOGIN.

This way if the user has websites on either of my servers, they login to the correct server.

Cheers!!

Place this between the <head> </head> tags.

Code:
<script language="javascript">
function checkForm() {

    document.wcc.action = "http://www." + document.wcc.domain.value + ":2222/CMD_LOGIN";
    
    
    if (document.wcc.domain.value = "") {
    	alert("Please enter your domain name")
    	document.wcc.domain.focus();
    	return false;
    }
    
    if (document.wcc.username.value = "") {
        alert("Please enter your user name")
        document.wcc.username.focus();
        return false;
    }
    
    if (document.wcc.password.value = "") {
    	alert("Please enter your password")
    	document.wcc.password.focus();
    	return false;
    }  
    
}
</script>



Place this where you want your login form to be.

Code:
<form method="post" name="wcc" id="wcc" onSubmit="checkForm();">                                                
<input type="hidden" name="referer" value="/" />
<input type="hidden" name="LOGOUT_URL" value="http://www.mydomain.co.nz" />
<input type="hidden" name="FAIL_URL" value="http://www.mydomain.co.nz/login_failed.html" />
<table width="100%" border="0" cellspacing="3" cellpadding="0">
    <tr>
	<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
		    <td><strong>Control Centre Login </strong></td>
		    <td><a href="http://www.mydomain.co.nz/help.html">?</a></td>
		</tr>
	</table></td>
    </tr>
    <tr>
	<td>Domain</td>
	<td><input name="domain" type="text" id="domain" size="15" /></td>
    </tr>
    <tr>
	<td>UserID</td>
	<td><input name="username" type="text" id="username" size="15" /></td>
    </tr>
    <tr>
	<td>Pass</td>
	<td><input name="password" type="password" id="password" size="15" /></td>
    </tr>
    <tr>
	<td> </td>
	<td><input type="submit" name="login" id="login" value="Login"></td>
    </tr>
</table>
</form>

Make sure you change the values for FAIL_URL and LOGOUT_URL.

Hope it helps.


Cheers!!
 
Last edited:
Back
Top