Esempio n. 1
0
         $data['data'] = sprintf(_('Asset group has been created in %s'), $app_name);
         $data['id'] = $id;
     } catch (Exception $e) {
         Util::response_bad_request(_('Error! Asset group could not be created') . ': ' . $e->getMessage());
     }
     break;
 case 'delete_group':
     $group_id = POST('asset_id');
     if (!valid_hex32($group_id)) {
         Util::response_bad_request(_('Error! Asset group ID not allowed. Asset group could not be deleted'));
     } else {
         try {
             $db = new ossim_db();
             $conn = $db->connect();
             $asset_group = new Asset_group($group_id);
             $asset_group->delete($conn);
             $db->close();
             $data['status'] = 'success';
             $data['data'] = sprintf(_('Asset group has been permanently deleted from %s'), $app_name);
         } catch (Exception $e) {
             Util::response_bad_request(_('Error! Asset group could not be deleted') . ': ' . $e->getMessage());
         }
     }
     break;
 case 'add_new_assets':
     $group_id = POST('asset_id');
     if (!valid_hex32($group_id)) {
         Util::response_bad_request(_('Error! Asset group ID not allowed. Selected assets could not be added'));
     } else {
         try {
             $db = new ossim_db();