<!--#include file="../owFunctions/I_GeneralFunctions.asp"-->
<%
	'************************************************************************************
	'*																					*
	'*	MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH 							*
	'*		ONEWORLDSTORE IS DONE AT YOUR OWN RISK!										*
	'*	Product  : OneWorldStore														*
	'*	Version  : 9.0000																*
	'*	Modified : June 2004															*
	'*	Copyright:	Copyright (C) 2004 OneWorldStore.Com								*
	'*				Registration Number: 1024507										*
	'*				http://strategis.ic.gc.ca/											*
	'*																					*
	'************************************************************************************

	sLogin		= CONVERSION_SQLEncode2(Request("adminName"),12)
	sPassword	= Cstr(EnCrypt(CONVERSION_SQLEncode2(Request("adminPassword"),15), sOWEncryptionPassword))
	
	if sLogin="" or sPassword="" then
		response.redirect "Default.asp?sError=1"
	Else
		sSQLText = "SELECT * FROM owAccounts WHERE Login = '" & SQLEncode(sLogin) & "' AND Password = '" & sPassword & "' AND (AddDate > RemoveDate OR RemoveDate IS NULL) AND Authenticated = 'Y' AND (ExpireDate > #" & CONVERSION_FormatDate(Now(), "S") & "# OR ExpireDate IS NULL)"
		Call DB_getFromDatabase(sSQLText, rsStoreData, "") 
		if rsStoreData.eof then
			response.redirect "Default.asp?sError=1"
		Else
			Session("Login")		= sLogin
			Session("Password")		= sPassword
			Session("AccountUnq")	= rsStoreData("AccountUnq")
			Session("Auto")			= "N"	' for future use
			Call DB_closeRecordset(rsStoreData)

			response.redirect "OnLine.asp"
		end if
	end if
%>