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.

Access cpanel by PHP?

Discussion in 'General Discussion' started by freakin'me, Jul 8, 2005.

  1. freakin'me

    freakin'me Member

    Joined:
    Jul 8, 2005
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    #1 freakin'me, Jul 8, 2005
    Last edited: Jul 8, 2005
  2. RavenSoul_

    RavenSoul_ Well-Known Member

    Joined:
    Nov 2, 2004
    Messages:
    95
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    Not possible for the end-user.
    The accesshash can only be generated by WHM itself...

    I think you misunderstood the manual:

    This is only (for example) for hosting companies who want to make an automatic billing and account creation function.

    Location of your cPanel: http://www.yourdomain.com/cpanel/

    Hope this is clear enough for you now...
     
    #2 RavenSoul_, Jul 8, 2005
    Last edited: Jul 8, 2005
  3. freakin'me

    freakin'me Member

    Joined:
    Jul 8, 2005
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Sure it does, however I'm a reseller, so I think I'll have to do it like this then :( :
    <?php
    require("config.inc.php");
    $file = "http://".$reseller['username'].":".$reseller['password']."@localhost:".$reseller['port']."/scripts/listeditpkgs";
    $lines = file($file);



    $lines = implode($lines);

    preg_match_all('-value=\"(.*?)\"-', $lines, $a_packages);

    $packages = $a_packages[1];
    echo "<p>Underneath you see the available packages:<p>";
    for($i=0; $packages[$i];$i++)
    {
    if($packages[$i] <> "Edit")
    {
    $length = strlen($package[$i]);
    $package = substr($packages[$i], (strlen($reseller['username'])+1));
    echo $package."<br />";
    }
    }

    ?>

    And that, just to get all packages listed ;)
     
  4. RavenSoul_

    RavenSoul_ Well-Known Member

    Joined:
    Nov 2, 2004
    Messages:
    95
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    ^^ You gave me the impression that you are an end-user ^^


    Can you generate an accesshash in WHM with your reseller account?

    Submenu "Cluster/Remote Access" on the left:

    Setup Remote Access Key << this one
    Configure Cluster

    --
     
    #4 RavenSoul_, Jul 8, 2005
    Last edited: Jul 8, 2005
  5. freakin'me

    freakin'me Member

    Joined:
    Jul 8, 2005
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Thank you so much. It works :) :D
     
  6. RavenSoul_

    RavenSoul_ Well-Known Member

    Joined:
    Nov 2, 2004
    Messages:
    95
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    My pleasure :)
     
  7. freakin'me

    freakin'me Member

    Joined:
    Jul 8, 2005
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    How can I cange the domain-name for a user using php btw?
     
  8. RavenSoul_

    RavenSoul_ Well-Known Member

    Joined:
    Nov 2, 2004
    Messages:
    95
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    Is this relevant to this topic?

    (you better start a new one if not :))
     
Loading...

Share This Page