当前位置: 首页>>代码示例>>PHP>>正文


PHP Repository::delete_relationships方法代码示例

本文整理汇总了PHP中Repository::delete_relationships方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::delete_relationships方法的具体用法?PHP Repository::delete_relationships怎么用?PHP Repository::delete_relationships使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Repository的用法示例。


在下文中一共展示了Repository::delete_relationships方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete_link

function delete_link($conn, $data)
{
    $delete = $data['link'];
    $id_document = $data['id'];
    $link_type = $data['type'];
    ossim_valid($delete, OSS_DIGIT, OSS_HEX, OSS_NULLABLE, '#', 'illegal:' . _('Document ID'));
    ossim_valid($link_type, OSS_INPUT, 'illegal:' . _('Link Type'));
    ossim_valid($id_document, OSS_DIGIT, 'illegal:' . _('Document ID'));
    if (ossim_error()) {
        $info_error = _('Error') . ': ' . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    if ($delete != '') {
        $result = Repository::delete_relationships($conn, $id_document, $delete);
        if (!empty($result)) {
            $return['error'] = TRUE;
            $return['msg'] = $result;
            return $return;
        }
        if ($link_type == 'plugin_sid') {
            $result = Repository::delete_snort_references($conn, $id_document);
            if (!empty($result)) {
                $return['error'] = TRUE;
                $return['msg'] = $result;
                return $return;
            }
        }
    }
    $return['error'] = FALSE;
    $return['msg'] = _('Link deleted successfully');
    return $return;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:35,代码来源:repository_ajax.php

示例2: ossim_valid

ossim_valid(GET('key_delete'), OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("Key_delete"));
ossim_valid(GET('id_delete'), OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("Id_delete"));
if (ossim_error()) {
    die(ossim_error());
}
// DB connect
$db = new ossim_db();
$conn = $db->connect();
// New link on relationships
if ($linkdoc != "" && GET('insert') == "1") {
    $name_link = $id != "" ? $conn->GetOne("SELECT title from incident as total WHERE id={$id}") : "";
    Repository::insert_relationships($conn, $linkdoc, $type_link, $id_link);
}
// Delete link on relationships
if (GET('key_delete') != "" && GET('id_delete') != "") {
    Repository::delete_relationships($conn, GET('id_delete'), GET('key_delete'));
}
$rel_list = Repository::get_relationships_by_link($conn, $id_link);
$pholder = _('Type to Start Searching the Document to Link');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
echo _('AlienVault ' . (Session::is_pro() ? 'USM' : 'OSSIM'));
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="Pragma" content="no-cache"/>
		
	<?php 
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:addrepository.php

示例3: intval

if (GET('newlinkname') != "" && GET('insert') == "1") {
    if ($link_type == "directive") {
        $idd = intval(GET('newlinkname'));
        Repository::insert_relationships($conn, $id_document, $idd, $link_type, $idd);
    } else {
        $aux = explode("####", GET('newlinkname'));
        Repository::insert_relationships($conn, $id_document, $aux[0], $link_type, $aux[1]);
        if ($link_type == "plugin_sid") {
            Repository::insert_snort_references($conn, $id_document, $aux[1], $aux[0]);
        }
    }
}
// Delete link on relationships
if (GET('key_delete') != "") {
    $key = mb_convert_encoding(urldecode(GET('key_delete')), 'HTML-ENTITIES', 'UTF-8');
    Repository::delete_relationships($conn, $id_document, $key);
    if ($link_type == "plugin_sid") {
        Repository::delete_snort_references($conn, $id_document);
    }
}
$document = Repository::get_document($conn, $id_document);
$rel_list = Repository::get_relationships($conn, $id_document);
if ($link_type != "directive" && $link_type != "plugin_sid") {
    list($hostnet_list, $num_rows) = Repository::get_hostnet($conn, $link_type);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:repository_links.php


注:本文中的Repository::delete_relationships方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。