The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Customized Logins

Discussion in 'cPanel Developers' started by CoderJedi, Dec 29, 2007.

  1. CoderJedi

    CoderJedi Registered

    Joined:
    Dec 29, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Just a suggestion for replacement for the customized login snippet located at:

    http://www.cpanel.net/cpanel-login.phps

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

    Code:
    <?php
    /*---User Edit Area---*/
    $CPLogin_UseSSL = true; // Use SSL to log in: true/false
    $CPLogin_Host = 'example.com'; // Your server's hostname
    $CPLogin_Service = "whm"; // cpanel/whm/webmail
    /*---Do Not Edit Below---*/
    $CPLogin_FailURL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1";
    if ($CPLogin_UseSSL) {
            $CPLogin_Port = array('cpanel'=>2083,'whm'=>2087,'webmail'=>2096);
            $CPLogin_URL = "https://" . $CPLogin_Host . ":" . $CPLogin_Port[$CPLogin_Service] . "/login/";
    } else {
            $CPLogin_Port = array('cpanel'=>2082,'whm'=>2086,'webmail'=>2095);
            $CPLogin_URL = "http://" . $CPLogin_Host . ":" . $CPLogin_Port[$CPLogin_Service] . "/login/";
    }
    ?>
    <html>
    <h1>[Your Name Here]</h1>
    <b>cPanel Services Login</b><br>
    <?php if ($_GET['failed']) { ?>
    <font color=#FF0000>Your login attempt failed!</font>
    <?php } ?>
    <form action="<?php echo $CPLogin_URL; ?>"  method="post">
    User: <input type="text" name="user"><br>
    Pass: <input type="password" name="pass"><br>
    <input type="hidden" name="failurl" value="<?php echo $CPLogin_FailURL; ?>" />
    <input type="hidden" name="login_theme" value="default">
    <input type="submit" value="Login">
    </form>
    </html>
    
    // I love long nights filled with long lines of code just as much (if not more) than the next guy.. but hey, why not trim the fat when you can, right?
     
    #1 CoderJedi, Dec 29, 2007
    Last edited: Dec 29, 2007
Loading...
Similar Threads - Customized Logins
  1. Luke1818
    Replies:
    1
    Views:
    413

Share This Page