Esempio n. 1
0
function &RespawnSession($line = null, $file = null)
{
    global $FORUM;
    // Ensure session info was passed to the script.
    if (!isset($_COOKIE['sid']) && !$FORUM) {
        __printLoginRequiredErr();
    }
    // Attempt to respawn the session.
    $sid = new SId();
    if (!$sid->IsSessionValid()) {
        __printLoginRequiredErr();
    }
    //__printFatalErr("Failed to respawn user session.", $line, $file);
    return $sid;
}
Esempio n. 2
0
<?php

// 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 2 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, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
include_once "config.php";
include_once "{$INCLUDE_PATH}/system.php";
include_once "{$INCLUDE_PATH}/engine/sid.class.php";
include_once "{$INCLUDE_PATH}/engine/templates.php";
include_once "{$INCLUDE_PATH}/userstats.php";
global $URI_BASE, $URI_HOME, $LOGO;
$title = 'Index - News';
// Attempt to respawn a session.
$sid = new SId();
if ($sid->IsSessionValid()) {
    draw_page('login_forward.php');
} else {
    draw_page('index.php');
}
<?php

include_once "config.php";
include_once "{$INCLUDE_PATH}/system.php";
include_once "{$INCLUDE_PATH}/error.php";
include_once "{$INCLUDE_PATH}/engine/sid.php";
include_once "{$INCLUDE_PATH}/engine/validation.php";
include_once "{$INCLUDE_PATH}/engine/campaign.class.php";
include_once "{$INCLUDE_PATH}/engine/character.class.php";
include_once "{$INCLUDE_PATH}/engine/templates.php";
include_once "{$INCLUDE_PATH}/engine/serialization.php";
// Try to respawn a session to keep the menu nav in context.
$sid = new SId();
if ($REQUIRE_LOGIN && !$sid->IsSessionValid()) {
    draw_page('login_required.php');
    exit;
}
// Validate permission for the requested character.
$id = (int) $_POST['id'];
if (!$id) {
    $id = (int) $_GET['id'];
}
$campaign = new Campaign($id);
if ($sid->GetUserName() != $campaign->owner) {
    draw_page('view_campaign_error.php');
    exit;
}
$title = $campaign->cname;
draw_page('campaign_summary.php');