Assist newbie: UAPI installation with Joomla
Hi
I am a very new user. We do use cPanel via our hosting service provider who have suggested that some work I need doing (creating email forwarding records) could best be handled vu UAPI and the add_forwarder functions. Fine - I can understand that.
The trouble is that my minimal code fails
with
I assume that I need to install the UAPI library within Joomla. Can anyone help with some pointers as to where to find and install that library? Regards Nick
function replaceMailForwarder($memberName, $personalEMail) {
$forwarder = $memberName . '@conveners.pmhu3a.org.au';
// Instantiate the CPANEL object.require_once "
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
echo '$cPanel ' . __LINE__ . ' ' . __FUNCTION__ . '
';
var_dump($cPanel);
echo '
';
// Delete the forwarder for user@example.com
$delete_forwarder = $cpanel->uapi(
'Email', 'delete_forwarder',
array(
'address' => $forwarder,
'forwarder' => $personalEMail,
)
);
echo '$delete_forwarder ' . __LINE__ . ' ' . __FUNCTION__ . '
';
var_dump($delete_forwarder);
echo '
';
die(' dead at ' . __LINE__ . ' in ' . __FUNCTION__);
}with
0 - Class 'CPANEL' not foundI assume that I need to install the UAPI library within Joomla. Can anyone help with some pointers as to where to find and install that library? Regards Nick
-
Thanks for the reply. My problem is, I think, finding that UAPI! There seem to be several copies in Joomla components but none seem to work. I look forward to other pointers from the forum Nick 0 -
I'm not sure what you mean by "finding" that uapi. The uapi system is built-in to ever cPanel & WHM system, and is available on the command line. 0 -
That is what I thought - built in. But the problem is that if I I enter $cpanel = new CPANEL(); I receive the error message " 0 - Class 'CPANEL' not found " This within a Joomla form. And I therefore assumed that I need PHP require_once('the location of UAPI'); That looks to be the way other Joomla components reference their own copies of the cPanel.php. Nick 0
Please sign in to leave a comment.
Comments
5 comments