本文整理汇总了PHP中Acl::get_users_by_entity方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::get_users_by_entity方法的具体用法?PHP Acl::get_users_by_entity怎么用?PHP Acl::get_users_by_entity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::get_users_by_entity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_timestamps
}
}
if (!valid_hex32($username)) {
$body = get_timestamps($dbconn, $username, $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
$email = get_email($dbconn, $username);
Util::send_email($dbconn, $email, $subject, $body, $attachments);
} else {
// username is a entity
$entity_data = Acl::get_entity($dbconn, $username, FALSE, FALSE);
if ($entity_data["admin_user"] != "") {
$body = get_timestamps($dbconn, $entity_data["admin_user"], $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
$email = get_email($dbconn, $entity_data["admin_user"]);
Util::send_email($dbconn, $email, $subject, $body, $attachments);
} else {
// doesn't exit pro admin
$users_list = Acl::get_users_by_entity($dbconn, $username);
foreach ($users_list as $k => $user_data) {
if ($user_data['email'] != "") {
$body = get_timestamps($dbconn, $user_data['login'], $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
if ($user_data['email'] != '') {
Util::send_email($dbconn, $user_data['email'], $subject, $body, $attachments);
}
}
}
}
}
if (file_exists($file_path)) {
unlink($file_path);
}
$cc->auth()->logout();
}
示例2: echochildrens
function echochildrens($entities, $parent_id, $entities_admin)
{
/* Connect to db */
$db = new ossim_db();
$conn = $db->connect();
$users_by_entity = Acl::get_users_by_entity($conn, $parent_id);
$me = Session::get_session_user();
$entities_types = Acl::get_entities_types($conn);
$length_name = !empty($_GET['length_name']) ? GET('length_name') : 30;
echo ",children:[";
$is_editable = $parent_id != "" && (!empty($users_by_entity[$me]) || Session::am_i_admin() || !empty($entities_admin[$me]));
if ($is_editable) {
echo "{title:'<font style=\"font-weight:normal\">" . _("All Assets") . "</font>', url:'AllAssets', key:'e_" . $parent_id . "_allassets', icon:'../../pixmaps/menu/assets.gif', isFolder:false, expand:true,";
echo "children:[ ";
echo "{ key:'e_" . $parent_id . "_net', isFolder:true, isLazy:true, icon:'../../pixmaps/theme/net.png', title:'" . _("Networks") . "'},";
echo "{ key:'e_" . $parent_id . "_sensor', isFolder:true, isLazy:true, icon:'../../pixmaps/theme/server.png', title:'" . _("Sensors") . "'}";
echo "]}";
}
$children = Acl::get_entity_childs($conn, $parent_id);
if (!empty($children)) {
$flag = false;
foreach ($children as $index => $child_id) {
$icon = "../../pixmaps/theme/any.png";
$child = $entities[0][$child_id];
$entity_allowed = Acl::entityAllowed($child_id);
$child_key = "e_" . $child_id;
$child_sn = strlen($child['name']) > $length_name ? substr($child['name'], 0, $length_name) . "..." : $child['name'];
$child_name = Util::htmlentities($child['name']);
$chil_ent_admin = $entities_admin;
$chil_ent_admin[$child['admin_user']] = $child_id;
if ($child['parent_id'] == $parent_id) {
$title = "<font style=\"font-weight:bold;\">" . Util::htmlentities($child_sn) . "</font> <font style=\"color:gray\">[" . $entities_types[$child['type']]['name'] . "]</font>";
$tooltip = Util::htmlentities($child['name']) . " [" . $entities_types[$child['type']]['name'] . "]";
if ($flag || $is_editable) {
echo ",";
}
$flag = true;
echo "{title:'" . $title . "', tooltip:'{$tooltip}', noLink: true, url:'" . $child_url . "', key:'" . $child_key . "', icon:'{$icon}', expand:true, name:'{$child_name}'";
echochildrens($entities, $child_id, $withusers, $entities_admin, $length_name);
echo "}";
}
}
}
echo "]";
}
示例3: _
<body>' . '<table width="100%" cellspacing="0" cellpadding="0" style="border:0px;">' . '<tr><td width="75">' . _('Id:') . '</td><td>' . $result->fields["id"] . '</td></tr>' . '<tr><td width="75">' . _('Title:') . '</td><td>' . $result->fields["title"] . '</td></tr>' . '<tr><td width="75">' . _('Date:') . '</td><td>' . $result->fields["date"] . '</td></tr>' . '<tr><td width="75">' . _('Ref:') . '</td><td>' . $result->fields["ref"] . '</td></tr>' . '<tr><td width="75">' . _('Type id:') . '</td><td>' . $result->fields["type_id"] . '</td></tr>' . '<tr><td width="75">' . _('Priority:') . '</td><td>' . $result->fields["priority"] . '</td></tr>' . '<tr><td width="75">' . _('Last update:') . '</td><td>' . $result->fields["last_update"] . '</td></tr>' . '<tr><td width="75">' . _('In charge:') . '</td><td>' . $in_charge . '</td></tr>' . '<tr><td width="75">' . _('Submitter:') . '</td><td>' . $result->fields["submitter"] . '</td></tr>' . '</table>' . '</body>
</html>';
if (!valid_hex32($result->fields["in_charge"])) {
$user_data = Session::get_list($conn, "WHERE login='" . $result->fields["in_charge"] . "'", "", TRUE);
if (is_object($user_data[0])) {
if ($user_data[0]->get_email() != '') {
Util::send_email($conn, $user_data[0]->get_email(), $subject, $body);
}
}
} else {
// In_charge is a entity
$entity_data = Acl::get_entity($conn, $result->fields["in_charge"], FALSE, FALSE);
if ($entity_data["admin_user"] != "") {
// exists pro admin
$pro_admin_data = Session::get_list($conn, "WHERE login='" . $entity_data["admin_user"] . "'", "", TRUE);
if ($pro_admin_data[0]->get_email() != '') {
Util::send_email($conn, $pro_admin_data[0]->get_email(), $subject, $body);
}
} else {
// Doesn't exit pro admin
$users_list = Acl::get_users_by_entity($conn, $result->fields["in_charge"]);
foreach ($users_list as $user) {
if ($user["email"] != '') {
Util::send_email($conn, $user['email'], $subject, $body);
}
}
}
}
$result->MoveNext();
}
$db->close();
示例4: echochildrens
function echochildrens($entities, $parent_id, $withusers, $entities_admin)
{
$length_name = 50;
echo ",children:[";
/* Connect to db */
$db = new ossim_db();
$conn = $db->connect();
$users_by_entity = Acl::get_users_by_entity($conn, $parent_id);
$me = Session::get_session_user();
$entities_types = Acl::get_entities_types($conn);
$is_editable = $parent_id != "" && (!empty($users_by_entity[$me]) || Session::am_i_admin() || !empty($entities_admin[$me]));
if ($is_editable) {
echo "{title:'<font style=\"font-weight:normal\">" . _("All Assets") . "</font>', key:'ae_" . $parent_id . "', icon:'../../pixmaps/menu/assets.gif', isFolder:true, isLazy:true}";
if ($withusers) {
echo ",{title:'<font style=\"font-weight:normal\">" . _("Assets by user") . "</font>', key:'ue_" . $parent_id . "', icon:'../../pixmaps/menu/assets.gif', isFolder:true, isLazy:true}";
}
}
$children = Acl::get_entity_childs($conn, $parent_id);
if (!empty($children)) {
$flag = false;
foreach ($children as $index => $child_id) {
$icon = "../../pixmaps/theme/any.png";
$child = $entities[0][$child_id];
$entity_allowed = Acl::entityAllowed($child_id);
if ($entity_allowed == 2) {
$child_link = "noLink: false";
$child_url = "../acl/entities_edit.php?id=" . $child_id;
} else {
$child_link = "noLink: true";
$child_url = "";
}
$child_key = "e_" . $child_id;
$child_sn = strlen($child['name']) > $length_name ? substr($child['name'], 0, $length_name) . "..." : $child['name'];
$child_name = Util::htmlentities($child['name']);
$chil_ent_admin = $entities_admin;
$chil_ent_admin[$child['admin_user']] = $child_id;
if ($child['parent_id'] == $parent_id) {
$title = "<font style=\"font-weight:bold;\">" . Util::htmlentities($child_sn) . "</font> <font style=\"color:gray\">[" . $entities_types[$child['type']]['name'] . "]</font>";
$tooltip = Util::htmlentities($child['name']) . " [" . $entities_types[$child['type']]['name'] . "]";
if ($flag || $is_editable) {
echo ",";
}
$flag = true;
$h = "400";
echo "{title:'" . $title . "', h:'{$h}', " . $child_link . ", url:'" . $child_url . "', tooltip:'{$tooltip}', key:'" . $child_key . "', icon:'{$icon}', expand:true, name:'{$child_name}'";
echochildrens($entities, $child_id, $withusers, $entities_admin);
echo "}";
}
}
}
echo "]";
}