diff --git a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php index 25de3672..4666d0e4 100644 --- a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php +++ b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php @@ -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'])); diff --git a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php index bf3582ac..1487b98e 100644 --- a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php +++ b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php @@ -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));