gorgo

Well-Known Member
Jan 9, 2002
148
0
316
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]
 
B

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 [email protected] and I'll be happy to help out.
 

xnull

Well-Known Member
Sep 9, 2001
156
0
316
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?
 

Daniel

Well-Known Member
PartnerNOC
Aug 13, 2001
165
0
316
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?
 

awsol

cPanel Test Bitch
Feb 8, 2002
591
0
316
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.
 

smerkel

Member
Feb 19, 2002
13
0
301
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.
 

unifiedmedia

Registered
Jun 4, 2002
1
0
301
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.
 

isputra

Well-Known Member
May 3, 2003
575
0
166
Mbelitar
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.
Where i can find cpbill ?

cPanel.net Support Ticket Number: