Ejemplo n.º 1
0
    }
    if ($TS_APP['isenable'] == '1' && $TS_URL['ac'] != 'admin') {
        tsNotice($TS_URL['app'] . "应用关闭,请开启后访问!");
    }
}
//定义网站URL
define('SITE_URL', $TS_SITE['site_url']);
//设置时区
date_default_timezone_set($TS_SITE['timezone']);
//接管SESSION,前台用户基本数据,$TS_USER数组
$TS_USER = isset($_SESSION['tsuser']) ? $_SESSION['tsuser'] : '';
//记录日志
if ($TS_CF['logs']) {
    //打印用户日志记录
    userlog($_POST, intval($TS_USER['userid']));
    userlog($_GET, intval($TS_USER['userid']));
}
//控制前台ADMIN访问权限
if ($TS_URL['ac'] == 'admin' && $TS_USER['isadmin'] != 1 && $TS_URL['app'] != 'system') {
    tsHeaderUrl(SITE_URL);
}
//控制后台访问权限
if ($TS_USER['isadmin'] != 1 && $TS_URL['app'] == 'system' && $TS_URL['ac'] != 'login') {
    tsHeaderUrl(SITE_URL);
}
//控制插件设置权限
if ($TS_USER['isadmin'] != 1 && $TS_URL['in'] == 'edit') {
    tsHeaderUrl(SITE_URL);
}
//判断用户是否需要验证Email,管理员除外
if ($TS_SITE['isverify'] == 1 && intval($TS_USER['userid']) > 0 && $TS_URL['app'] != 'system' && $TS_URL['ac'] != 'admin') {
Ejemplo n.º 2
0
function reject_member($pid)
{
    //user log first
    $fn = 'Reject  Member  Details';
    $ac = 'Rejected  Member  Details';
    userlog($fn, $ac);
    $transdate = date("Y-m-d H:i:s");
    $sql = "Update person  set status=2 ,approvedby='{$_SESSION['userid']}',approvaldate='{$transdate}' where autoid={$pid}";
    $insert = pg_query($sql);
    if (!$insert) {
        echo "The transaction failed {$sql} ";
    } else {
        header("location:../approval/apprmember.php");
    }
    pg_close($conn);
}
Ejemplo n.º 3
0
function process_switch($pid)
{
    //user log first
    $fn = 'Funds Switch';
    $ac = 'Switch Funds';
    userlog($fn, $ac);
    #redirect to switch funds
    header("location:switch.php?pid={$pid}");
}
Ejemplo n.º 4
0
/**
 * 记录用户日志
 * @param unknown $array
 * @param unknown $userid
 */
function userlog(&$array, $userid)
{
    if (is_array($array)) {
        foreach ($array as $key => $value) {
            if (!is_array($value)) {
                $data = "UserId:" . $userid . "\n";
                $data .= "IP:" . getIp() . "\n";
                $data .= "TIME:" . date('Y-m-d H:i:s') . "\n";
                $data .= "URL:" . $_SERVER['REQUEST_URI'] . "\n";
                $data .= "DATA:" . $data . "\n";
                $data .= "--------------------------------------\n";
                logging(date('Ymd') . '-' . $userid . '.txt', $data);
            } else {
                userlog($array[$key], $userid);
            }
        }
    }
}