當前位置: 首頁>>代碼示例>>PHP>>正文


PHP session_redirect函數代碼示例

本文整理匯總了PHP中session_redirect函數的典型用法代碼示例。如果您正苦於以下問題:PHP session_redirect函數的具體用法?PHP session_redirect怎麽用?PHP session_redirect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了session_redirect函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: session_redirect

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
//
require_once 'pre.php';
require_once 'my_utils.php';
require_once 'common/event/EventManager.class.php';
require_once 'common/widget/WidgetLayoutManager.class.php';
$hp = Codendi_HTMLPurifier::instance();
if (user_isloggedin()) {
    // If it's super user and license terms have not yet been agreed then redirect
    // to license agreement page
    if (user_is_super_user() && !license_already_displayed()) {
        session_redirect("/admin/approve_license.php");
    }
    // Make sure this page is not cached because
    // it uses the exact same URL for all user's
    // personal page
    header("Cache-Control: no-cache, no-store, must-revalidate");
    // for HTTP 1.1
    header("Pragma: no-cache");
    // for HTTP 1.0
    if (browser_is_netscape4()) {
        $feedback .= $Language->getText('my_index', 'err_badbrowser');
    }
    $title = $Language->getText('my_index', 'title', array($hp->purify(user_getrealname(user_getid()), CODENDI_PURIFIER_CONVERT_HTML) . ' (' . user_getname() . ')'));
    $GLOBALS['HTML']->includeJavascriptFile('/scripts/scriptaculous/scriptaculous.js');
    my_header(array('title' => $title, 'body_class' => array('widgetable')));
    echo '<p>' . $Language->getText('my_index', 'message') . '</p>';
開發者ID:rinodung,項目名稱:tuleap,代碼行數:31,代碼來源:index.php

示例2: exit_error

// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
//
require_once 'pre.php';
$request = HTTPRequest::instance();
$confirm_hash = $request->get('confirm_hash');
$um = UserManager::instance();
$user = $um->getUserByConfirmHash($confirm_hash);
if ($user == null) {
    exit_error($Language->getText('include_exit', 'error'), $Language->getText('account_lostlogin', 'invalid_hash'));
}
if ($request->isPost() && $request->exist('Update') && $request->existAndNonEmpty('form_pw') && !strcmp($request->get('form_pw'), $request->get('form_pw2'))) {
    $user->setPassword($request->get('form_pw'));
    $um->updateDb($user);
    session_redirect("/");
}
$purifier =& Codendi_HTMLPurifier::instance();
$HTML->header(array('title' => $Language->getText('account_lostlogin', 'title')));
?>
<p><b><?php 
echo $Language->getText('account_lostlogin', 'title');
?>
</b>
<P><?php 
echo $Language->getText('account_lostlogin', 'message', array($purifier->purify($user->getRealName(), CODENDI_PURIFIER_CONVERT_HTML)));
?>
.

<form action="lostlogin.php" method="post">
<p><?php 
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:31,代碼來源:lostlogin.php

示例3: db_query

    } else {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('account_preferences', 'error_user_tracker_mailformat'));
    }
}
//
// Perform the update
//
// User
db_query("UPDATE user SET " . "mail_siteupdates=" . $form_mail_site . "," . "mail_va=" . $form_mail_va . "," . "theme='" . db_es($user_theme) . "'," . "sticky_login=" . $form_sticky_login . "," . "language_id='" . db_es($language_id) . "' WHERE " . "user_id=" . user_getid());
// Preferences
user_set_preference("user_csv_separator", $user_csv_separator);
user_set_preference("user_csv_dateformat", $user_csv_dateformat);
user_set_preference(Codendi_Mail_Interface::PREF_FORMAT, $user_tracker_mailformat);
if ($username_display !== null) {
    user_set_preference("username_display", $username_display);
}
$user->setLabFeatures($request->existAndNonEmpty('form_lab_features'));
if ($user_theme_variant) {
    $user->setPreference('theme_variant', $user_theme_variant);
}
if ($user_edition_default_format) {
    $user->setPreference(PFUser::EDITION_DEFAULT_FORMAT, $user_edition_default_format);
}
//plugins specific preferences
$em = EventManager::instance();
$em->processEvent('update_user_preferences_appearance', array('request' => $request));
//
// Output
//
session_redirect("/account/index.php");
開發者ID:blestab,項目名稱:tuleap,代碼行數:30,代碼來源:updateprefs.php

示例4: session_redirect

 * Tuleap 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 Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */
require_once 'pre.php';
require_once 'account.php';
require_once 'common/include/CSRFSynchronizerToken.class.php';
require_once 'common/include/lib/Upload.class.php';
$user_manager = UserManager::instance();
$user = $user_manager->getCurrentUser();
if ($user->isAnonymous()) {
    session_redirect("/account/");
}
$csrf = new CSRFSynchronizerToken('/account/change_avatar.php');
if (isset($_FILES['avatar'])) {
    $handle = new Upload($_FILES['avatar']);
    $handle->image_resize = true;
    $handle->image_ratio_crop = 'L';
    $handle->image_y = 50;
    $handle->image_x = 50;
    $handle->image_background_color = '#FFFFFF';
    $handle->image_convert = 'png';
    $handle->file_new_name_body = 'avatar';
    $handle->file_safe_name = false;
    $handle->file_force_extension = false;
    $handle->file_new_name_ext = '';
    $handle->allowed = 'image/*';
開發者ID:nterray,項目名稱:tuleap,代碼行數:31,代碼來源:change_avatar.php

示例5: taskboard_init

<?php

/*
 * Copyright (C) 2013 Vitaliy Pylypiv <vitaliy.pylypiv@gmail.com>
 *
 * This file is part of FusionForge.
 *
 * FusionForge 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 2 of the License,
 * or (at your option) any later version.
 *
 * FusionForge 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, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
if (!$taskboard->getID()) {
    $taskboard = taskboard_init($group_id);
}
session_redirect('/plugins/taskboard/admin/?group_id=' . $group_id . '&action=trackers');
開發者ID:vpylypv,項目名稱:taskboard,代碼行數:25,代碼來源:init.php

示例6: exit_error

    if (permission_exist('DOCUMENT_READ', $docid)) {
        if (!permission_is_authorized('DOCUMENT_READ', $docid, user_getid(), $object_group_id)) {
            exit_error($Language->getText('global', 'perm_denied'), $Language->getText('global', 'error_perm_denied'));
        }
    } else {
        if (!permission_is_authorized('DOCGROUP_READ', $row['doc_group'], user_getid(), $object_group_id)) {
            exit_error($Language->getText('global', 'perm_denied'), $Language->getText('global', 'error_perm_denied'));
        }
    }
    if (user_isloggedin()) {
        //Insert a new entry in the doc_log table only for restricted documents
        $sql = "INSERT INTO doc_log(user_id,docid,time) " . "VALUES ('" . user_getid() . "','" . $docid . "','" . time() . "')";
        $res_insert = db_query($sql);
    }
    // HTML or text files that were copy/pasted are displayed in a Codendi-formatted page.
    // Uploaded files are always displayed as-is.
    if (($row['filetype'] == 'text/html' || $row['filetype'] == 'text/plain') && $row['filesize'] == 0) {
        docman_header(array('title' => $row['title'], 'help' => 'DocumentManager.html'));
        if ($object_group_id != $from_group_id) {
            $group_name = util_get_group_name_from_id($object_group_id);
            print '<H3><span class="feedback">' . $Language->getText('docman_display_doc', 'warning_different_group', array($group_name)) . '</span></H3>';
        }
        // Document data can now contain HTML tags but not php code
        print util_unconvert_htmlspecialchars($row['data']);
        docman_footer($params);
    } else {
        session_redirect("/docman/download.php?docid=" . $docid);
    }
} else {
    exit_error($Language->getText('global', 'error'), $Language->getText('docman_display_doc', 'error_wrongid'));
}
開發者ID:nterray,項目名稱:tuleap,代碼行數:31,代碼來源:display_doc.php

示例7: session_require

// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: trove_cat_edit.php,v 1.2 2003/11/13 11:29:21 helix Exp $
require "pre.php";
require "trove.php";
session_require(array('group' => '1', 'admin_flags' => 'A'));
// ########################################################
if ($GLOBALS["Submit"]) {
    $newroot = trove_getrootcat($GLOBALS['form_parent']);
    if ($GLOBALS[form_shortname]) {
        db_query('UPDATE trove_cat ' . 'SET ' . 'shortname=\'' . $GLOBALS[form_shortname] . '\',fullname=\'' . $GLOBALS[form_fullname] . '\',description=\'' . $GLOBALS[form_description] . '\',parent=\'' . $GLOBALS[form_parent] . '\',version=' . date("Ymd", time()) . '01' . ',root_parent=\'' . $newroot . '\' WHERE trove_cat_id=' . $GLOBALS["form_trove_cat_id"]);
    }
    // update full paths now
    trove_genfullpaths($newroot, trove_getfullname($newroot), $newroot);
    session_redirect("/admin/trove/trove_cat_list.php");
}
$res_cat = db_query("SELECT * FROM trove_cat WHERE trove_cat_id={$trove_cat_id}");
if (db_numrows($res_cat) < 1) {
    exit_error("No Suck Category", "That trove cat does not exist");
}
$row_cat = db_fetch_array($res_cat);
$HTML->header(array(title => "Trove - Edit Category"));
?>

<form action="trove_cat_edit.php" method="post">
<input type="hidden" name="form_trove_cat_id" value="<?php 
print $GLOBALS['trove_cat_id'];
?>
">
<p>New category short name (no spaces, unix-like):
開發者ID:BackupTheBerlios,項目名稱:berlios,代碼行數:31,代碼來源:trove_cat_edit.php

示例8: while

    //$eachroot = ;//must make this bypass because it wouldn't compile otherwise
    while (list($rootnode, $value) = each($allroots)) {
        // check for array, then clear each root node for group
        db_query("\n\t\t\tDELETE FROM trove_group_link\n\t\t\tWHERE group_id='{$group_id}'\n\t\t\tAND trove_cat_root='{$rootnode}'\n\t\t");
        for ($i = 1; $i <= $TROVE_MAXPERROOT; $i++) {
            $varname = 'root' . $i;
            // check to see if exists first, then insert into DB
            //@TODO change this to use the escaping utils
            $var_aux = getStringFromRequest($varname);
            $category = $var_aux[$rootnode];
            if ($category) {
                trove_setnode($group_id, $category, $rootnode);
            }
        }
    }
    session_redirect('/project/admin/?group_id=' . $group_id);
}
project_admin_header(array('title' => _('Group Trove Information'), 'group' => $group_id));
echo _('<h3>Edit Trove Categorization</h3><p>Select up to three locations for this project in each of the Trove root categories. If the project does not require any or all of these locations, simply select "None Selected".</p><p> IMPORTANT: Projects should be categorized in the most specific locations available in the map. Simultaneous categorization in a specific category AND a parent category will result in only the more specific categorization being accepted</p>.');
?>

<form action="<?php 
echo getStringFromServer('PHP_SELF');
?>
" method="post">

<?php 
$CATROOTS = trove_getallroots();
while (list($catroot, $fullname) = each($CATROOTS)) {
    print "\n<hr />\n<p><strong>{$fullname}</strong> " . help_button('trove_cat', $catroot) . "</p>\n";
    $res_grpcat = db_query("\n\t\tSELECT trove_cat_id\n\t\tFROM trove_group_link\n\t\tWHERE group_id='{$group_id}'\n\t\tAND trove_cat_root='{$catroot}'");
開發者ID:neymanna,項目名稱:fusionforge,代碼行數:31,代碼來源:group_trove.php

示例9: session_require

require "account.php";
require $DOCUMENT_ROOT . '/project/admin/project_admin_utils.php';
session_require(array('group' => $group_id, 'admin_flags' => 'A'));
if ($GLOBALS[Submit]) {
    /*
    	PROBLEM - no feedbacks or checks for success/failure
    */
    if (account_namevalid(strtolower($form_username))) {
        $res_domain = db_query("SELECT http_domain FROM groups WHERE group_id={$group_id}");
        $row_domain = db_fetch_array($res_domain);
        $res = db_query("INSERT INTO mailaliases (group_id,domain,user_name,email_forward) VALUES " . "({$group_id},'{$row_domain['http_domain']}','" . strtolower($form_username) . "','{$form_email}')");
        if (!$res) {
            exit_error('Error in Query', 'This database query had an unknown failure. Please email
admin@' . $GLOBALS['sys_default_domain'] . ' with details of the problem.');
        }
        session_redirect("/project/admin/editaliases.php?group_id={$group_id}");
    }
}
project_admin_header(array('title' => 'Add Mail Alias', 'group' => $group_id));
?>
<P>Add email alias/forward for project: <B><?php 
html_a_group($group_id);
?>
</B>

<P><FORM action="editaliases-new.php" method="post">
New username:
<BR><INPUT type="text" name="form_username">
<P>New email forward address:
<BR><INPUT type="text" name="form_email">
<INPUT type="hidden" name="group_id" value="<?php 
開發者ID:BackupTheBerlios,項目名稱:berlios,代碼行數:31,代碼來源:editaliases-new.php

示例10: doc_data

        }
        if ($upload_instead) {
            // Upload file
            $query = "insert into doc_data(title,data,createdate,updatedate,created_by,doc_group,description,filename,filesize,filetype) " . "values(" . "'" . htmlspecialchars($title) . "'," . "'" . $data . "'," . "'" . time() . "'," . "'" . time() . "'," . "'" . $user . "'," . "'" . $doc_group . "'," . "'" . htmlspecialchars($description) . "'," . "'" . $fileName . "'," . "'" . $fileSize . "'," . "'" . $fileType . "')";
        } else {
            // Copy/paste data
            $query = "insert into doc_data(title,data,createdate,updatedate,created_by,doc_group,description,filename,filesize,filetype) " . "values(" . "'" . htmlspecialchars($title) . "'," . "'" . htmlspecialchars($data) . "'," . "'" . time() . "'," . "'" . time() . "'," . "'" . $user . "'," . "'" . $doc_group . "'," . "'" . htmlspecialchars($description) . "'," . "'',0,'text/html')";
        }
        $res_insert = db_query($query);
        if (db_affected_rows($res_insert) < 1) {
            docman_header(array('title' => $Language->getText('docman_new', 'title_new')));
            echo '<p>' . $Language->getText('docman_new', 'error_dbinsert') . ':</p><h3><span class="feedback">' . db_error() . '</span></h3>';
            docman_footer(array());
        } else {
            $feedback .= $Language->getText('docman_new', 'insert_ok');
            session_redirect("/docman/?group_id={$group_id}&feedback={$feedback}");
        }
    } else {
        docman_header(array('title' => $Language->getText('docman_new', 'title_add')));
        echo '<h2>' . $Language->getText('docman_new', 'header_add') . '</h2>';
        if ($user == 100) {
            print "<p>" . $Language->getText('docman_new', 'not_logged') . "<p>";
        }
        if (!groups_defined($group_id)) {
            echo "<p>" . $Language->getText('docman_new', 'no_docgroup', array("/docman/admin/index.php?group_id=" . $group_id)) . "<p>";
        }
        $star = '&nbsp;<span class="highlight"><big>*</big></span>';
        echo '
			<form name="adddata" action="new.php?mode=add&group_id=' . $group_id . '" method="POST" enctype="multipart/form-data">
            <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="' . $sys_max_size_upload . '">
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:30,代碼來源:new.php

示例11: session_redirect

<?php

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
//
require_once 'pre.php';
session_redirect('/softwaremap/trove_list.php');
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:10,代碼來源:index.php

示例12: MailManager

$mailManager = new MailManager();
$user_tracker_mailformat = $mailManager->getMailPreferencesByUser($user);
if ($request->existAndNonEmpty(Codendi_Mail_Interface::PREF_FORMAT)) {
    if ($request->valid(new Valid_WhiteList(Codendi_Mail_Interface::PREF_FORMAT, $mailManager->getAllMailFormats()))) {
        $user_tracker_mailformat = $request->get(Codendi_Mail_Interface::PREF_FORMAT);
    } else {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('account_preferences', 'error_user_tracker_mailformat'));
    }
}
//
// Perform the update
//
// User
db_query("UPDATE user SET " . "mail_siteupdates=" . $form_mail_site . "," . "mail_va=" . $form_mail_va . "," . "fontsize=" . $user_fontsize . "," . "theme='" . db_es($user_theme) . "'," . "sticky_login=" . $form_sticky_login . "," . "language_id='" . db_es($language_id) . "' WHERE " . "user_id=" . user_getid());
// Preferences
user_set_preference("user_csv_separator", $user_csv_separator);
user_set_preference("user_csv_dateformat", $user_csv_dateformat);
user_set_preference(Codendi_Mail_Interface::PREF_FORMAT, $user_tracker_mailformat);
if ($username_display !== null) {
    user_set_preference("username_display", $username_display);
}
$user = UserManager::instance()->getCurrentUser();
$user->setLabFeatures($request->existAndNonEmpty('form_lab_features'));
//plugins specific preferences
$em = EventManager::instance();
$em->processEvent('update_user_preferences_appearance', array('request' => $request));
//
// Output
//
session_redirect("/account/preferences.php");
開發者ID:nterray,項目名稱:tuleap,代碼行數:30,代碼來源:updateprefs.php

示例13: db_query

<?php

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: logout.php,v 1.2 2003/11/13 11:29:21 helix Exp $
require 'pre.php';
db_query("DELETE FROM session WHERE session_hash='{$session_hash}'");
session_cookie('session_hash', '');
session_redirect('/');
開發者ID:BackupTheBerlios,項目名稱:berlios,代碼行數:12,代碼來源:logout.php

示例14: exit_no_group

if (!$group_id) {
    exit_no_group();
}
session_require(array('group' => $group_id));
$group =& group_get_object($group_id);
if (!$group || !is_object($group)) {
    exit_error(_('Error'), _('Error creating group'));
} else {
    if ($group->isError()) {
        exit_error(_('Error'), $group->getErrorMessage());
    }
}
$perm =& $group->getPermission(session_get_user());
if (!$perm || !is_object($perm)) {
    exit_error(_('Error'), _('Error creating permission'));
} else {
    if ($perm->isError()) {
        exit_error(_('Error'), $perm->getErrorMessage());
    }
}
$group_name = $group->getUnixName();
$filename = $group_name . '-scmroot.tar.gz';
if (file_exists($sys_scm_tarballs_path . '/' . $filename)) {
    Header('Content-disposition: filename="' . str_replace('"', '', $filename) . '"');
    Header("Content-type: application/x-gzip");
    $length = filesize($sys_scm_tarballs_path . '/' . $filename);
    Header("Content-length: " . $length);
    readfile_chunked($sys_scm_tarballs_path . '/' . $filename);
} else {
    session_redirect(util_make_url("/404.php"));
}
開發者ID:neymanna,項目名稱:fusionforge,代碼行數:31,代碼來源:tarballs.php

示例15: db_query

    // delete all associated radio buttons
    $sql = "SELECT * FROM survey_radio_choices WHERE question_id='{$question_id}'";
    $result = db_query($sql);
    $rows = db_numrows($result);
    if ($rows > 0) {
        for ($j = 0; $j < $rows; $j++) {
            $radio_id = db_result($result, $j, 'choice_id');
            survey_data_radio_delete($question_id, $radio_id);
        }
    }
    // return to update mode
    session_redirect("/survey/admin/edit_question.php?func=update_question&group_id={$group_id}&question_id={$question_id}");
}
if (array_key_exists('cancel', $_POST) && isset($_POST['cancel'])) {
    // return to update mode
    session_redirect("/survey/admin/edit_question.php?func=update_question&group_id={$group_id}&question_id={$question_id}");
}
survey_header(array('title' => $Language->getText('survey_admin_update_radio', 'update_r'), 'help' => 'AdministeringSurveys.html#CreatingorEditingQuestions'));
// fetch question and associated radio button from DB, and check for integrity IDs
$qry = "SELECT * FROM survey_questions WHERE question_id='{$question_id}'";
$res = db_query($qry);
if (db_numrows($res) == 0) {
    $feedback .= " Error finding question #" . $question_id;
    survey_footer(array());
    exit;
} else {
    echo '<h2><font color=red>' . $Language->getText('survey_s_utils', 'warn_loose_button') . '</font></h2>';
}
?>

<P>
開發者ID:nterray,項目名稱:tuleap,代碼行數:31,代碼來源:confirm_update.php


注:本文中的session_redirect函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。