Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cPanel API2 Hooks

Discussion in 'cPanel Developers' started by michaelbarvixe, Oct 10, 2014.

  1. michaelbarvixe

    michaelbarvixe Registered

    Oct 10, 2014
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    I am attempting to hook Api2::AddonDomains::addaddondomain using a Perl module. I have the hook registered, but it seems it's being skipped when an addon is created. Essentially, what I'm trying to do is make an alternate form of commondomains. I need to specifically block a domain, but allow subdomains of it (for example, block but allow

    Here is what I'm seeing in /usr/local/cpanel/logs/error_log when an addon is created:

    To get it working, I currently have it so it will just fail and display the domain being added, but it's not even doing that.

    package Arv::Domains;
    use strict;
    use warnings;
    sub addon {
        my ( $context, $data) = @_;
        my $args = $data->{'args'};
        my $domain = $args->{'newdomain'};
        return 0,"$domain";
    sub describe {
        my $hook = [
                'namespace' => 'Cpanel',
                'function'  => 'Api2::AddonDomain::addaddondomain',
                'stage'     => 'pre',
                'hook'      => 'Arv::Domains::addon',
        return $hook;
    I know it's registering properly, so I'm not sure what's going on.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice