The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cpanel / Webmail within a Frame

Discussion in 'User Experience' started by xman888, Jul 8, 2009.

  1. xman888

    xman888 Well-Known Member

    Joined:
    Nov 23, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    Just a quick question.

    Is it possible to have no header , and then have cpanel / webmail appear within a frame within an existing site, so that it keeps the same look and feel as the site?

    If this is possible, were abouts in my form/code below do you tell the code to open up the page with the 'target frame'?

    Thanks for any help.

    Kind regards,
    Anthony

    <?php
    $postlocation = "http://www.domain.com.au/docpanellogin.php";
    print "<form action=\"" . $postlocation . "\" method=\"POST\">";

    if (($_GET['failed'] == "1") or ($error == 1))
    {
    ?>
    <div align="center"><font color=#FF0000 face=verdana size=1>Your
    login attempt failed!</font><br />
    <?php
    }
    ?>
    <input name="domain" class="input2" type="text" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <br />
    <input name="username" class="input2" type="text" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <br />
    <input name="pass" class="input2" type="password" value="" style="width:140;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 />
    <select name="login_option" style="font-family: Verdana; font-size: 8pt;width:100;height:18">
    <option value="2082">cPanel </option>
    <option value="2083">Secure cPanel </option>
    </select>
    <br />
    <input name="submit" type="submit" class="input2" style="width:100;height:20;font-family:Verdana; font-size:8pt" onMouseOut="blur(this);" value=" Click to Login " />
    </form>
     
  2. xman888

    xman888 Well-Known Member

    Joined:
    Nov 23, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I forgot to post the contents of docpanellogin.php - don't know if this is revelent or not.

    Kind regards,
    Anthony

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

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you have reseller access or greater to the server, you can use the Branding Editor in cPanel to have your cPanel and Webmail interfaces match the look and feel of your website. Let me know if you need assistance with this.
     
  4. xman888

    xman888 Well-Known Member

    Joined:
    Nov 23, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Hello David,

    Thanks for the reply.

    I have reseller access, and have been customising cpanel through branding.

    However I was referring to what in that code above can I modify so that cpanel/webmail opens up in a frame on my site.

    Kind regards,
    Anthony
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    What you could do is have your login page post to a script that generates a page with frames, and with the frame that should login to cPanel being automatically logged in using something like logmein.pm mentioned at:

    http://forums.cpanel.net/437949-post5.html
     
Loading...

Share This Page