示例#1
0
文件: delete.php 项目: robbat2/rats
<?php

/* $Id: delete.php,v 1.2 2003/06/22 23:07:07 robbat2 Exp $ */
/* $Source: /code/convert/cvsroot/infrastructure/rats/delete.php,v $ */
include './header.inc.php';
$perm = v('perm', 'del');
include 'lib/commontable.inc.php';
if ($tablePerm[$perm]) {
    $idDel = v('id');
    $tableDel = v('table');
    $query = 'DELETE FROM ' . $tableName . ' WHERE ' . $tableData[$tableName]['_idkey'] . '=' . MySQL_quote($idDel);
    echo $query;
    $m = _MySQL_queryhelper($query);
    $m->checkerror();
    $_SESSION['msg'] = 'Item deleted from ' . $tableName;
    if (!dodbg()) {
        httpredirect('view.php?table=' . $tableName);
    }
}
/* vim: set ft=php expandtab shiftwidth=4 softtabstop=4 tabstop=4: */
示例#2
0
<?php

/* $Id: header.inc.php,v 1.11 2003/06/22 23:07:30 robbat2 Exp $ */
error_reporting(E_ALL);
ob_start();
include 'include.php';
include './gui/header.inc.php';
// validate user stuff
if (isset($skipvalidate) && $skipvalidate && !isset($_COOKIE['skipvalidate']) && !isset($_GET['skipvalidate']) && !isset($_POST['skipvalidate'])) {
    $uservalid = TRUE;
    $validationskipped = TRUE;
} else {
    $uservalid = admin_validate();
    if (!$uservalid) {
        //possible hack or invalid password
        //header('Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".'index.php'.'?loginerror=1');
        httpredirect('index.php', '?loginerror=baduserpass');
        //echo 'REDIRECT';
        exit;
    }
    $validationskipped = FALSE;
}
if (isset($_SESSION) && isset($_SESSION['msg'])) {
    echo $_SESSION['msg'] . '<br />' . "\n";
    unset($_SESSION['msg']);
}
示例#3
0
function admin_strictchecks()
{
    global $sessionInfo;
    if (isset($sessionInfo['remoteip']) && !empty($sessionInfo['remoteip']) && $sessionInfo['remoteip'] != $_SERVER['REMOTE_ADDR']) {
        $extra = $sessionInfo['remoteip'] . ' vs. ' . $_SERVER['REMOTE_ADDR'];
        httpredirect('index.php', '?loginerror=spoofip&amp;extra=' . urlencode($extra));
    }
    if (isset($sessionInfo['httphost']) && !empty($sessionInfo['httphost']) && $sessionInfo['httphost'] != $_SERVER['HTTP_HOST']) {
        $extra = $sessionInfo['httphost'] . ' vs. ' . $_SERVER['HTTP_HOST'];
        httpredirect('index.php', '?loginerror=spoofhost&amp;extra=' . urlencode($extra));
    }
}
示例#4
0
文件: validate.php 项目: robbat2/rats
<?php

// validate login
// either display error
// or good results
$frames = TRUE;
include 'header.inc.php';
if (isset($uservalid) && $uservalid && isset($validationskipped) && !$validationskipped) {
    $mode = v('mode', 'normal');
    if ($mode == 'kiosk') {
        httpredirect('kiosk.php');
    } else {
        httpredirect('main.php');
    }
}
include 'footer.inc.php';