UAPI from cPanel hook
Is there a way to make a direct UAPI call from a cPanel hook, without having to connect via cURL?
This may not be possible to do, I'm not sure if I'm missing something or not.
I'm wanting to call the UAPI function cPGreyList::disable_domains in an Api2::AddonDomain::addaddondomain hook
How do you call this without somehow obtaining the account's password to instantiate a cPanel connection with cURL?
I can do it by using root and root's access hash, but this requires escalated privileges, which is not really ideal.
Just wondering if I'm missing something.
-
Howdy, If you're writing this as a Perl module, you can 'use Cpanel::API' and invoke a UAPI function with Cpanel::API::execute('cPGreyList', 'disable_domains', { 'domains' => 'domain.tld' } ); Unfortunately, hook scripts do not have access to this. If you have more questions, please feel free to ask. Thanks! David Nielson Integration Developer, cPanel 0
Please sign in to leave a comment.
Comments
1 comment