Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 3 of 12 FirstFirst 1 2 3 4 5 ... LastLast
Results 31 to 45 of 179
  1. #31
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by bdraco
    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 ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  2. #32
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,313
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Nicely done. Thank you for posting this.

  3. #33
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by sawbuck
    Nicely done. Thank you for posting this.
    thx, i didn't think someone will look at it so quickly
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  4. #34
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default 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.
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  5. #35
    cPanel Partner NOC cPanel Partner NOC Badge gorilla's Avatar
    Join Date
    Feb 2004
    Location
    Sydney / Australia
    Posts
    736

    Thumbs up

    Quote Originally Posted by SarcNBit
    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!

  6. #36
    Registered User
    Join Date
    Aug 2004
    Posts
    1

    Default

    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??

  7. #37
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by demon
    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.
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  8. #38
    Member
    Join Date
    Mar 2002
    Posts
    70

    Default

    Quote Originally Posted by anand
    thx, i didn't think someone will look at it so quickly
    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!

  9. #39
    cPanel Partner NOC cPanel Partner NOC Badge gorilla's Avatar
    Join Date
    Feb 2004
    Location
    Sydney / Australia
    Posts
    736

    Default

    Quote Originally Posted by checksoft
    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 ?

  10. #40
    Member
    Join Date
    Mar 2002
    Posts
    70

    Arrow

    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 by checksoft; 09-21-2004 at 10:09 PM.

  11. #41
    Member
    Join Date
    Oct 2001
    Posts
    651

    Default

    anand,

    Nice work. I just set up your script. I changed the drop down to a radio button list.

    https://tlcwe.com/cplogin/
    Last edited by Marty; 09-22-2004 at 10:50 AM.
    Marty Hoskins
    TLC Web Enterprises

  12. #42
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by checksoft
    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!
    did you get it working or not ? The include file should be included inside an existing page with .php extension only. I thought you would know .htm can't include php code and still run it unless your apache is specially configured to do so

    Just include the file in your existing design, rename the page to .php and see it working on your browser.
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  13. #43
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by Marty
    anand,

    Nice work. I just set up your script. I changed the drop down to a radio button list.

    https://tlcwe.com/cplogin/

    Good to know its usefull.

    Personally i like the drop down better, but its then its all about choice
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  14. #44
    Member
    Join Date
    Mar 2002
    Posts
    70

    Default

    Quote Originally Posted by anand
    did you get it working or not ? The include file should be included inside an existing page with .php extension only. I thought you would know .htm can't include php code and still run it unless your apache is specially configured to do so

    Just include the file in your existing design, rename the page to .php and see it working on your browser.
    This post:
    http://developers.evrsoft.com/forum/...ead.php?t=3007
    says including php into an html file is kosher. I am guessing that the subject code is only designed for insertion into a php file.

    I've put this one on my back-burner.

    Thanks for your reply.

  15. #45
    Member
    Join Date
    Oct 2001
    Posts
    651

    Default

    Quote Originally Posted by checksoft
    This post:
    http://developers.evrsoft.com/forum/...ead.php?t=3007
    says including php into an html file is kosher. I am guessing that the subject code is only designed for insertion into a php file.

    I've put this one on my back-burner.

    Thanks for your reply.
    Yea, it is kosher as long as you not the last line in the instructions from the site you just linked to. Note what it says:

    You just put the php code on the page where you want whatever it is to show up.

    The same as if it were html. Just make sure the php code is between <?php and ?>

    Also you would ave to name your page with a .php extension. just in case you didn't know
    You can do it as long as you rename that .html file to a .php file. That is what the poeple on this board said as well.
    Marty Hoskins
    TLC Web Enterprises

Similar Threads & Tags
Similar threads

  1. Firefox - Generic Popup Login Box instead of cPanel/WHM login pages
    By Nathan D. in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-01-2009, 08:27 AM
  2. Problem with non SSL login to WHM, CPANEL and WEBMAIL
    By mailo in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 10-15-2008, 01:27 PM
  3. Adding webmail to your site
    By nileshwarade in forum E-mail Discussions
    Replies: 10
    Last Post: 01-18-2006, 06:41 AM
  4. cPanel/WHM/WebMail login box to your site
    By sfera in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-20-2005, 01:40 PM
  5. adding a login feature for webmail
    By Darnell30 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-18-2003, 08:06 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube