one for all cpanel login script?
Found this on another forum for:cpanel
whm
modernbill
webmail
The problem is when I attempt to login via index.php using this script it attempts
use server2.domain.com and gives failed login attempt - meanwhile the domain is one server 1.
Using second method (IP version), here are some problems:
- no ability / usefullness of script for clients on cpanel dedicated / vps servers or on shared / reseller plans using static IP's, not server shared IPs. How to work around that?
- tried to login to my domain hosted server #1, instead it attempted to login me using server #3 IP.
- in address bar it shows this (very insecure) and link also invalid as you can before the 2083
http://www.domain.com/:2083/login/?u...clientpassword
Anyone know of a fix?
Code:
<?
$server = "https://server1.domain.com";
$bserver = "https://server2.domain.com";
$uname = $_GET['uname'];
$pword = $_GET['pword'];
$type = $_GET['type'];
if($type == "whm")
{
Header("Location: " . $server . ":2087/login/?user=" . $uname ."&password=" . $pword . "");
}elseif($type == "cpanel")
{
Header("Location: " . $server . ":2083/login/?user=" . $uname ."&password=" . $pword . "");
}elseif($type == "webmail")
{
Header("Location: " . $server . ":2096/login/?user=" . $uname ."&password=" . $pword . "");
}elseif($type == "mbilling")
{
Header("Location: " . $bserver . "/billing?op=login&username=" . $uname ."&password=" . $pword . "");
}
?>
<html>
<body>
<?
if($type == "")
{
?>
<form method="get" action="">
Username: <input type="text" name="uname"><br />
Password: <input type="password" name="pword"><br />
Login To:
<select name="type">
<option selected>Select Login --
<option value="whm">WHM
<option value="cpanel">cPanel
<option value="webmail">WebMail
<option value="mbilling">mBill
</select>
<br /><br />
<input type="submit" value="Login">
<?
}
?>
</body>
</html>
I also tried:
Code:
<?
$domain = $_GET['domain'];
if( $domain !== "" )
{
$server = "https://server1ipaddress.com";
$bserver = "https://server2ipaddress.com";
}else{
$server = $_GET['domain'];
$bserver = $_GET['domain'];
}
$uname = $_GET['uname'];
$pword = $_GET['pword'];
$type = $_GET['type'];
if($type == "whm")
{
Header("Location: " . $server . ":2087/login/?user=" . $uname ."&pass=" . $pword . "");
}elseif($type == "cpanel")
{
Header("Location: " . $server . ":2083/login/?user=" . $uname ."&pass=" . $pword . "");
}elseif($type == "webmail")
{
Header("Location: " . $server . ":2096/login/?user=" . $uname ."&password=" . $pword . "");
}elseif($type == "mbilling")
{
Header("Location: " . $bserver . "/modernbill?op=login&username=" . $uname ."&password=" . $pword . "");
}
?>

