本文整理汇总了PHP中Asset_host::delete_from_db方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset_host::delete_from_db方法的具体用法?PHP Asset_host::delete_from_db怎么用?PHP Asset_host::delete_from_db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset_host
的用法示例。
在下文中一共展示了Asset_host::delete_from_db方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: POST
if (Token::verify('tk_asset_form', $token) == FALSE) {
$error = Token::create_error_message();
Util::response_bad_request($error);
}
$asset_id = POST('asset_id');
$db = new ossim_db();
$conn = $db->connect();
$can_i_modify_ips = Asset_host::can_i_modify_ips($conn, $asset_id);
$db->close();
if (!valid_hex32($asset_id) || $can_i_modify_ips == FALSE) {
Util::response_bad_request(_('Error! Asset ID not allowed. Asset could not be deleted'));
} else {
try {
$db = new ossim_db();
$conn = $db->connect();
Asset_host::delete_from_db($conn, $asset_id, TRUE);
$db->close();
$data['status'] = 'success';
$data['data'] = sprintf(_('Asset has been permanently deleted from %s'), $app_name);
} catch (Exception $e) {
Util::response_bad_request(_('Error! Asset could not be deleted') . ': ' . $e->getMessage());
}
}
break;
case 'add_to_groups':
//Validate Form token
$token = POST('token');
if (Token::verify('tk_asset_form', $token) == FALSE) {
$error = Token::create_error_message();
Util::response_bad_request($error);
}
示例2: delete_member
function delete_member($conn, $data)
{
$uuid = $data['id'];
$type = $data['type'];
// Type
ossim_valid($uuid, OSS_HEX, 'illegal:' . _("ID"));
ossim_valid($type, OSS_NULLABLE, OSS_LETTER, 'illegal:' . _("Device Type"));
check_ossim_error();
if ($type == 'host') {
Asset_host::delete_from_db($conn, $uuid);
} elseif ($type == 'net') {
Asset_net::delete_from_db($conn, $uuid);
} else {
throw new Exception(_('Invalid Action'));
}
$response['error'] = FALSE;
$response['data'] = array();
return $response;
}