Fixed: WebsitePanel error codes not being converted properly

This commit is contained in:
Christopher York 2013-01-29 12:32:54 -06:00
parent a2c0a6b6eb
commit 880e35c634
2 changed files with 19 additions and 11 deletions

View file

@ -39,7 +39,12 @@
/** /**
* Common error codes encountered while using the WebsitePanel Server Module * 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 * These are not all the Enterprise Server error codes, only the ones I have encountered using the API
*
* @access public
* @return array
*/ */
function websitepanel_GetEnterpriseServerErrors()
{
$esErrorCodes = array(-100 => 'User already exists', $esErrorCodes = array(-100 => 'User already exists',
-101 => 'User not found', -101 => 'User not found',
-102 => 'User has child user accounts', -102 => 'User has child user accounts',
@ -51,3 +56,5 @@ $esErrorCodes = array(-100 => 'User already exists',
-601 => 'The website already exists on the target hosting space', -601 => 'The website already exists on the target hosting space',
-700 => 'The email domain already exists on the target hosting space', -700 => 'The email domain already exists on the target hosting space',
-1100 => 'User already exists'); -1100 => 'User already exists');
return $esErrorCodes;
}

View file

@ -50,6 +50,7 @@ function websitepanel_GetErrorMessage($code)
// Include the common / known error codes // Include the common / known error codes
require_once(ROOTDIR . '/modules/servers/websitepanel/websitepanel.errorcodes.php'); require_once(ROOTDIR . '/modules/servers/websitepanel/websitepanel.errorcodes.php');
$esErrorCodes = websitepanel_GetEnterpriseServerErrors();
// Check if the error code exists, if not return the code // Check if the error code exists, if not return the code
if (array_key_exists($code, $esErrorCodes)) if (array_key_exists($code, $esErrorCodes))