} } else { $sql = "DELETE FROM `cookiedata` WHERE `user_name`='{$usertmp}' AND `user_cookie` ='{$cookievalue}'"; delete($sql); setcookie("loginname", "", time() - 3600, "/"); setcookie("loginid", "", time() - 3600, "/"); $logincheck = 0; } } } else { die(""); } } if (!is_null($user)) { $sql = "SELECT `user_id` FROM `users` WHERE `user_name`='{$user}'"; $user_id = queryValue($sql); } if (check_data('authid', 'get') && ctype_digit($_GET['authid'])) { $authid = $_GET['authid']; } if (!is_null($user_id) && !is_null($authid)) { $sql = "SELECT * FROM `authdata` WHERE `user_id`='{$user_id}' AND `auth_id`='{$authid}'"; $row = queryRow($sql); } if ($row) { $time = date('Y-m-d H:i:s'); $region = $row['region']; if ($region != "CN" && $region != "EU") { $region = "US"; } $sql = "SELECT * FROM `synctime` WHERE `region`='{$region}'";
public static function pseudoExists($pseudo) { $r = queryValue(' select count(*) from joueur where joueur_pseudo=\'' . addslashes($pseudo) . '\' '); return intval($r) != 0; }
$selectpic = db_iconv('selectpic', "post", TRUE, true); if (checkauthname($authname) && checkauthregion($region) && checkauthselectpic($selectpic)) { $region = $strregion[$region]; try { $auth = @Authenticator::generate($region); $authserial = $auth->serial(); $authserect = $auth->secret(); $authrestorecode = $auth->restore_code(); if (isset($_POST['morenauthset'])) { if ($_POST['morenauthset'] == "on") { $sql = "UPDATE `authdata` SET `auth_moren`=0 WHERE `user_id`='{$user_id}' AND `auth_moren`=1"; update($sql); $auth_moren = 1; } } if (queryValue("SELECT COUNT(*) FROM `authdata` WHERE `user_id`='{$user_id}' AND `auth_moren`=1") == 0) { $auth_moren = 1; } if (is_null($authserial)) { $authaddbyservererrorid = 5; } else { insert("INSERT INTO `authdata`(`user_id`, `auth_moren`, `auth_name`, `serial`, `region`, `secret`,`restore_code`, `auth_img`) VALUES ('{$user_id}','{$auth_moren}','{$authname}','{$authserial}','{$region}','{$authserect}','{$authrestorecode}','{$selectpic}')"); $authaddbyservererrorid = 0; $sql = "SELECT `auth_id` FROM `authdata` WHERE `serial`='{$authserial}' AND `user_id`='{$user_id}' AND `auth_name`='{$authname}'"; $rowtemp = queryRow($sql); $auth_id = $rowtemp['auth_id']; if ($auth_id > 0) { $authaddbyservererrorid = 0; } else { $authaddbyservererrorid = 5; }
function check_vaild_post_unixtime($unixtime, $username) { if (!ctype_digit($unixtime)) { return false; } if (abs(time() - $unixtime) > 900) { //与服务器差别均较大的unix值抛弃 return false; } $userunixindb = queryValue("select `lastused_session_time` from `users` where `user_name`='{$username}'"); if ($userunixindb - $unixtime < 600) { //数据库时间小于当前时间前移5分钟的,认可 $writedata = $userunixindb < $unixtime ? $unixtime : $userunixindb; update("update `users` set `lastused_session_time`= '{$writedata}' where `user_name`='{$username}'"); return true; } return false; }
<?php defined("ZHANGXUAN") or die("no hacker."); $days = round((time() - strtotime("2013-06-20")) / 3600 / 24); $sql = "SELECT COUNT(*) FROM `users` UNION SELECT COUNT(*) FROM `authdata`;"; $result = @mysqli_query($dbconnect, $sql); $rowtemp = mysqli_fetch_array($result); $user_count = queryValue($sql); $rowtemp = mysqli_fetch_array($result); $auth_count = $rowtemp[0]; //fixed mysql func ?> <div id="layout-bottom"> <div id="homewrapperbotton"> <div id="footer"> <div id="footline"> <div id="sitemap"> <div class="column"> <h3 class="pages"> <a href="<?php echo SITEHOST; ?> " tabindex="100">站点页面</a> </h3> <ul> <li><a href="<?php echo SITEHOST; ?> welcome.php">WELCOME</a></li> <li><a href="<?php echo SITEHOST;
<?php require_once 'classes/class.phpmailer.php'; //IXWEBHOSTING使用模式1 include 'includes/config.php'; $topnavvalue = "修改密码"; include 'includes/html_toubu/html_toubu.php'; include 'includes/page_inc/header_normal.php'; if ($logincheck == 0) { $navurladd = SITEHOST . "welcome.php"; $topnavvalue = "WELCOME"; include 'includes/page_inc/welcome_inc.php'; } else { $sql = "SELECT `user_right` FROM `users` WHERE `user_name`='{$user}'"; $user_right = queryValue($sql); if ($user_right == 0) { include 'includes/changepsd/changepsd_check.php'; if ($changepsderrorid == 0) { $navurladd = SITEHOST . "changepsd.php"; $jumptxt = "密码修改成功,已向注册邮箱发送提示邮件,即将跳转到我的账号。"; $jumpurl = SITEHOST . "account.php"; include 'includes/changepsd/changepsd_checked.php'; } else { $error_html_code[1] = "验证码输入错误。"; $error_html_code[2] = "内容输入错误。"; $error_html_code[3] = "没登入啊少年,不要这么变态啊。"; $error_html_code[4] = "两次输入的密码不一致。"; $error_html_code[5] = "旧密码输入错误。"; include 'includes/page_inc/changepsd_inc.php'; } } else {
private function insert() { $q = 'insert into '; $q .= $this->table_name; $new_id = queryValue(' select ' . $this->table_name . '_id from ' . $this->table_name . ' order by ' . $this->table_name . '_id desc limit 1 '); $new_id = intval($new_id) + 1; $this->item_id = $new_id; $this->id = $new_id; $keys = array(); $values = array(); foreach ($this->fields as $field) { $keys[] = $field; $values[] = "'" . addslashes($this->{$this->getMinName($field)}) . "'"; } $keys = implode(', ', $keys); $values = implode(', ', $values); $q .= '(' . $keys . ') values(' . $values . ')'; querySimple($q); }
function semesterOptionList($selectedSid = "", $addblank = false, $defaultText = null, $fallOnly = false) { // Make options list of semesters in database $result = mysql_query("select sid,name,snum from semester " . ($fallOnly ? "where sid regexp '^f' " : "") . "order by snum desc"); if (!$result) { die("Cannot get semester list. " . mysql_error()); } // Add blank semester if ($addblank) { echo " <option value=''"; if ($selectedSid == "") { echo " selected='yes'"; } echo ">{$defaultText}</option>\r\n"; } // If no selection specified, use current "active" semester if ($selectedSid == "") { $selectedSid = queryValue("select sid from semester where status='A'", ""); } // List semesters $first = true; while ($row = mysql_fetch_assoc($result)) { if ($first) { // Select first one if no selection specified $first = false; if ($selectedSid == "" && !$addblank) { $sel = "selected='yes'"; } } else { $sel = ""; } // Mark designed one as selected if ($selectedSid == $row['sid']) { $sel = "selected='yes'"; } echo " <option {$sel} value='" . $row['sid'] . "'>" . $row['name'] . "</option>\r\n"; } }