Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    May 2006
    Posts
    14

    Default Logging Into cPanel In the Background

    Right now I am trying to set-up a customized cPanel. I have one master cPanel account, and I am using databases to sort out which ftp and mysql goes to which account. For me this has been the easiest way.

    Now here is where the trouble is. I have been able to script creating the FTP accounts, MySQL, and everything else fine. The only problem is I can run the scripts after I enter in the master username and password (when it pops up on my page). Now I couldn't possibly give the log-in informations to my customers because then they could just log right into cPanel and have control over everything!

    So I need to automatically log into cPanel in the background, so the user isn't even prompted for a username and password, and I'll let my databases do the rest of the sorting out.

    Right now I have this script (which is a modified version of a manual log-in script I found on this forum):

    PHP Code:
    <?php
      $domain 
    'domain.com';
        
    $user 'usernamel';
        
    $pass 'password';
        
    $port '2082';
        
    $pre 'http://';
    ?>
    <body onLoad="setTimeout('document.forms[0].submit();',10);">
    <form action="<?php echo $pre.$domain.':'.$port.'/login/'?>" method="post">
                
                
        <p><input type="hidden" name="user" value="<?php echo $user?>" />
          <input type="hidden" name="pass" value="<?php echo $pass?>" />
    </p>
    </form>
    Now when I run the script, it automatically logs me in, and brings me to the main cPanel page. However I do not want to be redirected there because I do not want my customers to have access to all of the accounts, or to even access cPanel at all. So I tried using it in an inline frame, and that didn't work (I don't know why), and if I load it from a popup, I have no way to close it, so the user can still use it.

    So I would like to know if there is another alternative, or if there is another way to manipulate this code to allow me to automatically log-in without my users even knowing.

    Thank-you!
    Last edited by cardine; 06-11-2006 at 10:27 AM.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    2

    Default

    They have some other tools in PHP that do something like what your asking. You're safest bet to achieve this is to use PHP to open the page itself and parse the data. I suggest you look into the fopen function and use the format "protocol://usernameassword@domain" which by your script variables would be something like "http://username1assword@domain.com"

    I don't recommend really having an iframe, frame, page, popup, or anything else available to your customers that contains information that they shouldn't see.

    This isn't the best class, and it uses fsockopen instead of fopen, but its basically the same idea.

    Cpanel X PHP Class

  3. #3
    Member
    Join Date
    May 2006
    Posts
    14

    Default

    Ok, thank-you!

Similar Threads & Tags
Similar threads

  1. how to change cpanel log in background ?
    By Frost2x in forum Themes and Branding
    Replies: 1
    Last Post: 09-15-2010, 06:34 PM
  2. cPanel and WHM background in Chinese language pack
    By zlpd in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-21-2010, 11:44 AM
  3. Logging on to webmail without logging on to cpanel
    By Simsen in forum E-mail Discussions
    Replies: 2
    Last Post: 10-15-2007, 07:15 AM
  4. Replies: 1
    Last Post: 10-21-2003, 06:08 AM
  5. Logging into Cpanel
    By Tux-e-do in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-12-2002, 12:17 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube