<!--#include file="../database_type.asp"-->

<%
 '============================数据库连接对象的建立-免费版请指定ACCESS数据库路径=========================================== 
	Dim Acc_db
	 
	If Database_type=1 Then
		
		ConnStr="driver={SQL Server};server="&SqlLocalName&";uid="&SqlUsername&";pwd="&SqlPassword&";database="&SqlDatabaseName&";"		
	Else
		Acc_db="Database/WebsenElecommerce.asp"
		Acc_db=data_path&Acc_db                   'data_path为路径
		ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&Acc_db&"")
	End If
	
		 on error resume next
		Set conn = Server.CreateObject("ADODB.Connection")
		conn.commandtimeout=20
		conn.open ConnStr
	
	If Err.number>0 Then
		err.Clear
		Set Conn = Nothing
		Response.Write "<br><br><br><br><br><br><br><div align='center'>数据库连接出错!请检查连接数据库的参数及字符串设置是否正确！</div>"
		Response.End
	End If
	
 '============================================================================================	



'----------------------------------获取网站的全局配置信息---------------------------------------------------------
	sqlconfig="select top 1 * from [Websen_worldec_config]"
	Set rsconfig= Server.CreateObject("ADODB.Recordset") 
	rsconfig.Open sqlconfig,conn,1,1
	If rsconfig.Bof or rsconfig.EOF Then
		Response.Write "<br><br><br><br><br><br><br><div align='center'>网站配置数据丢失！系统无法正常运行！</div>"
		Response.End()
	Else
	
	HOPE_InstallDir=""&rsconfig("weburl2")&""           '网站所在文件夹
	is2weburl=Cint(rsconfig("is2weburl"))               '控制二级域名是否开启
	isblog=cint(rsconfig("isblog"))                     '控制博客的开关
	weboff_on=""&rsconfig("weboff_on")&""               '网站开关
 	forum_setting=""&rsconfig("forum_setting")&""       '系统使用的发邮件为JMAIL组件
	Stopreadme=""&rsconfig("Stopreadme")&""             '网站关闭提示信息
	WebName=""&rsconfig("WebName")&""
	reg_y_n=""&rsconfig("reg_y_n")&""
	WebUrl=""&rsconfig("WebUrl")&"" 
	WebUrl1=""&rsconfig("WebUrl1")&"" 
	userweb=""&rsconfig("userweb")&"" 
	weblogo=""&rsconfig("weblogo")&"" 
	webshoplogo=HOPE_InstallDir&"images/logo.jpg"
	weblogo2=weblogo
	HOPE_PageWidth=""&rsconfig("pagewidth")&"" 
	filesys=rsconfig("filesys")
	shoplogo2=webshoplogo
	if right(trim(weblogo),4)=".swf" then 
		weblogo="<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"" width=""196"" height=""63""> <param name=""movie"" value="&weblogo&"><param name=""quality"" value=""high""><embed src="&weblogo&" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""196"" height=""63""></embed></object>"
	else
		weblogo="<img src="&weblogo&" width=""196"" height=""63"">"
	end if
	
	if right(trim(webshoplogo),4)=".swf" then 
		webshoplogo="<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"" width=""196"" height=""63""> <param name=""movie"" value="&webshoplogo&"><param name=""quality"" value=""high""><embed src="&webshoplogo&" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""196"" height=""63""></embed></object>"
	else
		webshoplogo="<img src="&webshoplogo&" width=""196"" height=""63"">"
	end if
	
	vipbs=""&rsconfig("vipbs")&"" 
	rzjg=""&rsconfig("rzjg")&"" 
	SMTPServer=""&rsconfig("SMTPServer")&""
	HOPE_MailUser=""&rsconfig("HOPE_Emailuser")&""
	HOPE_MailPwd=""&rsconfig("HOPE_EmailPwd")&""
	SystemEmail=""&rsconfig("SystemEmail")&""
	Systemtel=""&rsconfig("Systemtel")&""
	hottel=""&rsconfig("hottel")&""
	hotfax=""&rsconfig("hotfax")&""
	worldname=""&rsconfig("worldname")&""
	Company=""&rsconfig("Company")&""
	address=""&rsconfig("add")&""
	yb=""&rsconfig("yb")&""
	worldecfuwu=""&rsconfig("worldecfuwu")&"" 
	yhzh=""&rsconfig("yhzh")&""
	bank=""&rsconfig("bank")&""
        wentiname=""&rsconfig("wentiname")&""
        wentidaan=""&rsconfig("wentidaan")&""
        shuxin=""&rsconfig("shuxin")&""
	Copyright=""&rsconfig("Copyright")&""
	PicUrl=""&rsconfig("PicUrl")&""
	LinkUrl=""&rsconfig("LinkUrl")&""
	newspic=""&rsconfig("newspic")&""
	bizrepic=""&rsconfig("bizrepic")&""
	search=""&rsconfig("search")&""
	admin_copy=""&rsconfig("admin_copy")&""
	citypingname=""&rsconfig("citypingname")&""
	cityscakey=""&rsconfig("cityscakey")&""
	cityzhkey=""&rsconfig("cityzhkey")&""
	cityjobzpkey=""&rsconfig("cityjobzpkey")&""
	citycpkey=""&rsconfig("citycpkey")&""
	Fy_In=""&rsconfig("citysql")&""
	indextime=""&rsconfig("indextime")&""
    kindtime=""&rsconfig("kindtime")&""
	cpmark=""&rsconfig("cpmark")&""
    zhmark=""&rsconfig("zhmark")&""
	sjmark=""&rsconfig("sjmark")&""
	ppmark=""&rsconfig("ppmark")&""
	zxmark=""&rsconfig("zxmark")&""
	markct=""&rsconfig("markct")&""
	autozz=""&rsconfig("autozz")&""
	EmailTitle=""&rsconfig("EmailTitle")&""
	Emailinfo=""&rsconfig("Emailinfo")&""
        lujing=""&rsconfig("lujing")&""
	Verification=""&rsconfig("Verification")&""
        Watermark=""&rsconfig("Watermark")&""
   	rsconfig.close
	set rsconfig=nothing
	end if
 

'-----------------------------------------------------------------------------------------------------
 

'  ////////////////////////判断用户是否从论坛登录// start///////////////////////////////
if Request.Cookies(BBSInfo&"username")<>"" and  Request.Cookies(BBSInfo&"OutPwd")<>"" then 
	sqlwangwei="select * from Websen_corporation where [User]='"&Request.Cookies(BBSInfo&"username")&"' and Pass='"&Request.Cookies(BBSInfo&"OutPwd")&"'"
	Set rswangwei= Server.CreateObject("ADODB.Recordset") 
	rswangwei.open sqlwangwei,conn,1,1
	if not rswangwei.eof then
		session("Email")=rswangwei("Email")
		session("id")=rswangwei("id")
		session("user")=rswangwei("user")
  		session("yxFlag")=rswangwei("Flag")  '已审核
		session("gradeid")=rswangwei("gradeid")
	else
		
	end if
	rswangwei.close
	set rswangwei=nothing
end if

' ////////////////////////判断用户是否从论坛登录/// end //////////////////////////////
 

%>
 