本文整理汇总了PHP中verify_permission函数的典型用法代码示例。如果您正苦于以下问题:PHP verify_permission函数的具体用法?PHP verify_permission怎么用?PHP verify_permission使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verify_permission函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: error
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$perm_templ = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
$perm_templ = $_GET['id'];
}
$confirm = "-1";
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
$confirm = $_GET['confirm'];
}
if ($perm_templ == "-1") {
error(ERR_INV_INPUT);
} else {
if (!verify_permission('user_edit_templ_perm')) {
error(ERR_PERM_DEL_PERM_TEMPL);
} else {
$templ_details = get_permission_template_details($perm_templ);
echo " <h2>" . _('Delete permission template') . " \"" . $templ_details['name'] . "\"</h2>\n";
if (isset($_GET['confirm']) && $_GET["confirm"] == '1') {
delete_perm_templ($perm_templ);
success(SUC_PERM_TEMPL_DEL);
} else {
echo " <p>" . _('Are you sure?') . "</p>\n";
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_perm_templ.php?id=" . $perm_templ . "&confirm=1'\" value=\"" . _('Yes') . "\">\n";
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
}
}
}
include_once "inc/footer.inc.php";
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:delete_perm_templ.php
示例2: verify_permission
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
verify_permission('templ_perm_edit') ? $perm_templ_perm_edit = "1" : ($perm_templ_perm_edit = "0");
$permission_templates = get_list_permission_templates();
if ($perm_templ_perm_edit == "0") {
error(ERR_PERM_EDIT_PERM_TEMPL);
} else {
echo " <h2>" . _('Permission templates') . "</h2>\n";
echo " <table>\n";
echo " <tr>\n";
echo " <th> </th>\n";
echo " <th>" . _('Name') . "</th>\n";
echo " <th>" . _('Description') . "</th>\n";
echo " </tr>\n";
foreach ($permission_templates as $template) {
$perm_item_list = get_permissions_by_template_id($template['id'], true);
$perm_items = implode(', ', $perm_item_list);
echo " <tr>\n";
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:list_perm_templ.php
示例3: delete_domains
function delete_domains($domains)
{
global $db;
$error = false;
$return = false;
$response = $db->beginTransaction();
foreach ($domains as $id) {
if (verify_permission('zone_content_edit_others')) {
$perm_edit = "all";
} elseif (verify_permission('zone_content_edit_own')) {
$perm_edit = "own";
} else {
$perm_edit = "none";
}
$user_is_zone_owner = verify_user_is_owner_zoneid($id);
if ($perm_edit == "all" || $perm_edit == "own" && $user_is_zone_owner == "1") {
if (is_numeric($id)) {
$db->exec("DELETE FROM zones WHERE domain_id=" . $db->quote($id, 'integer'));
$db->exec("DELETE FROM domains WHERE id=" . $db->quote($id, 'integer'));
$db->exec("DELETE FROM records WHERE domain_id=" . $db->quote($id, 'integer'));
} else {
error(sprintf(ERR_INV_ARGC, "delete_domains", "id must be a number"));
$error = true;
}
} else {
error(ERR_PERM_DEL_ZONE);
$error = true;
}
}
if (PEAR::isError($response)) {
$response = $db->rollback();
$commit = false;
} else {
$response = $db->commit();
$commit = true;
}
if (true == $commit && false == $error) {
$return = true;
}
return $return;
}
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:41,代码来源:record.inc.php
示例4: error
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$id = "-1";
if (isset($_GET['id']) || v_num($_GET['id'])) {
$id = $_GET['id'];
}
if ($id == "-1") {
error(ERR_INV_INPUT);
} elseif (!verify_permission('templ_perm_edit')) {
error(ERR_PERM_EDIT_PERM_TEMPL);
} else {
$id = $_GET['id'];
if (isset($_POST['commit'])) {
update_perm_templ_details($_POST);
}
$templ = get_permission_template_details($id);
$perms_templ = get_permissions_by_template_id($id);
$perms_avail = get_permissions_by_template_id();
echo " <h2>" . _('Edit permission template') . "</h2>\n";
echo " <form method=\"post\">\n";
echo " <input type=\"hidden\" name=\"templ_id\" value=\"" . $id . "\">\n";
echo " <table>\n";
echo " <tr>\n";
echo " <th>" . _('Name') . "</th>\n";
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:edit_perm_templ.php
示例5: add_new_user
function add_new_user($details)
{
global $db;
if (!verify_permission('user_add_new')) {
error(ERR_PERM_ADD_USER);
return false;
} elseif (user_exists($details['username'])) {
error(ERR_USER_EXISTS);
return false;
} elseif (!is_valid_email($details['email'])) {
error(ERR_INV_EMAIL);
return false;
} elseif ($details['active'] == 1) {
$active = 1;
} else {
$active = 0;
}
$query = "INSERT INTO users (username, password, fullname, email, description,";
if (verify_permission('user_edit_templ_perm')) {
$query .= ' perm_templ,';
}
$query .= " active) VALUES (" . $db->quote($details['username'], 'text') . ", " . $db->quote(md5($details['password']), 'text') . ", " . $db->quote($details['fullname'], 'text') . ", " . $db->quote($details['email'], 'text') . ", " . $db->quote($details['descr'], 'text') . ", ";
if (verify_permission('user_edit_templ_perm')) {
$query .= $db->quote($details['perm_templ'], 'integer') . ", ";
}
$query .= $db->quote($active, 'integer') . ")";
$response = $db->query($query);
if (PEAR::isError($response)) {
error($response->getMessage());
return false;
}
return true;
}
开发者ID:kitpz2,项目名称:grupappz,代码行数:33,代码来源:users.inc.php
示例6: verify_permission
include_once "inc/header.inc.php";
verify_permission('user_edit_own') ? $perm_edit_own = "1" : ($perm_edit_own = "0");
verify_permission('user_edit_others') ? $perm_edit_others = "1" : ($perm_edit_others = "0");
if (!(isset($_GET['id']) && v_num($_GET['id']))) {
error(ERR_INV_INPUT);
include_once "inc/footer.inc.php";
exit;
} else {
$uid = $_GET['id'];
}
if (isset($_POST['commit'])) {
if (delete_user($uid, $_POST['zone'])) {
success(SUC_USER_DEL);
}
} else {
if ($uid != $_SESSION['userid'] && !verify_permission('user_edit_others') || $uid == $_SESSION['userid'] && !verify_permission('user_edit_own')) {
error(ERR_PERM_DEL_USER);
include_once "inc/footer.inc.php";
exit;
} else {
$fullname = get_fullname_from_userid($uid);
$zones = get_zones("own", $uid);
echo " <h2>" . _('Delete user') . " \"" . $fullname . "\"</h2>\n";
echo " <form method=\"post\">\n";
echo " <table>\n";
if (count($zones) > 0) {
$users = show_users();
echo " <tr>\n";
echo " <td colspan=\"5\">\n";
echo " " . _('You are about to delete a user. This user is owner for a number of zones. Please decide what to do with these zones.') . "\n";
echo " </td>\n";
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:delete_user.php
示例7: verify_permission
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : ($perm_zone_master_add = "0");
$zone_templ = get_list_zone_templ($_SESSION['userid']);
$username = get_fullname_from_userid($_SESSION['userid']);
if ($perm_zone_master_add == "0") {
error(ERR_PERM_EDIT_ZONE_TEMPL);
} else {
echo " <h2>" . _('Zone templates for') . " " . $username . "</h2>\n";
echo " <table>\n";
echo " <tr>\n";
echo " <th> </th>\n";
echo " <th>" . _('Name') . "</th>\n";
echo " <th>" . _('Description') . "</th>\n";
echo " </tr>\n";
foreach ($zone_templ as $template) {
echo " <tr>\n";
if ($perm_zone_master_add == "1") {
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:list_zone_templ.php
示例8: elseif
$perm_view = "all";
} elseif (verify_permission('zone_content_view_own')) {
$perm_view = "own";
} else {
$perm_view = "none";
}
if (verify_permission('zone_content_edit_others')) {
$perm_content_edit = "all";
} elseif (verify_permission('zone_content_edit_own')) {
$perm_content_edit = "own";
} else {
$perm_content_edit = "none";
}
if (verify_permission('zone_meta_edit_others')) {
$perm_meta_edit = "all";
} elseif (verify_permission('zone_meta_edit_own')) {
$perm_meta_edit = "own";
} else {
$perm_meta_edit = "none";
}
$user_is_zone_owner = verify_user_is_owner_zoneid($zone_id);
if ($perm_meta_edit == "all" || $perm_meta_edit == "own" && $user_is_zone_owner == "1") {
$meta_edit = "1";
}
if (isset($_POST['slave_master_change']) && is_numeric($_POST["domain"])) {
change_zone_slave_master($_POST['domain'], $_POST['new_master']);
}
if (isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types)) {
change_zone_type($_POST['newtype'], $zone_id);
}
if (isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"])) {
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:edit.php
示例9: edit_zone_templ
function edit_zone_templ($details, $zone_templ_id)
{
global $db;
$zone_name_exists = zone_templ_name_exists($details['templ_name'], $zone_templ_id);
if (!verify_permission('zone_master_add')) {
error(ERR_PERM_ADD_ZONE_TEMPL);
return false;
} elseif ($zone_name_exists != '0') {
error(ERR_ZONE_TEMPL_EXIST);
return false;
} else {
$query = "UPDATE zone_templ\n\t\t\tSET name=" . $db->quote($details['templ_name'], 'text') . ",\n\t\t\tdescr=" . $db->quote($details['templ_descr'], 'text') . "\n\t\t\tWHERE id=" . $db->quote($zone_templ_id, 'integer');
$result = $db->query($query);
if (PEAR::isError($result)) {
error($result->getMessage());
return false;
}
return true;
}
}
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:20,代码来源:templates.inc.php
示例10: verify_permission
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
verify_permission('user_view_others') ? $perm_view_others = "1" : ($perm_view_others = "0");
verify_permission('user_edit_own') ? $perm_edit_own = "1" : ($perm_edit_own = "0");
verify_permission('user_edit_others') ? $perm_edit_others = "1" : ($perm_edit_others = "0");
verify_permission('templ_perm_edit') ? $perm_templ_perm_edit = "1" : ($perm_templ_perm_edit = "0");
verify_permission('user_is_ueberuser') ? $perm_is_godlike = "1" : ($perm_is_godlike = "0");
verify_permission('user_add_new') ? $perm_add_new = "1" : ($perm_add_new = "0");
#if (isset($_GET['action']) && $_GET['action'] === "switchuser" && $perm_is_godlike === "1"){
# $_SESSION["userlogin"] = $_GET['username'];
# echo '<meta http-equiv="refresh" content="1"/>';
#}
unset($commit_button);
if (isset($_POST['commit'])) {
foreach ($_POST['user'] as $user) {
update_user_details($user);
}
}
$users = get_user_detail_list("");
echo " <h2>" . _('User administration') . "</h2>\n";
echo " <form method=\"post\" action=\"\">\n";
echo " <table>\n";
echo " <tr>\n";
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:users.php
示例11: get_zone_templ_is_owner
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$zone_templ_id = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
$zone_templ_id = $_GET['id'];
}
$confirm = "-1";
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
$confirm = $_GET['confirm'];
}
$owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
if ($zone_templ_id == "-1") {
error(ERR_INV_INPUT);
} else {
if (!verify_permission('zone_master_add') || !$owner) {
error(ERR_PERM_DEL_ZONE_TEMPL);
} else {
$templ_details = get_zone_templ_details($zone_templ_id);
echo " <h2>" . _('Delete zone template') . " \"" . $templ_details['name'] . "\"</h2>\n";
if (isset($_GET['confirm']) && $_GET["confirm"] == '1') {
delete_zone_templ($zone_templ_id);
success(SUC_ZONE_TEMPL_DEL);
} else {
echo " <p>" . _('Are you sure?') . "</p>\n";
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_zone_templ.php?id=" . $zone_templ_id . "&confirm=1'\" value=\"" . _('Yes') . "\">\n";
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
}
}
}
include_once "inc/footer.inc.php";
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:delete_zone_templ.php
示例12: error
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
if (!verify_permission('zone_master_add')) {
error(ERR_PERM_ADD_ZONE_TEMPL);
} else {
if (isset($_POST['commit'])) {
if (add_zone_templ($_POST, $_SESSION['userid'])) {
success(SUC_ZONE_TEMPL_ADD);
}
// TODO: otherwise repopulate values to form
}
/*
Display new zone template form
*/
$username = get_fullname_from_userid($_SESSION['userid']);
echo " <h2>" . _('Add zone template for') . " " . $username . "</h2>\n";
echo " <form method=\"post\" action=\"add_zone_templ.php\">\n";
echo " <table>\n";
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:add_zone_templ.php
示例13: trim
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$owner = "-1";
if (isset($_POST['owner']) && v_num($_POST['owner'])) {
$owner = $_POST['owner'];
}
$zone = trim($_POST['domain']);
$master = $_POST['slave_master'];
$type = "SLAVE";
verify_permission('zone_slave_add') ? $zone_slave_add = "1" : ($zone_slave_add = "0");
if ($_POST['submit'] && $zone_slave_add == "1") {
if (!is_valid_hostname_fqdn($zone, 0)) {
error(ERR_DNS_HOSTNAME);
} elseif (domain_exists($zone)) {
error(ERR_DOMAIN_EXISTS);
} elseif (!is_valid_ipv4($master) && !is_valid_ipv6($master)) {
error(ERR_DNS_IP);
} else {
if (add_domain($zone, $owner, $webip, $mailip, $empty, $type, $master)) {
success(SUC_ZONE_ADD);
unset($zone, $owner, $webip, $mailip, $empty, $type, $master);
}
}
}
if ($zone_slave_add != "1") {
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:add_zone_slave.php
示例14: elseif
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
if (verify_permission('zone_content_edit_others')) {
$perm_edit = "all";
} elseif (verify_permission('zone_content_edit_own')) {
$perm_edit = "own";
} else {
$perm_edit = "none";
}
$zone_id = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
$zone_id = $_GET['id'];
}
$confirm = "-1";
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
$confirm = $_GET['confirm'];
}
$zone_info = get_zone_info_from_id($zone_id);
$zone_owners = get_fullnames_owners_from_domainid($zone_id);
$user_is_zone_owner = verify_user_is_owner_zoneid($zone_id);
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:delete_domain.php
示例15: verify_permission
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$master_ip = $_POST["master_ip"];
$ns_name = $_POST["ns_name"];
$account = $_POST["account"];
verify_permission('supermaster_add') ? $supermasters_add = "1" : ($supermasters_add = "0");
if ($_POST["submit"]) {
if (add_supermaster($master_ip, $ns_name, $account)) {
success(SUC_SM_ADD);
} else {
$error = "1";
}
}
echo " <h2>" . _('Add supermaster') . "</h2>\n";
if ($supermasters_add != "1") {
echo " <p>" . _("You do not have the permission to add a new supermaster.") . "</p>\n";
} else {
echo " <form method=\"post\" action=\"add_supermaster.php\">\n";
echo " <table>\n";
echo " <tr>\n";
echo " <td class=\"n\">" . _('IP address of supermaster') . "</td>\n";
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:add_supermaster.php
示例16: error
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$master_ip = "-1";
if (isset($_GET['master_ip']) && (is_valid_ipv4($_GET['master_ip']) || is_valid_ipv6($_GET['master_ip']))) {
$master_ip = $_GET['master_ip'];
}
$confirm = "-1";
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
$confirm = $_GET['confirm'];
}
if ($master_ip == "-1") {
error(ERR_INV_INPUT);
} else {
verify_permission('supermaster_edit') ? $perm_sm_edit = "1" : ($perm_sm_edit = "0");
if ($perm_sm_edit == "0") {
error(ERR_PERM_DEL_SM);
} else {
$info = get_supermaster_info_from_ip($master_ip);
echo " <h2>" . _('Delete supermaster') . " \"" . $master_ip . "\"</h2>\n";
if ($_GET["confirm"] == '1') {
if (delete_supermaster($master_ip)) {
success(SUC_ZONE_DEL);
}
} else {
echo " <p>\n";
echo " " . _('Hostname in NS record') . ": " . $info['ns_name'] . "<br>\n";
echo " " . _('Account') . ": " . $info['account'] . "\n";
echo " </p>\n";
echo " <p>" . _('Are you sure?') . "</p>\n";
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:delete_supermaster.php
示例17: verify_permission
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
verify_permission('user_edit_own') ? $perm_edit_own = "1" : ($perm_edit_own = "0");
verify_permission('user_edit_others') ? $perm_edit_others = "1" : ($perm_edit_others = "0");
verify_permission('user_is_ueberuser') ? $perm_is_godlike = "1" : ($perm_is_godlike = "0");
if (!(isset($_GET['id']) && v_num($_GET['id']))) {
error(ERR_INV_INPUT);
include_once "inc/footer.inc.php";
exit;
} else {
$uid = $_GET['id'];
}
if (isset($_POST['commit'])) {
if (is_valid_user($uid)) {
$zones = $_POST['zone'];
if (delete_user($uid, $zones)) {
success(SUC_USER_DEL);
}
} else {
header("Location: users.php");
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:delete_user.php
示例18: error
if (file_exists('inc/custom_header.inc.php')) {
include 'inc/custom_header.inc.php';
}
echo " <h1>Poweradmin</h1>\n";
if (file_exists('install')) {
error(ERR_INSTALL_DIR_EXISTS);
include 'inc/footer.inc.php';
exit;
} elseif (isset($_SESSION["userid"])) {
verify_permission('search') ? $perm_search = "1" : ($perm_search = "0");
verify_permission('zone_content_view_own') ? $perm_view_zone_own = "1" : ($perm_view_zone_own = "0");
verify_permission('zone_content_view_other') ? $perm_view_zone_other = "1" : ($perm_view_zone_other = "0");
verify_permission('supermaster_view') ? $perm_supermaster_view = "1" : ($perm_supermaster_view = "0");
verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : ($perm_zone_master_add = "0");
verify_permission('zone_slave_add') ? $perm_zone_slave_add = "1" : ($perm_zone_slave_add = "0");
verify_permission('supermaster_add') ? $perm_supermaster_add = "1" : ($perm_supermaster_add = "0");
echo " <div class=\"menu\">\n";
echo " <span class=\"menuitem\"><a href=\"index.php\">" . _('Index') . "</a></span>\n";
if ($perm_search == "1") {
echo " <span class=\"menuitem\"><a href=\"search.php\">" . _('Search zones and records') . "</a></span>\n";
}
if ($perm_view_zone_own == "1" || $perm_view_zone_other == "1") {
echo " <span class=\"menuitem\"><a href=\"list_zones.php\">" . _('List zones') . "</a></span>\n";
}
if ($perm_supermaster_view) {
echo " <span class=\"menuitem\"><a href=\"list_supermasters.php\">" . _('List supermasters') . "</a></span>\n";
}
if ($perm_zone_master_add) {
echo " <span class=\"menuitem\"><a href=\"add_zone_master.php\">" . _('Add master zone') . "</a></span>\n";
}
if ($perm_zone_slave_add) {
开发者ID:kitpz2,项目名称:grupappz,代码行数:31,代码来源:header.inc.php
示例19: search_zone_and_record
function search_zone_and_record($holy_grail, $perm)
{
global $db;
$holy_grail = trim($holy_grail);
$sql_add_from = '';
$sql_add_where = '';
$return_zones = array();
$return_records = array();
if (verify_permission('zone_content_view_others')) {
$perm_view = "all";
} elseif (verify_permission('zone_content_view_own')) {
$perm_view = "own";
} else {
$perm_view = "none";
}
if (verify_permission('zone_content_edit_others')) {
$perm_content_edit = "all";
} elseif (verify_permission('zone_content_edit_own')) {
$perm_content_edit = "own";
} else {
$perm_content_edit = "none";
}
// Search for matching domains
if ($perm == "own") {
$sql_add_from = ", zones ";
$sql_add_where = " AND zones.domain_id = domains.id AND zones.owner = " . $db->quote($_SESSION['userid'], 'integer');
}
$query = "SELECT \n\t\t\tdomains.id AS zid,\n\t\t\tdomains.name AS name,\n\t\t\tdomains.type AS type,\n\t\t\tdomains.master AS master\n\t\t\tFROM domains" . $sql_add_from . "\n\t\t\tWHERE domains.name LIKE " . $db->quote($holy_grail, 'text') . $sql_add_where;
$response = $db->query($query);
if (PEAR::isError($response)) {
error($response->getMessage());
return false;
}
while ($r = $response->fetchRow()) {
$return_zones[] = array("zid" => $r['zid'], "name" => $r['name'], "type" => $r['type'], "master" => $r['master']);
}
// Search for matching records
if ($perm == "own") {
$sql_add_from = ", zones ";
$sql_add_where = " AND zones.domain_id = records.domain_id AND zones.owner = " . $db->quote($_SESSION['userid'], 'integer');
}
$query = "SELECT\n\t\t\trecords.id AS rid,\n\t\t\trecords.name AS name,\n\t\t\trecords.type AS type,\n\t\t\trecords.content AS content,\n\t\t\trecords.ttl AS ttl,\n\t\t\trecords.prio AS prio,\n\t\t\trecords.domain_id AS zid\n\t\t\tFROM records" . $sql_add_from . "\n\t\t\tWHERE (records.name LIKE " . $db->quote($holy_grail, 'text') . " OR records.content LIKE " . $db->quote($holy_grail, 'text') . ")" . $sql_add_where;
$response = $db->query($query);
if (PEAR::isError($response)) {
error($response->getMessage());
return false;
}
while ($r = $response->fetchRow()) {
$return_records[] = array("rid" => $r['rid'], "name" => $r['name'], "type" => $r['type'], "content" => $r['content'], "ttl" => $r['ttl'], "zid" => $r['zid'], "prio" => $r['prio']);
}
return array('zones' => $return_zones, 'records' => $return_records);
}
开发者ID:kitpz2,项目名称:grupappz,代码行数:52,代码来源:record.inc.php
示例20: array
}
}
$domains = $temp;
} else {
$domains = array();
}
if (isset($_POST['zone_template'])) {
$zone_template = $_POST['zone_template'];
} else {
$zone_template = "none";
}
/*
Check user permissions
*/
verify_permission('zone_master_add') ? $zone_master_add = "1" : ($zone_master_add = "0");
verify_permission('user_view_others') ? $perm_view_others = "1" : ($perm_view_others = "0");
if (isset($_POST['submit']) && $zone_master_add == "1") {
$error = false;
foreach ($domains as $domain) {
if (!is_valid_hostname_fqdn($domain, 0)) {
error($domain . ' failed - ' . ERR_DNS_HOSTNAME);
} elseif (domain_exists($domain)) {
error($domain . ' failed - ' . ERR_DOMAIN_EXISTS);
// TODO: repopulate domain name(s) to the form if there was an error occured
$error = true;
} elseif (add_domain($domain, $owner, $dom_type, '', $zone_template)) {
success("<a href=\"edit.php?id=" . get_zone_id_from_name($domain) . "\">" . $domain . " - " . SUC_ZONE_ADD . '</a>');
}
}
if (false === $error) {
unset($domains, $owner, $dom_type, $zone_template);
开发者ID:jelastic-public-cartridges,项目名称:jelastic-powerdns-cartridge,代码行数:31,代码来源:add_zone_master.php
注:本文中的verify_permission函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论