Example #1
0
                $data['data'] = _('Net removed successfully');
            } catch (Exception $e) {
                $data['status'] = 'error';
                $data['data'] = _('Error! Net could not be removed');
            }
        }
        break;
    case 'remove_icon':
        $validate = array('asset_id' => array('validation' => 'OSS_HEX', 'e_message' => 'illegal:' . _('Net ID')));
        $net_id = POST('asset_id');
        $validation_errors = validate_form_fields('POST', $validate);
        if (is_array($validation_errors) && !empty($validation_errors)) {
            $data['status'] = 'error';
            $data['data'] = _('Error! Net ID not allowed.  Icon could not be removed');
        } else {
            try {
                $db = new ossim_db();
                $conn = $db->connect();
                Asset_net::delete_icon($conn, $net_id);
                $db->close();
                $data['status'] = 'OK';
                $data['data'] = _('Net icon removed successfully');
            } catch (Exception $e) {
                $data['status'] = 'error';
                $data['data'] = _('Error! Net icon could not be removed');
            }
        }
        break;
}
echo json_encode($data);
exit;