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


PHP redirectHeader函数代码示例

本文整理汇总了PHP中redirectHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP redirectHeader函数的具体用法?PHP redirectHeader怎么用?PHP redirectHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: write_config

            write_config();
            redirectHeader("system_authservers.php");
        } else {
            $act = "edit";
        }
    } elseif (isset($pconfig['act']) && $pconfig['act'] == 'del' && isset($id)) {
        /* Remove server from main list. */
        $serverdeleted = $a_server[$id]['name'];
        foreach ($config['system']['authserver'] as $k => $as) {
            if ($config['system']['authserver'][$k]['name'] == $serverdeleted) {
                unset($config['system']['authserver'][$k]);
            }
        }
        $savemsg = gettext("Authentication Server") . " {$serverdeleted} " . gettext("deleted") . "<br />";
        write_config($savemsg);
        redirectHeader("system_authservers.php");
    }
}
$pgtitle = array(gettext('System'), gettext('Users'), gettext('Servers'));
$shortcut_section = "authentication";
// list of all possible fields for auth item (used for form init)
$all_authfields = array('type', 'name', 'ldap_caref', 'ldap_host', 'ldap_port', 'ldap_urltype', 'ldap_protver', 'ldap_scope', 'ldap_basedn', 'ldap_authcn', 'ldap_extended_query', 'ldap_binddn', 'ldap_bindpw', 'ldap_attr_user', 'radius_host', 'radius_auth_port', 'radius_acct_port', 'radius_secret', 'radius_timeout', 'radius_srvcs');
foreach ($all_authfields as $fieldname) {
    if (!isset($pconfig[$fieldname])) {
        $pconfig[$fieldname] = null;
    }
}
legacy_html_escape_form_data($pconfig);
legacy_html_escape_form_data($a_server);
include "head.inc";
$main_buttons = array(array('label' => 'Add server', 'href' => 'system_authservers.php?act=new'));
开发者ID:noikiy,项目名称:core-2,代码行数:31,代码来源:system_authservers.php

示例2: elseif

            if (!isset($pconfig[$fieldname])) {
                $pconfig[$fieldname] = null;
            }
        }
    }
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['id']) && is_numericint($_POST['id'])) {
        $id = $_POST['id'];
    }
    if (isset($_POST['act'])) {
        $act = $_POST['act'];
    }
    if ($act == "del") {
        // remove client
        if (!isset($id) || !isset($a_client[$id])) {
            redirectHeader("vpn_openvpn_client.php");
            exit;
        }
        if (!empty($a_client[$id])) {
            openvpn_delete('client', $a_client[$id]);
        }
        unset($a_client[$id]);
        write_config();
    } else {
        // update client (after validation)
        $pconfig = $_POST;
        $input_errors = array();
        if (isset($id) && $a_client[$id]) {
            $vpnid = $a_client[$id]['vpnid'];
        }
        if (isset($pconfig['mode']) && $pconfig['mode'] != "p2p_shared_key") {
开发者ID:Anasxrt,项目名称:core,代码行数:31,代码来源:vpn_openvpn_client.php

示例3: elseif

            if (!isset($pconfig[$fieldname])) {
                $pconfig[$fieldname] = null;
            }
        }
    }
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['id']) && is_numericint($_POST['id'])) {
        $id = $_POST['id'];
    }
    if (isset($_POST['act'])) {
        $act = $_POST['act'];
    }
    if ($act == "del") {
        // action delete
        if (!isset($a_server[$id])) {
            redirectHeader("vpn_openvpn_server.php");
            exit;
        }
        if (!empty($a_server[$id])) {
            openvpn_delete('server', $a_server[$id]);
        }
        unset($a_server[$id]);
        write_config();
    } else {
        // action add/update
        $input_errors = array();
        $pconfig = $_POST;
        if (isset($id) && $a_server[$id]) {
            $vpnid = $a_server[$id]['vpnid'];
        } else {
            $vpnid = 0;
开发者ID:aya,项目名称:core,代码行数:31,代码来源:vpn_openvpn_server.php

示例4: unset

     $config['notifications']['smtp']['username'] = $_POST['smtpusername'];
     $config['notifications']['smtp']['password'] = $_POST['smtppassword'];
     $config['notifications']['smtp']['fromaddress'] = $_POST['smtpfromaddress'];
     if ($_POST['disable_smtp'] == "yes") {
         $config['notifications']['smtp']['disable'] = true;
     } else {
         unset($config['notifications']['smtp']['disable']);
     }
     // System Sounds
     if ($_POST['disablebeep'] == "yes") {
         $config['system']['disablebeep'] = true;
     } else {
         unset($config['system']['disablebeep']);
     }
     write_config();
     redirectHeader("system_advanced_notifications.php");
     return;
 }
 if ($_POST['test_growl'] == gettext("Test Growl")) {
     // Send test message via growl
     if ($config['notifications']['growl']['ipaddress'] && ($config['notifications']['growl']['password'] = $_POST['password'])) {
         @unlink('/var/db/growlnotices_lastmsg.txt');
         register_via_growl();
         notify_via_growl(sprintf(gettext("This is a test message from %s.  It is safe to ignore this message."), $g['product_name']), true);
     }
 }
 if ($_POST['test_smtp'] == gettext("Test SMTP")) {
     // Send test message via smtp
     @unlink('/var/db/notices_lastmsg.txt');
     $savemsg = notify_via_smtp(sprintf(gettext("This is a test message from %s.  It is safe to ignore this message."), $g['product_name']), true);
 }
开发者ID:nasaa0528,项目名称:core,代码行数:31,代码来源:system_advanced_notifications.php

示例5: foreach

            /* Add the user to All Users group. */
            foreach ($config['system']['group'] as $gidx => $group) {
                if ($group['name'] == "all") {
                    if (!is_array($config['system']['group'][$gidx]['member'])) {
                        $config['system']['group'][$gidx]['member'] = array();
                    }
                    $config['system']['group'][$gidx]['member'][] = $userent['uid'];
                    break;
                }
            }
            $a_user[] = $userent;
        }
        local_user_set_groups($userent, $_POST['groups']);
        local_user_set($userent);
        write_config();
        redirectHeader("system_usermanager.php");
    }
}
$closehead = false;
include "head.inc";
?>

<body>

<?php 
include "fbegin.inc";
?>

<script type="text/javascript">
//<![CDATA[
开发者ID:karawan,项目名称:core,代码行数:30,代码来源:system_usermanager.php

示例6: array

        } else {
            $name = "Shared Key Server {$prot}:{$port}";
        }
        $ras_serverent['index'] = $sindex;
        $ras_serverent['name'] = $name;
        $ras_serverent['mode'] = $server['mode'];
        $ras_server[] = $ras_serverent;
    }
}
if (isset($_GET['act'])) {
    $input_errors = array();
    $act = $_GET['act'];
    if ($act == "skconf" || $act == "skzipconf") {
        $srvid = isset($_GET['srvid']) ? $_GET['srvid'] : false;
        if ($srvid === false || !isset($config['openvpn']['openvpn-server'][$srvid]['mode']) || $config['openvpn']['openvpn-server'][$srvid]['mode'] != "p2p_shared_key") {
            redirectHeader("vpn_openvpn_export.php");
            exit;
        }
        if (empty($_GET['useaddr'])) {
            $input_errors[] = "You need to specify an IP or hostname.";
        } else {
            $useaddr = $_GET['useaddr'];
        }
        $proxy = "";
        if (!empty($_GET['proxy_addr']) || !empty($_GET['proxy_port'])) {
            $proxy = array();
            if (empty($_GET['proxy_addr'])) {
                $input_errors[] = "You need to specify an address for the proxy port.";
            } else {
                $proxy['ip'] = $_GET['proxy_addr'];
            }
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:vpn_openvpn_export_shared.php

示例7: array

    $config['openvpn']['openvpn-csc'] = array();
}
$a_csc =& $config['openvpn']['openvpn-csc'];
if (is_numericint($_GET['id'])) {
    $id = $_GET['id'];
}
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
    $id = $_POST['id'];
}
$act = $_GET['act'];
if (isset($_POST['act'])) {
    $act = $_POST['act'];
}
if ($_GET['act'] == "del") {
    if (!$a_csc[$id]) {
        redirectHeader("vpn_openvpn_csc.php");
        exit;
    }
    openvpn_delete_csc($a_csc[$id]);
    unset($a_csc[$id]);
    write_config();
    $savemsg = gettext("Client Specific Override successfully deleted") . "<br />";
}
if ($_GET['act'] == "edit") {
    if (isset($id) && $a_csc[$id]) {
        $pconfig['custom_options'] = $a_csc[$id]['custom_options'];
        $pconfig['disable'] = isset($a_csc[$id]['disable']);
        $pconfig['common_name'] = $a_csc[$id]['common_name'];
        $pconfig['block'] = $a_csc[$id]['block'];
        $pconfig['description'] = $a_csc[$id]['description'];
        $pconfig['tunnel_network'] = $a_csc[$id]['tunnel_network'];
开发者ID:hlcherub,项目名称:core,代码行数:31,代码来源:vpn_openvpn_csc.php

示例8: vpn_l2tp_configure

            $retval = vpn_l2tp_configure();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            if (is_subsystem_dirty('l2tpusers')) {
                clear_subsystem_dirty('l2tpusers');
            }
        }
    }
}
if ($_GET['act'] == "del") {
    if ($a_secret[$_GET['id']]) {
        unset($a_secret[$_GET['id']]);
        write_config();
        mark_subsystem_dirty('l2tpusers');
        redirectHeader("vpn_l2tp_users.php");
        exit;
    }
}
include "head.inc";
$main_buttons = array(array('label' => gettext("add user"), 'href' => 'vpn_l2tp_users_edit.php'));
?>

<body>
<?php 
include "fbegin.inc";
?>

	<section class="page-content-main">
		<div class="container-fluid">
			<div class="row">
开发者ID:Toudix,项目名称:core,代码行数:31,代码来源:vpn_l2tp_users.php

示例9: redirectHeader

    if (!$a_ca[$id]) {
        redirectHeader("system_camanager.php");
        exit;
    }
    $exp_name = urlencode("{$a_ca[$id]['descr']}.crt");
    $exp_data = base64_decode($a_ca[$id]['crt']);
    $exp_size = strlen($exp_data);
    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; filename={$exp_name}");
    header("Content-Length: {$exp_size}");
    echo $exp_data;
    exit;
}
if ($act == "expkey") {
    if (!$a_ca[$id]) {
        redirectHeader("system_camanager.php");
        exit;
    }
    $exp_name = urlencode("{$a_ca[$id]['descr']}.key");
    $exp_data = base64_decode($a_ca[$id]['prv']);
    $exp_size = strlen($exp_data);
    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; filename={$exp_name}");
    header("Content-Length: {$exp_size}");
    echo $exp_data;
    exit;
}
if ($_POST) {
    unset($input_errors);
    $input_errors = array();
    $pconfig = $_POST;
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:system_camanager.php

示例10: isset

}
$act = isset($_POST['act']) ? $_POST['act'] : '';
if ($act == "delgroup") {
    if (!isset($id) || !isset($_POST['groupname']) || !isset($a_group[$id]) || $_POST['groupname'] != $a_group[$id]['name']) {
        redirectHeader("system_groupmanager.php");
        exit;
    }
    local_group_del($a_group[$id]);
    $groupdeleted = $a_group[$id]['name'];
    unset($a_group[$id]);
    write_config();
    $savemsg = gettext("Group") . " {$groupdeleted} " . gettext("successfully deleted") . "<br />";
}
if ($act == "delpriv") {
    if (!isset($id) || !isset($a_group[$id])) {
        redirectHeader("system_groupmanager.php");
        exit;
    }
    $privdeleted = $priv_list[$a_group[$id]['priv'][$_POST['privid']]]['name'];
    unset($a_group[$id]['priv'][$_POST['privid']]);
    if (is_array($a_group[$id]['member'])) {
        foreach ($a_group[$id]['member'] as $uid) {
            $user = getUserEntryByUID($uid);
            if ($user) {
                local_user_set($user);
            }
        }
    }
    write_config();
    $act = "edit";
    $savemsg = gettext("Privilege") . " {$privdeleted} " . gettext("successfully deleted") . "<br />";
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:system_groupmanager.php

示例11: array

    }
    if (!$input_errors && is_array($imported_ips)) {
        $alias = array();
        $alias['address'] = implode(" ", $imported_ips);
        $alias['detail'] = implode("||", $imported_descs);
        $alias['name'] = $_POST['name'];
        $alias['type'] = "network";
        $alias['descr'] = $_POST['descr'];
        unset($imported_ips, $imported_descs);
        $a_aliases[] = $alias;
        // Sort list
        $a_aliases = msort($a_aliases, "name");
        if (write_config()) {
            mark_subsystem_dirty('aliases');
        }
        redirectHeader("firewall_aliases.php");
        exit;
    }
}
include "head.inc";
?>
<body>
<?php 
include "fbegin.inc";
?>


	<section class="page-content-main">
		<div class="container-fluid">
			<div class="row">
开发者ID:Toudix,项目名称:core,代码行数:30,代码来源:firewall_aliases_import.php

示例12: array_merge

            $a_group['priv'] = $pconfig['sysprivs'];
        } else {
            $a_group['priv'] = array_merge($a_group['priv'], $pconfig['sysprivs']);
        }
        if (is_array($a_group['member'])) {
            foreach ($a_group['member'] as $uid) {
                $user = getUserEntryByUID($uid);
                if ($user) {
                    local_user_set($user);
                }
            }
        }
        admin_groups_sort();
        $retval = write_config();
        $savemsg = get_std_save_message($retval);
        redirectHeader("system_groupmanager.php?act=edit&amp;id={$groupid}");
        exit;
    }
}
/* if ajax is calling, give them an update message */
if (isAjax()) {
    print_info_box_np($savemsg);
}
include "head.inc";
?>

<body onload="<?php 
echo $jsevents["body"]["onload"];
?>
">
<?php 
开发者ID:hlcherub,项目名称:core,代码行数:31,代码来源:system_groupmanager_addprivs.php

示例13: sync_package_miniupnpd

            sync_package_miniupnpd();
            parse_package_templates();
            /* if start_command is defined, restart w/ this */
            if (!empty($pkg['start_command'])) {
                exec($pkg['start_command'] . ">/dev/null 2&>1");
            }
            /* if restart_command is defined, restart w/ this */
            if (!empty($pkg['restart_command'])) {
                exec($pkg['restart_command'] . ">/dev/null 2&>1");
            }
            if (!empty($pkg['aftersaveredirect'])) {
                redirectHeader($pkg['aftersaveredirect']);
            } elseif (empty($pkg['adddeleteeditpagefields'])) {
                redirectHeader("services_upnp.php?id=0");
            } elseif (empty($pkg['preoutput'])) {
                redirectHeader("services_upnp.php");
            }
            exit;
        } else {
            $get_from_post = true;
        }
    } elseif (!$input_errors) {
        exit;
    }
}
include "head.inc";
?>

<body>

<?php 
开发者ID:noikiy,项目名称:core-2,代码行数:31,代码来源:services_upnp.php

示例14: get_std_save_message

        $savemsg = get_std_save_message();
        clear_subsystem_dirty('sysctl');
    }
    if ($_POST['Submit'] == gettext("Save")) {
        $tunableent = array();
        $tunableent['tunable'] = $_POST['tunable'];
        $tunableent['value'] = $_POST['value'];
        $tunableent['descr'] = $_POST['descr'];
        if (isset($id) && $a_tunable[$id]) {
            $a_tunable[$id] = $tunableent;
        } else {
            $a_tunable[] = $tunableent;
        }
        mark_subsystem_dirty('sysctl');
        write_config();
        redirectHeader("system_advanced_sysctl.php");
        exit;
    }
}
$pgtitle = array(gettext('System'), gettext('Settings'), gettext('Tunables'));
include "head.inc";
?>

<body>
<?php 
include "fbegin.inc";
?>


<!-- row -->
<section class="page-content-main">
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:system_advanced_sysctl.php

示例15: array

                $acl_entry['aclname'] = $pconfig['aclname'];
                $acl_entry['aclaction'] = $pconfig['aclaction'];
                $acl_entry['description'] = $pconfig['description'];
                $acl_entry['aclid'] = $pconfig['aclid'];
                $acl_entry['row'] = array();
                foreach ($networkacl as $acl) {
                    $acl_entry['row'][] = $acl;
                }
                if (isset($id) && $a_acls[$id]) {
                    $a_acls[$id] = $acl_entry;
                } else {
                    $a_acls[] = $acl_entry;
                }
                mark_subsystem_dirty("unbound");
                write_config();
                redirectHeader("/services_unbound_acls.php");
                exit;
            }
        }
    }
}
$closehead = false;
$pgtitle = "Services: DNS Resolver: Access Lists";
include "head.inc";
?>

<body>

<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script>
<script type="text/javascript" src="/javascript/row_helper.js"></script>
开发者ID:hlcherub,项目名称:core,代码行数:30,代码来源:services_unbound_acls.php


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