I noticed sites are actually charging for these scripts which is a sham. The script below allow your users to login to WHM, Cpanel, or Webmail on any server. These scripts can be easily modified for secure login and individual servers as well
Webmail Login:
In head section of page add:
PHP Code:<script language="javascript">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var webmail="http://" + username + "+" + server + ":" + password + "@" + server + "/webmail" + "/" + username + "+" + server;
window.location = webmail;
}
else {
alert("Please enter your username and password.");
}
}
// End -->
</script>
Add anywhere where you want the login box to appear, this can be fitted to match your site as well.
*****************************PHP Code:<form name=login>
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2><b>Logon to NeoMail </b></h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type=text name=username size=20 maxlength="36">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type=password name=password size=20>
</td>
</tr>
<tr>
<td>Your Domain:</td>
<td>
<input type=server value=domain.com name=server size=20>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</td>
</tr>
</table>
</form>
Cpanel Login:
First create file named cpanel.php and insert the code below
PHP Code:<?
if ($_POST["submit"]) {
if ((!$_POST["user"]) || (!$_POST["pass"]) || (!$_POST["yourdomain"])) {
echo("Please complete all fields.");
}
else {
?>
<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="0;URL=http://<?=$_POST["user"]?>:<?=$_POST["pass"]?>@<?=$_POST["yourdomain"]?>:2082"
</HEAD>
</HTML>
<?
}
}
?>
Then add this to where you want the login box, of course can be modified as long as input fields are correct.
PHP Code:<form method="post" action="cpanel.php">
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2><b>Logon to Cpanel </b></h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type="text" name="user" size='10'><br>
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type="password" name="pass" size='10'><br>
</td>
</tr>
<tr>
<td>Your Domain:</td>
<td>
[url]www.[/url]<input type="text" name="yourdomain" size='20'>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="submit" name="submit" value="Login!">
</td>
</tr>
</table>
</form>
In cpanel.php change 2082 to 2083 for secure login.
*****************************
WHM Login:
First create file named whm.php and insert the code below
PHP Code:<?
if ($_POST["submit"]) {
if ((!$_POST["user"]) || (!$_POST["pass"]) || (!$_POST["yourdomain"])) {
echo("Please complete all fields.");
}
else {
?>
<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="0;URL=http://<?=$_POST["user"]?>:<?=$_POST["pass"]?>@<?=$_POST["yourdomain"]?>:2086"
</HEAD>
</HTML>
<?
}
}
?>
Then add the login box:
PHP Code:<form method="post" action="whm.php">
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2><b>Logon to Cpanel </b></h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type="text" name="user" size='10'><br>
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type="password" name="pass" size='10'><br>
</td>
</tr>
<tr>
<td>Your Domain:</td>
<td>
[url]www.[/url]<input type="text" name="yourdomain" size='20'>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="submit" name="submit" value="Login!">
</td>
</tr>
</table>
</form>
In whm.php change 2086 to 2087 for secure login.
These are basic scripts, nothing fancy, but they do work well.
You can name the php files whatever you like just make sure to change the form method URL. You can modify these as far as the HTML look of the login boxes and the PHP coding to allow only individual servers. I posted the basics for all. In the webmail script, if you just want neomail replace "/webmail" with ":2095"



LinkBack URL
About LinkBacks
Reply With Quote








