Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Default Login Script

    I have searched the forums and I can't seem to locate the working answer. I have CPanel 11 and WHM and I have been testing some of the login scripts so I can have a log in box directly on my customer support page. However when I test them, they all take me to the x theme log in screen. I can't seem to get them to work. I see that there are some posts about changes in WHM to the Tweak settings. Any and all help will be greatly appreciated.

    Thanks
    Joe

  2. #2
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    91

    Default

    Post some script so that we can take a look at it. Otherwise it is not really possible to troubleshoot this.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Default Some I have tried

    http://www.wlscripting.com/tutorial/33/2/
    http://www.millerswebsite.co.uk/index.php?page=scripts (at the very bottom of the page)
    http://www.cpanelappz.com/cpanel-login-script.htm

    Just to name a few.

    I have even tried the suggested http://www.domainname.com:2095/login...&pass=Password

    They all seem to have the same effect.

    Thanks

  4. #4
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    91

    Default

    Post the ACTUAL script that you are using right now and I will help you go through it. You should have 2 main components..

    1. A simple form with a username / password box

    2. A script that it "posts" to the cpanel page.

    For example say you had the following variables (I'm writing this in php)

    PHP Code:
    $domain "domain.com";
    $username "bobby245";
    $password "pass2323"
    You would then build the URL like this...
    PHP Code:
    $url "http://".$username.":".$password."@".$domain.":2082/"
    Then either insert a static link on page OR use something like the http redirect to get the user to that page. Try writing out the code, testing it and then posting your results here.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Default Here is the last one I was playing with

    Two PHP Script
    1)docpanellogin.php
    2)include_anywhere.php

    Code for docpanellogin.php

    <?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']);
    }
    ?>


    code for include_anywhere.php

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

Similar Threads & Tags
Similar threads

  1. Login Script
    By Shadow23 in forum E-mail Discussions
    Replies: 0
    Last Post: 04-27-2007, 09:32 PM
  2. cPanel Login Script
    By TitaniumHosting in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 05-04-2005, 04:48 PM
  3. login script
    By Tcracker in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-19-2004, 09:46 PM
  4. Login / Logout Script
    By Hornet in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-01-2003, 10:37 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube