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.

Login CPanel from a Web Page?

Discussion in 'General Discussion' started by wimp, Aug 16, 2002.

  1. wimp

    wimp Well-Known Member

    Joined:
    Jul 13, 2002
    Messages:
    301
    Likes Received:
    0
    Trophy Points:
    16
    hi all,
    is it possible to login the CPanel from a webpage?
    e.g. with a checkbox for userID an PW ?


    thanks
     
  2. itf

    itf Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    you can use this method:

    http:// user : password @ domain.com:2082

    (use it without space characters)
     
  3. MrHits

    MrHits Well-Known Member

    Joined:
    Oct 31, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    script to log in from page

    This asks the user for the domain name of their site. however, it is easily modified (2 minute mod) to ask for their user/pass, then push the user to their domain with user/pass embedded.


    (change references of gotwebhosting.com to whatever your domain is) and link to your whois script. Or just delete that function all together.

    There are a few links you should change, I put some notes in the html below, and some help for the customers that are not able to log in. IE, if the domain is not yet pointed, I tell them that they need to see &transfer.php& for instructions on transfering the domain.

    In all..its a handy script, if you know any html, you will be able to easily incoporate this to your site.

    -------------------
    two parts to this script login.html and customer-push.php



    contents of login login.html

    &!-- (c) ticket@web-hosting-support.com --&

    &form name=&submit& action=&customer-push.php& method=&get&&&
    www.
    &input type=&text& name=&domain&&&br&
    &font size=&-1&&Secure Control Panel
    &input type=&radio& value=&Y& name=&secure&&
    &BR&
    Non Secure (faster)
    &input type=&radio& value=&N& name=&secure& checked&
    &/font&&BR&
    &input type=&submit& value=&Submit&&
    &/form&


    Now for contents of customer-push.php




    &?

    ////////////////////////////////////////////////
    //Jeremy - May 19, 2002
    //Function to push user to their control panel
    //ticket@web-hosting-support.com
    //made for gotwebhosting.com
    //custom support solutions for cpanel servers
    ////////////////////////////////////////////////

    //check the domain the user typed in
    $phpnet = fsockopen(&$domain&, 2082, &$errno, &$errstr, 30);

    //the domain failed
    if(!$phpnet)
    {
    //give them reasons why they can not access the page
    ?&

    &p&&br&&p&&CENTER& &h2&UNABLE TO LOG IN!&/h2&&/p&&/center&
    &B&POSSIBLE&/B& reasons why you were unable to login:
    &P& 1) You might have mis-typed your domain name (the format must be domainname.ext,
    where .ext is .com, .net, .org, etc.). Please try again:&br&
    &form name=&submit& action=&customer-push.php& method=&get&&&
    www.
    &input type=&text& name=&domain&&&br&
    &font size=&-1&&Secure Control Panel
    &input type=&radio& value=&Y& name=&secure&&
    &BR&
    Non Secure (faster)
    &input type=&radio& value=&N& name=&secure& checked&
    &/font&&BR&
    &input type=&submit& value=&Submit&&
    &/form&


    2) Your domain may not yet be pointed to our nameservers:&br&
        A) Click here for instruction on how to &a href=&/transfer.php&&transfer&/a& your domain to our servers.&br&
        B) Click here to do a &a href=&http://www.gotwebhosting.com/whois.cgi?whois=$domain&&whois&/a& to see if your domain is pointed to us.
    &br&&br&&br&
    If this information did not help you, and you are in need of assistance, please contact &a href=&http://web-hosting-support.com/helpdesk/pdesk.cgi& target=&_blank&&tech support&/a&.

    &?php



    // GREAT! I'm able to acess the site using the admin port, lets
    //send the user over to the control panel
    else
    {
    // first, check to see if the user wanted a non secure panel
    if ($secure==&N&)
    {
    header(&Location: http://$domain:2082&);
    }

    //I guess not, send him to the secure panel.
    //(he/she was warned it will be slow)
    if ($secure==&Y&)
    {
    header(&Location: https://$domain:2083&);
    }
    }

    ?&
     
  4. wimp

    wimp Well-Known Member

    Joined:
    Jul 13, 2002
    Messages:
    301
    Likes Received:
    0
    Trophy Points:
    16
    thanks to all.



    &MrHits &
    i tryed your script but becomes the following error when i try to access an account:


    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/mydirectory/public_html/testerlogin/customer-push.php on line 2

    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/mydirectory/public_html/testerlogin/customer-push.php on line 2

    Parse error: parse error in /home/mydirectory/public_html/testerlogin/customer-push.php on line 2
     
  5. Jacynthe

    Jacynthe Member

    Joined:
    Sep 3, 2002
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Re: script to log in from page



    That code is really messed up with all the & replacing " and < or >
    Is there a way you could please rewrite it using the php tag in the forum?

    thank you very much.
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    The switchover to the new message board system caused that mess. All < > and " in old messages were changed to &.

    You'll have to just copy the code and change to the brackets or quotes depending on which is needed. If you know html and php code, it's fairly easy to know what's what.
     
  7. Jacynthe

    Jacynthe Member

    Joined:
    Sep 3, 2002
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I thought it was too until I kept getting parsing errors....
     
  8. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Maybe MrHits will see this and repost the code. ;)

    The board changeover did make some messes.
     
  9. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    All they need to do on the board is turn html code on in the forum and it will work ok. Look bottom of this page left side you will see html code for this forum is turned off.
     
  10. techark

    techark Well-Known Member

    Joined:
    May 22, 2002
    Messages:
    280
    Likes Received:
    0
    Trophy Points:
    16
    Email me and I will send you a java script code that works. But let me warn you it means you are sending the user name and password over an open connection and if you are doing it between servers you are really opening yourself up for a hack.

    We have only been hacked once and it was when we had the script for log in from our website. A few web sites got defaced, so use it at your own discretion.

    The script kiddies and defacers are out there.

    monte+techark.com
     
Loading...

Share This Page