ubb.php

来自「日程 BosDates v4.5 Copyright ?2004-2005 B」· PHP 代码 · 共 92 行

PHP
92
字号
<?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.                    ////////////////////////////////////////////////////////////////////////////////Setup variables for the database information$intUserTable = "Users";$intUserID = "U_Number";$intUserName = "U_Username";$intUserEmail = "U_Email";//See if the user is logged infunction authenticateUser() {	global $integration_prefix,$int_link,$cookie_prefix,$cookie_path,$cookie_domain;	if($_COOKIE[$cookie_prefix."w3t_myid"] != "") {        	$uid = $_COOKIE[$cookie_prefix."w3t_myid"];		$result = query("SELECT U_Password FROM {$integration_prefix}Users WHERE U_Number='$uid'",$int_link);		list($check_password) = mysql_fetch_row($result);		$db6password = md5($check_id.$check_password);		if($_COOKIE[$cookie_prefix."w3t_myid"] == $db6password) { return true; }			else { return false; }		}		else { return false; }	}//Check the username/passwordfunction validateLogin($user,$pass) {	global $integration_prefix,$int_link;	$user = protect($user);	$pass = md5(protect($pass));	$result = query("SELECT U_Number FROM {$integration_prefix}Users WHERE U_Username='$user' AND U_Password='$pass'",$int_link);	list($userID) = mysql_fetch_row($result);	return $userID;	}//Set the cookiefunction setLogin($chkLogin,$username,$password) {	global $cookie_prefix,$cookie_path,$cookie_domain;	$db6password = md5($chkLogin.md5($password));    	srand((double)microtime()*1000000);    	$newsessionid = md5(rand(0,32767));    	$date = time()+($Globals['gmtoffset']*3600);	setcookie($cookie_prefix."w3t_myid",$chkLogin,time() + 2592000,$cookie_path,$cookie_domain);	setcookie($cookie_prefix."w3t_key",$db6password,time() + 2592000,$cookie_path,$cookie_domain);	setcookie($cookie_prefix."w3t_mysess","$newsessionid","0",$cookie_path,$cookie_domain);	}//Clear out the users cookies so they can logoutfunction clearLogin() {	Global $integration_prefix,$int_link,$cookie_prefix,$cookie_path,$cookie_domain;	$uid = $_COOKIE[$cookie_prefix."w3t_myid"];	$result = query("UPDATE {$integration_prefix}Users SET U_SessionId = '' WHERE U_Number='$uid'",$int_link);	setcookie($cookie_prefix."w3t_myid","",time() - 3600,$cookie_path,$cookie_domain);	setcookie($cookie_prefix."w3t_key","",time() - 3600,$cookie_path,$cookie_domain);	setcookie($cookie_prefix."w3t_mysess","",time() - 3600,$cookie_path,$cookie_domain);	setcookie($cookie_prefix."w3t_visit","",time() - 3600,$cookie_path,$cookie_domain);	}//Get the user idfunction getUserID() {	global $cookie_prefix;	$userID = $_COOKIE[$cookie_prefix."w3t_myid"];	return $userID;	}//Get the users infofunction getUserInfo($userID=0) {	global $uus_link,$cookie_prefix,$cookie_prefix,$int_link,$integration_prefix;	if($userID == 0) {		if($_COOKIE[$cookie_prefix."bdUserID"] == "") { return false; }		$userID = $_COOKIE[$cookie_prefix."w3t_myid"];		}	$result = query("SELECT bc1,bc2,bc3 FROM bosdevUUS WHERE id=$userID",$uus_link);	list($isAdmin,$rules,$fees) = mysql_fetch_row($result);	$result = query("SELECT U_Username,U_Email FROM {$integration_prefix}Users WHERE U_Number=$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 + =
减小字号Ctrl + -
显示快捷键?