Hi all!
I need to create a way of "light" account suspend, meaning that users shouldn't be able to login to cPanel but their websites would be accessible. Based on /usr/local/cpanel/scripts/suspendacct I created another script where I commented out .htaccess creation and if called from cli it works. But, I need to be able to call it remotely via some API calls.
I created /usr/local/cpanel/Cpanel/TestModule.pm in which I call my new script by:
Cpanel::SafeRun::Simple::saferun('/usr/local/cpanel/scripts/lightsuspendacct', $user);
The only problem I have is that I'm unable to call my API2 function with root privileges. Whenever I call it with cpanel_xmlapi_user=root I get = PHP Fatal error: Uncaught exception 'Exception' with message 'curl_exec threw error "SSL read: errno -12273"
I'm using cPanel XMLAPI Client Class v1.0.13 and have no problems in calling XMLAPI calls (createacct, suspendacct, etc) or API2 calls (Park, AddonDomain, etc).
So, my question is how I can call my "lightsuspendacct" script from outside world with root privileges or maybe, there is a more suitable way of achieving the same thing? (*)
* - I could add my function in Accounting* files in Cpanel/ dir, but I don't see this as an appropriate way.
Thanks!
I need to create a way of "light" account suspend, meaning that users shouldn't be able to login to cPanel but their websites would be accessible. Based on /usr/local/cpanel/scripts/suspendacct I created another script where I commented out .htaccess creation and if called from cli it works. But, I need to be able to call it remotely via some API calls.
I created /usr/local/cpanel/Cpanel/TestModule.pm in which I call my new script by:
Cpanel::SafeRun::Simple::saferun('/usr/local/cpanel/scripts/lightsuspendacct', $user);
The only problem I have is that I'm unable to call my API2 function with root privileges. Whenever I call it with cpanel_xmlapi_user=root I get = PHP Fatal error: Uncaught exception 'Exception' with message 'curl_exec threw error "SSL read: errno -12273"
I'm using cPanel XMLAPI Client Class v1.0.13 and have no problems in calling XMLAPI calls (createacct, suspendacct, etc) or API2 calls (Park, AddonDomain, etc).
So, my question is how I can call my "lightsuspendacct" script from outside world with root privileges or maybe, there is a more suitable way of achieving the same thing? (*)
* - I could add my function in Accounting* files in Cpanel/ dir, but I don't see this as an appropriate way.
Thanks!