本文整理汇总了PHP中Permission::P方法的典型用法代码示例。如果您正苦于以下问题:PHP Permission::P方法的具体用法?PHP Permission::P怎么用?PHP Permission::P使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permission
的用法示例。
在下文中一共展示了Permission::P方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAdminUI
public function processAdminUI()
{
$network = Network::processSelectUI('Statistics');
if ($network) {
$this->report_selected_networks[$network->getId()] = $network;
} else {
$networks = Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_VIEW_STATISTICS'));
foreach ($networks as $network) {
$this->report_selected_networks[$network->getId()] = $network;
}
}
$this->processDateRangeUI();
$this->processSelectedNodesUI();
$this->processDistinguishUsersByUI();
$this->processSelectedUsersUI();
$this->processSelectedReportsUI();
}
示例2: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
$server = Server::getServer();
if (Security::hasAnyPermission(array(array(Permission::P('SERVER_PERM_EDIT_CONTENT_LIBRARY'), $server)))) {
$items[] = array('path' => 'server/content_library', 'title' => _("Reusable content library"), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Content&action=list"));
}
return $items;
}
示例3: PrintUploadedFileInfo
// | Boston, MA 02111-1307, USA gnu@gnu.org |
// | |
// +-------------------------------------------------------------------+
/**
* @package WiFiDogAuthServer
* @copyright 2004-2006 Technologies Coeus inc.
* @version Subversion $Id$
* @link http://www.wifidog.org/
*/
/**
* Load common include file
*/
require_once 'admin_common.php';
require_once 'classes/MainUI.php';
require_once 'classes/Server.php';
Security::requirePermission(Permission::P('SERVER_PERM_EDIT_SERVER_CONFIG'), Server::getServer());
$db = AbstractDb::getObject();
$html = '';
/** Affiche les informations sur le fichier envoy� par le client
*/
function PrintUploadedFileInfo($form_name_file)
{
$html .= "Nom du fichier envoy�:" . $_FILES[$form_name_file]['name'] . "<br>";
$html .= "Taille: " . $_FILES[$form_name_file]['size'] . " octets" . "<br>";
$html .= "Mime type: " . $_FILES[$form_name_file]['type'] . "<br>";
$html .= "Nom du fichier temporaire sur le serveur: " . $_FILES[$form_name_file]['tmp_name'] . "<br>";
$html .= "Erreurs au cours du transfert: " . $_FILES[$form_name_file]['error'] . "<br>";
}
$html .= "<fieldset class=\"pretty_fieldset\">";
$html .= "<legend>" . _("NoCat user database import") . "</legend>";
if (empty($_REQUEST['action'])) {
示例4: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
if ($networks = Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_NETWORK_CONFIG'))) {
foreach ($networks as $networkId => $network) {
$items[] = array('path' => 'network/network_' . $networkId . 'edit', 'title' => sprintf(_("Edit %s"), $network->getName()), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Network&action=edit&object_id={$networkId}"));
}
}
if (Security::hasPermission(Permission::P('SERVER_PERM_ADD_NEW_NETWORK'), Server::getServer())) {
$items[] = array('path' => 'network/network_add_new', 'title' => sprintf(_("Add a new network on this server")), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Network&action=new_ui"));
}
$items[] = array('path' => 'network', 'title' => _('Network administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}
示例5: array
// | |
// +-------------------------------------------------------------------+
/**
* @package WiFiDogAuthServer
* @author Philippe April
* @copyright 2004-2006 Philippe April
* @version Subversion $Id$
* @link http://www.wifidog.org/
*/
/**
* Load common include file
*/
require_once 'admin_common.php';
require_once 'classes/MainUI.php';
require_once 'classes/User.php';
$networks = Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_ANY_USER'));
$db = AbstractDb::getObject();
$smarty = SmartyWifidog::getObject();
$total = array();
$total['incoming'] = 0;
$total['outgoing'] = 0;
// Process user ID searchbox
$errmsg = null;
$user = User::processSelectUserUI("user_id_searchbox", $errmsg);
if (!empty($_REQUEST['user_id']) || !empty($user)) {
header("Location: " . BASE_SSL_PATH . "admin/generic_object_admin.php?object_id={$user->getId()}&object_class=User&action=edit");
exit;
} else {
$smarty->assign("error", null);
$smarty->assign('sort_ids', array('username', 'account_origin', 'reg_date'));
$smarty->assign('direction_ids', array('asc', 'desc'));
示例6: processGraphAdminUI
/**
* Process admin interface of this object.
*
* @return void
*
* @access public
*/
public function processGraphAdminUI(&$errMsg, $network = null)
{
$hge_id = $this->getHgeId();
if (is_null($network) || Security::hasPermission(Permission::P('NETWORK_PERM_ALLOW_GROUP_NODE'), $network)) {
$name = "hge_{$hge_id}_graph";
HotspotGraph::processGraphAdminUI($this, $errMsg);
}
}
示例7: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
$network = Network::getCurrentNetwork();
$server = Server::getServer();
if (Security::hasAnyPermission(array(array(Permission::P('NETWORK_PERM_VIEW_ONLINE_USERS'), $network)))) {
$items[] = array('path' => 'users/online_users', 'title' => _("Online Users"), 'url' => BASE_URL_PATH . "admin/online_users.php");
}
if (Security::hasPermission(Permission::P('SERVER_PERM_EDIT_SERVER_CONFIG'), $server)) {
$items[] = array('path' => 'users/import_nocat', 'title' => _("Import NoCat user database"), 'url' => BASE_URL_PATH . "admin/import_user_database.php");
}
if (Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_ANY_USER'))) {
$items[] = array('path' => 'users/user_manager', 'title' => _("User manager"), 'url' => BASE_URL_PATH . "admin/user_log.php");
}
if (Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_VIEW_STATISTICS'))) {
$items[] = array('path' => 'users/statistics', 'title' => _("Statistics"), 'url' => BASE_URL_PATH . "admin/stats.php");
}
$items[] = array('path' => 'users', 'title' => _('User administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}
示例8: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
$server = Server::getServer();
if (Security::hasPermission(Permission::P('SERVER_PERM_EDIT_ROLES'), $server)) {
$items[] = array('path' => 'server/roles', 'title' => _("User roles"), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Role&action=list"));
}
return $items;
}
示例9: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
$server = self::getServer();
if (Security::hasPermission(Permission::P('SERVER_PERM_EDIT_SERVER_CONFIG'), $server)) {
$items[] = array('path' => 'server/admin', 'title' => _("Server configuration"), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Server&action=edit&object_id=" . SERVER_ID . ""));
}
$items[] = array('path' => 'server', 'title' => _('Server administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}
示例10: USING
// | |
// +-------------------------------------------------------------------+
/**
* @package WiFiDogAuthServer
* @author Philippe April
* @copyright 2004-2006 Philippe April
* @version Subversion $Id$
* @link http://www.wifidog.org/
*/
/**
* Load common include file
*/
require_once 'admin_common.php';
require_once 'classes/Node.php';
require_once 'classes/MainUI.php';
Security::requirePermission(Permission::P('NETWORK_PERM_VIEW_ONLINE_USERS'), Network::getCurrentNetwork());
$db = AbstractDb::getObject();
$smarty = SmartyWifidog::getObject();
$online_users = null;
$db->execSql("SELECT connections.user_id, name, username, account_origin, timestamp_in, incoming, outgoing FROM users,nodes,connections JOIN tokens USING (token_id) WHERE token_status='" . TOKEN_INUSE . "' AND users.user_id=connections.user_id AND nodes.node_id=connections.node_id ORDER BY account_origin, timestamp_in DESC", $online_users);
$smarty->assign("users_array", $online_users);
$ui = MainUI::getObject();
$ui->addContent('main_area_middle', $smarty->fetch("admin/templates/online_users.html"));
$ui->display();
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
示例11: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
if (Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_ANY_NODE_CONFIG'))) {
$items[] = array('path' => 'node/node_edit', 'title' => _("Edit nodes"), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Node&action=list"));
} else {
if ($nodes = Security::getObjectsWithPermission(Permission::P('NODE_PERM_EDIT_CONFIG'))) {
foreach ($nodes as $nodeId => $node) {
$items[] = array('path' => 'node/node_' . $nodeId . 'edit', 'title' => sprintf(_("Edit %s"), $node->getName()), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Node&action=edit&object_id={$nodeId}"));
}
}
}
if (Security::hasPermission(Permission::P('NETWORK_PERM_ADD_NODE'))) {
$items[] = array('path' => 'node/node_add_new', 'title' => sprintf(_("Add a new node")), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Node&action=new_ui"));
}
$items[] = array('path' => 'node', 'title' => _('Node administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}