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


PHP Acl::get_entities_admin方法代码示例

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


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

示例1: array

    // users
    $users = array();
    if (Session::am_i_admin()) {
        $users_list = Session::get_list($conn_ossim);
        foreach ($users_list as $user_data) {
            $users[] = $user_data->login;
        }
    } else {
        $users_list = Acl::get_my_users($conn_ossim, Session::get_session_user());
        foreach ($users_list as $user_data) {
            $users[] = $user_data["login"];
        }
    }
    // entities
    list($entities_all, $num_entities) = Acl::get_entities($conn_ossim);
    list($entities_admin, $num) = Acl::get_entities_admin($conn_ossim, Session::get_session_user());
    $entities_list = array_keys($entities_admin);
}
$db->close($conn);
$db->close($conn_ossim);
?>
<!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 _('Backup');
?>
</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  		<meta http-equiv="Pragma" content="no-cache">
  		<link rel="stylesheet" type="text/css" href="../style/style.css"/>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:index.php

示例2: showSubCategoryHTML

    function showSubCategoryHTML()
    {
        // get list reports
        $db = new ossim_db();
        $dbconn = $db->connect();
        $creports = array();
        $subreports_ac = array();
        $sql_search = "";
        if ($search != "") {
            $sql_search = "AND name like '%{$search}%'";
        }
        $result = $dbconn->Execute("SELECT login, name, value FROM user_config where category='custom_report' {$sql_search} ORDER BY name ASC");
        $hi = 0;
        while (!$result->EOF) {
            $available = false;
            $unserializedata = unserialize($result->fields["value"]);
            $available_for_user = $unserializedata["user"];
            $available_for_entity = $unserializedata["entity"];
            // check if this report is available for session user
            if (Session::am_i_admin()) {
                $available = true;
            } else {
                if ($available_for_user == "0") {
                    $available = true;
                } else {
                    if ($available_for_user != "" && $available_for_user == $session_user || $result->fields["login"] == $session_user) {
                        $available = true;
                    } else {
                        if (preg_match("/pro|demo/i", $version)) {
                            if (Acl::am_i_proadmin()) {
                                $entities_list = Acl::get_entities_admin($dbconn, Session::get_session_user());
                                $entities = array_keys($entities_list[0]);
                                $users = Acl::get_my_users($dbconn, Session::get_session_user());
                                $users_login = array();
                                foreach ($users as $user) {
                                    $users_login[] = $user["login"];
                                }
                                if (in_array($available_for_entity, $entities) || in_array($available_for_user, $users_login) || in_array($result->fields["login"], $users_login)) {
                                    $available = true;
                                }
                            } else {
                                $entities = Acl::get_user_entities(Session::get_session_user());
                                if (in_array($available_for_entity, $entities)) {
                                    $available = true;
                                }
                            }
                        }
                    }
                }
            }
            // save report if is available
            $maxpag = 20;
            $to = $pag * $maxpag;
            $from = $to - $maxpag;
            if ($available) {
                if ($from <= $hi && $hi < $to) {
                    $creports[] = $result->fields;
                }
                // autocomplete
                $key = base64_encode($result->fields["name"] . "###" . $result->fields["login"]);
                $subreports_ac[$key] = trim($result->fields["name"]);
                $hi++;
            }
            $result->MoveNext();
        }
        $dbconn->disconnect();
        //
        $html = '<table style="margin:0;padding:0;width:100%;font-size:11px">
					<tr>
						<td colspan="2">' . _('Properties report') . ':</td>
					</tr>
					<tr>
						<td>' . _('Report Name') . ':</td>
						<td>
							<select name="run">';
        foreach ($subreports_ac as $key => $value) {
            $html .= '<option value="' . $key . '"';
            $html .= $this->get('run') == $key ? ' selected="selected"' : "";
            $html .= '>' . $value . '</option>';
        }
        $html .= ' 		</select>
						</td>
					</tr>
					<tr>
						<td>' . _('Refresh report') . ':</td>
						<td><input name="refresh" value="false" ';
        if ($this->get('refresh') == 'false') {
            $html .= 'checked="checked" ';
        }
        $html .= 'type="radio">' . _('No') . '
					<input name="refresh" value="true" ';
        if ($this->get('refresh') == 'true') {
            $html .= 'checked="checked" ';
        }
        $html .= 'type="radio">' . _('Yes') . '
						<input style="width:80px" type="text" name="secondRefresh" value="' . $this->get('secondRefresh') . '" /> ' . _('seconds') . '</td>
					</tr>
				</table>';
        return $html;
    }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:100,代码来源:custom_report.php


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