Adding a cPanel/WHM/WebMail login box to your site.

Nibuha

Member
Feb 3, 2004
19
0
151
Or

A old system i used was having them input the domain ... that is a easy way and they do not need to know IP or anything.


HTML:
<HTML><HEAD><TITLE></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
	font-size: 10px;
}
-->
</style></HEAD>
<BODY vLink=#808080 aLink=#808080 link=#808080 leftMargin=0 topMargin=0>
<SCRIPT language=javascript>
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var domain = form.domain.value;
var port = form.port.value;
if (username && password && domain && port) {
var cpanel = "http://" + username + ":" + password + "@" + domain + port;
window.location = cpanel;
}
else {
alert("Please enter the account details contained in your welcome e-mail.\n");
   }
}
//  End -->
</SCRIPT>
<CENTER>
  <TABLE width="24%" height=170 
      border=0 cellPadding=0 cellSpacing=0 
      borderColor=#111111 id=AutoNumber7 style="BORDER-COLLAPSE: collapse">
    <TBODY>
      <TR>
        <TD vAlign=top width="75%" 
          background="Nibuha Hosting - cheap hosting, reseller hosting, smtp servers, cpanel, fantastico_files/loginbg.gif" 
          height=98>
          <FORM action=--WEBBOT-SELF-- method=post>
            <!--webbot bot="SaveResults" u-file="fpweb:///_private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" -->
            <P><SPAN style="FONT-SIZE: 8.5pt"><B><FONT face=Arial 
            color=#666666>Client Login</FONT><FONT face=Arial 
            color=#999999><BR>
              </FONT></B></SPAN><FONT face=Arial 
            color=#999999><FONT size=1>username:<BR>
              <INPUT 
            style="BORDER-RIGHT: #808080 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #808080 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: #808080 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana" 
            size=14 name=username>
              </FONT><FONT style="FONT-SIZE: 7pt" 
            size=1><BR>
              password:<BR>
              </FONT><FONT size=1>
              <INPUT 
            style="BORDER-RIGHT: #808080 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #808080 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: #808080 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana" 
            type=password size=14 name=password>
              <BR>
              domain:<BR>
              <FONT 
            style="FONT-SIZE: 7pt"><SPAN style="FONT-SIZE: 8.5pt">
              <INPUT 
            style="BORDER-RIGHT: #808080 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #808080 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: #808080 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana" 
            size=14 name=domain>
              <BR>
              port:<BR>
              <SELECT 
            style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; FONT-FAMILY: Verdana" 
            size=1 name=port>
                <OPTION value=:2082 selected>cPanel Login - 2082</OPTION>
                <OPTION value=:2086>Reseller Login - 2086</OPTION>
              </SELECT>
              <!--webbot bot="HTMLMarkup" startspan -->
              <INPUT style="FONT-WEIGHT: bold; FONT-SIZE: 7pt; FONT-FAMILY: Verdana" onclick=Login(this.form) type=button value=Login name=button>
              <!--webbot bot="HTMLMarkup" endspan i-checksum="32450" -->
              <BR>
              </SPAN></FONT></FONT></FONT><FONT 
            style="FONT-SIZE: 7pt" face=Verdana color=#999999 size=1>Webmail login - click <A 
            href="http://www.nibuhahosting.com/wlogin/">here</A></FONT></P>
        </FORM></TD>
      </TR>
    </TBODY>
  </TABLE>
</CENTER>




	
</BODY>

</HTML>
 
Last edited:

chadi

BANNED
Apr 20, 2004
415
0
166
Nibuha said:
Or

A old system i used was having them input the domain ... that is a easy way and they do not need to know IP or anything.


HTML:
<HTML><HEAD><TITLE></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
	font-size: 10px;
}
-->
</style></HEAD>
<BODY vLink=#808080 aLink=#808080 link=#808080 leftMargin=0 topMargin=0>
<SCRIPT language=javascript>
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var domain = form.domain.value;
var port = form.port.value;
if (username && password && domain && port) {
var cpanel = "http://" + username + ":" + password + "@" + domain + port;
window.location = cpanel;
}
else {
alert("Please enter the account details contained in your welcome e-mail.\n");
   }
}
//  End -->
</SCRIPT>
<CENTER>
  <TABLE width="24%" height=170 
      border=0 cellPadding=0 cellSpacing=0 
      borderColor=#111111 id=AutoNumber7 style="BORDER-COLLAPSE: collapse">
    <TBODY>
      <TR>
        <TD vAlign=top width="75%" 
          background="Nibuha Hosting - cheap hosting, reseller hosting, smtp servers, cpanel, fantastico_files/loginbg.gif" 
          height=98>
          <FORM action=--WEBBOT-SELF-- method=post>
            <!--webbot bot="SaveResults" u-file="fpweb:///_private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" -->
            <P><SPAN style="FONT-SIZE: 8.5pt"><B><FONT face=Arial 
            color=#666666>Client Login</FONT><FONT face=Arial 
            color=#999999><BR>
              </FONT></B></SPAN><FONT face=Arial 
            color=#999999><FONT size=1>username:<BR>
              <INPUT 
            style="BORDER-RIGHT: #808080 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #808080 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: #808080 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana" 
            size=14 name=username>
              </FONT><FONT style="FONT-SIZE: 7pt" 
            size=1><BR>
              password:<BR>
              </FONT><FONT size=1>
              <INPUT 
            style="BORDER-RIGHT: #808080 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #808080 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: #808080 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana" 
            type=password size=14 name=password>
              <BR>
              domain:<BR>
              <FONT 
            style="FONT-SIZE: 7pt"><SPAN style="FONT-SIZE: 8.5pt">
              <INPUT 
            style="BORDER-RIGHT: #808080 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #808080 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: #808080 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana" 
            size=14 name=domain>
              <BR>
              port:<BR>
              <SELECT 
            style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 7pt; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; FONT-FAMILY: Verdana" 
            size=1 name=port>
                <OPTION value=:2082 selected>cPanel Login - 2082</OPTION>
                <OPTION value=:2086>Reseller Login - 2086</OPTION>
              </SELECT>
              <!--webbot bot="HTMLMarkup" startspan -->
              <INPUT style="FONT-WEIGHT: bold; FONT-SIZE: 7pt; FONT-FAMILY: Verdana" onclick=Login(this.form) type=button value=Login name=button>
              <!--webbot bot="HTMLMarkup" endspan i-checksum="32450" -->
              <BR>
              </SPAN></FONT></FONT></FONT><FONT 
            style="FONT-SIZE: 7pt" face=Verdana color=#999999 size=1>Webmail login - click <A 
            href="http://www.nibuhahosting.com/wlogin/">here</A></FONT></P>
        </FORM></TD>
      </TR>
    </TBODY>
  </TABLE>
</CENTER>




	
</BODY>

</HTML>
That form is not working correctly for sure. You see, I did a test and it doesn't work first off, and second it shows the actual username AND password in the address bar.
 

Nibuha

Member
Feb 3, 2004
19
0
151
Like i said it was the old system lol.

It was only trying to help ...

give ya a idea of what you can do.
 

chadi

BANNED
Apr 20, 2004
415
0
166
Nibuha said:
Like i said it was the old system lol.

It was only trying to help ...

give ya a idea of what you can do.
Thank you and I understand. But, I'm confused here. Being the system old or new, its still a form script. I am just wondering, can you perhaps correct it or explain to me what is wrong so I can do it? I am thinking about becoming a reseller so I am testing and reserching.

Thanks.
 

SarcNBit

Well-Known Member
Oct 14, 2003
1,001
3
168
chadi said:
I am thinking about becoming a reseller so I am testing and reserching.
372 posts AND you just claimed that you tested the script and it didn't work. Just doesn't seem to jive with someone who claims to be thinking about becoming a reseller. Unless of course you are thinking about giving up hosting and are going to buy a reseller account on someone elses box. There is a thought!
 

chadi

BANNED
Apr 20, 2004
415
0
166
Its a shame that everytime I post you are always there behind me with an insult. That's really low and shameful. It is none of your business or concern what I do or not do. I tested it, yes I have a few hosting accounts with my current host, called "dedicated". I tested it and it did not work. Is that ok with you?

Stop following me please
 

SarcNBit

Well-Known Member
Oct 14, 2003
1,001
3
168
Is there no 'ignore posts from this member' (double entendre intended) on these forums? I could use that.
 

chadi

BANNED
Apr 20, 2004
415
0
166
Yes, I will use that. That's even sadder that YOU mentioned it. You insult me constnatly for no reason whatsoever (perhaps business is not treating you good eh?) then you kindly recommend the ignore post. Or, did you say that you want to use that against me? That's pathetic both ways
 

SarcNBit

Well-Known Member
Oct 14, 2003
1,001
3
168
If you find the feature please let me know (PM or here is fine). I will be happy to ignore your posts. I do try to, but I felt I was posting more for Nibuha's benefit than for yours.

How did I insult you in the last post? I simply said it doesn't seem to jive. That was an open invitation to explain yourself.

I think that your statement about becoming a reseller was either a flat out lie or a terribly misleading statement. It is sad that you have to lie to solicit assistance around here, and by doing so you insult everyone else.
 

SarcNBit

Well-Known Member
Oct 14, 2003
1,001
3
168
SarcNBit said:
If you find the feature please let me know (PM or here is fine).
Found it. By clicking on my name you are only able to add me as a buddy, but if you go into the user cp (link above), you will see a section for buddy /ignore lists. Add me there and you will be all set. :)
 

anand

Well-Known Member
Nov 11, 2002
1,432
1
168
India
cPanel Access Level
DataCenter Provider
bdraco said:
Here is a sample php script that will allow you to add a branded login box to your site:

http://www.cpanel.net/cpanel-login.phps
I have made small changes to this script which allows you to include the login script anywhere and still catch incorrect logins and redirect them to your website. I have tested the script before posting the details here, however incase it doesn't work for you do let me know.

Hope this helps someone.

dpcpanellogin.php
Code:
<?php
error_reporting(E_ALL ^ E_NOTICE);
//Here we check if any field was missed / left empty and act accordingly
if ($_POST['domain'] && $_POST['username'] && $_POST['pass'] && !($_GET['failed'] == "1"))
{
    switch ($_POST['login_option'])
    {
        case "2082":    $port = "2082";
                $protocol = "http://";
                break;
        case "2083":    $port = "2083";
                $protocol = "https://";
                break;
        case "2086":    $port = "2086";
                $protocol = "http://";
                break;
        case "2087":    $port = "2087";
                $protocol = "https://";
                break;
        case "2095":    $port = "2095";
                $protocol = "http://";
                break;
        case "2096":    $port = "2096";
                $protocol = "https://";
                break;
    }
            
    $redirectlocation = $protocol.$_POST['domain'].":".$port."/login/?user=".$_POST['username']."&pass=".$_POST['pass']."&failurl=".$_POST['failurl'];
    header ("Location: ".$redirectlocation);
}
else
{
    $error = 1;
    header ("Location: ".$_POST['failurl']);
}
?>
include_anywhere.php
Code:
<?php
    $postlocation = "docpanellogin.php";
    print "<form action=\"" . $postlocation . "\" method=\"POST\">";

    if (($_GET['failed'] == "1") or ($error == 1))
    {
?>
        <font color=#FF0000 face=verdana size=1>Your login attempt failed!</font><br>
<?php
    }
?>
    <font face="Verdana" size="1">Domain:</font>
        <input name="domain" class="input2" type="text" value="" style="width:110;height:18;font-family:Verdana; font-size:8pt" size="20" /><br>
        <font face="Verdana" size="1">Username:</font>
        <input name="username" class="input2" type="text" value="" style="width:110;height:18;font-family:Verdana; font-size:8pt" size="20" /><br>
        <font face="Verdana" size="1">Password:</font>
        <input name="pass" class="input2" type="password" value="" style="width:110;height:18;font-family:Verdana; font-size:8pt" size="20" />
<?php
    print "<input type=hidden name=failurl value=\"http://" .  $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1\">";
?>
    <br>
    <font face="Verdana" size="1">Options:</font>
    <select name="login_option" style="font-family: Verdana; font-size: 8pt;width:110;height:18">
        <option value="2082">cPanel </option>
        <option value="2083">Secure cPanel </option>
    <option value="2086">WHM</option>
    <option value="2087">Secure WHM</option>
        <option value="2095">Webmail</option>
        <option value="2096">Secure Webmail</option>
    </select>
    <br>
        <input class="input2" type="submit" value=" Click to Login " style="width:100;height:20;font-family:Verdana; font-size:8pt" onmouseout="blur(this);" />
    </form>
Just include the code in include_anywhere.php inside your page and place the docpanellogin.php file in the same directory. The rest should work :)

The reason why this script was written was because we have too many servers and its very hard to come back each time to the script and insert the new server name. Instead here we just take the domain from the user. Anyone who wants to embed the domain name should replace the following lines from include_anywhere.php

Code:
    <font face="Verdana" size="1">Domain:</font>
        <input name="domain" class="input2" type="text" value="" style="width:110;height:18;font-family:Verdana; font-size:8pt" size="20" /><br>
and replace with

Code:
        <input name="domain" type="hidden" value="YOUR_SERVER_NAME"/>
replacing the "YOUR_SERVER_NAME" with your server name. (I haven't test this part but it should work ;) )

I will post all these files and information on my website and post the url here so it can refered by anyone.
 

anand

Well-Known Member
Nov 11, 2002
1,432
1
168
India
cPanel Access Level
DataCenter Provider
Cpanel Login Script (cPanel/WHM/WebMail login box)

The above script with description is now available through the below url

http://www.cpanelappz.com/cpanel-login-script.htm.

Please note the script is only a variant of the original script by Nick, so the credit still goes to him for giving us cPanel and this script. :)
 

gorilla

Well-Known Member
Feb 3, 2004
694
1
168
Sydney / Australia
SarcNBit said:
If you find the feature please let me know (PM or here is fine). I will be happy to ignore your posts. I do try to, but I felt I was posting more for Nibuha's benefit than for yours.

How did I insult you in the last post? I simply said it doesn't seem to jive. That was an open invitation to explain yourself.

I think that your statement about becoming a reseller was either a flat out lie or a terribly misleading statement. It is sad that you have to lie to solicit assistance around here, and by doing so you insult everyone else.
I TOTALLY agree with SarcNBit !!!
It doesnt seem to jive that you are posting without even having a reseller account or server! :D
 

demon

Registered
Aug 5, 2004
1
0
151
i have been using the logon script for some time now and just started to play with again.

i would like to know do you all think it would posible so the script would add the @domain.com to the user name so the users don't have to??
 

anand

Well-Known Member
Nov 11, 2002
1,432
1
168
India
cPanel Access Level
DataCenter Provider
demon said:
i have been using the logon script for some time now and just started to play with again.

i would like to know do you all think it would posible so the script would add the @domain.com to the user name so the users don't have to??
could u explain what u mean by that ? The form i posted is actually meant for multiple servers so you would need to enter the domain name on the form.
 

checksoft

Well-Known Member
Mar 16, 2002
67
0
306
anand said:
thx, i didn't think someone will look at it so quickly :D
OK...I am no php coder so I would love to have a little helpm on this. I copied both files into an html file and get this (with a submit button and empty form fields):

"; if (($_GET['failed'] == "1") or ($error == 1)) { ?> Your login attempt failed!
Domain:
Username:
Password: "; ?>
Options:

How do I fix this?

Thanks!
 

gorilla

Well-Known Member
Feb 3, 2004
694
1
168
Sydney / Australia
checksoft said:
OK...I am no php coder so I would love to have a little helpm on this. I copied both files into an html file and get this (with a submit button and empty form fields):

"; if (($_GET['failed'] == "1") or ($error == 1)) { ?> Your login attempt failed!
Domain:
Username:
Password: "; ?>
Options:

How do I fix this?

Thanks!
dont you need to save this as a php file ? :)
 

checksoft

Well-Known Member
Mar 16, 2002
67
0
306
Ahhh....include_anywhere.php works fine now. I thought I could use it as a php-include within an HTML file.

The other file, docpanellogin.php, redirects me to my normal index page only. I have a feeling both files are supposed to work together, but I don't know what to do to make it work....help...please.

BTW, great work!
 
Last edited: