diff --git a/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.errorcodes.php b/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.errorcodes.php index 8ce934d1..5bde4a57 100644 --- a/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.errorcodes.php +++ b/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.errorcodes.php @@ -39,15 +39,22 @@ /** * Common error codes encountered while using the WebsitePanel Server Module * These are not all the Enterprise Server error codes, only the ones I have encountered using the API + * + * @access public + * @return array */ -$esErrorCodes = array(-100 => 'User already exists', - -101 => 'User not found', - -102 => 'User has child user accounts', - -300 => 'Hosting package could not be found', - -301 => 'Hosting package has child hosting spaces', - -501 => 'The sub-domain belongs to an existing hosting space that does not allow sub-domains to be created', - -502 => 'The domain or sub-domain exists within another hosting space', - -511 => 'Instant alias is enabled, but not configured', - -601 => 'The website already exists on the target hosting space', - -700 => 'The email domain already exists on the target hosting space', - -1100 => 'User already exists'); \ No newline at end of file +function websitepanel_GetEnterpriseServerErrors() +{ + $esErrorCodes = array(-100 => 'User already exists', + -101 => 'User not found', + -102 => 'User has child user accounts', + -300 => 'Hosting package could not be found', + -301 => 'Hosting package has child hosting spaces', + -501 => 'The sub-domain belongs to an existing hosting space that does not allow sub-domains to be created', + -502 => 'The domain or sub-domain exists within another hosting space', + -511 => 'Instant alias is enabled, but not configured', + -601 => 'The website already exists on the target hosting space', + -700 => 'The email domain already exists on the target hosting space', + -1100 => 'User already exists'); + return $esErrorCodes; +} \ No newline at end of file diff --git a/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.functions.php b/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.functions.php index 2c73b195..b41b2ddc 100644 --- a/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.functions.php +++ b/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.functions.php @@ -50,6 +50,7 @@ function websitepanel_GetErrorMessage($code) // Include the common / known error codes require_once(ROOTDIR . '/modules/servers/websitepanel/websitepanel.errorcodes.php'); + $esErrorCodes = websitepanel_GetEnterpriseServerErrors(); // Check if the error code exists, if not return the code if (array_key_exists($code, $esErrorCodes))