Example #1
0
            $pb = 1;
        }
    }
    if (!有此权限('查看比赛')) {
        if (time() < $e[starttime]) {
            i异常("比赛尚未开始!", 取路径("contest/index.php"));
        }
        if ($d[readforce] > $_SESSION[readforce]) {
            i异常("你没有该场比赛的参与权限!", 取路径("contest/index.php"));
        }
        if ($_SESSION['ID'] != $_GET['uid'] && time() < $e[endtime]) {
            $uid = $_SESSION['ID'];
        }
    }
} else {
    i异常("未查询到记录!", 取路径("contest/index.php"));
}
gethead(1, "", "{$e['cname']} - {$d['pid']}. {$d['probname']}");
$LIB->mathjax();
$r = new DataAccess();
?>

<div class='row-fluid'>
<div id='leftbar' class='span4'>
<table class='table table-striped table-condensed table-bordered fiexd'>
<tr>
<th style="width: 5em;">比赛名称</th>
<td><b><?php 
echo $e[cname];
?>
</b></td>
Example #2
0
if (!$pwd) {
    $pwd = $_COOKIE['cogs_pwd_hash'];
}
$sql = "select * from userinfo where usr='******'";
$cnt = $p->dosql($sql);
if ($cnt == 0) {
    i异常("用户不存在!", 取路径("user/login.php"));
} else {
    $d = $p->rtnrlt(0);
    if ($pwd == $d['pwdhash'] || encode($_REQUEST['password']) == $d['pwdhash']) {
        $LIB->get_userinfo($d['uid']);
        $q = new DataAccess();
        $sql = "UPDATE `userinfo` SET `lastip` = '{$_SERVER['REMOTE_ADDR']}' WHERE `uid` ={$d['uid']}";
        $q->dosql($sql);
        $sql = "insert into login(uid,ua,ip,ltime,version) values({$d['uid']},'" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "','{$_SERVER['REMOTE_ADDR']}',NOW(),'" . mysql_real_escape_string($cfg['dir_root']) . "')";
        if ($SET['login_log']) {
            $q->dosql($sql);
        }
        if ($_REQUEST['savepwd']) {
            $tm = time() + 7776000;
            setcookie("cogs_usr", $usr, $tm, "/");
            setcookie("cogs_pwd_hash", $d['pwdhash'], $tm, "/");
        }
        if (!$_REQUEST['from']) {
            $_REQUEST['from'] = base64_encode("/" . $SET['global_root']);
        }
        i提示("用户 {$d['nickname']} 登录成功!{$_REQUEST['savepwd']}", $_REQUEST['from']);
    } else {
        i异常("密码错误,登录失败!", 取路径("user/login.php"));
    }
}
Example #3
0
<?php

require_once "../include/header.php";
setcookie("cogs_user", "", -100, "/");
setcookie("cogs_pwd_hash", "", -100, "/");
$_SESSION = array();
session_destroy();
if (!isset($_SESSION['ID'])) {
    i提示("退出(注销用户会话)成功!");
} else {
    i异常("退出(注销用户会话)失败!");
}