Exemplo n.º 1
0
 public function update_user_credit($mobile, $credit)
 {
     //$mobile = '18782963909';
     //$credit = 1;
     $db = new dbstuff();
     $db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, 0);
     $sql = "SELECT `uid` FROM " . DZ_DBTABLEPRE . "common_member WHERE `username`={$mobile}";
     $result = $db->query($sql);
     if ($db->num_rows($result) == 0) {
         return false;
     } else {
         $row = $db->fetch_array($result);
         $uid = $row['uid'];
         $sql = "SELECT * FROM " . DZ_DBTABLEPRE . "common_member_count WHERE `uid`={$uid}";
         $result = $db->query($sql);
         if ($db->num_rows($result) == 0) {
             return false;
         } else {
             $row = $db->fetch_array($result);
             if ($row['extcredits2'] < $credit) {
                 return false;
             } else {
                 //print_r($row);$row['extcredits2'] = 376;
                 $new_credit = $row['extcredits2'] - $credit;
                 $sql = 'UPDATE ' . DZ_DBTABLEPRE . "common_member_count SET extcredits2='{$new_credit}' WHERE uid='{$uid}'";
                 $re = $db->query($sql);
                 if ($db->num_rows($re) == 0) {
                     return false;
                 } else {
                     return true;
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
function check_authority()
{
    require GAME_ROOT . './include/modules/core/sys/config/server.config.php';
    $_COOKIE = gstrfilter($_COOKIE);
    $cuser = $_COOKIE[$gtablepre . 'user'];
    $cpass = $_COOKIE[$gtablepre . 'pass'];
    require GAME_ROOT . './include/db_' . $database . '.class.php';
    $db = new dbstuff();
    $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
    unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
    $result = $db->query("SELECT * FROM {$gtablepre}users WHERE username='******'");
    if (!$db->num_rows($result)) {
        echo "<span><font color=\"red\">Cookie无效,请登录。</font></span><br>";
        die;
    }
    $udata = $db->fetch_array($result);
    if ($udata['password'] != $cpass) {
        echo "<span><font color=\"red\">Cookie无效,请登录。</font></span><br>";
        die;
    } elseif ($udata['groupid'] < 9 && $cuser !== $gamefounder) {
        echo "<span><font color=\"red\">要求至少9权限。</font></span><br>";
        die;
    }
    unset($db);
    unset($cuser);
    unset($cpass);
    unset($udata);
    unset($result);
}
Exemplo n.º 3
0
function getImCount()
{
    $db_uch = new dbstuff();
    $db_uch->charset = dbcharset;
    $db_uch->connect(dbhost, dbuser, dbpw, dbname, pconnect);
    $result = $db_uch->result($db_uch->query("SELECT COUNT(*) FROM " . tname("spacefield") . " WHERE qq <> ''"), 0);
    return $result;
}
Exemplo n.º 4
0
 public function UcenterReg($data)
 {
     $db = new dbstuff();
     $db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, 0);
     $uid = uc_user_register($data['username'], $data['password'], $data['email']);
     if ($uid <= 0) {
         return $uid;
         /*	if($uid == -1) {
         				return '用户名不合法';
         			} elseif($uid == -2) {
         				return '包含要允许注册的词语';
         			} elseif($uid == -3) {
         				return '用户名已经存在';
         			} elseif($uid == -4) {
         				return 'Email 格式有误';
         			} elseif($uid == -5) {
         				return 'Email 不允许注册';
         			} elseif($uid == -6) {
         				return '该 Email 已经被注册';
         			} else {
         				return '未定义';
         			}*/
     } else {
         $username = $data['username'];
         $sql = "SELECT `username`,`password` FROM " . DZ_DBTABLEPRE . "common_member WHERE `uid`={$uid}";
         $result = $db->query($sql);
         if ($db->num_rows($result) == 0) {
             $sql = "SELECT `username`,`password` FROM " . UC_DBTABLEPRE . "members WHERE `uid`={$uid}";
             $result = $db->query($sql);
             $row = $db->fetch_array($result);
             //激活
             $sql = "insert into " . DZ_DBTABLEPRE . "common_member set regdate='" . time() . "',uid='{$uid}',email='" . $data['email'] . "',username='******'username'] . "',password='******'password'] . "',timeoffset=9999";
             $db->query($sql);
             $sql = "insert into " . DZ_DBTABLEPRE . "common_member_status set uid='{$uid}', regip='{$_SERVER['REMOTE_ADDR']}',lastip='{$_SERVER['REMOTE_ADDR']}',lastvisit=" . time() . ", lastactivity=" . time() . ',lastpost=0, lastsendmail=0';
             $db->query($sql);
             $sql = "insert into " . DZ_DBTABLEPRE . "common_member_profile set uid='{$uid}'";
             $db->query($sql);
             $sql = "insert into " . DZ_DBTABLEPRE . "common_member_field_forum set uid='{$uid}'";
             $db->query($sql);
             $sql = "insert into " . DZ_DBTABLEPRE . "common_member_field_home set uid='{$uid}' ";
             $db->query($sql);
             $sql = "insert into " . DZ_DBTABLEPRE . "common_member_count set uid='{$uid}' ";
             $db->query($sql);
             $db->query('UPDATE ' . DZ_DBTABLEPRE . "common_setting SET svalue='{$data['username']}' WHERE skey='lastmember'");
             //exit;
         }
     }
     unset($db);
     return $uid;
 }
Exemplo n.º 5
0
    $template = Template::getInstance();
    $template->setOptions($options);
}
//信息调用
//后台
$admin_login_temp = $_COOKIE["admin_login"];
$admin_exp = authcode($admin_login_temp, 'DECODE');
$admin_tem = explode("\t", $admin_exp);
$admin_login = $admin_tem['1'];
//前台
$authcookie = $_COOKIE["authcookie"];
$exp = authcode($authcookie, 'DECODE');
$tem = explode("\t", $exp);
if ($tem || $admin_tem) {
    $sql_us = "select * from et_users where mailadres='{$tem['1']}' && password='******'0']}' && user_id='{$tem['2']}'";
    $query_us = $db->query($sql_us);
    $my = $db->fetch_array($query_us);
    $my['user_head'] = $my['user_head'] ? "{$webaddr}/attachments/head/" . $my['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $tem1 = explode(" ", $my['home_city']);
    $my['home_sf'] = $tem1[0];
    $my['home_city'] = $tem1[1];
    $tem2 = explode(" ", $my['live_city']);
    $my['live_sf'] = $tem2[0];
    $my['live_city'] = $tem2[1];
    $tem3 = explode("-", $my['birthday']);
    $my['birth_year'] = $tem3[0];
    $my['birth_month'] = $tem3[1];
    $my['birth_day'] = $tem3[2];
    $tem4 = explode(" ", $my['msn']);
    if (count($tem4) == 2) {
        $my['msn'] = $tem4[0];
Exemplo n.º 6
0
<?php

define('IN_DISCUZ', true);
include_once '../../config.inc.php';
require_once '../../include/global.func.php';
require_once '../../include/db_' . $database . '.class.php';
$uid = $_GET['uid'];
$buyer = $_GET['buyer'];
$price = $_GET['price'];
$amount = $_GET['amount'];
$orderid = $_GET['orderid'];
$submitdate = $_GET['submitdate'];
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
$db->select_db($dbname);
$settings = array();
$query = $db->query("SELECT * FROM {$tablepre}settings");
while ($setting = $db->fetch_array($query)) {
    $settings[$setting['variable']] = $setting['value'];
}
$settings['creditstrans'] = explode(',', $settings['creditstrans']);
$extcredits = $settings['creditstrans'][0];
updatecredits($uid, array($extcredits => $amount));
$timestamp = time();
$db->query("INSERT INTO {$tablepre}creditslog (uid, fromto, sendcredits, receivecredits, send, receive, dateline, operation)VALUES ({$uid}, '{$buyer}', 0, {$extcredits}, 0, {$amount}, {$timestamp}, 'AFD')");
$db->query("UPDATE {$tablepre}orders SET status = '2', confirmdate = {$timestamp} WHERE orderid = '{$orderid}'");
Exemplo n.º 7
0
 runquery($extrasql);
 $sql = file_get_contents(ROOT_PATH . './install/data/install_data.sql');
 $sql = str_replace("\r\n", "\n", $sql);
 runquery($sql);
 $onlineip = $_SERVER['REMOTE_ADDR'];
 $timestamp = time();
 $backupdir = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . substr($timestamp, 0, 4)), 8, 6);
 $ret = false;
 if (is_dir(ROOT_PATH . 'data/backup')) {
     $ret = @rename(ROOT_PATH . 'data/backup', ROOT_PATH . 'data/backup_' . $backupdir);
 }
 if (!$ret) {
     @mkdir(ROOT_PATH . 'data/backup_' . $backupdir, 0777);
 }
 if (is_dir(ROOT_PATH . 'data/backup_' . $backupdir)) {
     $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('backupdir', '{$backupdir}')");
 }
 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
 $siteuniqueid = 'DX' . $chars[date('y') % 60] . $chars[date('n')] . $chars[date('j')] . $chars[date('G')] . $chars[date('i')] . $chars[date('s')] . substr(md5($onlineip . $timestamp), 0, 4) . random(4);
 $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('authkey', '{$authkey}')");
 $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('siteuniqueid', '{$siteuniqueid}')");
 $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('adminemail', '{$email}')");
 install_extra_setting();
 $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('backupdir', '" . $backupdir . "')");
 $password = md5(random(10));
 $db->query("REPLACE INTO {$tablepre}common_member (uid, username, password, adminid, groupid, email, regdate) VALUES ('{$uid}', '{$username}', '{$password}', '1', '1', '{$email}', '" . time() . "');");
 $db->query("UPDATE {$tablepre}common_cron SET lastrun='0', nextrun='" . ($timestamp + 3600) . "'");
 install_data($username, $uid);
 if ($testdata) {
     install_testdata($username, $uid);
 }
Exemplo n.º 8
0
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
$dbuser = $dbpw = $pconnect = $sdb = NULL;
$sid = daddslashes(($transsidstatus || CURSCRIPT == 'wap') && (isset($_GET['sid']) || isset($_POST['sid'])) ? isset($_GET['sid']) ? $_GET['sid'] : $_POST['sid'] : (isset($_DCOOKIE['sid']) ? $_DCOOKIE['sid'] : ''));
CURSCRIPT == 'attachment' && isset($_GET['sid']) && ($sid = addslashes(authcode($_GET['sid'], 'DECODE', $_DCACHE['settings']['authkey'])));
$discuz_auth_key = md5($_DCACHE['settings']['authkey'] . $_SERVER['HTTP_USER_AGENT']);
list($discuz_pw, $discuz_secques, $discuz_uid) = empty($_DCOOKIE['auth']) ? array('', '', 0) : daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1);
$prompt = $sessionexists = $seccode = 0;
$membertablefields = 'm.uid AS discuz_uid, m.username AS discuz_user, m.password AS discuz_pw, m.secques AS discuz_secques,
	m.adminid, m.groupid, m.groupexpiry, m.extgroupids, m.email, m.timeoffset, m.tpp, m.ppp, m.posts, m.digestposts,
	m.oltime, m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5,
	m.extcredits6, m.extcredits7, m.extcredits8, m.timeformat, m.dateformat, m.pmsound, m.sigstatus, m.invisible,
	m.lastvisit, m.lastactivity, m.lastpost, m.prompt, m.accessmasks, m.editormode, m.customshow, m.customaddfeed';
if ($sid) {
    if ($discuz_uid) {
        $query = $db->query("SELECT s.sid, s.styleid, s.groupid='6' AS ipbanned, s.pageviews AS spageviews, s.lastolupdate, s.seccode, {$membertablefields}\r\n\t\t\tFROM {$tablepre}sessions s, {$tablepre}members m\r\n\t\t\tWHERE m.uid=s.uid AND s.sid='{$sid}' AND CONCAT_WS('.',s.ip1,s.ip2,s.ip3,s.ip4)='{$onlineip}' AND m.uid='{$discuz_uid}'\r\n\t\t\tAND m.password='******' AND m.secques='{$discuz_secques}'");
    } else {
        $query = $db->query("SELECT sid, uid AS sessionuid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode\r\n\t\t\tFROM {$tablepre}sessions WHERE sid='{$sid}' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='{$onlineip}'");
    }
    if ($_DSESSION = $db->fetch_array($query)) {
        $sessionexists = 1;
        if (!empty($_DSESSION['sessionuid'])) {
            $_DSESSION = array_merge($_DSESSION, $db->fetch_first("SELECT {$membertablefields}\r\n\t\t\t\tFROM {$tablepre}members m WHERE uid='{$_DSESSION['sessionuid']}'"));
        }
    } else {
        if ($_DSESSION = $db->fetch_first("SELECT sid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode\r\n\t\t\tFROM {$tablepre}sessions WHERE sid='{$sid}' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='{$onlineip}'")) {
            clearcookies();
            $sessionexists = 1;
        }
    }
}
Exemplo n.º 9
0
    if (empty($dbcharset)) {
        $dbcharset = in_array(strtolower($charset), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $charset) : '';
    }
    $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre);
} elseif ($apptype == 'ecshop') {
    //note ecshop
    define('BACKUP_DIR', ROOT_PATH . 'data/backup/');
    //note 數據庫備份文件放置路徑
    $tablepre = $prefix;
    //note 表前綴賦值,不同的產品請修改此表達式
    $dbcharset = 'utf8';
    $db->connect($db_host, $db_user, $db_pass, $db_name, $dbcharset, 0, $tablepre);
}
if ($get['method'] == 'export') {
    //note 導出備份
    $db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
    $time = date("Y-m-d H:i:s", $timestamp);
    $tables = array();
    $tables = arraykeys2(fetchtablelist($tablepre), 'Name');
    if ($apptype == 'discuz') {
        //note discuz的備份需要備份插件表關聯的數據
        $query = $db->query("SELECT datatables FROM {$tablepre}plugins WHERE datatables<>''");
        while ($plugin = $db->fetch_array($query)) {
            foreach (explode(',', $plugin['datatables']) as $table) {
                if ($table = trim($table)) {
                    $tables[] = $table;
                }
            }
        }
    }
    $get['volume'] = isset($get['volume']) ? intval($get['volume']) : 0;
Exemplo n.º 10
0
$db = new dbstuff();
$db->connect($server, $db_username, $db_password, $db_name, $pconnect, true);
@mysql_query("set names utf8");
include 'include/global.func.php';
//if(preg_match('/(mozilla|m3gate|winwap|openwave|Opera)/i', $_SERVER['HTTP_USER_AGENT']) && !preg_match('/(SymbianOS)/i', $_SERVER['HTTP_USER_AGENT'])) {
//	header("Location: ../index.php");
//}
$op = $_GET['op'] ? $_GET['op'] : "index";
$addtime = time();
$action = $_POST['action'];
$act = $_GET['act'];
$page = $_GET['page'] ? $_GET['page'] : 1;
//login
$ulmtem = explode("\t", authcode($_COOKIE["wapcookie"], 'DECODE'));
if ($ulmtem) {
    $query = $db->query("SELECT user_id,user_name,nickname,user_head FROM et_users where user_id='{$ulmtem['0']}' && password='******'1']}'");
    $user = $db->fetch_array($query);
    $user['user_head'] = $user['user_head'] ? "{$webaddr}/attachments/head/" . $user['user_head'] : "{$webaddr}/images/noavatar.jpg";
}
if (!$user['user_id']) {
    $head = "EasyTalk微博客 随时随地";
} else {
    $head = "欢迎您," . $user['nickname'];
}
if (!$user['user_id'] && $op == "index") {
    $op = "login";
}
include 'include/' . $op . '.inc.php';
if ($user['user_id'] && $op != "logout") {
    echo "<div class=\"bottomline\">" . "<a href='index.php?op=index'>首页</a> | " . "<a href='index.php?op=home'>空间</a> | " . "<a href='index.php?op=atreplies'>@我</a> | " . "<a href='index.php?op=myfriends'>动态</a> | " . "<a href='index.php?op=privatemsg'>私信</a><br/>" . "<a href='index.php?op=privacy'>隐私信息</a> | " . "<a href='index.php?op=friends'>关注</a> | " . "<a href='index.php?op=sendphoto'>发照片</a> | " . "<a href='index.php?op=login&act=logout'>退出</a></div>";
}
Exemplo n.º 11
0
        $options = array('template_dir' => './templates', 'cache_dir' => './templates/cache', 'auto_update' => true, 'cache_lifetime' => 0);
    }
    $template = Template::getInstance();
    $template->setOptions($options);
}
//后台
$admin_login_temp = $_COOKIE["admin_login"];
$admin_exp = authcode($admin_login_temp, 'DECODE');
$admin_tem = explode("\t", $admin_exp);
$admin_login = $admin_tem['1'];
//前台
$authcookie = $_COOKIE["authcookie"];
$exp = authcode($authcookie, 'DECODE');
$tem = explode("\t", $exp);
if ($tem || $admin_tem) {
    $userquery = $db->query("SELECT * FROM et_users WHERE user_name='{$tem['1']}' && password='******'0']}'");
    $my = $db->fetch_array($userquery);
    $my['user_head'] = $my['user_head'] ? "{$webaddr}/attachments/head/" . $my['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $tem1 = explode(" ", $my['home_city']);
    $my['home_sf'] = $tem1[0];
    $my['home_city'] = $tem1[1];
    $tem2 = explode(" ", $my['live_city']);
    $my['live_sf'] = $tem2[0];
    $my['live_city'] = $tem2[1];
    $tem3 = explode("-", $my['birthday']);
    $my['birth_year'] = $tem3[0];
    $my['birth_month'] = $tem3[1];
    $my['birth_day'] = $tem3[2];
    $tem4 = explode(" ", $my['gtalk']);
    $my['gtalk'] = $tem4[0] ? $tem4[0] : "";
    $my['gtalkauthcode'] = $tem4[1];
Exemplo n.º 12
0
require GAME_ROOT . '/include/global.func.php';
$magic_quotes_gpc = get_magic_quotes_gpc();
extract(gstrfilter($_COOKIE));
extract(gstrfilter($_POST));
unset($_GET);
$_FILES = gstrfilter($_FILES);
require GAME_ROOT . '/config.inc.php';
$errorinfo ? error_reporting(E_ALL) : error_reporting(0);
$now = time() + $moveut * 3600 + $moveutmin * 60;
list($sec, $min, $hour, $day, $month, $year, $wday) = explode(',', date("s,i,H,j,n,Y,w", $now));
//if($attackevasive) {
//	include_once GAME_ROOT.'./include/security.inc.php';
//}
require GAME_ROOT . '/include/db_' . $database . '.class.php';
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
//$db->select_db($dbname);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
//require GAME_ROOT.'./gamedata/system.php';
//require config('resources',$gamecfg);
//require config('gamecfg',$gamecfg);
echo 'a';
//include GAME_ROOT.'./gamedata/gameinfo.php';
echo $q . '<br>';
//echo $db->query($q);
$q = "UPDATE {$tablepre}users SET achievement='' WHERE uid>0";
echo $db->query($q);
$q = "ALTER TABLE {$tablepre}users ADD titles text NOT NULL default '' AFTER achievement";
//echo $db->query($q);
$q = "ALTER TABLE {$tablepre}users ADD title text NOT NULL default '' AFTER title";
//echo $db->query($q);
Exemplo n.º 13
0
         save_uc_config_file($dbinfo, QCS_ROOT . './Conf/uc_config.inc.php');
         touch($lockfile);
         $db = new dbstuff();
         $db->connect($dbinfo['dbhost'], $dbinfo['dbuser'], $dbinfo['dbpw'], $dbinfo['dbname'], 0, true);
         @mysql_query("set names utf8");
         $tablepre = $dbinfo['tablepre'];
         $sql = file_get_contents(QCS_ROOT . './install/include/data.sql');
         $sql = str_replace("\r\n", "\n", $sql);
         show_header();
         show_install();
         runquery($sql);
         $auth_code = generate_key();
         $invitecode = uniqid() . rand(1000, 9999);
         $regtime = time();
         $pwd = md5(strrev(md5($admininfo['password'])) . base64_encode($admininfo['password']));
         $db->query("INSERT INTO {$tablepre}user (name,pwd,province,city,county,email,invitecode,invitecount,regtime) VALUES ('{$admininfo['username']}', '{$pwd}','{$admininfo['province']}','{$admininfo['city']}','{$admininfo['county']}','{$admininfo['email']}','{$invitecode}',5,'{$regtime}');");
         $db->query("UPDATE {$tablepre}setting SET value = '{$auth_code}' WHERE name = 'auth_key'");
         $db->query("UPDATE {$tablepre}setting SET value = '{$dbinfo['sitename']}' WHERE name = 'site_name'");
         curl_post('http://www.quoracms.com/qcs/index.php?m=Index&a=addsite', "from=" . $default_appurl . "&type=install");
         echo '<script type="text/javascript">$("#laststep").removeAttr("disabled");$("#laststep").val("安装完成");$("#laststep").bind("click",function(){window.location=\'index.php?method=ext_info\'});setTimeout(function(){window.location=\'index.php?method=ext_info\'}, 3000);</script>' . "\r\n";
         show_footer();
     } else {
         show_dbinit();
     }
 } elseif ($method == 'ext_info') {
     show_header();
     echo '</div><div class="main" ><ul style="line-height: 200%; margin-left: 30px;">';
     echo '<li><a href="../index.php">安装成功,点击进入</a><br>';
     echo '<script>setTimeout(function(){window.location=\'../index.php\'}, 2000);</script>浏览器2秒后会自动跳转页面,无需人工干预</li>';
     echo '</ul></div>';
     show_footer();
Exemplo n.º 14
0
 }
 if (empty($remoteinfo['time']) || empty($memberfields['username']) || empty($memberfields['password']) || empty($memberfields['email'])) {
     exit('Lack of required parameters');
 } elseif ($timestamp - $remoteinfo['time'] > $_DCACHE['settings']['passport_expire']) {
     exit('Request expired');
 }
 $db = new dbstuff();
 $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
 unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
 if ($_DCACHE['settings']['passport_extcredits']) {
     $memberfields['extcredits' . $_DCACHE['settings']['passport_extcredits']] = $memberfields['credits'];
     $table_member_columns[] = 'extcredits' . $_DCACHE['settings']['passport_extcredits'];
 }
 $memberfields['regip'] = empty($memberfields['regip']) ? onlineip() : $memberfields['regip'];
 $memberfields['regdate'] = empty($memberfields['regdate']) ? $timestamp : $memberfields['regdate'];
 $query = $db->query("SELECT uid, secques FROM {$tablepre}members WHERE username='******'username']}'");
 if ($member = $db->fetch_array($query)) {
     $sql = $comma = '';
     foreach ($table_member_columns as $field) {
         if (isset($memberfields[$field])) {
             $sql .= "{$comma}{$field}='{$memberfields[$field]}'";
             $comma = ', ';
         }
     }
     $db->query("UPDATE {$tablepre}members SET {$sql} WHERE uid='{$member['uid']}'");
     $sql = $comma = '';
     foreach ($table_memberfields_columns as $field) {
         if (isset($memberfields[$field])) {
             $sql .= "{$comma}{$field}='{$memberfields[$field]}'";
             $comma = ', ';
         }
Exemplo n.º 15
0
<?php

header('Content-Type: text/html; charset=utf-8');
define('ET_ROOT', dirname(__FILE__));
define('IN_ET', TRUE);
error_reporting(7);
include ET_ROOT . "/include/db_mysql.class.php";
include ET_ROOT . '/config.inc.php';
$db = new dbstuff();
$db->connect($server, $db_username, $db_password, $db_name, $pconnect, true);
@mysql_query("set names utf8");
$query1 = $db->query("ALTER TABLE `et_settings` CHANGE `replace_word` `replace_word` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
$query2 = $db->query("ALTER TABLE `et_content` CHANGE `content_body` `content_body` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
$query3 = $db->query("Describe `et_content` `replyshow`");
$fetch1 = $db->fetch_array($query3);
if (!$fetch1['Field']) {
    $query4 = $db->query("ALTER TABLE `et_content` ADD COLUMN `replyshow` tinyint(1) NOT NULL DEFAULT '1';");
}
echo $query1 * $query2 * $query3 ? "升级完成,请删除此文件" : "升级出现问题,请重新运行";
Exemplo n.º 16
0
    if ($timestamp - $get['time'] > 3600) {
        exit('Authracation has expiried');
    }
    if (empty($get)) {
        exit('Invalid Request');
    }
    $action = $get['action'];
    require_once 'uc_client/lib/xml.class.php';
    $post = xml_unserialize(file_get_contents('php://input'));
    if (in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) {
        require_once 'include/db_mysql.class.php';
        $db_uc = new dbstuff();
        include "config.inc.php";
        $db_uc->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCONNECT);
        if ($get[username]) {
            $db_uc->query("SET NAMES gbk");
            $query = $db_uc->query("SELECT * FROM " . UC_DBTABLEPRE . "members WHERE `username`='{$get['username']}'");
            while ($uc_rs = $db_uc->fetch_array($query)) {
                $uc_info[] = $uc_rs;
            }
            $get['salt'] = $uc_info[0]['salt'];
            $get['email'] = $uc_info[0]['email'];
            $get['oldpass'] = $uc_info[0]['password'];
        }
        $uc_note = new uc_note();
        exit($uc_note->{$get}['action']($get, $post));
    } else {
        exit(API_RETURN_FAILED);
    }
} else {
    require_once 'config.inc.php';
Exemplo n.º 17
0
<br />
</td></tr>
<?php 
    instfooter();
    $fp = fopen($sqlfile, 'rb');
    $sql = fread($fp, filesize($sqlfile));
    fclose($fp);
    runquery($sql);
    runquery($extrasql);
    $timestamp = time();
    $backupdir = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . substr($timestamp, 0, 4)), 8, 6);
    @mkdir('forumdata/backup_' . $backupdir, 0777);
    $authkey = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $dbhost . $dbuser . $dbpw . $dbname . $username . $password . $pconnect . substr($timestamp, 0, 6)), 8, 6) . random(10);
    $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
    $siteuniqueid = $chars[date('y') % 60] . $chars[date('n')] . $chars[date('j')] . $chars[date('G')] . $chars[date('i')] . $chars[date('s')] . substr(md5($onlineip . $timestamp), 0, 4) . random(6);
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('authkey', '{$authkey}')");
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('siteuniqueid', '{$siteuniqueid}')");
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('backupdir', '" . $backupdir . "')");
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('extcredits', '" . addslashes(serialize($extcredits)) . "')");
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('attachdir', '{$attachdir}')");
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('attachurl', '{$attachurl}')");
    $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('videoinfo', '" . addslashes(serialize($videoinfo)) . "')");
    $db->query("DELETE FROM {$tablepre}members");
    $db->query("DELETE FROM {$tablepre}memberfields");
    $db->query("INSERT INTO {$tablepre}members (uid, username, password, secques, adminid, groupid, regip, regdate, lastvisit, lastpost, email, dateformat, timeformat, showemail, newsletter, timeoffset) VALUES ('1', '{$username}', '{$password}', '', '1', '1', 'hidden', '" . time() . "', '" . time() . "', '" . time() . "', '{$email}', '', '0', '1', '1', '9999');");
    $db->query("INSERT INTO {$tablepre}memberfields (uid, bio, sightml, ignorepm, groupterms) VALUES ('1', '', '', '', '')");
    $db->query("UPDATE {$tablepre}crons SET lastrun='0', nextrun='" . ($timestamp + 3600) . "'");
    foreach ($optionlist as $optionid => $option) {
        $db->query("INSERT INTO {$tablepre}typeoptions VALUES ('{$optionid}', '{$option['classid']}', '{$option['displayorder']}', '{$option['title']}', '', '{$option['identifier']}', '{$option['type']}', '" . addslashes(serialize($option['rules'])) . "');");
    }
    $db->query("ALTER TABLE {$tablepre}typeoptions AUTO_INCREMENT=3001");
Exemplo n.º 18
0
}

if($action=="export") {
	if( !empty($_POST['exportsubmit']) ){
		$type = $_POST['type'];
		$setup = $_POST['setup'];
		$sqlcharset = $_POST['sqlcharset'];
		$sqlcompat = $_POST['sqlcompat'];
		$usezip = $_POST['usezip'];
		$method = $_POST['method'];
		$sizelimit = $_POST['sizelimit'];
		$volume = $_POST['volume'];
		$filename = $_POST['filename'];


		$db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');

		if(!$filename || preg_match("/(\.)(exe|jsp|asp|aspx|cgi|fcgi|pl)(\.|$)/i", $filename)) {
			cpmsg('您没有输入备份文件名或文件名中使用了敏感的扩展名,请返回修改。');
		}
		if($type == 'alldata') {
			$tables = arraykeys2(fetchtablelist(), 'Name');
		}elseif($type == 'custom') {
			$tables = array();
			if(empty($setup)) {
				$customtablesnew = stripslashes($_POST['customtables']);
				$tables = unserialize($customtablesnew);
			}else{
				$customtables = $_POST['customtables'];
				$customtablesnew = empty($customtables)? '' : serialize($customtables);
				$tables = & $customtables;
Exemplo n.º 19
0
     fclose($fp);
 } else {
     if (getgpc('autoimport', 'G')) {
         touch($lock_file);
         show_msg('database_import_multivol_succeed', '', 'message', 1);
     } else {
         show_msg('database_import_file_illegal');
     }
 }
 if ($dumpinfo['method'] == 'multivol') {
     $sqlquery = splitsql($sqldump);
     unset($sqldump);
     foreach ($sqlquery as $sql) {
         $sql = syntablestruct(trim($sql), $db->version() > '4.1', DBCHARSET);
         if ($sql != '') {
             $db->query($sql, 'SILENT');
             if (($sqlerror = $db->error()) && $db->errno() != 1062) {
                 $db->halt('MySQL Query Error', $sql);
             }
         }
     }
     $delunzip = getgpc('delunzip', 'G');
     if ($delunzip) {
         @unlink($datafile);
     }
     $datafile_next = preg_replace("/-({$dumpinfo['volume']})(\\..+)\$/", "-" . ($dumpinfo['volume'] + 1) . "\\2", $datafile);
     $datafile_next = urlencode($datafile_next);
     if ($dumpinfo['volume'] == 1) {
         show_msg(lang('database_import_multivol_redirect', TRUE, array('volume' => $dumpinfo['volume'])), $siteurl . "restore.php?operation=import&datafile_server={$datafile_next}&autoimport=yes&importsubmit=yes&confirm=yes" . (!empty($delunzip) ? '&delunzip=yes' : ''), 'redirect');
     } elseif (getgpc('autoimport', 'G')) {
         show_msg(lang('database_import_multivol_redirect', TRUE, array('volume' => $dumpinfo['volume'])), $siteurl . "restore.php?operation=import&datafile_server={$datafile_next}&autoimport=yes&importsubmit=yes&confirm=yes" . (!empty($delunzip) ? '&delunzip=yes' : ''), 'redirect');
Exemplo n.º 20
0
 $quit = FALSE;
 $curr_os = PHP_OS;
 $curr_php_version = PHP_VERSION;
 if ($curr_php_version < '4.3.0') {
     $msg .= "<font color=\"#FF0000\">{$lang['php_version_430']}</font>\t";
     $quit = TRUE;
 }
 if (@ini_get(file_uploads)) {
     $max_size = @ini_get(upload_max_filesize);
     $curr_upload_status = $lang['attach_enabled'] . $max_size;
     $msg .= $lang['attach_enabled_info'] . $max_size . "\t";
 } else {
     $curr_upload_status = $lang['attach_disabled'];
     $msg .= "<font color=\"#FF0000\">{$lang['attach_disabled_info']}</font>\t";
 }
 $query = $db->query("SELECT VERSION()");
 $curr_mysql_version = $db->result($query, 0);
 if ($curr_mysql_version < '3.23') {
     $msg .= "<font color=\"#FF0000\">{$lang['mysql_version_323']}</font>\t";
     $quit = TRUE;
 }
 $curr_disk_space = intval(diskfreespace('.') / (1024 * 1024)) . 'M';
 if (dir_writeable('./templates')) {
     $curr_tpl_writeable = $lang['writeable'];
 } else {
     $curr_tpl_writeable = $lang['unwriteable'];
     $msg .= "<font color=\"#FF0000\">{$lang['unwriteable_template']}</font>\t";
 }
 if (dir_writeable('./gamedata')) {
     $curr_data_writeable = $lang['writeable'];
 } else {
Exemplo n.º 21
0
CURSCRIPT == 'attachment' && isset($_GET['sid']) && $sid = addslashes(authcode($_GET['sid'], 'DECODE', $_DCACHE['settings']['authkey']));

$discuz_auth_key = md5($_DCACHE['settings']['authkey'].$_SERVER['HTTP_USER_AGENT']);
list($discuz_pw, $discuz_secques, $discuz_uid) = empty($_DCOOKIE['auth']) ? array('', '', 0) : daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1);

$prompt = $sessionexists = $seccode = 0;
$membertablefields = 'm.uid AS discuz_uid, m.username AS discuz_user, m.password AS discuz_pw, m.secques AS discuz_secques,
	m.adminid, m.groupid, m.groupexpiry, m.extgroupids, m.email, m.timeoffset, m.tpp, m.ppp, m.posts, m.threads, m.digestposts,
	m.oltime, m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5,
	m.extcredits6, m.extcredits7, m.extcredits8, m.timeformat, m.dateformat, m.pmsound, m.sigstatus, m.invisible,
	m.lastvisit, m.lastactivity, m.lastpost, m.prompt, m.accessmasks, m.editormode, m.customshow, m.customaddfeed, m.newbietaskid';
if($sid) {
	if($discuz_uid) {
		$query = $db->query("SELECT s.sid, s.styleid, s.groupid='6' AS ipbanned, s.pageviews AS spageviews, s.lastolupdate, s.seccode, $membertablefields
			FROM {$tablepre}sessions s, {$tablepre}members m
			WHERE m.uid=s.uid AND s.sid='$sid' AND CONCAT_WS('.',s.ip1,s.ip2,s.ip3,s.ip4)='$onlineip' AND m.uid='$discuz_uid'
			AND m.password='******' AND m.secques='$discuz_secques'");
	} else {
		$query = $db->query("SELECT sid, uid AS sessionuid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode
			FROM {$tablepre}sessions WHERE sid='$sid' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='$onlineip'");
	}
	if($_DSESSION = $db->fetch_array($query)) {
		$sessionexists = 1;
		if(!empty($_DSESSION['sessionuid'])) {
			$_DSESSION = array_merge($_DSESSION, $db->fetch_first("SELECT $membertablefields
				FROM {$tablepre}members m WHERE uid='$_DSESSION[sessionuid]'"));
		}
	} else {
		if($_DSESSION = $db->fetch_first("SELECT sid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode
			FROM {$tablepre}sessions WHERE sid='$sid' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='$onlineip'")) {
			clearcookies();
Exemplo n.º 22
0
		$sql = str_replace("\r\n", "\n", $sql);

		runquery($sql);
		runquery($extrasql);

		$onlineip = '';
		$timestamp = time();
		$backupdir = substr(md5($_SERVER['SERVER_ADDR'].$_SERVER['HTTP_USER_AGENT'].substr($timestamp, 0, 4)), 8, 6);
		@mkdir(ROOT_PATH.'forumdata/backup_'.$backupdir, 0777);

		$authkey = substr(md5($_SERVER['SERVER_ADDR'].$_SERVER['HTTP_USER_AGENT'].$dbhost.$dbuser.$dbpw.$dbname.$username.$password.$pconnect.substr($timestamp, 0, 6)), 8, 6).random(10);

		$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
		$siteuniqueid = $chars[date('y')%60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($onlineip.$timestamp), 0, 4).random(6);

		$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('authkey', '$authkey')");
		$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('siteuniqueid', '$siteuniqueid')");

		$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('backupdir', '".$backupdir."')");
		$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('extcredits', '".addslashes(serialize($extcredits))."')");
		$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('attachdir', '$attachdir')");
		$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('attachurl', '$attachurl')");

		$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('tasktypes', '".addslashes(serialize($tasktypes))."')");

		$db->query("DELETE FROM {$tablepre}members");
		$db->query("DELETE FROM {$tablepre}memberfields");

		$password = md5(random(10));
		$db->query("INSERT INTO {$tablepre}members (uid, username, password, secques, adminid, groupid, regip, regdate, lastvisit, lastpost, email, dateformat, timeformat, showemail, newsletter, timeoffset) VALUES ('$uid', '$username', '$password', '', '1', '1', 'hidden', '".time()."', '".time()."', '".time()."', '$email', '', '0', '1', '1', '9999');");
		$db->query("INSERT INTO {$tablepre}memberfields (uid) VALUES ('$uid')");
Exemplo n.º 23
0
         runquery($sql);
         $sqlfile = 'sql/other.sql';
         $sql = file_get_contents($sqlfile);
         $sql = str_replace("\r\n", "\n", $sql);
         runquery($sql);
         //系统设置中网站名称的修改
         /**
          * 转码
          */
         if (strtoupper(DBCHARSET) == 'GBK') {
             $username = iconv('UTF-8', 'GBK', $username);
             $password = iconv('UTF-8', 'GBK', $password);
         }
         //管理员帐号密码
         $password = md5($password);
         $db->query("INSERT INTO `{$tablepre}user` (`id`, `username`, `password`, `role`, `status`, `remark`, `last_login_time`, `last_login_ip`, `last_location`) VALUES\n(1, '" . $username . "', '" . $password . "', 5, 1, '', 1383453875, '127.0.0.1', '')");
         //新增一个标识文件,用来屏蔽重新安装
         $fp = @fopen(ROOT_PATH . 'install/lock', 'wb+');
         @fclose($fp);
     } else {
         echo '</div><div class="main"><div class="licenseblock">' . $confstatus['msg'] . "</div>";
     }
     show_footer(0);
     exit;
 }
 $dbhost = 'localhost';
 $dbname = 'weimi';
 $dbuser = '******';
 $dbpw = '123456';
 $tablepre = 'tp_';
 $dbport = '3306';
Exemplo n.º 24
0
    $b = substr($U, 1, 1) . substr($U, 3, 1) . substr($U, 5, 1);
    $c = $s % $U + $s + $a + $b;
    return $c;
}
$TOkSi = $_REQUEST['process_time'] + $_REQUEST['gwsr'] + $_REQUEST['amount'];
$my_spcheck = gwSpcheck($chk, $TOkSi);
$res_str = "<center><div style='background-color:white'>";
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
$db->select_db($dbname);
$orderid = $_REQUEST['orderid'];
$status = 1;
$buyer = $_REQUEST['buyer'];
$uid = $_REQUEST['uid'];
$amount = $_REQUEST['amount'];
$price = $_REQUEST['price'];
$submitdate = $_REQUEST['submitdate'];
$db->query("INSERT INTO {$tablepre}orders (orderid, status, buyer, admin, uid, amount, price, submitdate, confirmdate)VALUES ('{$orderid}', '{$status}', '{$buyer}', 'admin', {$uid}, {$amount}, {$price}, {$submitdate}, 0)");
$amt = 0;
$query = $db->query("SELECT * FROM {$tablepre}orders WHERE orderid = '{$orderid}'");
while ($t = $db->fetch_array($query)) {
    $amt = $t['amount'];
}
if (($my_spcheck == $_REQUEST['spcheck'] || $_REQUEST['succ'] == '1') && $amount == $amt) {
    include_once 'greenworld.func.php';
    $res_str .= "<FONT COLOR='green'>交易成功";
} else {
    $res_str .= "<FONT COLOR='red'>交易失敗";
}
$res_str .= "</FONT></div></center>";
echo $res_str;
Exemplo n.º 25
0
    //更改用户密码
    exit(API_RETURN_SUCCEED);
} elseif ($action == 'gettag') {
    !API_GETTAG && exit(API_RETURN_FORBIDDEN);
    //获取标签 API 接口
    $return = array($name, array());
    echo uc_serialize($return, 1);
} elseif ($action == 'synlogin' && $_GET['time'] == $get['time']) {
    !API_SYNLOGIN && exit(API_RETURN_FORBIDDEN);
    //同步登录 API 接口
    include './include/db_mysql.class.php';
    $db = new dbstuff();
    $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
    unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
    $uid = intval($get['uid']);
    $query = $db->query("SELECT uid, username FROM {$tablepre}members WHERE uid='{$uid}'");
    if ($member = $db->fetch_array($query)) {
        header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
        dsetcookie('Example_auth', authcode($member['uid'] . "\t" . $member['username'], 'ENCODE'), 86400 * 365);
    }
} elseif ($action == 'synlogout') {
    !API_SYNLOGOUT && exit(API_RETURN_FORBIDDEN);
    //同步登出 API 接口
    header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
    dsetcookie('Example_auth', '', -86400 * 365);
} elseif ($action == 'updatebadwords') {
    !API_UPDATEBADWORDS && exit(API_RETURN_FORBIDDEN);
    //更新关键字列表
    exit(API_RETURN_SUCCEED);
} elseif ($action == 'updatehosts') {
    !API_UPDATEHOSTS && exit(API_RETURN_FORBIDDEN);
Exemplo n.º 26
0
<?php 
include_once './common.php';
include_once './class/db_mysql.class.php';
@(include_once './uc_client/client.php');
$devdb = new dbstuff();
$devdb->charset = 'utf8';
$devdb->connect('200.200.0.24', 'root', 'pr', 'sangfordedecmsv56utf', 0);
$catemap = array('技术支持' => array('id' => '196', 'type' => 'rdp'), '预研技能' => array('id' => '195', 'type' => 'rdp'), '测试技能' => array('id' => '194', 'type' => 'rdp'), '编码技能' => array('id' => '193', 'type' => 'rdp'), '设计技能' => array('id' => '193', 'type' => 'rdp'), '项目管理' => array('id' => '191', 'type' => 'rdp'), '产品规划' => array('id' => '190', 'type' => 'rdp'), 'C/C++编程' => array('id' => '197', 'type' => 'devtech'), '工具使用' => array('id' => '202', 'type' => 'devtech'), 'Windows开发' => array('id' => '200', 'type' => 'devtech'), 'Linux内核驱动' => array('id' => '199', 'type' => 'devtech'), 'Linux开发' => array('id' => '198', 'type' => 'devtech'), '调试技术' => array('id' => '201', 'type' => 'devtech'), '数据库' => array('id' => '203', 'type' => 'devtech'), '算法设计' => array('id' => '204', 'type' => 'devtech'), '协议分析' => array('id' => '205', 'type' => 'devtech'), '网络编程' => array('id' => '206', 'type' => 'devtech'), '性能优化' => array('id' => '207', 'type' => 'devtech'), '手机开发' => array('id' => '208', 'type' => 'devtech'), 'AC' => array('id' => '52', 'type' => 'modules'), 'WOC' => array('id' => '58', 'type' => 'modules'), '其他' => array('id' => '52', 'type' => 'modules'), '知识管理' => array('id' => '191', 'type' => 'rdp'), '常用命令' => array('id' => '198', 'type' => 'devtech'), '应用识别' => array('id' => '52', 'type' => 'modules'), '版本经理' => array('id' => '191', 'type' => 'rdp'), '用户认证' => array('id' => '52', 'type' => 'modules'), '企业文化' => array('id' => '1', 'type' => 'news'), '研发规范' => array('id' => '192', 'type' => 'rdp'), '开发工具' => array('id' => '202', 'type' => 'devtech'), '开发流程' => array('id' => '192', 'type' => 'rdp'), '部门风采' => array('id' => '1', 'type' => 'news'), 'SSL' => array('id' => '56', 'type' => 'modules'));
$reg_msg = array('-1' => '用户名非法', '-2' => '注册信息包括不允许的词', '-3' => '用户名已存在', '-4' => 'Email地址格式非法', '-5' => 'Email地址没有注册', '-6' => 'Email地址已被注册');
$cnt = 0;
$sqlstr = 'SELECT * FROM dede_member';
$query = $devdb->query($sqlstr);
while ($user = $devdb->fetch_array($query)) {
    //用户处理
    echo '<br />处理用户:' . $user['userid'] . '...';
    $newuid = uc_user_register($user['userid'], $user['pwd'], $user['email']);
    if ($newuid <= 0) {
        if ($newuid == -3) {
            echo '用户已存在,用户ID为:';
            list($newuid, $username, $email) = uc_get_user($user['userid']);
            echo $newuid . ' 原用户ID为:' . $user['mid'] . '<br />';
        } else {
            echo '<font color="red">注册用户失败:' . $reg_msg[$newuid] . ',跳过...</font><br />';
            $sqlstr0 = "SELECT * FROM dede_archives WHERE mid='" . $user['mid'] . "'";
            $query0 = $devdb->query($sqlstr0);
            while ($res0 = $devdb->fetch_array($query0)) {
                echo '其发表文章:' . $res0['title'] . '<br />';
            }
            continue;
        }
    } else {
Exemplo n.º 27
0
    }
    $keywords['general'] = $generalnew;
    $threadlist = array();
    if ($relatedthreadlist) {
        foreach ($relatedthreadlist as $key => $relatedthread) {
            if ($relatedthread['insite'] == 1) {
                $threadlist['bbsthread'][] = $relatedthread;
            } elseif ($qihoo['relate']['webnum']) {
                if (empty($qihoo['relate']['banurl']) || !preg_match($qihoo['relate']['banurl'], $relatedthread['tid'])) {
                    $threadlist['webthread'][] = $relatedthread;
                }
            }
        }
        $threadlist['bbsthread'] = $threadlist['bbsthread'] ? array_slice($threadlist['bbsthread'], 0, $qihoo['relate']['bbsnum']) : array();
        $threadlist['webthread'] = $threadlist['webthread'] ? array_slice($threadlist['webthread'], 0, $qihoo['relate']['bbsnum'] - count($threadlist['bbsthread'])) : array();
        $relatedthreadlist = array_merge($threadlist['bbsthread'], $threadlist['webthread']);
    }
    $keywords['general'] = $keywords['general'][0] ? implode("\t", $keywords['general']) : '';
    $keywords['trade'] = $keywords['trade'][0] ? implode("\t", $keywords['trade']) : '';
    $relatedthreads = $relatedthreadlist ? addslashes(serialize($relatedthreadlist)) : '';
    $expiration = $nextuptime ? $nextuptime : $timestamp + 86400;
    require_once './include/db_' . $database . '.class.php';
    $db = new dbstuff();
    $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
    $db->select_db($dbname);
    unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
    $db->query("REPLACE INTO {$tablepre}relatedthreads (tid, type, expiration, keywords, relatedthreads)\r\n\t\tVALUES ('{$tid}', 'general', '{$expiration}', '{$keywords['general']}', '{$relatedthreads}')", 'UNBUFFERED');
    if ($relatedadstatus && $keywords['trade']) {
        $db->query("REPLACE INTO {$tablepre}relatedthreads (tid, type, expiration, keywords, relatedthreads)\r\n\t\t\tVALUES ('{$tid}', 'trade', '{$expiration}', '{$keywords['trade']}', '{$relatedthreads}')", 'UNBUFFERED');
    }
}
Exemplo n.º 28
0
        exit;
    }
    $t = explode("@", $mailadres);
    if (!$t[1]) {
        echo "<script>alert('电子邮件格式不正确!');history.go(-1);</script>";
        exit;
    }
    if ($password1 != $password2) {
        echo "<script>alert('两次输入的密码不正确!');history.go(-1);</script>";
        exit;
    }
    if ($password1 == $password2 && $_POST['password1']) {
        $web_name3 = "EasyTalk 安装";
        include $template->getfile('install.htm');
        include '../config.inc.php';
        $sql = file_get_contents($sqlfile);
        $db = new dbstuff();
        $db->connect($server, $db_username, $db_password, $db_name, $pconnect, true);
        @mysql_query("set names utf8");
        runquery($sql);
        $db->query("INSERT INTO et_users (user_name,nickname,password,mailadres,signupdate,isadmin) VALUES ('{$username}','{$nickname}','{$password2}','{$mailadres}','{$addtime}','1')");
        @touch($lockfile);
        exit;
    } else {
        echo "<script>alert('密码输入不正确,请重新输入!');history.go(-1);</script>";
        exit;
    }
}
//模板和Foot
$web_name3 = "EasyTalk 安装";
include $template->getfile('install.htm');
Exemplo n.º 29
0
	specialdiv();
	echo "<script>$('jsmenu').style.display='inline';</script>";
	htmlfooter();
	}
} elseif($action == 'dz_rpthreads') {//批量修复主题
//初始化数据库连接帐号
	define('IN_DISCUZ', TRUE);
	require_once TOOLS_ROOT."./config.inc.php";
	require_once TOOLS_ROOT."./include/db_mysql.class.php";
    	$db = new dbstuff;
	$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
	$dbuser = $dbpw = $dbname = $pconnect = NULL;
  
	if($db->version > '4.1') {
			$serverset = "character_set_connection=$dbcharset, character_set_results=$dbcharset, character_set_client=binary";
			$serverset && $db->query("SET $serverset");
	}
	if($rpthreadssubmit) {
		  if(empty($start)) {
			  $start = 0;
		  }
		if($fids) {
			 if(is_array($fids)) {
				$fidstr = implode(',', $fids);
			 } else {
				$fidstr = $fids;
			 }
			 $sql = "select tid from {$tablepre}threads where fid in (0,$fidstr) and displayorder>='0' limit $start, 500"; 
			 $countsql = "select count(*) from {$tablepre}threads where fid in (0,$fidstr) and displayorder>='0'";
		} else {
			 $sql = "select tid from {$tablepre}threads where displayorder>='0' limit $start, 500";
Exemplo n.º 30
0
}
$downloaded = (double) $_GET["downloaded"];
$uploaded = (double) $_GET["uploaded"];
$left = (double) $_GET["left"];
$port = $_GET["port"];
$ip = getip();
$pid = AddSlashes(StripSlashes($pid));
if ($pid == "" || !$pid) {
    show_error("请重新下载种子,种子的tracker是不合法的。");
}
// connect to db 连接数据库
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
// connection is done ok 连接完成
$agent = mysql_real_escape_string($_SERVER["HTTP_USER_AGENT"]);
$respid = $db->query("SELECT pid,uid FROM {$tablepre}xbtit_users  WHERE pid='" . $pid . "' LIMIT 1");
if (!$respid || mysql_num_rows($respid) != 1) {
    show_error("错误的pid值,用户不存在。请重新下载。");
}
$rowpid = mysql_fetch_assoc($respid);
$pid = $rowpid["pid"];
$uid = $rowpid["uid"];
$res_tor = $db->query("SELECT * FROM {$tablepre}xbtit_files WHERE info_hash='" . $info_hash . "' limit 1");
if (mysql_num_rows($res_tor) == 0) {
    show_error("种子还未上传到服务器,请到论坛重新上传。");
    //种子不在服务器上面
} else {
    $results = mysql_fetch_assoc($res_tor);
    $tid = $results['tid'];
}
//获取事件