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.

Logging in from a site

Discussion in 'General Discussion' started by greg, Dec 20, 2001.

  1. greg

    greg Active Member

    Joined:
    Sep 4, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Hi

    I would like to be able to give my customers the chance to log into their control panel via the front page of my site. All they would have to do is fill in a short form (username/password)..

    Is this possible and if so how?

    Thanks in advance...
     
  2. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    361
    Likes Received:
    0
    Trophy Points:
    16
    I would also like too know...
     
  3. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    Shot in the dark-
    I KNOW I have done this before though.... it was in the form

    http://username:password@HOSTNAME.OF.SERVER/cpanel
    (or /controlpanel, or :2082, what have you)
    At least I think.

    I will play around with it............

    :cool:
     
  4. Daniel

    Daniel Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    165
    Likes Received:
    0
    Trophy Points:
    16
    The problem is what happends when you have 2 servers or more. Then you have to tell the username password and server. And most clients don\'t know what server they are on.
     
  5. Craig

    Craig Well-Known Member

    Joined:
    Aug 10, 2001
    Messages:
    171
    Likes Received:
    0
    Trophy Points:
    16
    [quote:3d877613a7]

    Shot in the dark-
    I KNOW I have done this before though.... it was in the form

    http://username:password@HOSTNAME.OF.SERVER/cpanel
    (or /controlpanel, or :2082, what have you)
    At least I think.

    I will play around with it............

    :cool: [/quote:3d877613a7]

    Could you just not use \"customers_domain_name\" instead of server name. Although it would mean them filling in another box would get around the multi server problem..

    Just a thought :]

    C.
     
  6. Daniel

    Daniel Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    165
    Likes Received:
    0
    Trophy Points:
    16
    That would work. :D
     
  7. Mat

    Mat Well-Known Member

    Joined:
    Sep 26, 2001
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    I tried this and it didn't work, I think cpanel checks if a person logs in this way, but I was using PHP and the header function so, not sure...


    &?php
    if (!isset($user)) {
    ?&
    &title&Control Panel Login&/title&
    &body bgcolor=\&#000000\& text=\&#999999\& link=\&#999999\& vlink=\&#999999\& alink=\&#666666\&&
    &div align=\&center\&&
    &form name=\&login\& method=\&post\& action=\&login.php\&&
    &/form&
    &form name=\&form1\& method=\&post\& action=\&\&&
    User:
    &input type=\&text\& name=\&user\&&&br&
    Pass:
    &input type=\&password\& name=\&pass\&&&Br&
    &input type=\&hidden\& name=\&action\& value=\&login\&&
    &input type=\&submit\& name=\&Submit\& value=\&Submit\&&
    &/form&
    &/div&
    &?
    }

    if ($action == \&login\&) {
    $url = \&http://\&.$user.\&:\&.$pass.\&@www.aphosting.com:2082\&;
    header(\&Location: $url\&);
    exit;
    }
    ?&
     
  8. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    361
    Likes Received:
    0
    Trophy Points:
    16
    Hmm, this last one works perfect for me...
     
  9. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Domenico, [quote:5ce51a596b]Hmm, this last one works perfect for me...
    [/quote:5ce51a596b]Do you mean you don\'t get the pop-up screen and it lets you enter the cpanel straight on? Have you made any changes to the script?

    I still get the pop-up screen for some reason. :(
     
  10. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    361
    Likes Received:
    0
    Trophy Points:
    16
    Ehm, sorry. I have the same problem :-(

    Do you have a fix yet?
    It is really stupid because when you put the same string in explorer you go straight to the cpanel.

    What is causing this?



    [Edited on 12/26/01 by Domenico]
     
  11. Mat

    Mat Well-Known Member

    Joined:
    Sep 26, 2001
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    I found a neomail login Javascript page, and adapted it to work with Cpanel... You could make a pull down box to choose to go into WHM or Cpanel, just make another var for the port number....

    [quote:df70e31975]
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
    <script language=\"javascript\">
    <!-- Begin
    function Login(form) {
    var username = form.username.value;
    var password = form.password.value;
    var server = form.server.value;
    if (username && password && server) {
    var cplogin = \"http://\" + username + \":\" + password + \"@\" + server + \":2082/\";
    window.location = cplogin;
    }
    else {
    alert(\"Please enter a Username and password.\");
    }
    }
    // End -->
    </script>
    </head>

    <body bgcolor=\"#FFFFFF\">
    <form name=login>
    <div align=\"center\">
    <table border=1 cellpadding=3>
    <tr>
    <td colspan=2 align=center>
    <h2 align=\"center\">Cpanel4 Login</h2>
    </td>
    </tr>
    <tr>
    <td>Username:</td>
    <td>
    <input type=text name=username size=15 maxlength=\"26\">
    </td>
    </tr>
    <tr>
    <td>Password:</td>
    <td>
    <input type=password name=password size=15>
    </td>
    </tr>
    <tr>
    <td>Hostname:</td>
    <td>
    <input type=\"text\" value=\"aphosting.com\" name=\"server\" maxlength=\"65\" size=\"15\">
    </td>
    </tr>
    <tr>
    <td colspan=2 align=center>
    <input type=button value=\"Login!\" onClick=\"Login(this.form)\" name=\"button\">
    </td>
    </tr>
    </table>
    </div>
    </form>
    </body>
    </html>
    [/quote:df70e31975]
     
  12. MrHits

    MrHits Well-Known Member

    Joined:
    Oct 31, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Cpanel has a cvs file, that you can use to parse our the user/domain names from. Take this data daily, and dump it into a mysql database.

    Then, on your main website, create a login function where the the user just types the username and password. The script can then look up the appropriate domain associated with that username, and redirect the user to:
    https://user:pass@domain.com:2083

    Please note, that this will work only if you have unique users. I DO NOT duplicate usernames, even across multiple servers.

    This is probably an hour or two hour script. I\'d create it, but my admin duties right now for my job are consuming my time.

    - Jeremy
     
  13. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Jeremy,
    [quote:da568d7654]Cpanel has a cvs file, that you can use to parse our the user/domain names from. Take this data daily, and dump it into a mysql database.

    [/quote:da568d7654]
    Can you tell us where that .cvs file is located?
     
  14. MrHits

    MrHits Well-Known Member

    Joined:
    Oct 31, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    /var/cpanel/acccts.db

    comma delimited.

    - Jeremy
     
  15. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    361
    Likes Received:
    0
    Trophy Points:
    16
    This works!
    Thanks!


    [quote:340e94b72b]I found a neomail login Javascript page, and adapted it to work with Cpanel... You could make a pull down box to choose to go into WHM or Cpanel, just make another var for the port number....

    [quote:340e94b72b]
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
    <script language=\"javascript\">
    <!-- Begin
    function Login(form) {
    var username = form.username.value;
    var password = form.password.value;
    var server = form.server.value;
    if (username && password && server) {
    var cplogin = \"http://\" + username + \":\" + password + \"@\" + server + \":2082/\";
    window.location = cplogin;
    }
    else {
    alert(\"Please enter a Username and password.\");
    }
    }
    // End -->
    </script>
    </head>

    <body bgcolor=\"#FFFFFF\">
    <form name=login>
    <div align=\"center\">
    <table border=1 cellpadding=3>
    <tr>
    <td colspan=2 align=center>
    <h2 align=\"center\">Cpanel4 Login</h2>
    </td>
    </tr>
    <tr>
    <td>Username:</td>
    <td>
    <input type=text name=username size=15 maxlength=\"26\">
    </td>
    </tr>
    <tr>
    <td>Password:</td>
    <td>
    <input type=password name=password size=15>
    </td>
    </tr>
    <tr>
    <td>Hostname:</td>
    <td>
    <input type=\"text\" value=\"aphosting.com\" name=\"server\" maxlength=\"65\" size=\"15\">
    </td>
    </tr>
    <tr>
    <td colspan=2 align=center>
    <input type=button value=\"Login!\" onClick=\"Login(this.form)\" name=\"button\">
    </td>
    </tr>
    </table>
    </div>
    </form>
    </body>
    </html>
    [/quote:340e94b72b]


    [/quote:340e94b72b]
     
  16. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    It works fine. But don\'t try this in a cyber cafe. ;)
     
  17. Mat

    Mat Well-Known Member

    Joined:
    Sep 26, 2001
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    You shouldn\'t use anything you want to keep secure from a cyber cafe.... You don\'t know if there might be key loggers installed on those machines..... No matter how you login, it gets the details....


    Generally, if you want to access something securely, do it from your home box... No where else....
     
  18. greg

    greg Active Member

    Joined:
    Sep 4, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Just a quick message to say thanks for all your help! It works great.
     
  19. mIRCnet

    mIRCnet Registered

    Joined:
    May 25, 2002
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello

    Why dont you ask the customer to enter his account name in a form and submet it, the cpanel will give a box asking for the user name and password of the account.

    All what you are going to do is to redirect the user to hes cpanel URL

    ;)
     
Loading...

Share This Page