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 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