CoderJedi

Registered
Dec 29, 2007
1
0
51
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?
 
Last edited: