📄 uus.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. ////////////////////////////////////////////////////////////////////////////////See if user is logged infunction authenticateUser() { global $uus_link,$cookie_prefix; if(!isset($_COOKIE[$cookie_prefix."bdUserID"])) { return false; } $chkData = substr($_COOKIE[$cookie_prefix."bdUserID"],0,8).substr($_COOKIE[$cookie_prefix."bdUserID"],-8); $userID = intval(substr($_COOKIE[$cookie_prefix."bdUserID"],8,strlen($_COOKIE[$cookie_prefix."bdUserID"])-16)); $result = query("SELECT username,password FROM bosdevUUS WHERE id=$userID",$uus_link); list($chkUsr,$chkPass) = mysql_fetch_row($result); if($chkData == substr(md5($chkUsr),0,8).substr($chkPass,0,8)) { return true; } else { return false; } }//Check the username/passwordfunction validateLogin($user,$pass) { global $uus_link; $user = protect($user); $pass = md5(protect($pass)); $result = query("SELECT id FROM bosdevUUS WHERE username='$user' AND password='$pass' AND status=1",$uus_link); list($userID) = mysql_fetch_row($result); return $userID; }//Set the cookiefunction setLogin($chkLogin,$username,$password) { global $cookie_prefix,$cookie_path,$cookie_domain; $cookieData = substr(md5($username),0,8).$chkLogin.substr(md5($password),0,8); setcookie($cookie_prefix."bdUserID",$cookieData,time() + 604800,$cookie_path,$cookie_domain); }//Clear the cookiefunction clearLogin() { global $cookie_prefix,$cookie_path,$cookie_domain; setcookie($cookie_prefix."bdUserID","",time() - 604800,$cookie_path,$cookie_domain); }//Get the user idfunction getUserID() { global $cookie_prefix; $userID = protect(substr($_COOKIE[$cookie_prefix."bdUserID"],8,-8)); return $userID; }//Get the users infofunction getUserInfo($userID=0) { global $uus_link,$cookie_prefix; if($userID == 0) { if($_COOKIE[$cookie_prefix."bdUserID"] == "") { return false; } $userID = protect(substr($_COOKIE[$cookie_prefix."bdUserID"],8,-8)); } $result = query("SELECT username,email,bc1,bc2,bc3 FROM bosdevUUS WHERE id=$userID",$uus_link); list($username,$email,$isAdmin,$rules,$fees) = 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 + -