From 58d2abbdae1e15066ee3f96caa43c536ccf844b1 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 23 Apr 2019 15:37:54 +0200 Subject: [PATCH] restauro api Former-commit-id: de9d1588e0e8ef53b48b72d52597963b59aee11f --- pandora_console/include/api.php | 95 ++------------------------------- 1 file changed, 4 insertions(+), 91 deletions(-) diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 8e8f40339d..3b04cedd24 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -37,12 +37,9 @@ $api_password = get_parameter('apipass', ''); $password = get_parameter('pass', ''); $user = get_parameter('user', ''); $info = get_parameter('info', ''); -$user_db = get_parameter('user_db', ''); + $other = parseOtherParameter($otherSerialize, $otherMode); -$group_db = get_parameter('group_db', ''); -$disable = get_parameter('disable', ''); -$id_up = get_parameter('id_up', ''); -$id_profile = get_parameter('id_profile', ''); + $apiPassword = io_output_password(db_get_value_filter('value', 'tconfig', ['token' => 'api_password'])); $correctLogin = false; @@ -110,6 +107,7 @@ if ($correctLogin) { if ($op == 'set' && $id) { switch ($op2) { case 'update_agent': + case 'add_module_in_conf': case 'update_module_in_conf': case 'delete_module_in_conf': @@ -151,93 +149,8 @@ if ($correctLogin) { } break; - case 'info_user_name': - - if ($user_db === '') { - returnError(__('User not specified'), __('User not specified')); - return; - } - - $id_os = api_set_info_user_name($returnType, $user_db); - - if ($id_os != 100) { - return; - } - - if ($id_os == 100) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'filter_user_group': - - if ($user_db === '' && ( $group_db === '' || $disable === '')) { - returnError(__('User, group or disabled status not specified'), __('User, group or disabled status not specified')); - return; - } - - $id_os = api_set_filter_user_group($returnType, $user_db, $group_db, $disable); - - if ($id_os != 100) { - return; - } - - if ($id_os == false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'delete_user_profiles': - - if ($user_db === '') { - returnError(__('User or group not specified'), __('User, group not specified')); - return; - } - - $id_os = api_set_delete_user_profiles($user_db, $id_up); - - if ($id_os != 100) { - return; - } - - if ($id_os == false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'list_all_user': - - $id_os = api_set_list_all_user($returnType); - - if ($id_os === false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - - case 'add_permission_user_to_group': - - if ($user_db == null || $group_db == null || $id_up == null) { - returnError(__('User, group or profile not specified'), __('User, group or profile status not specified')); - return; - } - - $id_os = api_set_add_permission_user_to_group($returnType, $user_db, $group_db, $id_up, $id_profile); - - if ($id_os != 100) { - return; - } - - if ($id_os == false) { - returnError('not_allowed_operation_cluster', $returnType); - return false; - } - break; - default: + // break; } }