本文整理汇总了PHP中print_header_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP print_header_redirect函数的具体用法?PHP print_header_redirect怎么用?PHP print_header_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_header_redirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: access_denied
function access_denied()
{
if (!auth_is_user_authenticated()) {
if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
$t_return_page = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$t_return_page .= '?' . $_SERVER['QUERY_STRING'];
}
$t_return_page = string_url(string_sanitize_url($t_return_page));
print_header_redirect('login_page.php?return=' . $t_return_page);
}
} else {
if (auth_get_current_user_id() == user_get_id_by_name(config_get_global('anonymous_account'))) {
if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
$t_return_page = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$t_return_page .= '?' . $_SERVER['QUERY_STRING'];
}
$t_return_page = string_url(string_sanitize_url($t_return_page));
echo '<center>';
echo '<p>' . error_string(ERROR_ACCESS_DENIED) . '</p>';
print_bracket_link('login_page.php?return=' . $t_return_page, lang_get('click_to_login'));
echo '<p></p>';
print_bracket_link('main_page.php', lang_get('proceed'));
echo '</center>';
}
} else {
echo '<center>';
echo '<p>' . error_string(ERROR_ACCESS_DENIED) . '</p>';
print_bracket_link('main_page.php', lang_get('proceed'));
echo '</center>';
}
}
exit;
}
示例2: access_denied
/**
* Function to be called when a user is attempting to access a page that
* he/she is not authorised to. This outputs an access denied message then
* re-directs to the mainpage.
*/
function access_denied()
{
if (!auth_is_user_authenticated()) {
if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
$t_return_page = $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['QUERY_STRING'])) {
$t_return_page .= '?' . $_SERVER['QUERY_STRING'];
}
$t_return_page = string_url(string_sanitize_url($t_return_page));
print_header_redirect('login_page.php' . '?return=' . $t_return_page);
}
} else {
if (current_user_is_anonymous()) {
if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
$t_return_page = $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['QUERY_STRING'])) {
$t_return_page .= '?' . $_SERVER['QUERY_STRING'];
}
$t_return_page = string_url(string_sanitize_url($t_return_page));
echo '<p class="center">' . error_string(ERROR_ACCESS_DENIED) . '</p><p class="center">';
print_bracket_link(helper_mantis_url('login_page.php') . '?return=' . $t_return_page, lang_get('click_to_login'));
echo '</p><p class="center">';
print_bracket_link(helper_mantis_url('main_page.php'), lang_get('proceed'));
echo '</p>';
}
} else {
echo '<p class="center">' . error_string(ERROR_ACCESS_DENIED) . '</p>';
echo '<p class="center">';
print_bracket_link(helper_mantis_url('main_page.php'), lang_get('proceed'));
echo '</p>';
}
}
exit;
}
示例3: auth_ensure_user_authenticated
/**
* Check that there is a user logged-in and authenticated
* If the user's account is disabled they will be logged out
* If there is no user logged in, redirect to the login page
* If parameter is given it is used as a URL to redirect to following
* successful login. If none is given, the URL of the current page is used
* @param string $p_return_page Page to redirect to following successful logon, defaults to current page
* @access public
*/
function auth_ensure_user_authenticated($p_return_page = '')
{
# if logged in
if (auth_is_user_authenticated()) {
# check for access enabled
# This also makes sure the cookie is valid
if (OFF == current_user_get_field('enabled')) {
print_header_redirect('logout_page.php');
}
} else {
# not logged in
if (is_blank($p_return_page)) {
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
}
$p_return_page = $_SERVER['REQUEST_URI'];
}
$p_return_page = string_url($p_return_page);
print_header_redirect('login_page.php?return=' . $p_return_page);
}
}
示例4: access_denied
function access_denied()
{
if (!php_version_at_least('4.1.0')) {
global $_SERVER;
}
if (!auth_is_user_authenticated()) {
if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
if (!isset($_SERVER['REQUEST_URI'])) {
if (!isset($_SERVER['QUERY_STRING'])) {
$_SERVER['QUERY_STRING'] = '';
}
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
}
$t_return_page = string_url($_SERVER['REQUEST_URI']);
print_header_redirect('login_page.php?return=' . $t_return_page);
}
} else {
echo '<center>';
echo '<p>' . error_string(ERROR_ACCESS_DENIED) . '</p>';
print_bracket_link('main_page.php', lang_get('proceed'));
echo '</center>';
}
exit;
}
示例5: gpc_get_string
$f_os_build = gpc_get_string('os_build');
$f_description = gpc_get_string('description');
if (profile_is_global($f_profile_id)) {
access_ensure_global_level(config_get('manage_global_profile_threshold'));
profile_update(ALL_USERS, $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description);
form_security_purge('profile_update');
print_header_redirect('manage_prof_menu_page.php');
} else {
profile_update(auth_get_current_user_id(), $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description);
form_security_purge('profile_update');
print_header_redirect('account_prof_menu_page.php');
}
break;
case 'delete':
if (profile_is_global($f_profile_id)) {
access_ensure_global_level(config_get('manage_global_profile_threshold'));
profile_delete(ALL_USERS, $f_profile_id);
form_security_purge('profile_update');
print_header_redirect('manage_prof_menu_page.php');
} else {
profile_delete(auth_get_current_user_id(), $f_profile_id);
form_security_purge('profile_update');
print_header_redirect('account_prof_menu_page.php');
}
break;
case 'make_default':
current_user_set_pref('default_profile', $f_profile_id);
form_security_purge('profile_update');
print_header_redirect('account_prof_menu_page.php');
break;
}
示例6: access_ensure_project_level
if ($f_manage_page && $t_dst_project_id != ALL_PROJECTS) {
access_ensure_project_level(MANAGER, $t_dst_project_id);
}
# user should only be able to set columns for a project that is accessible.
if ($t_dst_project_id != ALL_PROJECTS) {
access_ensure_project_level(VIEWER, $t_dst_project_id);
}
# Calculate the user id to set the configuration for.
if ($f_manage_page) {
$t_user_id = NO_USER;
} else {
$t_user_id = auth_get_current_user_id();
}
$t_all_columns = columns_get_all();
$t_default = null;
$t_view_issues_page_columns = config_get('view_issues_page_columns', $t_default, $t_user_id, $t_src_project_id);
$t_view_issues_page_columns = columns_remove_invalid($t_view_issues_page_columns, $t_all_columns);
$t_print_issues_page_columns = config_get('print_issues_page_columns', $t_default, $t_user_id, $t_src_project_id);
$t_print_issues_page_columns = columns_remove_invalid($t_print_issues_page_columns, $t_all_columns);
$t_csv_columns = config_get('csv_columns', $t_default, $t_user_id, $t_src_project_id);
$t_csv_columns = columns_remove_invalid($t_csv_columns, $t_all_columns);
$t_excel_columns = config_get('excel_columns', $t_default, $t_user_id, $t_src_project_id);
$t_excel_columns = columns_remove_invalid($t_excel_columns, $t_all_columns);
config_set('view_issues_page_columns', $t_view_issues_page_columns, $t_user_id, $t_dst_project_id);
config_set('print_issues_page_columns', $t_print_issues_page_columns, $t_user_id, $t_dst_project_id);
config_set('csv_columns', $t_csv_columns, $t_user_id, $t_dst_project_id);
config_set('excel_columns', $t_excel_columns, $t_user_id, $t_dst_project_id);
form_security_purge('manage_columns_copy');
$t_redirect_url = $f_manage_page ? 'manage_config_columns_page.php' : 'account_manage_columns_page.php';
print_header_redirect($t_redirect_url);
示例7: require_api
require_api('authentication_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
auth_ensure_user_authenticated();
$f_ref = string_sanitize_url(gpc_get_string('ref', ''));
if (count(current_user_get_accessible_projects()) == 1) {
$t_project_ids = current_user_get_accessible_projects();
$t_project_id = (int) $t_project_ids[0];
if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
$t_ref_urlencoded = string_url($f_ref);
print_header_redirect("set_project.php?project_id={$t_project_id}&ref={$t_ref_urlencoded}", true);
/* print_header_redirect terminates script execution */
}
}
html_page_top(lang_get('select_project_button'));
?>
<!-- Project Select Form BEGIN -->
<div id="select-project-div" class="form-container">
<form id="select-project-form" method="post" action="set_project.php">
<?php
# CSRF protection not required here - form does not result in modifications
?>
<fieldset>
<legend><span><?php
echo lang_get('choose_project');
示例8: news_ensure_enabled
require_once 'string_api.php';
news_ensure_enabled();
$f_news_id = gpc_get_int('news_id');
$f_action = gpc_get_string('action', '');
# If deleting item redirect to delete script
if ('delete' == $f_action) {
form_security_validate('news_delete');
$row = news_get_row($f_news_id);
# This check is to allow deleting of news items that were left orphan due to bug #3723
if (project_exists($row['project_id'])) {
access_ensure_project_level(config_get('manage_news_threshold'), $row['project_id']);
}
helper_ensure_confirmed(lang_get('delete_news_sure_msg'), lang_get('delete_news_item_button'));
news_delete($f_news_id);
form_security_purge('news_delete');
print_header_redirect('news_menu_page.php', true);
}
# Retrieve news item data and prefix with v_
$row = news_get_row($f_news_id);
if ($row) {
extract($row, EXTR_PREFIX_ALL, 'v');
}
access_ensure_project_level(config_get('manage_news_threshold'), $v_project_id);
$v_headline = string_attribute($v_headline);
$v_body = string_textarea($v_body);
html_page_top(lang_get('edit_news_title'));
# Edit News Form BEGIN
?>
<br />
<div align="center">
<form method="post" action="news_update.php">
示例9: config_get
# $Id: bug_report_page.php,v 1.64.2.1 2007-10-13 22:32:53 giallu Exp $
# --------------------------------------------------------
# This file POSTs data to report_bug.php
$g_allow_browser_cache = 1;
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'file_api.php';
require_once $t_core_path . 'custom_field_api.php';
require_once $t_core_path . 'last_visited_api.php';
$f_master_bug_id = gpc_get_int('m_id', 0);
# this page is invalid for the 'All Project' selection except if this is a clone
if (ALL_PROJECTS == helper_get_current_project() && 0 == $f_master_bug_id) {
print_header_redirect('login_select_proj_page.php?ref=bug_report_page.php');
}
if (ADVANCED_ONLY == config_get('show_report')) {
print_header_redirect('bug_report_advanced_page.php' . (0 == $f_master_bug_id) ? '' : '?m_id=' . $f_master_bug_id);
}
if ($f_master_bug_id > 0) {
# master bug exists...
bug_ensure_exists($f_master_bug_id);
# master bug is not read-only...
if (bug_is_readonly($f_master_bug_id)) {
error_parameters($f_master_bug_id);
trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
}
$t_bug = bug_prepare_edit(bug_get($f_master_bug_id, true));
# the user can at least update the master bug (needed to add the relationship)...
access_ensure_bug_level(config_get('update_bug_threshold', null, $t_bug->project_id), $f_master_bug_id);
#@@@ (thraxisp) Note that the master bug is cloned into the same project as the master, independent of
# what the current project is set to.
if ($t_bug->project_id != helper_get_current_project()) {
示例10: Copyright
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 - 2004 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
# --------------------------------------------------------
# $Id: logout_page.php,v 1.17 2004/05/30 01:49:31 vboctor Exp $
# --------------------------------------------------------
require_once 'core.php';
auth_logout();
if (HTTP_AUTH == config_get('login_method')) {
auth_http_set_logout_pending(true);
}
print_header_redirect(config_get('logout_redirect_page'));
示例11: strip_tags
$f_query_name = strip_tags(gpc_get_string('query_name'));
$f_is_public = gpc_get_bool('is_public');
$f_all_projects = gpc_get_bool('all_projects');
$t_query_redirect_url = 'query_store_page.php';
# We can't have a blank name
if (is_blank($f_query_name)) {
$t_query_redirect_url = $t_query_redirect_url . '?error_msg=' . urlencode(lang_get('query_blank_name'));
print_header_redirect($t_query_redirect_url);
}
# Check and make sure they don't already have a
# query with the same name
$t_query_arr = filter_db_get_available_queries();
foreach ($t_query_arr as $t_id => $t_name) {
if ($f_query_name == $t_name) {
$t_query_redirect_url = $t_query_redirect_url . '?error_msg=' . urlencode(lang_get('query_dupe_name'));
print_header_redirect($t_query_redirect_url);
exit;
}
}
$t_project_id = helper_get_current_project();
if ($f_all_projects) {
$t_project_id = 0;
}
$t_filter_string = filter_db_get_filter(gpc_get_cookie(config_get('view_all_cookie'), ''));
$t_new_row_id = filter_db_set_for_current_user($t_project_id, $f_is_public, $f_query_name, $t_filter_string);
if ($t_new_row_id == -1) {
$t_query_redirect_url = $t_query_redirect_url . '?error_msg=' . urlencode(lang_get('query_store_error'));
print_header_redirect($t_query_redirect_url);
} else {
print_header_redirect('view_all_bug_page.php');
}
示例12: form_security_validate
# 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 MantisBT. If not, see <http://www.gnu.org/licenses/>.
/**
* @package MantisBT
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2013 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once 'core.php';
form_security_validate('manage_user_proj_add');
auth_reauthenticate();
$f_user_id = gpc_get_int('user_id');
$f_access_level = gpc_get_int('access_level');
$f_project_id = gpc_get_int_array('project_id', array());
$t_manage_user_threshold = config_get('manage_user_threshold');
user_ensure_exists($f_user_id);
foreach ($f_project_id as $t_proj_id) {
if (access_has_project_level($t_manage_user_threshold, $t_proj_id) && access_has_project_level($f_access_level, $t_proj_id)) {
project_add_user($t_proj_id, $f_user_id, $f_access_level);
}
}
form_security_purge('manage_user_proj_add');
print_header_redirect('manage_user_edit_page.php?user_id=' . $f_user_id);
示例13: require_api
require_api('authentication_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('gpc_api.php');
require_api('print_api.php');
require_api('user_api.php');
# check if at least one way to get here is enabled
if (OFF == config_get('allow_signup') && OFF == config_get('lost_password_feature') && OFF == config_get('send_reset_password')) {
trigger_error(ERROR_LOST_PASSWORD_NOT_ENABLED, ERROR);
}
$f_user_id = gpc_get_string('id');
$f_confirm_hash = gpc_get_string('confirm_hash');
# force logout on the current user if already authenticated
if (auth_is_user_authenticated()) {
auth_logout();
# reload the page after logout
print_header_redirect('verify.php?id=' . $f_user_id . '&confirm_hash=' . $f_confirm_hash);
}
$t_calculated_confirm_hash = auth_generate_confirm_hash($f_user_id);
if ($f_confirm_hash != $t_calculated_confirm_hash) {
trigger_error(ERROR_LOST_PASSWORD_CONFIRM_HASH_INVALID, ERROR);
}
# set a temporary cookie so the login information is passed between pages.
auth_set_cookies($f_user_id, false);
user_reset_failed_login_count_to_zero($f_user_id);
user_reset_lost_password_in_progress_count_to_zero($f_user_id);
# fake login so the user can set their password
auth_attempt_script_login(user_get_field($f_user_id, 'username'));
user_increment_login_count($f_user_id);
define('ACCOUNT_VERIFICATION_INC', true);
include dirname(__FILE__) . '/account_page.php';
示例14: user_get_id_by_email
$client->setAccessToken($_SESSION['access_token']);
}
if ($client->getAccessToken()) {
$userData = $objOAuthService->userinfo->get();
$data['userData'] = $userData;
$_SESSION['access_token'] = $client->getAccessToken();
}
$user_id = user_get_id_by_email($userData->email);
# check for disabled account
if (!user_is_enabled($user_id)) {
echo "<p>Your email didn't to registration on this web site. Please register new account first. ";
return false;
}
# max. failed login attempts achieved...
if (!user_is_login_request_allowed($user_id)) {
echo "<p>Your email didn't to registration on this web site. Please register new account first. ";
return false;
}
# check for anonymous login
if (user_is_anonymous($user_id)) {
echo "<p>Your email didn't to registration on this web site. Please register new account first. ";
return false;
}
user_increment_login_count($user_id);
user_reset_failed_login_count_to_zero($user_id);
user_reset_lost_password_in_progress_count_to_zero($user_id);
# set the cookies
auth_set_cookies($user_id, false);
auth_set_tokens($user_id);
print_header_redirect('../../../my_view_page.php');
示例15: gpc_get_int
require_once $t_core_path . 'custom_field_api.php';
require_once $t_core_path . 'date_api.php';
require_once $t_core_path . 'last_visited_api.php';
require_once $t_core_path . 'projax_api.php';
$f_bug_id = gpc_get_int('bug_id');
$t_bug = bug_prepare_edit(bug_get($f_bug_id, true));
if ($t_bug->project_id != helper_get_current_project()) {
# in case the current project is not the same project of the bug we are viewing...
# ... override the current project. This to avoid problems with categories and handlers lists etc.
$g_project_override = $t_bug->project_id;
$t_changed_project = true;
} else {
$t_changed_project = false;
}
if (SIMPLE_ONLY == config_get('show_update')) {
print_header_redirect('bug_update_page.php?bug_id=' . $f_bug_id);
}
if (bug_is_readonly($f_bug_id)) {
error_parameters($f_bug_id);
trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
}
access_ensure_bug_level(config_get('update_bug_threshold'), $f_bug_id);
html_page_top1(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
html_page_top2();
print_recently_visited();
?>
<br />
<form method="post" action="bug_update.php">
<?php
echo form_security_field('bug_update');