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.

Cpanel::Account

Discussion in 'General Discussion' started by gorgo, Feb 19, 2002.

  1. gorgo

    gorgo Well-Known Member

    Joined:
    Jan 9, 2002
    Messages:
    148
    Likes Received:
    0
    Trophy Points:
    16
    I created a quick CGI script to test the cpanel::account module and it always returns the error Access Denied

    Not a standard Apache 403 or 401 either, its generated by the script


    Does the script have to run as root to access cpanel::account?

    Here is a copy of my code that I made

    [i:82aab9c7ac]
    #!/usr/bin/perl

    BEGIN {

    push (@INC,&/usr/local/cpanel&);

    }

    use Cpanel::Accounting;




    my($whm) = Cpanel::Accounting-&new;

    $whm-&{host} = &localhost&;

    $whm-&{user} = &USERID HERE&;

    $whm-&{accesshash} = &HASH HERE&;

    $whm-&{usessl} = 0;



    print &Content-type: text/html\n\n&;

    $response = $whm-&createacct(&testdomain.com&,&testdom&,&password&,&Basic&);


    print $response;
    [/i:82aab9c7ac]
     
  2. bdraco

    bdraco Guest

    [quote:cc68700e46][i:cc68700e46]Originally posted by gorgo[/i:cc68700e46]

    I created a quick CGI script to test the cpanel::account module and it always returns the error Access Denied

    Not a standard Apache 403 or 401 either, its generated by the script


    Does the script have to run as root to access cpanel::account?

    Here is a copy of my code that I made

    [i:cc68700e46]
    #!/usr/bin/perl

    BEGIN {

    push (@INC,&/usr/local/cpanel&);

    }

    use Cpanel::Accounting;




    my($whm) = Cpanel::Accounting-&new;

    $whm-&{host} = &localhost&;

    $whm-&{user} = &USERID HERE&;

    $whm-&{accesshash} = &HASH HERE&;

    $whm-&{usessl} = 0;



    print &Content-type: text/html\n\n&;

    $response = $whm-&createacct(&testdomain.com&,&testdom&,&password&,&Basic&);


    print $response;
    [/i:cc68700e46][/quote:cc68700e46]


    I'd rather not help you in the forum with this one since it involves passwords.. Please send me an email to nick@cpanel.net and I'll be happy to help out.
     
  3. gorgo

    gorgo Well-Known Member

    Joined:
    Jan 9, 2002
    Messages:
    148
    Likes Received:
    0
    Trophy Points:
    16
    thanks Nick, I emailed you
     
  4. xnull

    xnull Well-Known Member

    Joined:
    Sep 9, 2001
    Messages:
    156
    Likes Received:
    0
    Trophy Points:
    16
    I haven't tested this, but I'd like to.

    Can you please at least explain why this might not have worked for gorgo, and what else is required?
     
  5. Daniel

    Daniel Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    165
    Likes Received:
    0
    Trophy Points:
    16
    I'm having the same problem can anyone shed some light?
     
  6. Daniel

    Daniel Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    165
    Likes Received:
    0
    Trophy Points:
    16
    Well I got past that now I get &Sorry, you must choose a plan&

    This is what I have:

    $response = $whm-&createacct(&testing.com&,&test1234&,&testing&,&economy&);

    Any ideas?
     
  7. gidechoi

    gidechoi Member

    Joined:
    Mar 16, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    same problem

    Not wored.
    access denied.

    How can I fix it.
     
  8. gidechoi

    gidechoi Member

    Joined:
    Mar 16, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    I fixed it

    in hash you must erase ----Start, END---.
     
  9. Daniel

    Daniel Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    165
    Likes Received:
    0
    Trophy Points:
    16
    I never did get it to create an account. I can get it to do other things but not create accounts.
     
  10. awsol

    awsol cPanel Test Bitch

    Joined:
    Feb 8, 2002
    Messages:
    591
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Boston MA
    Nick is going to be releasing CPBill sometime this week. It will have all these functions built in and best of all it is free to use. So hold on guys.
     
  11. smerkel

    smerkel Member

    Joined:
    Feb 19, 2002
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I'm bloody stupid

    Either I’m stupid, or really really tired, but how is the hash generated in the first place. (i.e. wtf is the remote access key in $whm-&{accesshash} = '&REMOTE ACCESS KEY HERE&'’; ?)

    I’m assuming it’s a hash (of some sort) derived from the password of the account one wants to use to manipulate whatever. A brief explanation would be helpful.

    Cheers.
     
  12. unifiedmedia

    unifiedmedia Registered

    Joined:
    Jun 4, 2002
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Took forever to find..

    Finally, I was able to figure out where the hash for a user was stored. I kept getting &Access Denied& every time I tried to run the Remote Access.. Maybe it's me who was a bit slow here, but I'm a fairly intelligent person and took me quite a while to figure out.

    So in the hopes of saving someone else the 3 hours it just took me to track down the information, the users' hash is stored in their home directory in the .accesshash file.
     
  13. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Mbelitar
    Where i can find cpbill ?

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page