示例#1
0
function adminlog($action = '', $detail = '')
{
    global $curuser, $timestamp, $onlineip, $grouptypes;
    if (empty($action)) {
        return;
    }
    if ($curuser->info['isfounder']) {
        $agtname = lang('founder');
    } else {
        $usergroups = read_cache('usergroups', 2);
        $agtname = $usergroups[$curuser->info['grouptype2']]['cname'];
    }
    $record = mhtmlspecialchars($timestamp . "\t" . $curuser->info['mid'] . "\t" . $curuser->info['mname'] . "\t" . $agtname . "\t" . $onlineip . "\t" . $action . "\t" . $detail);
    record2file('adminlog', $record);
}
示例#2
0
                }
                message('loginsucceed', axaction(2, $forward));
            } elseif ($curuser->info['checked'] == 2) {
                //需要重新激活的会员
                message('outmemberactive', axaction(0, 'tools/memactive.php?ppt=1&username='******'&password='******'&forward=' . rawurlencode($forward)));
            } else {
                message('nocheckmember', axaction(1, $forward));
            }
        } elseif ($enable_uc) {
            //UC帐号需要激活
            message('outmemberactive', axaction(0, 'tools/memactive.php?username='******'&password='******'&forward=' . rawurlencode($forward)));
        }
        login_safecheck($username, $errtimes);
        $password = preg_replace("/^(.{" . round(strlen($password) / 4) . "})(.+?)(.{" . round(strlen($password) / 6) . "})\$/s", "\\1***\\3", $password);
        $record = mhtmlspecialchars($timestamp . "\t" . stripslashes($username) . "\t" . $password . "\t" . $onlineip);
        record2file('badlogin', $record);
        message($cantimes ? 'loginfailed' : 'mloginerrtimes', axaction(1, $forward), $cantimes);
    }
} elseif ($action == 'logout') {
    if ($enable_uc) {
        include_once M_ROOT . './include/ucenter/uc.inc.php';
    }
    $cmember = $curuser->info;
    if ($enable_pptin && !empty($pptin_url) && $pptin_logout) {
        $url = $pptin_url . $pptin_logout;
        $url .= (strpos($url, '?') ? '&' : '?') . 'verify=' . substr(md5("{$onlineip}{$pptin_key}{$_SERVER['HTTP_USER_AGENT']}"), 8, 8) . "&{$getval}=" . rawurlencode($forward);
        #PHPWind
        header('location:' . $url);
        exit;
    }
    mclearcookie();
示例#3
0
function mailto($to, $subject, $msg, $sarr = array(), $from = '', $ischeck = 0)
{
    include_once M_ROOT . './include/mail.fun.php';
    $ret = sys_mail($to, splang($subject, $sarr), splang($msg, $sarr), $from);
    if (!$ischeck && $ret) {
        global $curuser, $timestamp;
        $record = mhtmlspecialchars($timestamp . "\t" . $curuser->info['mid'] . "\t" . $curuser->info['mname'] . "\t" . $ret);
        record2file('smtp', $record);
    }
    return $ret;
}
示例#4
0
 function updatecrids($crids = array(), $updatedb = 0, $reason = '')
 {
     //积分能否为负值,及为小数点?
     global $currencys, $timestamp;
     if (empty($this->info['mid'])) {
         return;
     }
     if (empty($crids) || !is_array($crids)) {
         return;
     }
     if (!$reason) {
         $reason = lang('otherreason');
     }
     $record = array();
     foreach ($crids as $crid => $value) {
         $this->updatefield('currency' . $crid, $this->info['currency' . $crid] + $value, 'main');
         $record[] = mhtmlspecialchars($timestamp . "\t" . $this->info['mid'] . "\t" . $this->info['mname'] . "\t" . (!$crid ? lang('cash') : $currencys[$crid]['cname']) . "\t" . ($value >= 0 ? '+' : '-') . "\t" . abs($value) . "\t" . $reason);
     }
     !empty($record) && record2file('currencylog', $record);
     $updatedb && $this->updatedb();
 }
示例#5
0
 function updatecredit($get, $post)
 {
     if (!API_UPDATECREDIT) {
         return API_RETURN_FORBIDDEN;
     }
     $credit = $get['credit'];
     $amount = $get['amount'];
     $uid = $get['uid'];
     $time = $get['time'];
     require_once M_ROOT . './include/ucenter/config.inc.php';
     require_once M_ROOT . './uc_client/client.php';
     $ucresult = uc_get_user($uid, 1);
     if (!is_array($ucresult)) {
         return API_RETURN_FAILED;
     }
     $mname = $ucresult[1];
     $row = $this->db->fetch_one("SELECT mid,mname FROM " . $this->tablepre . "members WHERE mname='{$mname}'");
     $this->db->query("UPDATE " . $this->tablepre . "members SET currency{$credit}=currency{$credit}+'{$amount}' WHERE mid='{$row['mid']}'");
     include_once M_ROOT . './include/general.fun.php';
     include_once M_ROOT . './dynamic/cache/currencys.cac.php';
     $record = mhtmlspecialchars($time . "\t" . $row['mid'] . "\t" . $row['mname'] . "\t" . $currencys_0[$credit]['cname'] . "\t" . '+' . "\t" . $amount . "\t" . 'ucenter currency exchange');
     record2file('currencylog', $record);
     return API_RETURN_SUCCEED;
 }