%@ Language=VBScript %>
<%option explicit%>
<%
dim conclass,rst,strsql, strUserID,strPassword,strErrorMessages
strUserID= QuerySafeString(trim(Request.Form("txtUserID")))
if strUserID<>"" then
strPassword= QuerySafeString(Request.Form("txtPassword"))
strUserID= ucase(strUserID)
set conclass =new ClsDataBase
conclass.getconnectionstring = PortalConnectString
strsql = "SELECT Password1 ,UserName, AdminUser" & _
" FROM news_t_users WHERE UserID='" & struserid & "' AND Active='Y'"
'Response.Write strsql
'Response.End
'on error resume next
set rst= conclass.Execute (strsql,strErrorMessages)
if err.number<> 0 then
strErrorMessages=err.Description
elseif (rst.eof and rst.bof) then
strErrorMessages="Invalid user id/password combination"
elseif strPassword=rst.fields("Password1")then
strErrorMessages=""
Session("UserID")= strUserID
Session("UserName")=rst.fields("UserName")
Session("Admin")=rst.fields("AdminUser")
Response.Redirect "Admin/News/List.asp"
else
strErrorMessages="Invalid user id/password combination"
end if
end if
%>