Results 1 to 14 of 14

Thread: Remote Login forms for DirectAdmin v1.12 or better

  1. #1
    Join Date
    Jun 2003
    Location
    UK
    Posts
    2,326

    Remote Login forms for DirectAdmin v1.12 or better

    Here they are


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


    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
    OptimumServers » Managed Dedicated Servers & General Systems Management » Coming Soon!
    ProWebUK - Quality Web Services
    DirectAdmin Server Checklist

  2. #2
    Join Date
    Jul 2003
    Posts
    20

    Cool login form idea...

    hey fellow DA users...

    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
    matt@casslin.com
    866-732-0292

    Casslin Web Services
    www.casslin.com

  3. #3
    Just to let you guys know, the FAIL_URL option has been added a while back.

    John

  4. #4
    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..*

    John

  5. #5
    Where could I define the URL where users go to when they sign out?

  6. #6
    You pass it with LOGOUT_URL the same way you pass FAIL_URL (see above form)

    John

  7. #7
    Join Date
    Apr 2004
    Posts
    78
    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>
    ---

  8. #8
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    388
    can this form add a domain field. so users will be redirect to http://customerdomain:2222 and login.

  9. #9
    Join Date
    Feb 2004
    Location
    Colorado
    Posts
    4,111
    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.
    Just do what it takes to make it happen

  10. #10
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    388
    hopefully some can help with the code.

  11. #11
    Join Date
    Apr 2004
    Posts
    29
    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

  12. #12
    Join Date
    Apr 2007
    Posts
    1
    Quote Originally Posted by TheBear View Post
    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

  13. #13
    http://help.directadmin.com/item.php?id=61
    I've just tested that code (in the id=61 link) to double check it works, and I didn't have any problems.
    Wrong pass and logout both forward correctly.

    John

  14. #14
    Join Date
    May 2005
    Location
    In this Forum at the moment.
    Posts
    32

    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&#37;" 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>&nbsp;</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 by Webgecko; 05-15-2008 at 07:15 PM.
    Webgecko
    --

Similar Threads

  1. Remote syslog + directadmin problems.
    By Dixiesys in forum System-Level Technical Discussion
    Replies: 9
    Last Post: 09-17-2010, 05:59 AM
  2. Directadmin Backup to Remote Site
    By viru5 in forum General Technical Discussion & Troubleshooting
    Replies: 2
    Last Post: 04-21-2010, 03:51 AM
  3. Squirrel mail remote login How?
    By Nexxterra.com in forum General Technical Discussion & Troubleshooting
    Replies: 3
    Last Post: 07-02-2009, 02:40 PM
  4. Remote MYSQL server and Directadmin
    By FastAttack in forum MySQL / PHP
    Replies: 3
    Last Post: 09-16-2007, 12:40 PM
  5. Replies: 3
    Last Post: 02-10-2006, 09:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •