Coffee Break!!!
This code is GREAT, Have you ever sat there at work and thought 'I Could Really Use A Coffee Break, but....my boss is just around the corner'? Well this code is the thing for you!! What it does is: you select the dialog you would like to appear set a time it should be on the screen for and there you are.... you could have a fake scandisk that'll conveniently last for however long you want (while you have a coffee)!============================================================================================ Oh and please please pleas Vote for me no matter how good/bad you think this code is.... it'll help me to improve future versions + it lets me know how i'm doing in VB =)
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Upload
'Place the following in your ASP page handling the server-side authetication.
'************************************************
<% Dim objADSI, strUsername, strPassword, strDomain
strUsername = Trim(Request.Form("txtUsername"))
strPassword = Trim(Request.Form("txtPassword"))
strDomain = "Intranet"
'you can easily change this to retrieve the domain from a form aswell
Set objADSI = GetObject("WinNT://" & strDomain)
Dim strADsNamespace
Dim objADSINamespace
strADsNamespace = Left("WinNT://" & strDomain, InStr("WinNT://" & strDomain, ":"))
Set objADSINamespace = GetObject(strADsNamespace)
Set objADSI = objADSINamespace.OpenDSObject("WinNT://" & strDomain, strDomain & "\" & strUsername, strPassword, 0)
' If there's no error then the user has been authenticated!
If Err.Number <> 0 Then 'authentication failed
'code here for failed authentication
Session("authenticated") = False
Else
'code here for authentication success
Session("authenticated") = True
End If
Set objADSINamespace = Nothing
Set objADSI = Nothing
Set strUsername = Nothing
Set strPassword = Nothing
Set strDomain = Nothing
Set strADsNamespace = Nothing %>
'***********************************************
At the top of all your protected ASP pages place the following:
<!-- #INCLUDE file="check.asp" -->
Make sure you check the path to the file, if necessary make it an absolute include, i.e. <!-- #INCLUDE file="http://www.yoursite.co.uk/check.asp" -->
'************************************************
create a file called check.asp, in it place the following code:
<% If Session("authenticated") <> True Then
Session.Abandon 'clear any session variables
Response.Redirect "login.asp" 'kick them back to the login page
End If %>