home *** CD-ROM | disk | FTP | other *** search
- <%
- ' Populating variables from the HTTP Header and the Server
- STATUS = Request("STATUS")
- USERNAME = Replace(Request("USERNAME"),"'","")
- PASSWORD = Replace(Request("PASSWORD"),"'","")
- THISPAGE = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL")
-
- ' These are the variables you may need to change
- DATA_PATH = "C:\Inetpub\wwwroot\advpasswordlite\_database\passwords.mdb"
- ConnPasswords_RuntimeUserName = "admin"
- ConnPasswords_RuntimePassword = "Xpass"
-
- ' checks to see if login form was submitted..if so its runs the validation code
- If STATUS = "CHECKEM" Then
-
- '****************************************************************************
- ' The following checks for a user and if it finds one it stores all their
- ' information in session variables that will be available to you at all times
- '****************************************************************************
-
-
- Set ConnPasswords = Server.CreateObject("ADODB.Connection")
- Set CmdCheckUser = Server.CreateObject("ADODB.Recordset")
- ConnPasswords.Open "DBQ=" & DATA_PATH & ";Driver={Microsoft Access Driver (*.mdb)};UID=" & ConnPasswords_RuntimeUserName & ";PASSWORD=" & ConnPasswords_RuntimePassword
- SQL = "SELECT FULL_NAME, USERNAME, PASSWORD, ACCESS_LEVEL, NOTES, ADMIN, ID FROM USERS WHERE (USERNAME = '" & USERNAME & "') AND (PASSWORD = '" & PASSWORD & "')"
- CmdCheckUser.Open SQL, ConnPasswords
-
- If CmdCheckUser.EOF And CmdCheckUser.BOF Then
-
- Session("PASSWORDACCESS") = "No"
-
- Else
-
- Session("PASSWORDACCESS") = "Yes"
- Session("FULL_NAME") = CmdCheckUser("FULL_NAME")
- Session("PASSWORD") = CmdCheckUser("PASSWORD")
- Session("USERNAME") = CmdCheckUser("USERNAME")
- Session("ADMIN") = CmdCheckUser("ADMIN")
-
- End If
-
- CmdCheckUser.Close
- Set CmdCheckUser = Nothing
- ConnPasswords.Close
- Set ConnPasswords = Nothing
-
- '*********************
- '*********************
-
- End If
-
- '**************************************************************
- ' The following checks for proper Access for the Admins
- '**************************************************************
-
- If CHECKFOR = "ADMIN" Then
- If Session("ADMIN") = "False" Then
- Session("PASSWORDACCESS") = "No"
- End If
- End IF
-
- '*********************
- '*********************
-
-
-
- '**************************************************************
- ' The following checks to see if a user has been validated yet
- ' If not it will show the login screen
- '**************************************************************
-
-
- If Session("PASSWORDACCESS") <> "Yes" Then
- Response.Write("<HTML>")
- Response.Write("<BODY bgcolor=""#FFFFFF"">")
-
- If Session("PASSWORDACCESS") = "No" Then
- Response.Write("<p align=""center""><font face=""Arial"" color=""#FF0000""><strong>ACCESS DENIED</strong></font></p>")
- Response.Write("<p align=""center""><small><strong><font face=""Arial"">INVALID USERNAME & PASSWORD</font></strong></small></p>")
- End If
-
- Response.Write("<form method=""POST"" action=""" & THISPAGE & """>")
- Response.Write(" <input type=""hidden"" name=""STATUS"" value=""CHECKEM""><div align=""center""><center><table")
- Response.Write(" border=""0"" bgcolor=""#C0C0C0"">")
- Response.Write(" <tr>")
- Response.Write(" <td bgcolor=""#FF0000""><strong><small><font face=""Arial"">USERNAME</font></small></strong></td>")
- Response.Write(" <td><input type=""text"" name=""USERNAME"" size=""10""></td>")
- Response.Write(" </tr>")
- Response.Write(" <tr>")
- Response.Write(" <td bgcolor=""#FF0000""><strong><small><font face=""Arial"">PASSWORD</font></small></strong></td>")
- Response.Write(" <td><input type=""password"" name=""PASSWORD"" size=""10""></td>")
- Response.Write(" </tr>")
- Response.Write(" </table>")
- Response.Write(" </center></div><div align=""center""><center><p> <input type=""submit"" value=""Login""></p>")
- Response.Write(" </center></div>")
- Response.Write("</form>")
- Response.Write("</BODY>")
- Response.Write("</HTML>")
-
- Response.End
- End If
-
- '*********************
- '*********************
- %>