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.

How send variables to cPanel

Discussion in 'General Discussion' started by iwab19, Oct 18, 2005.

  1. iwab19

    iwab19 Registered

    Joined:
    Oct 17, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    How send variables to cPanel and don't show me the window with username and password??

    example: in PHP

    $username= "john";
    $password = "smith";

    echo '
    <form action="http://dominio.com/cpanel/" method="POST" target="_blank">
    <input name="user" type="hidden" value="'.$username.'">
    <input name="pass" type="hidden" value="'.$password.';">
    <input name="login" type="submit" value=" GO ">
    </form>
    ';

    I want to enter directly to my account, from my code

    please help me.

    ---------
    sorry for my English, I'm Spanish
     
    #1 iwab19, Oct 18, 2005
    Last edited: Oct 18, 2005
  2. AlexSmithMCP

    AlexSmithMCP Well-Known Member

    Joined:
    May 26, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
  3. iwab19

    iwab19 Registered

    Joined:
    Oct 17, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    the window with user and password, don't work with cookies.

    I find something but I'm not sure, it about

    Auth_Main, setSessionUser, updatePassword
     
    #3 iwab19, Oct 18, 2005
    Last edited: Oct 18, 2005
  4. iwab19

    iwab19 Registered

    Joined:
    Oct 17, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I found it!!!

    pag.php: (in PHP)

    $dominio="www.domino.com";
    $user="john";
    $pass="smith";

    <form action="login_go.php" method="POST" target="_blank">
    <input name="domain" type="hidden" value="'.$dominio.'" />
    <input name="username" type="hidden" value="'.$usuario.'"/>
    <input name="pass" type="hidden" value="'.$pass.'"/>
    <select name="login_option">
    <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>
    <input name="login" type="submit" value=" GO ">
    </form>

    login_go.php:
    <?
    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);
    ?>
     
Loading...

Share This Page