Hejsa, jeg har en fejl i mit chat login, dog kun når chat session kører, altså det første script som i ser her er fra chatlogin.asp som tjekker om en session kører, hvis dette er tilfældet foretaget en response.redirect til chat.asp det lader også til at virker...
' Vis ikke loginsreen hvis session exsist If (chatID <> "") Then Response.Redirect "chat.asp?chatID=" & chatID Response.End End If
Scriptet redirecter til chat.asp som tjekker flg:
Dim chatID chatID = Request("chatID") If (chatID = "") Then Response.Redirect "expired.asp" Response.End End If
Denne side indeholder artikler med forskellige perspektiver på Identity & Access Management i private og offentlige organisationer. Artiklerne behandler aktuelle IAM-emner og leveres af producenter, rådgivere og implementeringspartnere.
Ja, chatten kører fin, men går man fra den, kan man ikke komme ind igen, da login.asp åbenbart registrere en session og sender en videre til chat.asp og her går det åbenbart galt
Der er umidlbart ikke nogen måde at komme direkte fra login.asp til expired.asp
okay, jeg har ændret lidt på system, vil hellere have at brugeren blivet logget af, når en anden side hentes, så er problemet med login i hvert fald løst.
Men nu opstår der et nyt problem, jeg får fejlmeddelse "chatID er ikke difineret ?? når jeg kører dette script
Dim chatName If (Application.StaticObjects.Item("conquerChat").Exists(CStr(chatID))) Then chatName = Application.StaticObjects.Item("conquerChat").Item(CStr(chatID)) Else chatName = "gæst" End If
Dim x
Application.Lock
' add a leaving message to chatroom For x = MESSAGES To 2 Step - 1 Application("chatline_" & x) = Application("chatline_" & x-1) Next Application("chatline_1") = "<span class='LoggedOut'>" & chatName & " forlader chatten " & time() & "</span><br>"
' remove user Application.StaticObjects.Item("conquerChat").Remove(CStr(chatID)) Application.StaticObjects.Item("conquerChatTime").Remove(CStr(chatID))
Dim chatName If (Application.StaticObjects.Item("conquerChat").Exists(CStr(chatID))) Then chatName = Application.StaticObjects.Item("conquerChat").Item(CStr(chatID)) End If
Dim x
Application.Lock
' add a leaving message to chatroom For x = MESSAGES To 2 Step - 1 Application("chatline_" & x) = Application("chatline_" & x-1) Next Application("chatline_1") = "<span class='LoggedOut'><" & chatName & " logger af " & Now() & "</span><br>"
' remove user Application.StaticObjects.Item("conquerChat").Remove(CStr(chatID)) Application.StaticObjects.Item("conquerChatTime").Remove(CStr(chatID))
Nu har jeg ikke selv konstrueret chatten, så jeg har ikke selv let ved at gennemskue den, men chatten kører via en global.asa og gemmer vel også chatID her?
Dim chatID chatID = Request("chatID") If ( (chatID = "chatID") OR (NOT Application.StaticObjects.Item("conquerChat").Exists(chatID)) ) Then Response.Redirect "expired.asp" Response.End End If
%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Dim chatName If (Application.StaticObjects.Item("conquerChat").Exists(CStr(chatID))) Then chatName = Application.StaticObjects.Item("conquerChat").Item(CStr(chatID)) Else chatName = "Guest" End If
' user wants to logoff, so we will have to notify all other users ' about this by printing some kind of 'user X is now logging off' ' message. If ( Len(Request("logoff.x")) > 0) Then
Dim x
Application.Lock
' add a leaving message to chatroom For x = MESSAGES To 2 Step - 1 Application("chatline_" & x) = Application("chatline_" & x-1) Next Application("chatline_1") = "<span class='LoggedOut'><" & chatName & " logger af " & Now() & "</span><br>"
' remove user Application.StaticObjects.Item("conquerChat").Remove(CStr(chatID)) Application.StaticObjects.Item("conquerChatTime").Remove(CStr(chatID))
' a new message has been send to chat. we want this message to ' be added our list of message, indicating which user send it. If ( Request("mode") = "message" ) Then
Dim textMessage textMessage = Request("message")
' do not add message, if it is empty If (Len(textMessage) > 0) Then
' we do not support most tags, however <b>, <i> ARE supported, thus we have ' to make check for these and replace with actual tags textMessage = Server.HTMLEncode(textMessage) textMessage = Replace(textMessage, "<b>", "<b>", 1, -1, 1) textMessage = Replace(textMessage, "</b>", "</b>", 1, -1, 1) textMessage = Replace(textMessage, "<i>", "<i>", 1, -1, 1) textMessage = Replace(textMessage, "</i>", "</i>", 1, -1, 1) textMessage = Replace(textMessage, "<u>", "<u>", 1, -1, 1) textMessage = Replace(textMessage, "</u>", "</u>", 1, -1, 1)
Dim i, text
Application.Lock
' move all messages one item down in queue For i = MESSAGES To 2 Step -1 Application("chatline_" & i) = Application("chatline_" & i-1) Next
End If ' >> Else .. If ( Len(Request("logoff.x")) > 0) Then
' do we have to drop some users? Dim arUserTimes, timeIdx, curTimestamp arUserTimes = Application.StaticObjects.Item("conquerChatTime").Keys curTimestamp = Now() For timeIdx = 0 To Application.StaticObjects.Item("conquerChatTime").Count-1 If (DateDiff("s", CDate(Application.StaticObjects.Item("conquerChatTime").Item(arUserTimes(timeIdx))), curTimestamp) > TIMEOUT) Then ' this user needs to be locked out - he fell asleep in class..hmm Application.Lock ' tell other users about this lazy chatter ;o) For x = MESSAGES To 2 Step - 1 Application("chatline_" & x) = Application("chatline_" & x-1) Next Application("chatline_1") = "<span class='LoggedOut'>" & Application.StaticObjects.Item("conquerChat").Item(arUserTimes(timeIdx)) & " blev logget af " & time() & "</span><br>"
If ( CLEAR_ON_EMPTY AND (Application.StaticObjects.Item("conquerChat").Count = 0) ) Then ' clear all messages Application.Lock For i = 1 To MESSAGES Application("chatline_" & i) = "" Next Application.UnLock End If
' print all messages in window For i = 1 To MESSAGES Response.Write Application("chatline_" & i) & "" Next
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.