本文整理汇总了PHP中Acl::get_entities_to_assign方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::get_entities_to_assign方法的具体用法?PHP Acl::get_entities_to_assign怎么用?PHP Acl::get_entities_to_assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::get_entities_to_assign方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_entities
function load_entities($dbconn)
{
$entities = Acl::get_entities_to_assign($dbconn);
foreach ($entities as $entity => $name) {
$json_entities .= '{ "txt":"' . utf8_encode($name) . '", "id": "e_' . $entity . '", "desc": "ENTITY:' . utf8_encode($name) . '"},';
}
return $json_entities;
}
示例2: get_policy_entities
function get_policy_entities($conn)
{
$entities = $entities_all = array();
$ctx_pro = '';
$entities_all = Acl::get_entities_to_assign($conn);
foreach ($entities_all as $k => $v) {
if (Acl::is_logical_entity($conn, $k)) {
$parent_id = Acl::get_logical_ctx_id($conn, $k);
$parent_id = $parent_id[0];
// first
$parent_name = Acl::get_entity_name($conn, $parent_id);
if (!empty($parent_id)) {
$entities[$parent_id] = $parent_name;
}
} else {
$entities[$k] = $v;
}
}
asort($entities);
$ctx_pro = array_shift(array_keys($entities));
return array($entities, $ctx_pro);
}
示例3: ticket_form
function ticket_form($action)
{
global $conn;
$users = Session::get_users_to_assign($conn);
if (Session::is_pro()) {
$entities = Acl::get_entities_to_assign($conn);
}
?>
<tr class="tticket">
<td colspan="2" class="nobborder"> </td>
</tr>
<tr class="tticket">
<th><label for="in_charge"><?php
echo _('In Charge:') . required();
?>
</label></th>
<td class="nobborder left">
<table cellspacing="0" cellpadding="0" class="transparent">
<tr>
<td class="nobborder">
<label for="transferred_user"><?php
echo _('User:');
?>
</label>
</td>
<td class="nobborder left">
<select onfocus='set_focus(this);' name="transferred_user" id="transferred_user" class="vfield" onchange="switch_user('user');return false;">
<?php
$num_users = 0;
foreach ($users as $k => $v) {
$login = $v->get_login();
$options .= "<option value='{$login}'" . ($action == $login ? " selected" : "") . ">{$login}</option>\n";
$num_users++;
}
if ($num_users == 0) {
echo "<option value='' style='text-align:center !important;'>- " . _("No users found") . "- </option>";
} else {
echo "<option value='' style='text-align:center !important;' selected='selected'>- " . _("Select one user") . " -</option>\n";
echo $options;
}
?>
</select>
</td>
<?php
if (!empty($entities)) {
?>
<td class="nobborder" nowrap='nowrap'>
<label for="transferred_entity" style='margin-right: 3px;'><?php
echo _('OR') . ' ' . _('Entity:');
?>
</label>
</td>
<td class="nobborder">
<select onfocus='set_focus(this);' name="transferred_entity" id="transferred_entity" class="vfield" onchange="switch_user('entity');return false;">
<?php
if (count($entities) == 0) {
echo "<option value='' style='text-align:center !important;'>- " . _('No entities found') . " -</option>";
} else {
echo "<option value='' style='text-align:center !important;'>- " . _('Select one entity') . " -</option>\n";
}
foreach ($entities as $k => $v) {
echo "<option value='{$k}'" . ($action == $k ? " selected" : "") . ">{$v}</option>";
}
?>
</select>
</td>
<?php
}
?>
</tr>
</table>
</td>
</tr>
<?php
}
示例4: PrintBASESubHeader
//.........这里部分代码省略.........
});
$('#views_close').on('click',function()
{
$('#views').hide();
});
$('#actions_link').on('click',function(event)
{
event.stopPropagation();
$('#custom_views').hide();
var diff = ($.browser.webkit && !(/chrome/.test(navigator.userAgent.toLowerCase()))) ? -3 : 0;
var vl = $('#actions_link').offset();
var tt = vl.top + $('#actions_link').outerHeight(true) + diff;
var ll = vl.left - $('#actions_dd').outerWidth(true) + $('#actions_link').outerWidth(true) + diff;
$('#actions_dd').css({position: 'absolute', left: Math.floor(ll), top: Math.floor(tt)}).toggle();
return false;
});
// AUTOCOMPLETES
<?php
$db_aux = new ossim_db(true);
$conn_aux = $db_aux->connect();
// Purge or Restore backup action is running
list($backup_status, $backup_mode, $backup_progress) = Backup::is_running($conn_aux);
if ($backup_status > 0) {
?>
show_backup_status();
<?php
}
$ctx = $_GET["ctx"] != "" ? $_GET["ctx"] : $_SESSION["ctx"];
$ents = '';
if (Session::is_pro()) {
$my_entities = Session::am_i_admin() ? $entities : Acl::get_entities_to_assign($conn_aux);
foreach ($my_entities as $e_id => $e_name) {
if (Session::get_entity_type($conn_aux, $e_id) != 'context') {
continue;
}
$ents .= '<option class="ents" value="' . $e_id . '"' . ($ctx == $e_id ? ' selected' : '') . '>' . _('Context') . ': ' . Util::htmlentities($e_name) . '</option>';
}
}
$db_aux->close($conn_aux);
?>
$("#otx_pulse").autocomplete('/ossim/otx/providers/otx_pulse_autocomplete.php?type=event', {
minChars: 0,
width: 197,
max: 50,
matchContains: "word",
autoFill: false,
scroll: true,
formatItem: function(row, i, max, value)
{
return (value.split('###'))[1];
},
formatResult: function(data, value)
{
return (value.split('###'))[1];
}
}).result(function(event, item)
{
if (typeof(item) != 'undefined' && item != null)
{
var _aux_item = item[0].split('###');
var pulse_id = _aux_item[0];
$('#otx_activity').prop('checked', false);
示例5: tab_discovery
function tab_discovery()
{
global $component, $uroles, $editdata, $scheduler, $username, $useremail, $dbconn, $disp, $enScanRequestImmediate, $enScanRequestRecur, $timeout, $smethod, $SVRid, $sid, $ip_list, $ip_exceptions_list, $schedule_type, $ROYEAR, $ROday, $ROMONTH, $time_hour, $time_min, $dayofweek, $dayofmonth, $sname, $user, $entity, $hosts_alive, $scan_locally, $version, $nthweekday, $semail, $not_resolve, $time_interval, $ssh_credential, $smb_credential, $net_id;
global $pluginOptions, $enComplianceChecks, $profileid;
$conf = $GLOBALS["CONF"];
$users = Session::get_users_to_assign($dbconn);
$entities_to_assign = Session::get_entities_to_assign($dbconn);
$pre_scan_locally_status = $conf->get_conf("nessus_pre_scan_locally");
$user_selected = $user;
$entity_selected = $entity;
$SVRid_selected = $SVRid;
$sid_selected = $sid != "" ? $sid : $editdata['meth_VSET'];
$timeout_selected = $editdata["meth_TIMEOUT"];
$ip_list_selected = str_replace("\\r\\n", "\n", str_replace(";;", "\n", $ip_list));
if (count($ip_exceptions_list) > 0) {
$ip_list_selected .= "\n" . implode("\n", $ip_exceptions_list);
}
$ROYEAR_selected = $ROYEAR;
$ROday_selected = $ROday;
$ROMONTH_selected = $ROMONTH;
$time_hour_selected = $time_hour;
$time_min_selected = $time_min;
$dayofweek_selected = $dayofweek;
$dayofmonth_selected = $dayofmonth;
$sname_selected = $sname;
if (preg_match("/^[a-f\\d]{32}\$/i", $net_id)) {
// Autofill new scan job from deployment
if (Asset_net::is_in_db($dbconn, $net_id)) {
$sname_selected = Asset_net::get_name_by_id($dbconn, $net_id);
$schedule_type = "M";
$ip_list = array();
$nips = explode(",", Asset_net::get_ips_by_id($dbconn, $net_id));
foreach ($nips as $nip) {
$ip_list[] = $net_id . "#" . trim($nip);
}
}
}
if ($schedule_type != "") {
$editdata['schedule_type'] = $schedule_type;
}
$cquery_like = "";
if ($component != "") {
$cquery_like = " AND component='{$component}'";
}
$today = date("Ymd");
$tyear = substr($today, 0, 4);
$nyear = $tyear + 1;
$tmonth = substr($today, 4, 2);
$tday = substr($today, 6, 2);
#SET VALUES UP IF EDIT SCHEDULER
if (isset($editdata['notify'])) {
$enotify = $editdata['notify'];
} else {
$enotify = "{$useremail}";
}
if (isset($editdata['time'])) {
list($time_hour, $time_min, $time_sec) = split(':', $editdata['time']);
$tz = Util::get_timezone();
$time_hour = $time_hour + $tz;
}
$arrTypes = array("N", "O", "D", "W", "M", "NW");
foreach ($arrTypes as $type) {
$sTYPE[$type] = "";
}
$arrJobTypes = array("C", "M", "R", "S");
foreach ($arrJobTypes as $type) {
$sjTYPE[$type] = "";
}
if (isset($editdata['schedule_type'])) {
$sTYPE[$editdata['schedule_type']] = "selected='selected'";
if ($editdata['schedule_type'] == 'D') {
$ni = 2;
} elseif ($editdata['schedule_type'] == 'O') {
$ni = 3;
} elseif ($editdata['schedule_type'] == 'W') {
$ni = 4;
} elseif ($editdata['schedule_type'] == 'NW') {
$ni = 6;
} else {
$ni = 5;
}
$show = "<br><script language=javascript>showLayer('idSched', {$ni});</script>";
} else {
if ($enScanRequestImmediate) {
$sTYPE['N'] = "selected='selected'";
$show = "<br><script language=javascript>showLayer('idSched', 1);</script>";
} else {
$sTYPE['O'] = "selected='selected'";
$show = "<br><script language=javascript>showLayer('idSched', 3);</script>";
}
}
if ($schedule_type != "") {
if ($schedule_type == "N") {
$show .= "<br><script language=javascript>showLayer('idSched', 1);</script>";
}
if ($schedule_type == "O") {
$show .= "<br><script language=javascript>showLayer('idSched', 3);</script>";
}
if ($schedule_type == "D") {
$show .= "<br><script language=javascript>showLayer('idSched', 2);</script>";
//.........这里部分代码省略.........