create an api whm object.
Trying to create an whm api object in a custom module. Is this possible, this method would actually be used for a Account::Create hook rollback. If the hook fails I want to terminate the newly activated account.
Looking to do something along the lines of.
package Cpanel::MyModule;
use Cpanel ();
sub method {
my ($params) = @_;
my $cpanel = Cpanel->new;
return $cpanel->api(method => 'terminateaccnt' );
}
1;
-
lol, I know where the docs are.... I also know that I can implement a post account creation hook that terminates an account if certain criteria is not met. I mean geez... thats what got me here int he first place. You didnt answer any part of my question just lol.. I dont even know what kind of response it was you sent.. just.. totally dodging the question. anyways.. so again.. 1. I create an account. 2. post account hook fails. 3. i want to now terminate the account that was created prior to the account::create hook failure. according to your docs you can do this by defining a rollback action. So what exactly triggers the rollback definition to execute? return value from the hook? if so, then what kind of return value? do you have examples? Also, if I am creating a custom module to be put in in /usr/local/cpanel/Cpanel, what code would i use to create a dispatch object that I can use to access the api. 0 -
this is resolved. 0 -
Would you mind sharing the resolution or letting us know the ticket number so we can update this thread for other users who encounter a similar issue? Thank you. 0
Please sign in to leave a comment.
Comments
4 comments