本文整理汇总了PHP中Permission::denyAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Permission::denyAccess方法的具体用法?PHP Permission::denyAccess怎么用?PHP Permission::denyAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permission
的用法示例。
在下文中一共展示了Permission::denyAccess方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
} else {
Permission::denyAccess(PERM_USER);
}
} elseif ($_GET['section'] == 'insert_add') {
if (Permission::checkPermission(PERM_USER)) {
$dns_ressource_record = new DnsRessourceRecord(false, (int) $_POST['dns_zone_id'], (int) $_SESSION['user_id'], $_POST['host'], $_POST['type'], $_POST['pri'], (int) $_POST['destination']);
if ($dns_ressource_record->store()) {
$message[] = array('Der Ressource Record ' . $dns_ressource_record->getHost() . ' wurde gespeichert.', 1);
} else {
$message[] = array('Der Ressource Record konnte nicht gespeichert werden.', 2);
}
Message::setMessage($message);
header('Location: ./dns_zone.php?dns_zone_id=' . $_POST['dns_zone_id']);
} else {
Permission::denyAccess(PERM_USER);
}
} elseif ($_GET['section'] == 'delete') {
$dns_ressource_record = new DnsRessourceRecord((int) $_GET['dns_ressource_record_id']);
$dns_ressource_record->fetch();
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $dns_ressource_record->getUserId())) {
if ($dns_ressource_record->delete()) {
$message[] = array('Der Ressource Record ' . $dns_ressource_record->getHost() . ' wurde gelöscht.', 1);
} else {
$message[] = array('Der Ressource Record ' . $dns_ressource_record->getHost() . ' konnte nicht gelöscht werden.', 2);
}
Message::setMessage($message);
header('Location: ./dns_zone.php?dns_zone_id=' . $dns_ressource_record->getDnsZoneId());
} else {
Permission::denyAccess(PERM_ROOT, $dns_ressource_record->getUserId());
}
}
示例2: Networkinterfacelist
$router->fetch();
$smarty->assign('router', $router);
$networkinterfacelist = new Networkinterfacelist(false, $router->getRouterId(), 0, -1, 'name', 'asc');
$smarty->assign('networkinterfacelist', $networkinterfacelist);
$originator_status_list = new OriginatorStatusList($router->getRouterId(), $router->getStatusdata()->getCrawlCycleId(), 0, -1);
$smarty->assign('originator_status_list', $originator_status_list);
$eventlist = new Eventlist();
$eventlist->init('router', $router->getRouterId(), false, 0, 10, 'event_id', 'desc');
$smarty->assign('eventlist', $eventlist);
$smarty->display("header.tpl.html");
$smarty->display("router.tpl.html");
$smarty->display("footer.tpl.html");
} elseif (isset($_GET['section']) and $_GET['section'] == 'add') {
//Logged in users can add a new router
if (Permission::checkPermission(PERM_USER)) {
$smarty->assign('message', Message::getMessage());
$smarty->assign('google_maps_api_key', ConfigLine::configByName('google_maps_api_key'));
$smarty->assign('community_location_longitude', ConfigLine::configByName('community_location_longitude'));
$smarty->assign('community_location_latitude', ConfigLine::configByName('community_location_latitude'));
$smarty->assign('community_location_zoom', ConfigLine::configByName('community_location_zoom'));
$smarty->assign('twitter_token', ConfigLine::configByName('twitter_token'));
$chipsetlist = new Chipsetlist(false, false, 0, -1);
$smarty->assign('chipsetlist', $chipsetlist->getList());
$smarty->display("header.tpl.html");
$smarty->display("router_new.tpl.html");
$smarty->display("footer.tpl.html");
} else {
Permission::denyAccess(PERM_USER);
}
} elseif ($_GET['section'] == "store") {
}
示例3: elseif
} else {
Permission::denyAccess(PERM_ROOT, $networkinterface->getRouter()->getUserId());
}
} elseif ($_GET['section'] == 'insert_add') {
$networkinterface = new Networkinterface((int) $_GET['interface_id']);
$networkinterface->fetch();
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $networkinterface->getRouter()->getUserId())) {
$ip = new Ip(false, (int) $_GET['interface_id'], (int) $_POST['network_id'], $_POST['ip']);
if ($ip->store()) {
$message[] = array('Die IP ' . $_POST['ip'] . ' wurde angelegt.', 1);
Message::setMessage($message);
} else {
$message[] = array('Die IP ' . $_POST['ip'] . ' konnte nicht angelegt werden.', 2);
Message::setMessage($message);
}
header('Location: ./router.php?router_id=' . $_GET['router_id']);
} else {
Permission::denyAccess(PERM_ROOT, $networkinterface->getRouter()->getUserId());
}
} elseif ($_GET['section'] == 'delete') {
$ip = new Ip((int) $_GET['ip_id']);
$ip->fetch();
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $ip->getNetworkinterface()->getRouter()->getUserId())) {
$ip->delete();
$message[] = array('Die IP ' . $ip->getIp() . '/' . $ip->getNetwork()->getNetmask() . ' wurde gelöscht.', 1);
Message::setMessage($message);
header('Location: ./router.php?router_id=' . $_GET['router_id']);
} else {
Permission::denyAccess(PERM_ROOT, $ip->getNetworkinterface()->getRouter()->getUserId());
}
}
示例4: Router
if ($_GET['object_type'] == "router") {
$router = new Router((int) $_GET['object_id']);
$router->fetch();
//Root and owning user can see api keys
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $router->getUserId())) {
$api_key_list = new ApiKeyList((int) $_GET['object_id'], 'router');
$smarty->assign('api_key_list', $api_key_list->getList());
$smarty->display("header.tpl.html");
$smarty->display("api_key_list.tpl.html");
$smarty->display("footer.tpl.html");
} else {
Permission::denyAccess(PERM_ROOT, (int) $router->getUserId());
}
} elseif ($_GET['object_type'] == "user") {
$user = new User((int) $_GET['object_id']);
$user->fetch();
//Root and owning user can see api keys
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $user->getUserId())) {
$api_key_list = new ApiKeyList((int) $_GET['object_id'], 'user');
$smarty->assign('api_key_list', $api_key_list->getList());
$smarty->display("header.tpl.html");
$smarty->display("api_key_list.tpl.html");
$smarty->display("footer.tpl.html");
} else {
Permission::denyAccess(PERM_ROOT, (int) $user->getUserId());
}
}
} elseif (Permission::checkPermission(PERM_ROOT)) {
} else {
//no permission to access this site
}
示例5: Network
<?php
require_once 'runtime.php';
require_once ROOT_DIR . '/lib/core/Networklist.class.php';
$smarty->assign('message', Message::getMessage());
if (isset($_GET['action']) and $_GET['action'] == 'delete') {
$network = new Network((int) $_GET['network_id']);
$network->fetch();
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $network->getUserId())) {
$network->delete();
header('Location: ./networks.php');
} else {
Permission::denyAccess(PERM_ROOT, $network->getUserId());
}
} elseif (empty($_POST)) {
$networklist = new Networklist();
$smarty->assign('networklist', $networklist->getNetworklist());
$smarty->display("header.tpl.html");
$smarty->display("networks.tpl.html");
$smarty->display("footer.tpl.html");
} else {
if (Permission::checkPermission(PERM_ROOT)) {
$network = new Network(false, (int) $_SESSION['user_id'], $_POST['ip'], (int) $_POST['netmask'], (int) $_POST['ipv']);
$network->store();
header('Location: ./networks.php');
} else {
Permission::denyAccess(PERM_ROOT);
}
}
示例6: header
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, (int) $router_data['user_id'])) {
$insert_result = RouterEditor::resetRouterAutoAssignHash($_GET['router_id']);
header('Location: ./routereditor.php?section=edit&router_id=' . $_GET['router_id']);
} else {
Permission::denyAccess(PERM_ROOT, (int) $router_data['user_id']);
}
}
if ($_GET['section'] == "insert_delete") {
$router = new Router((int) $_GET['router_id']);
$router->fetch();
//Root and owning user can delete router
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $router->getUserId())) {
if ($_POST['really_delete'] == 1) {
if ($router->delete()) {
$message[] = array("Der Router " . $router->getHostname() . " wurde entfernt.", 1);
Message::setMessage($message);
header('Location: ./user.php?user_id=' . $_SESSION['user_id']);
} else {
$message[] = array("Der Router konnte nicht entfernt werden.", 2);
Message::setMessage($message);
header('Location: ./routereditor.php?section=edit&router_id=' . $_GET['router_id']);
}
} else {
$message[] = array("Zum löschen des Routers ist eine Bestätigung erforderlich!", 2);
Message::setMessage($message);
header('Location: ./routereditor.php?section=edit&router_id=' . $_GET['router_id']);
}
} else {
Permission::denyAccess(PERM_ROOT, (int) $router_data['user_id']);
}
}
示例7: elseif
Permission::denyAccess(PERM_ROOT, $dns_zone->getUserId());
}
} elseif ($_GET['section'] == 'insert_edit') {
$dns_zone = new DnsZone((int) $_GET['dns_zone_id']);
$dns_zone->fetch();
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, $dns_zone->getUserId())) {
$dns_zone->setName($_POST['name']);
$dns_zone->setPriDns($_POST['pri_dns']);
$dns_zone->setSecDns($_POST['sec_dns']);
$dns_zone->setRefresh((int) $_POST['refresh']);
$dns_zone->setRetry((int) $_POST['retry']);
$dns_zone->setExpire((int) $_POST['expire']);
$dns_zone->setTtl((int) $_POST['ttl']);
if ($dns_zone->store()) {
$message[] = array('Die Änderungen wurden gespeichert.', 1);
} else {
$message[] = array('Die Änderungen konnten nicht gespeichert werden.', 2);
}
Message::setMessage($message);
header('Location: ./dns_zone.php?dns_zone_id=' . $_GET['dns_zone_id']);
} else {
Permission::denyAccess(PERM_ROOT, $dns_zone->getUserId());
}
} else {
$dns_zone_list = new DnsZoneList();
$smarty->assign('dns_zone_list', $dns_zone_list->getDnsZoneList());
$smarty->assign('message', Message::getMessage());
$smarty->display("header.tpl.html");
$smarty->display("dns_zones.tpl.html");
$smarty->display("footer.tpl.html");
}
示例8: header
header('Location: user.php?user_id=' . $_GET['user_id']);
} else {
header('Location: user_edit.php?section=edit&user_id=' . $_GET['user_id']);
}
} else {
Permission::denyAccess(PERM_ROOT, (int) $_GET['user_id']);
}
} elseif ($_GET['section'] == "delete") {
if (permission::checkIfUserIsOwnerOrPermitted(PERM_ROOT, (int) $_GET['user_id'])) {
if ($_POST['delete'] == "true") {
//fetch user data
$user = new User((int) $_GET['user_id']);
$user->fetch();
//logout user if the logged in user is the user to be deleted
if ($_GET['user_id'] == $_SESSION['user_id']) {
Login::user_logout();
}
//delete user
$user->delete();
$message[] = array("Der Benutzer " . $user->getNickname() . " wurde gelöscht.", 1);
message::setMessage($message);
header('Location: index.php');
} else {
$message[] = array("Sie müssen das Häckchen bei <i>Ja</i> setzen um den Benutzer zu löschen.", 2);
message::setMessage($message);
header('Location: user_edit.php?section=edit&user_id=' . $_GET['user_id']);
}
} else {
Permission::denyAccess(PERM_ROOT, (int) $_GET['user_id']);
}
}