Fixed: Do not run WebsitePanel hooks / addons when not enabled or fully configured
This commit is contained in:
parent
1b1ec436c5
commit
56ec2b3b20
2 changed files with 10 additions and 0 deletions
|
@ -54,6 +54,11 @@ function websitepanel_addons_AddonActivation($params)
|
|||
|
||||
// Retrieve the WebsitePanel Addons module settings
|
||||
$modSettings = websitepanel_addons_GetSettings();
|
||||
if (empty($modSettings['username']) || empty($modSettings['password'])) || empty($modSettings['serverhost'])) || empty($modSettings['serverport'])))
|
||||
{
|
||||
// The module is disabled or has not yet been configured - stop
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the associated WebsitePanel username from WHMCS
|
||||
$results = select_query('tblhosting', 'username', array('id' => $params['serviceid']));
|
||||
|
|
|
@ -53,6 +53,11 @@ function websitepanel_sync_ClientEdit($params)
|
|||
|
||||
// Retrieve the WebsitePanel Addons module settings
|
||||
$modSettings = websitepanel_sync_GetSettings();
|
||||
if (empty($modSettings['username']) || empty($modSettings['password'])) || empty($modSettings['serverhost'])) || empty($modSettings['serverport'])))
|
||||
{
|
||||
// The module is disabled or has not yet been configured - stop
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the WebsitePanel object instance
|
||||
$wsp = new WebsitePanel($modSettings['username'], $modSettings['password'], $modSettings['serverhost'], $modSettings['serverport'], (($modSettings['serversecured']) == 'on' ? TRUE : FALSE));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue