diff --git a/interface/lib/classes/json_handler.inc.php b/interface/lib/classes/json_handler.inc.php index de8dd5ba0dd254053821ae910f3a868ba943597f..edc57132b70ba7de24c6353b47f6ecefcb85e6ab 100644 --- a/interface/lib/classes/json_handler.inc.php +++ b/interface/lib/classes/json_handler.inc.php @@ -115,11 +115,17 @@ class ISPConfigJSONHandler { try { $this->_return_json('ok', '', call_user_func_array(array($this->classes[$class_name], $method), $params)); - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { $this->_return_json('remote_fault', $e->getMessage()); } } } -?> +if(!class_exists('ISPConfigRemoteException')) { + class ISPConfigRemoteException extends Exception { + public function __construct($code = '', $message = '') { + parent::__construct($message . ' (' . $code . ')', 0); + } + } +} \ No newline at end of file diff --git a/interface/lib/classes/remote.d/admin.inc.php b/interface/lib/classes/remote.d/admin.inc.php index 8b0c4730e80a0d4e0587baacc6772a227198a750..497f9a65541259b52371938ea648fbee4b567ced 100644 --- a/interface/lib/classes/remote.d/admin.inc.php +++ b/interface/lib/classes/remote.d/admin.inc.php @@ -52,7 +52,7 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'admin_record_permissions')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -62,7 +62,7 @@ class remoting_admin extends remoting { // check if userid is valid $check = $app->db->queryOneRecord('SELECT userid FROM sys_user WHERE userid = ?', $app->functions->intval($value)); if(!$check || !$check['userid']) { - throw new SoapFault('invalid parameters', $value . ' is no valid sys_userid.'); + throw new ISPConfigRemoteException('invalid parameters', $value . ' is no valid sys_userid.'); return false; } $permissions[$key] = $app->functions->intval($value); @@ -71,7 +71,7 @@ class remoting_admin extends remoting { // check if groupid is valid $check = $app->db->queryOneRecord('SELECT groupid FROM sys_group WHERE groupid = ?', $app->functions->intval($value)); if(!$check || !$check['groupid']) { - throw new SoapFault('invalid parameters', $value . ' is no valid sys_groupid.'); + throw new ISPConfigRemoteException('invalid parameters', $value . ' is no valid sys_groupid.'); return false; } $permissions[$key] = $app->functions->intval($value); @@ -81,7 +81,7 @@ class remoting_admin extends remoting { // check if permissions are valid $value = strtolower($value); if(!preg_match('/^[riud]+$/', $value)) { - throw new SoapFault('invalid parameters', $value . ' is no valid permission string.'); + throw new ISPConfigRemoteException('invalid parameters', $value . ' is no valid permission string.'); return false; } @@ -95,7 +95,7 @@ class remoting_admin extends remoting { break; default: - throw new SoapFault('invalid parameters', 'Only sys_userid, sys_groupid, sys_perm_user and sys_perm_group parameters can be changed with this function.'); + throw new ISPConfigRemoteException('invalid parameters', 'Only sys_userid, sys_groupid, sys_perm_user and sys_perm_group parameters can be changed with this function.'); break; } } @@ -113,7 +113,7 @@ class remoting_admin extends remoting { public function system_config_set($session_id, $section, $key, $value) { global $app; if(!$this->checkPerm($session_id, 'system_config_set')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($section != '' && $key != '') { @@ -123,7 +123,7 @@ class remoting_admin extends remoting { $system_config_str = $app->ini_parser->get_ini_string($system_config_array); return $app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1); } else { - throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + throw new ISPConfigRemoteException('invalid_function_parameter', 'Invalid function parameter.'); return false; } } @@ -138,7 +138,7 @@ class remoting_admin extends remoting { public function system_config_get($session_id, $section, $key) { global $app; if(!$this->checkPerm($session_id, 'system_config_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($section != '') { @@ -152,7 +152,7 @@ class remoting_admin extends remoting { else return false; } } else { - throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + throw new ISPConfigRemoteException('invalid_function_parameter', 'Invalid function parameter.'); return false; } } @@ -165,13 +165,13 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '') { - throw new SoapFault('field_empty_error', 'Group and name parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group and name parameter may not be empty.'); return false; } @@ -184,18 +184,18 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '' || $value == '') { - throw new SoapFault('field_empty_error', 'Group, name, and value parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group, name, and value parameter may not be empty.'); return false; } if(is_array($app->db->queryOneRecord('SELECT * FROM sys_config WHERE `group` = ? AND `name` = ?', $group, $name))) { - throw new SoapFault('record_unique_error', 'Group plus name field combination is not unique.'); + throw new ISPConfigRemoteException('record_unique_error', 'Group plus name field combination is not unique.'); return false; } @@ -208,18 +208,18 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '' || $value == '') { - throw new SoapFault('field_empty_error', 'Group, name, and value parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group, name, and value parameter may not be empty.'); return false; } if(!is_array($app->db->queryOneRecord('SELECT * FROM sys_config WHERE `group` = ? AND `name` = ?', $group, $name))) { - throw new SoapFault('record_nonexist_error', 'There is no record with this group plus name field combination.'); + throw new ISPConfigRemoteException('record_nonexist_error', 'There is no record with this group plus name field combination.'); return false; } @@ -232,13 +232,13 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_replace')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '' || $value == '') { - throw new SoapFault('field_empty_error', 'Group, name, and value parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group, name, and value parameter may not be empty.'); return false; } @@ -255,18 +255,18 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '') { - throw new SoapFault('field_empty_error', 'Group and name parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group and name parameter may not be empty.'); return false; } if(!is_array($app->db->queryOneRecord('SELECT * FROM sys_config WHERE `group` = ? AND `name` = ?', $group, $name))) { - throw new SoapFault('record_nonexist_error', 'There is no record with this group plus name field combination.'); + throw new ISPConfigRemoteException('record_nonexist_error', 'There is no record with this group plus name field combination.'); return false; } diff --git a/interface/lib/classes/remote.d/aps.inc.php b/interface/lib/classes/remote.d/aps.inc.php index 50dda4825577555eac85e0ca56891b866db1352f..2e1770be42a1ece22d64bccfa976dd9b5286453c 100644 --- a/interface/lib/classes/remote.d/aps.inc.php +++ b/interface/lib/classes/remote.d/aps.inc.php @@ -40,7 +40,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_update_package_list')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -60,7 +60,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_available_packages_list')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -82,7 +82,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_get_package_details')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -98,14 +98,14 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package details $details = $gui->getPackageDetails($primary_id); if (isset($details['error'])) { - throw new SoapFault('package_error', $details['error']); + throw new ISPConfigRemoteException('package_error', $details['error']); return false; } @@ -121,7 +121,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_get_package_file')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -137,14 +137,14 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package details $details = $gui->getPackageDetails($primary_id); if (isset($details['error'])) { - throw new SoapFault('package_error', $details['error']); + throw new ISPConfigRemoteException('package_error', $details['error']); return false; } @@ -155,7 +155,7 @@ class remoting_aps extends remoting { foreach ($details['Screenshots'] as $screen) { if (basename($screen['ScreenPath']) == $filename) { $found = true; break; } } if (!$found) { - throw new SoapFault('package_error', 'File not found in package.'); + throw new ISPConfigRemoteException('package_error', 'File not found in package.'); return false; } @@ -167,7 +167,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_get_package_details')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -183,14 +183,14 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package settings $settings = $gui->getPackageSettings($primary_id); if (isset($settings['error'])) { - throw new SoapFault('package_error', $settings['error']); + throw new ISPConfigRemoteException('package_error', $settings['error']); return false; } @@ -205,7 +205,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_change_package_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -215,12 +215,12 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } if(!isset($params['package_status']) || (($params['package_status'] != PACKAGE_ENABLED) && ($params['package_status'] != PACKAGE_LOCKED))) { - throw new SoapFault('package_error', 'Wrong new status: '.$params['package_status']); + throw new ISPConfigRemoteException('package_error', 'Wrong new status: '.$params['package_status']); return false; } @@ -235,7 +235,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_install_package')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -251,25 +251,25 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package details $details = $gui->getPackageDetails($primary_id); if (isset($details['error'])) { - throw new SoapFault('package_error', $details['error']); + throw new ISPConfigRemoteException('package_error', $details['error']); return false; } $settings = $gui->getPackageSettings($primary_id); if (isset($settings['error'])) { - throw new SoapFault('package_error', $settings['error']); + throw new ISPConfigRemoteException('package_error', $settings['error']); return false; } // Check given Site/VHostDomain if (!isset($params['main_domain'])) { - throw new SoapFault('invalid parameters', 'No valid domain given.'); + throw new ISPConfigRemoteException('invalid parameters', 'No valid domain given.'); return false; } @@ -284,7 +284,7 @@ class remoting_aps extends remoting { } if (!$domain) { - throw new SoapFault('invalid parameters', 'No valid domain given.'); + throw new ISPConfigRemoteException('invalid parameters', 'No valid domain given.'); return false; } @@ -295,7 +295,7 @@ class remoting_aps extends remoting { return $gui->createPackageInstance($result['input'], $primary_id); } - throw new SoapFault('invalid parameters', implode('
', $result['error'])); + throw new ISPConfigRemoteException('invalid parameters', implode('
', $result['error'])); return false; } @@ -304,7 +304,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_instance_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -318,7 +318,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_instance_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -332,7 +332,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_instance_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -344,7 +344,7 @@ class remoting_aps extends remoting { $result = $app->db->queryOneRecord($sql, $primary_id); if (!$result) { - throw new SoapFault('instance_error', 'No valid instance id given.'); + throw new ISPConfigRemoteException('instance_error', 'No valid instance id given.'); return false; } diff --git a/interface/lib/classes/remote.d/client.inc.php b/interface/lib/classes/remote.d/client.inc.php index 92adb9af5020ecca7bb1da90a548448c99614107..2d068a137ef2952d70a42e8f346118ca1a7ed9c7 100644 --- a/interface/lib/classes/remote.d/client.inc.php +++ b/interface/lib/classes/remote.d/client.inc.php @@ -53,7 +53,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -98,7 +98,7 @@ class remoting_client extends remoting { { global $app; if(!$this->checkPerm($session_id, 'client_get_id')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -108,7 +108,7 @@ class remoting_client extends remoting { if(isset($rec['client_id'])) { return $app->functions->intval($rec['client_id']); } else { - throw new SoapFault('no_client_found', 'There is no sysuser account for this client ID.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no sysuser account for this client ID.'); return false; } @@ -119,7 +119,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_get_emailcontact')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -130,7 +130,7 @@ class remoting_client extends remoting { if(is_array($rec)) { return $rec; } else { - throw new SoapFault('no_client_found', 'There is no client with this client ID.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no client with this client ID.'); return false; } } @@ -139,7 +139,7 @@ class remoting_client extends remoting { { global $app; if(!$this->checkPerm($session_id, 'client_get_id')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -149,7 +149,7 @@ class remoting_client extends remoting { if(isset($rec['groupid'])) { return $app->functions->intval($rec['groupid']); } else { - throw new SoapFault('no_group_found', 'There is no group for this client ID.'); + throw new ISPConfigRemoteException('no_group_found', 'There is no group for this client ID.'); return false; } @@ -162,7 +162,7 @@ class remoting_client extends remoting { if (!$this->checkPerm($session_id, 'client_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(!isset($params['parent_client_id']) || $params['parent_client_id'] == 0) $params['parent_client_id'] = $reseller_id; @@ -174,7 +174,7 @@ class remoting_client extends remoting { // Selected client is not a reseller. REMOVING PARENT_CLIENT_ID!!! $params['parent_client_id'] = 0; } elseif(isset($params['limit_client']) && $params['limit_client'] != 0) { - throw new SoapFault('Invalid reseller', 'Reseller cannot be client of another reseller.'); + throw new ISPConfigRemoteException('Invalid reseller', 'Reseller cannot be client of another reseller.'); return false; } } @@ -191,7 +191,7 @@ class remoting_client extends remoting { if (!$this->checkPerm($session_id, 'client_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -208,12 +208,12 @@ class remoting_client extends remoting { // check if this one is reseller $check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ?', intval($params['parent_client_id'])); if($check['limit_client'] == 0) { - throw new SoapFault('Invalid reseller', 'Selected client is not a reseller.'); + throw new ISPConfigRemoteException('Invalid reseller', 'Selected client is not a reseller.'); return false; } if(isset($params['limit_client']) && $params['limit_client'] != 0) { - throw new SoapFault('Invalid reseller', 'Reseller cannot be client of another reseller.'); + throw new ISPConfigRemoteException('Invalid reseller', 'Reseller cannot be client of another reseller.'); return false; } } @@ -251,7 +251,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -259,7 +259,7 @@ class remoting_client extends remoting { $sql = "SELECT * FROM `client_template_assigned` WHERE `client_id` = ?"; return $app->db->queryOneRecord($sql, $client_id); } else { - throw new SoapFault('The ID must be an integer.'); + throw new ISPConfigRemoteException('The ID must be an integer.'); return array(); } } @@ -289,7 +289,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -297,13 +297,13 @@ class remoting_client extends remoting { // check if client exists $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ?', $client_id); if(!$check) { - throw new SoapFault('Invalid client'); + throw new ISPConfigRemoteException('Invalid client'); return false; } // check if template exists $check = $app->db->queryOneRecord('SELECT `template_id` FROM `client_template` WHERE `template_id` = ?', $template_id); if(!$check) { - throw new SoapFault('Invalid template'); + throw new ISPConfigRemoteException('Invalid template'); return false; } @@ -318,7 +318,7 @@ class remoting_client extends remoting { return $insert_id; } else { - throw new SoapFault('The IDs must be of type integer.'); + throw new ISPConfigRemoteException('The IDs must be of type integer.'); return false; } } @@ -327,7 +327,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -335,13 +335,13 @@ class remoting_client extends remoting { // check if client exists $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ?', $client_id); if(!$check) { - throw new SoapFault('Invalid client'); + throw new ISPConfigRemoteException('Invalid client'); return false; } // check if template exists $check = $app->db->queryOneRecord('SELECT `assigned_template_id` FROM `client_template_assigned` WHERE `client_id` = ? AND `client_template_id` = ?', $client_id, $assigned_template_id); if(!$check) { - throw new SoapFault('Invalid template'); + throw new ISPConfigRemoteException('Invalid template'); return false; } @@ -356,7 +356,7 @@ class remoting_client extends remoting { return $affected_rows; } else { - throw new SoapFault('The IDs must be of type integer.'); + throw new ISPConfigRemoteException('The IDs must be of type integer.'); return false; } } @@ -367,7 +367,7 @@ class remoting_client extends remoting { if (!$this->checkPerm($session_id, 'client_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../client/form/client.tform.php', $client_id); @@ -384,7 +384,7 @@ class remoting_client extends remoting { global $app, $conf; if(!$this->checkPerm($session_id, 'client_delete_everything')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -440,7 +440,7 @@ class remoting_client extends remoting { } if (!$this->checkPerm($session_id, 'client_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../client/form/client.tform.php', $client_id); @@ -460,14 +460,14 @@ class remoting_client extends remoting { public function client_get_by_username($session_id, $username) { global $app; if(!$this->checkPerm($session_id, 'client_get_by_username')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $rec = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE username = ?", $username); if (isset($rec)) { return $rec; } else { - throw new SoapFault('no_client_found', 'There is no user account for this user name.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no user account for this user name.'); return false; } } @@ -475,12 +475,12 @@ class remoting_client extends remoting { public function client_get_by_customer_no($session_id, $customer_no) { global $app; if(!$this->checkPerm($session_id, 'client_get_by_customer_no')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $customer_no = trim($customer_no); if($customer_no == '') { - throw new SoapFault('permission_denied', 'There was no customer number specified.'); + throw new ISPConfigRemoteException('permission_denied', 'There was no customer number specified.'); return false; } $customer_no = $app->db->quote($customer_no); @@ -488,7 +488,7 @@ class remoting_client extends remoting { if (isset($rec)) { return $rec; } else { - throw new SoapFault('no_client_found', 'There is no user account for this customer number.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no user account for this customer number.'); return false; } } @@ -501,7 +501,7 @@ class remoting_client extends remoting { public function client_get_all($session_id) { global $app; if(!$this->checkPerm($session_id, 'client_get_all')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $result = $app->db->queryAllRecords("SELECT client_id FROM client WHERE 1"); @@ -529,7 +529,7 @@ class remoting_client extends remoting { $app->uses('auth'); if(!$this->checkPerm($session_id, 'client_change_password')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -542,7 +542,7 @@ class remoting_client extends remoting { $app->db->query($sql, $new_password, $client_id); return true; } else { - throw new SoapFault('no_client_found', 'There is no user account for this client_id'); + throw new ISPConfigRemoteException('no_client_found', 'There is no user account for this client_id'); return false; } } @@ -555,7 +555,7 @@ class remoting_client extends remoting { public function client_templates_get_all($session_id) { global $app; if(!$this->checkPerm($session_id, 'client_templates_get_all')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sql = "SELECT * FROM client_template"; @@ -568,17 +568,17 @@ class remoting_client extends remoting { //* Check permissions if(!$this->checkPerm($session_id, 'client_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check username and password if(!preg_match("/^[\w\.\-\_\@]{1,128}$/", $username)) { - throw new SoapFault('user_regex_error', 'Username contains invalid characters.'); + throw new ISPConfigRemoteException('user_regex_error', 'Username contains invalid characters.'); return false; } if(!preg_match("/^.{1,64}$/i", $password)) { - throw new SoapFault('password_length_error', 'Invalid password length or no password provided.'); + throw new ISPConfigRemoteException('password_length_error', 'Invalid password length or no password provided.'); return false; } @@ -588,7 +588,7 @@ class remoting_client extends remoting { //* too many failedlogins if($alreadyfailed['times'] > 5) { - throw new SoapFault('error_user_too_many_logins', 'Too many failed logins.'); + throw new ISPConfigRemoteException('error_user_too_many_logins', 'Too many failed logins.'); return false; } @@ -659,7 +659,7 @@ class remoting_client extends remoting { 'language' => $user['language'], 'country' => 'de'); } else { - throw new SoapFault('login_failed', 'Login failed.'); + throw new ISPConfigRemoteException('login_failed', 'Login failed.'); } } diff --git a/interface/lib/classes/remote.d/dns.inc.php b/interface/lib/classes/remote.d/dns.inc.php index f7b0d139747eb4217056a417e3f1e98e72cf4d82..4bd518ed1626ffaa2372fb045359d28f24ac8e82 100644 --- a/interface/lib/classes/remote.d/dns.inc.php +++ b/interface/lib/classes/remote.d/dns.inc.php @@ -46,7 +46,7 @@ class remoting_dns extends remoting { { global $app, $conf; if(!$this->checkPerm($session_id, 'dns_templatezone_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -180,7 +180,7 @@ class remoting_dns extends remoting { return $dns_soa_id; exit; } else { - throw new SoapFault('permission_denied', $error); + throw new ISPConfigRemoteException('permission_denied', $error); } } @@ -191,7 +191,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -203,7 +203,7 @@ class remoting_dns extends remoting { public function dns_slave_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../dns/form/dns_slave.tform.php', $client_id, $params); @@ -213,7 +213,7 @@ class remoting_dns extends remoting { public function dns_slave_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../dns/form/dns_slave.tform.php', $client_id, $primary_id, $params); @@ -224,7 +224,7 @@ class remoting_dns extends remoting { public function dns_slave_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'dns_zone_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->deleteQuery('../dns/form/dns_slave.tform.php', $primary_id); @@ -236,12 +236,12 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get_id')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(!preg_match('/^([a-z0-9][a-z0-9\-]+[a-z0-9]|[a-z0-9]{2})(\.[a-z]{2,63})+$/i', $origin)){ - throw new SoapFault('no_domain_found', 'Invalid domain name.'); + throw new ISPConfigRemoteException('no_domain_found', 'Invalid domain name.'); return false; } @@ -249,7 +249,7 @@ class remoting_dns extends remoting { if(isset($rec['id'])) { return $app->functions->intval($rec['id']); } else { - throw new SoapFault('no_domain_found', 'There is no domain ID with informed domain name.'); + throw new ISPConfigRemoteException('no_domain_found', 'There is no domain ID with informed domain name.'); return false; } } @@ -258,7 +258,7 @@ class remoting_dns extends remoting { public function dns_zone_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../dns/form/dns_soa.tform.php', $client_id, $params); @@ -268,7 +268,7 @@ class remoting_dns extends remoting { public function dns_zone_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../dns/form/dns_soa.tform.php', $client_id, $primary_id, $params); @@ -279,7 +279,7 @@ class remoting_dns extends remoting { public function dns_zone_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'dns_zone_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_soa.tform.php', $primary_id); @@ -294,7 +294,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_aaaa_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -306,7 +306,7 @@ class remoting_dns extends remoting { public function dns_aaaa_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_aaaa_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -317,7 +317,7 @@ class remoting_dns extends remoting { public function dns_aaaa_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_aaaa_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../dns/form/dns_aaaa.tform.php', $client_id, $primary_id, $params); @@ -329,7 +329,7 @@ class remoting_dns extends remoting { public function dns_aaaa_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_aaaa_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_aaaa.tform.php', $primary_id); @@ -345,7 +345,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_a_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -357,7 +357,7 @@ class remoting_dns extends remoting { public function dns_a_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_a_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -368,7 +368,7 @@ class remoting_dns extends remoting { public function dns_a_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_a_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -380,7 +380,7 @@ class remoting_dns extends remoting { public function dns_a_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_a_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_a.tform.php', $primary_id); @@ -396,7 +396,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_alias_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -408,7 +408,7 @@ class remoting_dns extends remoting { public function dns_alias_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_alias_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -419,7 +419,7 @@ class remoting_dns extends remoting { public function dns_alias_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_alias_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -431,7 +431,7 @@ class remoting_dns extends remoting { public function dns_alias_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_alias_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_alias.tform.php', $primary_id); @@ -447,7 +447,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_cname_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -459,7 +459,7 @@ class remoting_dns extends remoting { public function dns_cname_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_cname_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -470,7 +470,7 @@ class remoting_dns extends remoting { public function dns_cname_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_cname_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -482,7 +482,7 @@ class remoting_dns extends remoting { public function dns_cname_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_cname_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_cname.tform.php', $primary_id); @@ -498,7 +498,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_hinfo_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -510,7 +510,7 @@ class remoting_dns extends remoting { public function dns_hinfo_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_hinfo_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -521,7 +521,7 @@ class remoting_dns extends remoting { public function dns_hinfo_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_hinfo_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -533,7 +533,7 @@ class remoting_dns extends remoting { public function dns_hinfo_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_hinfo_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_hinfo.tform.php', $primary_id); @@ -549,7 +549,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_mx_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -561,7 +561,7 @@ class remoting_dns extends remoting { public function dns_mx_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_mx_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -572,7 +572,7 @@ class remoting_dns extends remoting { public function dns_mx_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_mx_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -584,7 +584,7 @@ class remoting_dns extends remoting { public function dns_mx_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_mx_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_mx.tform.php', $primary_id); @@ -600,7 +600,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_ns_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -612,7 +612,7 @@ class remoting_dns extends remoting { public function dns_ns_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ns_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -623,7 +623,7 @@ class remoting_dns extends remoting { public function dns_ns_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ns_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -635,7 +635,7 @@ class remoting_dns extends remoting { public function dns_ns_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ns_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_ns.tform.php', $primary_id); @@ -651,7 +651,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_ptr_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -663,7 +663,7 @@ class remoting_dns extends remoting { public function dns_ptr_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ptr_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -674,7 +674,7 @@ class remoting_dns extends remoting { public function dns_ptr_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ptr_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -686,7 +686,7 @@ class remoting_dns extends remoting { public function dns_ptr_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ptr_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_ptr.tform.php', $primary_id); @@ -702,7 +702,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_rp_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -714,7 +714,7 @@ class remoting_dns extends remoting { public function dns_rp_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_rp_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -725,7 +725,7 @@ class remoting_dns extends remoting { public function dns_rp_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_rp_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -737,7 +737,7 @@ class remoting_dns extends remoting { public function dns_rp_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_rp_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_rp.tform.php', $primary_id); @@ -753,7 +753,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_srv_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -765,7 +765,7 @@ class remoting_dns extends remoting { public function dns_srv_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_srv_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -776,7 +776,7 @@ class remoting_dns extends remoting { public function dns_srv_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_srv_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -788,7 +788,7 @@ class remoting_dns extends remoting { public function dns_srv_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_srv_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_srv.tform.php', $primary_id); @@ -804,7 +804,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_txt_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -816,7 +816,7 @@ class remoting_dns extends remoting { public function dns_txt_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_txt_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -827,7 +827,7 @@ class remoting_dns extends remoting { public function dns_txt_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_txt_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -839,7 +839,7 @@ class remoting_dns extends remoting { public function dns_txt_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_txt_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_txt.tform.php', $primary_id); @@ -856,7 +856,7 @@ class remoting_dns extends remoting { public function dns_zone_get_by_user($session_id, $client_id, $server_id) { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($client_id) && !empty($server_id)) { @@ -880,7 +880,7 @@ class remoting_dns extends remoting { public function dns_rr_get_all_by_zone($session_id, $zone_id) { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sql = "SELECT * FROM dns_rr WHERE zone = ?"; @@ -898,7 +898,7 @@ class remoting_dns extends remoting { public function dns_zone_set_status($session_id, $primary_id, $status) { global $app; if(!$this->checkPerm($session_id, 'dns_zone_set_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(in_array($status, array('active', 'inactive'))) { @@ -912,7 +912,7 @@ class remoting_dns extends remoting { $result = $app->db->affectedRows(); return $result; } else { - throw new SoapFault('status_undefined', 'The status is not available'); + throw new ISPConfigRemoteException('status_undefined', 'The status is not available'); return false; } } diff --git a/interface/lib/classes/remote.d/domains.inc.php b/interface/lib/classes/remote.d/domains.inc.php index 33830335d8989990cd1c4f4613ab290679763184..5bc70cf4a56e6a5606ec76d52c2f6dfbd6c4a46f 100644 --- a/interface/lib/classes/remote.d/domains.inc.php +++ b/interface/lib/classes/remote.d/domains.inc.php @@ -47,7 +47,7 @@ class remoting_domains extends remoting { global $app; if(!$this->checkPerm($session_id, 'domains_domain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -59,7 +59,7 @@ class remoting_domains extends remoting { public function domains_domain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'domains_domain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../client/form/domain.tform.php', $client_id, $params); @@ -69,7 +69,7 @@ class remoting_domains extends remoting { public function domains_domain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'domains_domain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../client/form/domain.tform.php', $primary_id); @@ -82,7 +82,7 @@ class remoting_domains extends remoting { { global $app; if(!$this->checkPerm($session_id, 'domains_get_all_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $group_id = $app->functions->intval($group_id); diff --git a/interface/lib/classes/remote.d/mail.inc.php b/interface/lib/classes/remote.d/mail.inc.php index 955c85d7aaca1a692e9ec23a9f3789b1112784f4..decd45a7c842e319b1d7b1d1787d6519039a61b6 100644 --- a/interface/lib/classes/remote.d/mail.inc.php +++ b/interface/lib/classes/remote.d/mail.inc.php @@ -45,7 +45,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_domain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -57,7 +57,7 @@ class remoting_mail extends remoting { public function mail_domain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'mail_domain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $primary_id = $this->insertQuery('../mail/form/mail_domain.tform.php', $client_id, $params); @@ -68,7 +68,7 @@ class remoting_mail extends remoting { public function mail_domain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'mail_domain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_domain.tform.php', $client_id, $primary_id, $params); @@ -79,7 +79,7 @@ class remoting_mail extends remoting { public function mail_domain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'mail_domain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_domain.tform.php', $primary_id); @@ -92,7 +92,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_aliasdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -105,7 +105,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_aliasdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_aliasdomain.tform.php', $client_id, $params); @@ -117,7 +117,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_aliasdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_aliasdomain.tform.php', $client_id, $primary_id, $params); @@ -128,7 +128,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_aliasdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_aliasdomain.tform.php', $primary_id); @@ -141,7 +141,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -155,7 +155,7 @@ class remoting_mail extends remoting { global $app; if (!$this->checkPerm($session_id, 'mail_user_add')){ - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -163,7 +163,7 @@ class remoting_mail extends remoting { $email_parts = explode('@', $params['email']); $tmp = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = ?", $email_parts[1]); if($tmp['domain'] != $email_parts[1]) { - throw new SoapFault('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); + throw new ISPConfigRemoteException('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); return false; } @@ -183,7 +183,7 @@ class remoting_mail extends remoting { if (!$this->checkPerm($session_id, 'mail_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -191,7 +191,7 @@ class remoting_mail extends remoting { $email_parts = explode('@', $params['email']); $tmp = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = ?", $email_parts[1]); if($tmp['domain'] != $email_parts[1]) { - throw new SoapFault('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); + throw new ISPConfigRemoteException('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); return false; } @@ -205,7 +205,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_user.tform.php', $primary_id); @@ -218,7 +218,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_user_filter_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -230,7 +230,7 @@ class remoting_mail extends remoting { { global $app; if (!$this->checkPerm($session_id, 'mail_user_filter_add')){ - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_user_filter.tform.php', $client_id, $params, 'mail:mail_user_filter:on_after_insert'); @@ -243,7 +243,7 @@ class remoting_mail extends remoting { global $app; if (!$this->checkPerm($session_id, 'mail_user_filter_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_user_filter.tform.php', $client_id, $primary_id, $params, 'mail:mail_user_filter:on_after_update'); @@ -256,7 +256,7 @@ class remoting_mail extends remoting { global $app; if (!$this->checkPerm($session_id, 'mail_user_filter_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id, 'mail:mail_user_filter:on_after_delete'); @@ -270,7 +270,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_user_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -293,7 +293,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_user_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -307,19 +307,19 @@ class remoting_mail extends remoting { //* Basic validation of variables if ($server_id <= 0) { - throw new SoapFault('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); + throw new ISPConfigRemoteException('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); return false; } if (/*$action_type != 'backup_download_mail' and*/ $action_type != 'backup_restore_mail' and $action_type != 'backup_delete_mail') { - throw new SoapFault('invalid_action', "Invalid action_type $action_type"); + throw new ISPConfigRemoteException('invalid_action', "Invalid action_type $action_type"); return false; } //* Validate instance $instance_record = $app->db->queryOneRecord("SELECT * FROM `sys_remoteaction` WHERE `action_param`=? and `action_type`=? and `action_state`='pending'", $primary_id, $action_type); if ($instance_record['action_id'] >= 1) { - throw new SoapFault('duplicate_action', "There is already a pending $action_type action"); + throw new ISPConfigRemoteException('duplicate_action', "There is already a pending $action_type action"); return false; } @@ -337,7 +337,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_alias_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -352,14 +352,14 @@ class remoting_mail extends remoting { if (!$this->checkPerm($session_id, 'mail_alias_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check if there is no active mailbox with this address $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = ?", $params["source"]); if($tmp['number'] > 0) { - throw new SoapFault('duplicate', 'There is already a mailbox with this email address.'); + throw new ISPConfigRemoteException('duplicate', 'There is already a mailbox with this email address.'); } unset($tmp); @@ -374,14 +374,14 @@ class remoting_mail extends remoting { if (!$this->checkPerm($session_id, 'mail_alias_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check if there is no active mailbox with this address $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = ?", $params["source"]); if($tmp['number'] > 0) { - throw new SoapFault('duplicate', 'There is already a mailbox with this email address.'); + throw new ISPConfigRemoteException('duplicate', 'There is already a mailbox with this email address.'); } unset($tmp); @@ -393,7 +393,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_alias_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_alias.tform.php', $primary_id); @@ -406,7 +406,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_forward_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -419,7 +419,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_forward_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_forward.tform.php', $client_id, $params); @@ -431,7 +431,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_forward_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_forward.tform.php', $client_id, $primary_id, $params); @@ -443,7 +443,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_forward_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_forward.tform.php', $primary_id); @@ -456,7 +456,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_catchall_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -469,7 +469,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_catchall_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $params); @@ -480,7 +480,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_catchall_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $primary_id, $params); @@ -491,7 +491,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_catchall_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_domain_catchall.tform.php', $primary_id); @@ -504,7 +504,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_transport_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -517,7 +517,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_transport_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_transport.tform.php', $client_id, $params); @@ -529,7 +529,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_transport_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_transport.tform.php', $client_id, $primary_id, $params); @@ -541,7 +541,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_transport_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_transport.tform.php', $primary_id); @@ -554,7 +554,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_relay_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -568,7 +568,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_relay_add')) { - throw new SoapFault('permission_denied','You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied','You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_relay_recipient.tform.php', $client_id, $params); @@ -580,7 +580,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_relay_update')) { - throw new SoapFault('permission_denied','You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied','You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_relay_recipient.tform.php', $client_id, $primary_id, $params); @@ -592,7 +592,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_relay_delete')) { - throw new SoapFault('permission_denied','You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied','You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_relay_recipient.tform.php', $primary_id); @@ -605,7 +605,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -618,7 +618,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $params); @@ -630,7 +630,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $primary_id, $params); @@ -642,7 +642,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_whitelist.tform.php', $primary_id); @@ -655,7 +655,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -668,7 +668,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $params); @@ -680,7 +680,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $primary_id, $params); @@ -692,7 +692,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_blacklist.tform.php', $primary_id); @@ -705,7 +705,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_spamfilter_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -718,7 +718,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_users.tform.php', $client_id, $params); @@ -730,7 +730,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_users.tform.php', $client_id, $primary_id, $params); @@ -742,7 +742,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_users.tform.php', $primary_id); @@ -755,7 +755,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_policy_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -768,7 +768,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_policy_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $params); @@ -780,7 +780,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_policy_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $primary_id, $params); @@ -792,7 +792,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_policy_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_policy.tform.php', $primary_id); @@ -805,7 +805,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_fetchmail_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -818,7 +818,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_fetchmail_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_get.tform.php', $client_id, $params); @@ -830,7 +830,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_fetchmail_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_get.tform.php', $client_id, $primary_id, $params); @@ -842,7 +842,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_fetchmail_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_get.tform.php', $primary_id); @@ -855,7 +855,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_whitelist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -868,7 +868,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_whitelist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_whitelist.tform.php', $client_id, $params); @@ -880,7 +880,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_whitelist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_whitelist.tform.php', $client_id, $primary_id, $params); @@ -892,7 +892,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_whitelist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_whitelist.tform.php', $primary_id); @@ -905,7 +905,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_blacklist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -918,7 +918,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_blacklist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_blacklist.tform.php', $client_id, $params); @@ -930,7 +930,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_blacklist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_blacklist.tform.php', $client_id, $primary_id, $params); @@ -942,7 +942,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_blacklist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_blacklist.tform.php', $primary_id); @@ -955,7 +955,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_filter_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -968,7 +968,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_filter_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_content_filter.tform.php', $client_id, $params); @@ -980,7 +980,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_filter_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_content_filter.tform.php', $client_id, $primary_id, $params); @@ -992,7 +992,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_filter_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_content_filter.tform.php', $primary_id); @@ -1011,7 +1011,7 @@ class remoting_mail extends remoting { public function mail_domain_get_by_domain($session_id, $domain) { global $app; if(!$this->checkPerm($session_id, 'mail_domain_get_by_domain')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($domain)) { @@ -1025,7 +1025,7 @@ class remoting_mail extends remoting { public function mail_domain_set_status($session_id, $primary_id, $status) { global $app; if(!$this->checkPerm($session_id, 'mail_domain_set_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(in_array($status, array('active', 'inactive'))) { @@ -1039,7 +1039,7 @@ class remoting_mail extends remoting { $result = $app->db->affectedRows(); return $result; } else { - throw new SoapFault('status_undefined', 'The status is not available'); + throw new ISPConfigRemoteException('status_undefined', 'The status is not available'); return false; } } @@ -1051,7 +1051,7 @@ class remoting_mail extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'mailquota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } diff --git a/interface/lib/classes/remote.d/monitor.inc.php b/interface/lib/classes/remote.d/monitor.inc.php index d3689b94caaa0e40ea65b3b906950ab114f9688f..9d207f0796b4df020c658f18dbb81e378300c720 100644 --- a/interface/lib/classes/remote.d/monitor.inc.php +++ b/interface/lib/classes/remote.d/monitor.inc.php @@ -38,7 +38,7 @@ class remoting_monitor extends remoting { global $app; if(!$this->checkPerm($session_id, 'monitor_jobqueue_count')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } diff --git a/interface/lib/classes/remote.d/server.inc.php b/interface/lib/classes/remote.d/server.inc.php index 66684cf15f74e78b2191a5bb33befb105ee46c23..261acd84838c502870668f5b2a8876d2a7c45814 100644 --- a/interface/lib/classes/remote.d/server.inc.php +++ b/interface/lib/classes/remote.d/server.inc.php @@ -52,7 +52,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get_serverid_by_ip')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sql = "SELECT server_id FROM server_ip WHERE ip_address = ?"; @@ -66,7 +66,7 @@ class remoting_server extends remoting { global $app; if(!$this->checkPerm($session_id, 'server_ip_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -78,7 +78,7 @@ class remoting_server extends remoting { public function server_ip_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'server_ip_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../admin/form/server_ip.tform.php', $client_id, $params); @@ -88,7 +88,7 @@ class remoting_server extends remoting { public function server_ip_update($session_id, $client_id, $ip_id, $params) { if(!$this->checkPerm($session_id, 'server_ip_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../admin/form/server_ip.tform.php', $client_id, $ip_id, $params); @@ -99,7 +99,7 @@ class remoting_server extends remoting { public function server_ip_delete($session_id, $ip_id) { if(!$this->checkPerm($session_id, 'server_ip_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../admin/form/server_ip.tform.php', $ip_id); @@ -118,7 +118,7 @@ class remoting_server extends remoting { public function server_get($session_id, $server_id = null, $section ='') { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -155,7 +155,7 @@ class remoting_server extends remoting { public function server_config_set($session_id, $server_id, $section, $key, $value) { global $app; if(!$this->checkPerm($session_id, 'server_config_set')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($server_id) && $server_id > 0 && $section != '' && $key != '') { @@ -165,7 +165,7 @@ class remoting_server extends remoting { $server_config_str = $app->ini_parser->get_ini_string($server_config_array); return $app->db->datalogUpdate('server', array("config" => $server_config_str), 'server_id', $server_id); } else { - throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + throw new ISPConfigRemoteException('invalid_function_parameter', 'Invalid function parameter.'); return false; } } @@ -180,7 +180,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -202,7 +202,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } if (!empty($session_id) && !empty($server_name)) { $sql = "SELECT server_id FROM server WHERE server_name = ?"; @@ -223,7 +223,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } if (!empty($session_id) && !empty($server_id)) { $sql = "SELECT * FROM server WHERE server_id = ?"; @@ -249,7 +249,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } if (!empty($session_id)) { if($server_id == 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION); @@ -269,7 +269,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } if (!empty($session_id) && !empty($server_id) && !empty($php)) { $php_versions = array(); diff --git a/interface/lib/classes/remote.d/sites.inc.php b/interface/lib/classes/remote.d/sites.inc.php index a2f15d6f9d4f73c5bcd67c21ca407c20dfde052c..b8ca4c2035247fd17c0ebf1538711f8103feea68 100644 --- a/interface/lib/classes/remote.d/sites.inc.php +++ b/interface/lib/classes/remote.d/sites.inc.php @@ -47,7 +47,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_cron_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -59,7 +59,7 @@ class remoting_sites extends remoting { public function sites_cron_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_cron_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/cron.tform.php', $client_id, $params); @@ -69,7 +69,7 @@ class remoting_sites extends remoting { public function sites_cron_update($session_id, $client_id, $cron_id, $params) { if(!$this->checkPerm($session_id, 'sites_cron_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/cron.tform.php', $client_id, $cron_id, $params); @@ -80,7 +80,7 @@ class remoting_sites extends remoting { public function sites_cron_delete($session_id, $cron_id) { if(!$this->checkPerm($session_id, 'sites_cron_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/cron.tform.php', $cron_id); @@ -95,7 +95,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -110,14 +110,14 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check for duplicates $tmp = $app->db->queryOneRecord("SELECT count(database_id) as dbnum FROM web_database WHERE database_name = ? AND server_id = ?", $params['database_name'], $params["server_id"]); if($tmp['dbnum'] > 0) { - throw new SoapFault('database_name_error_unique', 'There is already a database with that name on the same server.'); + throw new ISPConfigRemoteException('database_name_error_unique', 'There is already a database with that name on the same server.'); return false; } @@ -151,7 +151,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -183,7 +183,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_database_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -202,7 +202,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -214,7 +214,7 @@ class remoting_sites extends remoting { public function sites_database_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_database_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -227,7 +227,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -257,7 +257,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -285,7 +285,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_ftp_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -297,7 +297,7 @@ class remoting_sites extends remoting { public function sites_ftp_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_ftp_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/ftp_user.tform.php', $client_id, $params); @@ -307,7 +307,7 @@ class remoting_sites extends remoting { public function sites_ftp_user_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_ftp_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/ftp_user.tform.php', $client_id, $primary_id, $params); @@ -318,7 +318,7 @@ class remoting_sites extends remoting { public function sites_ftp_user_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_ftp_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/ftp_user.tform.php', $primary_id); @@ -331,7 +331,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_ftp_user_server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -353,7 +353,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_shell_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -365,7 +365,7 @@ class remoting_sites extends remoting { public function sites_shell_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_shell_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/shell_user.tform.php', $client_id, $params); @@ -375,7 +375,7 @@ class remoting_sites extends remoting { public function sites_shell_user_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_shell_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/shell_user.tform.php', $client_id, $primary_id, $params); @@ -386,7 +386,7 @@ class remoting_sites extends remoting { public function sites_shell_user_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_shell_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/shell_user.tform.php', $primary_id); @@ -401,7 +401,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -414,7 +414,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -445,7 +445,7 @@ class remoting_sites extends remoting { public function sites_web_domain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_domain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -465,7 +465,7 @@ class remoting_sites extends remoting { public function sites_web_domain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_domain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id); @@ -480,7 +480,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -493,7 +493,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -517,7 +517,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_aliasdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -537,7 +537,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_aliasdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id); @@ -552,7 +552,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_subdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -565,7 +565,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_subdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -589,7 +589,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_subdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -609,7 +609,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_subdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id); @@ -624,7 +624,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -636,7 +636,7 @@ class remoting_sites extends remoting { public function sites_web_aliasdomain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_childdomain.tform.php', $client_id, $params); @@ -646,7 +646,7 @@ class remoting_sites extends remoting { public function sites_web_aliasdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_childdomain.tform.php', $client_id, $primary_id, $params); @@ -657,7 +657,7 @@ class remoting_sites extends remoting { public function sites_web_aliasdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_childdomain.tform.php', $primary_id); @@ -672,7 +672,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_subdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -684,7 +684,7 @@ class remoting_sites extends remoting { public function sites_web_subdomain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_childdomain.tform.php', $client_id, $params); @@ -694,7 +694,7 @@ class remoting_sites extends remoting { public function sites_web_subdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_childdomain.tform.php', $client_id, $primary_id, $params); @@ -705,7 +705,7 @@ class remoting_sites extends remoting { public function sites_web_subdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_childdomain.tform.php', $primary_id); @@ -720,7 +720,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_folder_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -732,7 +732,7 @@ class remoting_sites extends remoting { public function sites_web_folder_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_folder.tform.php', $client_id, $params); @@ -742,7 +742,7 @@ class remoting_sites extends remoting { public function sites_web_folder_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_folder.tform.php', $client_id, $primary_id, $params); @@ -754,7 +754,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_folder_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -778,7 +778,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_folder_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -790,7 +790,7 @@ class remoting_sites extends remoting { public function sites_web_folder_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_folder_user.tform.php', $client_id, $params); @@ -800,7 +800,7 @@ class remoting_sites extends remoting { public function sites_web_folder_user_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_folder_user.tform.php', $client_id, $primary_id, $params); @@ -811,7 +811,7 @@ class remoting_sites extends remoting { public function sites_web_folder_user_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_folder_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_folder_user.tform.php', $primary_id); @@ -831,7 +831,7 @@ class remoting_sites extends remoting { public function client_get_sites_by_user($session_id, $sys_userid, $sys_groupid) { global $app; if(!$this->checkPerm($session_id, 'client_get_sites_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sys_userid = $app->functions->intval($sys_userid); @@ -846,7 +846,7 @@ class remoting_sites extends remoting { if(isset($result)) { return $result; } else { - throw new SoapFault('no_client_found', 'There is no site for this user'); + throw new ISPConfigRemoteException('no_client_found', 'There is no site for this user'); return false; } } @@ -864,7 +864,7 @@ class remoting_sites extends remoting { public function sites_web_domain_set_status($session_id, $primary_id, $status) { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_set_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(in_array($status, array('active', 'inactive'))) { @@ -880,7 +880,7 @@ class remoting_sites extends remoting { $affected_rows = $this->updateQuery('../sites/form/web_vhost_domain.tform.php', 0, $primary_id, $params); return $affected_rows; } else { - throw new SoapFault('status_undefined', 'The status is not available'); + throw new ISPConfigRemoteException('status_undefined', 'The status is not available'); return false; } } @@ -893,7 +893,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_database_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $client_id = $app->functions->intval($client_id); @@ -908,7 +908,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -922,7 +922,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -936,19 +936,19 @@ class remoting_sites extends remoting { //* Basic validation of variables if ($server_id <= 0) { - throw new SoapFault('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); + throw new ISPConfigRemoteException('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); return false; } if ($action_type != 'backup_download' and $action_type != 'backup_restore' and $action_type != 'backup_delete') { - throw new SoapFault('invalid_action', "Invalid action_type $action_type"); + throw new ISPConfigRemoteException('invalid_action', "Invalid action_type $action_type"); return false; } //* Validate instance $instance_record = $app->db->queryOneRecord("SELECT * FROM `sys_remoteaction` WHERE `action_param`= ? and `action_type`= ? and `action_state`= ?", $primary_id, $action_type, 'pending'); if ($instance_record['action_id'] >= 1) { - throw new SoapFault('duplicate_action', "There is already a pending $action_type action"); + throw new ISPConfigRemoteException('duplicate_action', "There is already a pending $action_type action"); return false; } @@ -967,7 +967,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'quota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -980,7 +980,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'trafficquota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($client_id != null) @@ -995,7 +995,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'trafficquota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($client_id != null) @@ -1010,7 +1010,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'databasequota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index 8522ebc6fd802cd07ebd32936b5359de22d27ad8..0ca262e597c8498e14a8f7e31e6d39ff4c326bfb 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -206,7 +206,7 @@ class remoting { fwrite($authlog_handle, $authlog ."\n"); fclose($authlog_handle); - throw new SoapFault($error['faultcode'], $error['faultstring']); + throw new ISPConfigRemoteException($error['faultcode'], $error['faultstring']); return false; } else { // User login right, so attempts can be deleted @@ -231,7 +231,7 @@ class remoting { global $app; if(empty($session_id)) { - throw new SoapFault('session_id_empty', 'The SessionID is empty.'); + throw new ISPConfigRemoteException('session_id_empty', 'The SessionID is empty.'); return false; } @@ -265,14 +265,14 @@ class remoting { //* Stop on error while preparing the sql query if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } //* Execute the SQL query $app->db->query($sql); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } if ( isset($params['_primary_id'] )) @@ -283,7 +283,7 @@ class remoting { //* Stop on error while executing the sql query if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } @@ -294,7 +294,7 @@ class remoting { /* if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } */ @@ -345,7 +345,7 @@ class remoting { //* Get the SQL query $sql = $app->remoting_lib->getSQL($params, 'INSERT', 0); if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } $app->log('Executed insertQueryPrepare', LOGLEVEL_DEBUG); @@ -361,7 +361,7 @@ class remoting { $app->db->query($sql); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } @@ -421,9 +421,9 @@ class remoting { //* Get the SQL query $sql = $app->remoting_lib->getSQL($params, 'UPDATE', $primary_id); - // throw new SoapFault('debug', $sql); + // throw new ISPConfigRemoteException('debug', $sql); if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } @@ -446,7 +446,7 @@ class remoting { $app->db->query($sql); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } @@ -492,7 +492,7 @@ class remoting { $affected_rows = $app->db->affectedRows(); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } @@ -543,7 +543,7 @@ class remoting { global $app; if(empty($session_id)) { - throw new SoapFault('session_id_empty', 'The SessionID is empty.'); + throw new ISPConfigRemoteException('session_id_empty', 'The SessionID is empty.'); return false; } @@ -552,7 +552,7 @@ class remoting { if($session['remote_userid'] > 0) { return $session; } else { - throw new SoapFault('session_does_not_exist', 'The Session is expired or does not exist.'); + throw new ISPConfigRemoteException('session_does_not_exist', 'The Session is expired or does not exist.'); return false; } } @@ -560,7 +560,7 @@ class remoting { public function server_get($session_id, $server_id = null, $section ='') { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -594,7 +594,7 @@ class remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -617,7 +617,7 @@ class remoting { public function get_function_list($session_id) { if(!$this->checkPerm($session_id, 'get_function_list')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->_methods; diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php index a5a5d0c31c49c647f33d5a0eca3310133820e05c..6fd5d2f3d97ded866b3a2bd000c29d1906b8014e 100644 --- a/interface/lib/classes/remoting_lib.inc.php +++ b/interface/lib/classes/remoting_lib.inc.php @@ -238,7 +238,7 @@ class remoting_lib extends tform_base { $sql = "SELECT * FROM ??"; return $app->db->queryAllRecords($sql, $this->formDef['db_table']); } else { - throw new SoapFault('invalid_id', 'The ID has to be > 0 or -1.'); + throw new ISPConfigRemoteException('invalid_id', 'The ID has to be > 0 or -1.'); return array(); } } elseif (@is_array($primary_id) || @is_object($primary_id)) { diff --git a/interface/lib/classes/rest_handler.inc.php b/interface/lib/classes/rest_handler.inc.php index ceaa7c63be32fc95198769c0398a6f46cc1e4b31..ebca73c40ecc683104e52bbedec668d318b46d74 100644 --- a/interface/lib/classes/rest_handler.inc.php +++ b/interface/lib/classes/rest_handler.inc.php @@ -173,11 +173,17 @@ class ISPConfigRESTHandler { try { $this->_return_json($return_code, call_user_func_array(array($this->classes[$class_name], $method), $params)); - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { $this->_return_error(500, 'REQUEST ERROR', $e->getMessage()); } } } -?> +if(!class_exists('ISPConfigRemoteException')) { + class ISPConfigRemoteException extends Exception { + public function __construct($code = '', $message = '') { + parent::__construct($message . ' (' . $code . ')', 0); + } + } +} \ No newline at end of file diff --git a/interface/lib/classes/soap_handler.inc.php b/interface/lib/classes/soap_handler.inc.php index 704e21b20ba282fc45d661dd2d1b78c66981e0ba..31221bcfe5a67c6db616ceecb780bc13535cfe18 100644 --- a/interface/lib/classes/soap_handler.inc.php +++ b/interface/lib/classes/soap_handler.inc.php @@ -71,25 +71,31 @@ class ISPConfigSoapHandler { public function __call($method, $params) { if(array_key_exists($method, $this->methods) == false) { - throw new SoapFault('invalid_method', 'Method ' . $method . ' does not exist'); + throw new ISPConfigRemoteException('invalid_method', 'Method ' . $method . ' does not exist'); } $class_name = $this->methods[$method]; if(array_key_exists($class_name, $this->classes) == false) { - throw new SoapFault('invalid_class', 'Class ' . $class_name . ' does not exist'); + throw new ISPConfigRemoteException('invalid_class', 'Class ' . $class_name . ' does not exist'); } if(method_exists($this->classes[$class_name], $method) == false) { - throw new SoapFault('invalid_method', 'Method ' . $method . ' does not exist in the class it was expected (' . $class_name . ')'); + throw new ISPConfigRemoteException('invalid_method', 'Method ' . $method . ' does not exist in the class it was expected (' . $class_name . ')'); } try { return call_user_func_array(array($this->classes[$class_name], $method), $params); - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { throw $e; } } } -?> +if(!class_exists('ISPConfigRemoteException')) { + class ISPConfigRemoteException extends SoapFault { + public function __construct($code = '', $message = '') { + parent::__construct($code, $message); + } + } +} diff --git a/interface/lib/classes/validate_client.inc.php b/interface/lib/classes/validate_client.inc.php index 980e6ffbb5a3b616fef71f65dc4213fda04a9857..20050d8cb5d77e94bc2a5b0cdbf4004d6fab9da4 100644 --- a/interface/lib/classes/validate_client.inc.php +++ b/interface/lib/classes/validate_client.inc.php @@ -193,7 +193,7 @@ class validate_client { } */ - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { //echo 'Error, see message: '.$e->faultstring; switch ($e->faultstring) { case 'INVALID_INPUT': @@ -212,7 +212,7 @@ class validate_client { break; } } - } catch(SoapFault $e){ + } catch(ISPConfigRemoteException $e){ // Connection to host not possible, europe.eu down? // this shouldn't be the user's fault, so we return no error }