Author |
Topic |
|
Tmpj
Junior Member
Denmark
467 Posts |
Posted - 22 June 2002 : 18:57:10
|
To Richard Kinser and the Snitz Forums 2000 Team:
The seperate login box you have here: http://forum.snitz.com/ can you post it for me?
I have tryed a search but without result.
------------------------------ Magic is an Orange http://www.magicorange.tk |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 22 June 2002 : 19:22:35
|
You can try Snitz Exchange and look for Nathan's inc_login.asp. That should get you started.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
|
|
Ez4arab
Junior Member
479 Posts |
Posted - 23 June 2002 : 06:10:53
|
I have use this in my forum if u like code here is it
<% '### start of timer code
Dim StopWatch(19)
sub StartTimer(x) StopWatch(x) = timer end sub
function StopTimer(x) EndTime = Timer
'Watch for the midnight wraparound... if EndTime < StopWatch(x) then EndTime = EndTime + (86400) end if
StopTimer = EndTime - StopWatch(x) end function
' StartTimer 1
'### end of timer code
dim mLev, strLoginStatus, MemberID dim strArchiveTablePrefix
strArchiveTablePrefix = strTablePrefix & "A_"
if Application("down") then if not Instr(request.servervariables("script_name"),"admin_") > 0 then Response.redirect("down.asp") end if end if
set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString
if (strAuthType = "nt") then call NTauthenticate() if (ChkAccountReg() = "1") then call NTUser() end if end if
if strAuthType = "db" then if (Request.Cookies(strUniqueID & "User")("Name") <> "" and Request.Cookies(strUniqueID & "User")("PWord") <> "") then '## Forum_SQL strSql = "SELECT MEMBER_ID, M_NAME, M_PASSWORD " strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS " strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(Request.Cookies(strUniqueID & "User")("Name"), "SQLString") & "' " strSql = strSql & " AND M_PASSWORD = '" & ChkString(Request.Cookies(strUniqueID & "User")("Pword"), "SQLString") &"'" Set rsCheck = my_Conn.Execute(strSql) if rsCheck.BOF or rsCheck.EOF then Call ClearCookies() strDBNTUserName = "" else strDBNTUserName = rsCheck("M_NAME") end if rsCheck.close set rsCheck = nothing else strDBNTUserName = "" end if end if strDBNTFUserName = Request.Form("Name") if strDBNTFUserName = "" then strDBNTFUserName = Request.Form("User") if strAuthType = "nt" then strDBNTUserName = Session(strCookieURL & "userID") strDBNTFUserName = Session(strCookieURL & "userID") end if
select case Request.Form("Method_Type") case "login" select case chkUser(strDBNTFUserName, Request.Form("Password")) case 1, 2, 3, 4 Call DoCookies(Request.Form("SavePassword")) strLoginStatus = 1 case else strLoginStatus = 0 end select case "logout" Call ClearCookies() end select
mLev = cint(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword")))
' DEM --> Added code for moderation and subscription if strDBNTUserName <> "" then MemberID = getMemberNumber(strDBNTUserName) else MemberID=0 end if
select case Request.Form("Method_Type")
case "login" %>
<% if strLoginStatus = 0 then %> <p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Your username and/or password were incorrect.</font></p> <% else %> <p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">You logged on successfully!</font></p> <%end if %> <meta http-equiv="Refresh" content="2; URL=<% =Request.ServerVariables("HTTP_REFERER") %>"> <% 'WriteFooter Response.End case "logout" %>
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">You logged out successfully!</font></p> <meta http-equiv="Refresh" content="2; URL=<% =Request.ServerVariables("HTTP_REFERER") %>">
<% 'WriteFooter Response.End end select
if (chkUser((strDBNTUserName), (Request.Cookies(strUniqueID & "User")("Pword"))) = 0) then %> <form action="<% =Request.ServerVariables("URL") %>" method="post" id=form1 name=form1> <INPUT type="hidden" name="Method_Type" value="login"> <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="<% =strForumCellColor %>"> <tr><td bgcolor="<% =strHeadCellColor %>" width="100%"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><b><p align="center">تسجيل الدخول</p></b></font></td></tr> <tr><td> <table align="center"> <% if (strAuthType = "db") then %> <tr> <td><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><b>اسم المستخدم:</b></font><br> <INPUT type="text" name="Name" size="10" value=""></td><tr> <td><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><b>كلمة المرور:</b></font><br> <INPUT type="password" name="Password" size="10" value=""><tr></td> <td valign="bottom"> <% if strGfxButtons <> "0" then %> <p align="center"><INPUT src=<%= strImageUrl %>button_login.gif type="image" value="Login" id=submit1 name=submit1 border=0 hspace=4></p> <% else if strGfxButtons = "0" then %> <p align="center"><INPUT type="submit" value="Login" id=submit1 name=submit1></p> <% end if end if end if %> </tr> </table> </td></tr></table> </form> <% else %> <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="<% =strForumCellColor %>"> <tr><td bgcolor="<% =strHeadCellColor %>" width="100%"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><b><p align="center">تسجيل الدخول</p></b></font></td></tr> <tr><td> <form action="<% =Request.ServerVariables("URL") %>" method="post" id=form2 name=form2> <p align="center"><INPUT type="hidden" name="Method_Type" value="logout"></p> <table align="center"> <tr> <td align="center"> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"> اسم المستخدم الحالي<br> <% if strAuthType="nt" then %> <b><% =Session(strCookieURL & "username")%> (<% =Session(strCookieURL & "userid") %>)</b> </font> </td> <td> <% else if strAuthType = "db" then %> <b><% = ChkString(strDBNTUserName, "display") %></b> </font> </td> </tr> <tr><td> <% if strGfxButtons <> "0" then %> <p align="center"><INPUT src=<%= strImageUrl %>button_logout.gif type="image" value="Logout" id=submit1 name=submit1 border=0 hspace=4></p> <% else if strGfxButtons = "0" then %> <p align="center"><INPUT type="submit" value="Logout" id=submit1 name=submit1></p> <% end if end if end if end if %> </td> </tr> </table> </td></tr></table> </form> <% end if %>
|
|
|
Tmpj
Junior Member
Denmark
467 Posts |
Posted - 23 June 2002 : 16:22:50
|
quote:
You can try Snitz Exchange and look for Nathan's inc_login.asp. That should get you started.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs
I already have looked in that, but I want to have it do this:
When the user has submitted the login form it should do this:
If he was logged in: the system should redirect to the same page as he came from.
If his username or password has wrong:
If should not display a error message just redirect to the same page as he came from where the login form i clean.
If he is not logged in case of any other things the system shpuld do the same as in the previous sample.
------------------------------ Magic is an Orange http://www.magicorange.tk |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
|
|
Topic |
|