本文整理汇总了PHP中session_require函数的典型用法代码示例。如果您正苦于以下问题:PHP session_require函数的具体用法?PHP session_require怎么用?PHP session_require使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了session_require函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: site_admin_header
/**
* Module of support routines for Site Admin
*
* Copyright 1999-2001 (c) VA Linux Systems
*
* @version $Id$
*
* This file is part of GForge.
*
* GForge 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.
*
* GForge 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 GForge; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
function site_admin_header($params)
{
global $feedback, $HTML;
session_require(array('group' => '1', 'admin_flags' => 'A'));
$HTML->header($params);
echo html_feedback_top($feedback);
}
示例2: request
function request()
{
$request =& HTTPRequest::instance();
session_require(array('group' => $request->get('group_id'), 'admin_flags' => 'A'));
if ($request->exist('view')) {
switch ($request->get('view')) {
case 'creation':
$this->view = 'creation';
break;
case 'edit':
$this->view = 'edit';
break;
default:
$this->view = 'browse';
break;
}
} else {
$this->view = 'browse';
}
if ($request->exist('action')) {
switch ($request->get('action')) {
case 'do_edit':
$this->action = 'do_edit';
break;
case 'do_create':
$this->action = 'do_create';
break;
case 'do_delete':
$this->action = 'do_delete';
break;
default:
break;
}
}
}
示例3: PluginsAdministration
function PluginsAdministration()
{
session_require(array('group' => '1', 'admin_flags' => 'A'));
}
示例4: session_require
* 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.
*
* GForge 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 GForge; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
session_require(array('isloggedin' => 1));
if (getStringFromRequest('submit')) {
if (!form_key_is_valid(getStringFromRequest('form_key'))) {
exit_form_double_submit();
}
$newemail = getStringFromRequest('newemail');
if (!validate_email($newemail)) {
form_release_key(getStringFromRequest('form_key'));
exit_error(_('Error'), _('Invalid email address.'));
}
$confirm_hash = substr(md5($session_hash . time()), 0, 16);
$u =& user_get_object(user_getid());
if (!$u || !is_object($u)) {
form_release_key(getStringFromRequest('form_key'));
exit_error('Error', 'Could Not Get User');
} elseif ($u->isError()) {
示例5: session_require_site_admin
/**
* Mandate current session to be site admin otherwise redirect to an error page
*/
function session_require_site_admin()
{
session_require(array('group' => '1', 'admin_flags' => 'A'));
}
示例6: getUGroupRow
private function getUGroupRow($ugroupId)
{
$res = ugroup_db_get_ugroup($ugroupId);
if ($res && !db_error($res) && db_numrows($res) == 1) {
$row = db_fetch_array($res);
session_require(array('group' => $row['group_id'], 'admin_flags' => 'A'));
if ($row['group_id'] == 100) {
$row = null;
}
} else {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_admin_editugroup', 'ug_not_found', array($ugroupId, db_error())));
}
return $row;
}
示例7: session_require
<?php
//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: tos.php,v 1.2 2003/11/13 11:29:26 helix Exp $
require "pre.php";
// Initial db and session library, opens session
session_require(array(isloggedin => 1));
$HTML->header(array(title => "Terms of Service"));
print "<p><h2>Step 2: Terms of Service Agreement</h2></p>";
include "../tos/tos_text.php";
?>
<BR><HR><BR>
<P align=center>By clicking below, you acknowledge that you have read
and understand the Terms of Service agreement. Clicking "I AGREE" will
constitute your legal signature on this document.
<P><H3 align=center><A href="basicinfo.php">[I AGREE]</A>
<A href="/">[I DISAGREE]</A></H3>
<?php
$HTML->footer(array());
?>
示例8: process
function process()
{
session_require(array('group' => '1', 'admin_flags' => 'A'));
$request =& HTTPRequest::instance();
$valid = new Valid('offset');
$valid->setErrorMessage('Invalid offset submitted. Force it to 0 (zero).');
$valid->addRule(new Rule_Int());
$valid->addRule(new Rule_GreaterOrEqual(0));
if ($request->valid($valid)) {
$offset = $request->get('offset');
} else {
$offset = 0;
}
$valid = new Valid('day');
$valid->addRule(new Rule_Date(), 'Invalid date submitted. Force it to today.');
if ($request->valid($valid)) {
$day = $request->get('day');
} else {
$day = date('Y-n-j');
}
$userLogManager = new UserLogManager();
$userLogManager->displayLogs($offset, $day);
}
示例9: PluginCreationWizard
function PluginCreationWizard()
{
session_require(array('group' => '1', 'admin_flags' => 'A'));
}
示例10: exit_error
} else {
exit_error($Language->getText('global', 'error'), 'No ldap plugin');
}
// User group id exists
$vUgroupId = new Valid_UInt('ugroup_id');
$vUgroupId->required();
if ($request->valid($vUgroupId)) {
$ugroupId = $request->get('ugroup_id');
} else {
exit_error($Language->getText('global', 'error'), $Language->getText('project_admin_editugroup', 'ug_not_found'));
}
// Do not try to modify ugroups of project 100
$res = ugroup_db_get_ugroup($ugroupId);
if ($res && !db_error($res) && db_numrows($res) == 1) {
$row = db_fetch_array($res);
session_require(array('group' => $row['group_id'], 'admin_flags' => 'A'));
if ($row['group_id'] == 100) {
exit_error($Language->getText('global', 'error'), "Cannot modify this ugroup with LDAP plugin");
}
} else {
exit_error($Language->getText('global', 'error'), $Language->getText('project_admin_editugroup', 'ug_not_found', array($ugroupId, db_error())));
}
$group_id = $row['group_id'];
$ldapUserGroupManager = new LDAP_UserGroupManager($ldapPlugin->getLdap());
$ldapUserGroupManager->setId($ugroupId);
$hp = Codendi_HTMLPurifier::instance();
$btn_update = $Language->getText('plugin_ldap', 'ugroup_edit_btn_update');
$vSubmit = new Valid_WhiteList('submit', array($btn_update));
$vSubmit->required();
if ($request->isPost() && $request->valid($vSubmit)) {
if ($request->get('submit') == $btn_update) {
示例11: site_project_header
function site_project_header($params)
{
global $HTML, $Language;
/*
Check to see if active
Check to see if private (if private check if user_ismember)
*/
$group_id = $params['group'];
//get the project object
$pm = ProjectManager::instance();
$project = $pm->getProject($group_id);
//group doesn't exist
if ($project->isError()) {
exit_error($Language->getText('include_html', 'invalid_g'), $Language->getText('include_html', 'g_not_exist'));
}
//group is private
if (!$project->isPublic() && isset($params['user_has_special_access']) && !$params['user_has_special_access']) {
//if its a private group, you must be a member of that group
session_require(array('group' => $group_id));
}
//for dead projects must be member of admin project
if (!$project->isActive()) {
//only SF group can view non-active, non-holding groups
session_require(array('group' => '1'));
}
if (isset($params['pv']) && $params['pv'] != 0) {
// Printer version: no right column, no tabs...
echo $HTML->pv_header($params);
} else {
site_header($params);
}
}
示例12: exit_not_logged_in
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Codendi; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once 'pre.php';
require_once 'www/project/admin/project_admin_utils.php';
require_once 'www/project/admin/include/UserImportHtml.class.php';
if (!user_isloggedin()) {
exit_not_logged_in();
return;
}
if (!isset($_REQUEST['group_id'])) {
exit_no_group();
}
session_require(array('group' => $_REQUEST['group_id'], 'admin_flags' => 'A'));
$import = new UserImportHtml($_REQUEST['group_id']);
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == "parse") {
$import->displayParse($_FILES['user_filename']['tmp_name']);
} else {
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == "import") {
$import->displayImport($_REQUEST['parsed_users']);
} else {
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == "showformat") {
$import->displayShowFormat();
} else {
$import->displayInput();
}
}
}
示例13: site_project_header
/**
* site_project_header() - everything required to handle
* security and state checks for a project web page
*
* @param params array() must contain $toptab and $group
*/
function site_project_header($params)
{
global $HTML;
/*
Check to see if active
Check to see if project rather than foundry
Check to see if private (if private check if user_ismember)
*/
$group_id = $params['group'];
//get the project object
$project =& group_get_object($group_id);
if (!$project || !is_object($project)) {
exit_error("GROUP PROBLEM", "PROBLEM CREATING GROUP OBJECT");
} else {
if ($project->isError()) {
exit_error("Group Problem", $project->getErrorMessage());
}
}
//group is private
if (!$project->isPublic()) {
//if it's a private group, you must be a member of that group
session_require(array('group' => $group_id));
}
//for dead projects must be member of admin project
if (!$project->isActive()) {
//only SF group can view non-active, non-holding groups
session_require(array('group' => '1'));
}
if (isset($params['title'])) {
$params['title'] = $project->getPublicName() . ': ' . $params['title'];
} else {
$params['title'] = $project->getPublicName();
}
echo $HTML->header($params);
if (isset($GLOBALS['feedback'])) {
echo html_feedback_top($GLOBALS['feedback']);
}
// echo $HTML->project_tabs($params['toptab'],$params['group'],$params['tabtext']);
}
示例14: session_require
*
* GForge 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 GForge; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $sys_path_to_jpgraph . '/jpgraph.php';
require_once $sys_path_to_jpgraph . '/jpgraph_line.php';
require_once $gfcommon . 'reporting/ReportUserAdded.class.php';
session_require(array('group' => $sys_stats_group));
$SPAN = getStringFromRequest('SPAN');
$start = getStringFromRequest('start');
$end = getStringFromRequest('end');
//
// Create Report
//
$report = new ReportUserAdded($SPAN, $start, $end);
//
// Check for error, such as license key problem
//
if ($report->isError()) {
echo $report->getErrorMessage();
exit;
}
// Some data
示例15: DataGenerator
function DataGenerator()
{
session_require(array('group' => '1', 'admin_flags' => 'A'));
}