📄 vb3.php
字号:
<?php//////////////////////////// COPYRIGHT NOTICE //////////////////////////////// This script is part of BosDates, a software application by BosDev, Inc //// Use of any kind of part or all of this script or modification of this //// script requires a license from BosDev, Inc. Use or modification of //// this script without a license constitutes Software Piracy and will //// result in legal action from BosDev, Inc. All rights reserved. //// http://www.bosdev.com sales@bosdev.com //// //// BosDates Copyright 2003, BosDev, Inc. ////////////////////////////////////////////////////////////////////////////////Special variable required by vBulletin 3global $vblicense;$vblicense = "";//Setup variables for the database information$intUserTable = "user";$intUserID = "userid";$intUserName = "username";$intUserEmail = "email";//See if the user is logged infunction authenticateUser() { global $integration_prefix,$int_link,$cookie_prefix,$cookie_path,$cookie_domain,$vblicense; if($_COOKIE[$cookie_prefix."userid"] != "" && $_COOKIE[$cookie_prefix."password"] != "") { $uid = $_COOKIE[$cookie_prefix."userid"]; if($uid == "") { $uid = 0; } $result = query("SELECT password,salt FROM {$integration_prefix}user WHERE userid=$uid",$int_link); list($check_password,$check_salt) = mysql_fetch_row($result); $cookiepass = md5($check_password . $vblicense); if($cookiepass == $_COOKIE[$cookie_prefix."password"]) { return true; } else { return false; } } }//Check the username/passwordfunction validateLogin($user,$pass) { Global $int_link,$integration_prefix,$vblicense; $user = protect($user); $result = query("SELECT userid,password,salt FROM {$integration_prefix}user WHERE username='$user'",$int_link); list($check_id,$check_password,$check_salt) = mysql_fetch_row($result); $md5cookpass = md5(md5(md5($pass) . $check_salt) . $vblicense); $md5dbpass = md5($check_password . $vblicense); $return = $check_id; if ($md5cookpass != $md5dbpass) { $return = ""; } return $return; }//Set the cookiefunction setLogin($chkLogin,$username,$password) { Global $int_link,$integration_prefix,$cookie_prefix,$cookie_path,$cookie_domain,$vblicense; $username = protect($username); $result = query("SELECT userid,password,salt FROM {$integration_prefix}user WHERE username='$username'",$int_link); list($check_id,$check_password,$check_salt) = mysql_fetch_row($result); $dbpassword = md5(md5($password) . $check_salt); $cookiepass = md5($dbpassword . $vblicense); setcookie( $cookie_prefix."userid", $check_id, time()+2592000,$cookie_path,$cookie_domain); setcookie( $cookie_prefix."password", $cookiepass, time()+2592000,$cookie_path,$cookie_domain); }//Clear the cookiefunction clearLogin() { Global $cookie_prefix,$cookie_path,$cookie_domain; setcookie( $cookie_prefix."userid", "", time()-3600,$cookie_path,$cookie_domain); setcookie( $cookie_prefix."password", "", time()-3600,$cookie_path,$cookie_domain); setcookie( "sessionhash", "", time()-3600,$cookie_path,$cookie_domain); return; }//Get the user idfunction getUserID() { global $cookie_prefix; $userID = $_COOKIE[$cookie_prefix."userid"]; return $userID; }//Get the users infofunction getUserInfo($userID=0) { Global $int_link,$integration_prefix,$cookie_prefix,$cookie_path,$cookie_domain,$vblicense,$uus_link; if($userID == 0) { if($_COOKIE[$cookie_prefix."userid"] == "") { return false; } $userID = $_COOKIE[$cookie_prefix."userid"]; } $result = query("SELECT bc1,bc2,bc3 FROM bosdevUUS WHERE id=$userID",$uus_link); list($isAdmin,$rules,$fees) = mysql_fetch_row($result); $result = query("SELECT username,email FROM {$integration_prefix}user WHERE userid=$userID",$int_link); list($username,$email) = mysql_fetch_row($result); $userInfo['name'] = $username; $userInfo['email'] = $email; $userInfo['admin'] = $isAdmin; $userInfo['rules'] = $rules; $userInfo['fees'] = $fees; return $userInfo; }?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -