<% Function ChkString(string) if string = "" then string = " " ChkString = Replace(string, "'", "''") End Function Function ChkUser(strName, StrPasswd) strSql ="SELECT Member_id, M_level, M_Name, M_Password from Members where M_Name = '" & strName & "' and M_Password = '" & StrPasswd &"'" 'Response.Write StrSql set rs_chk = my_conn.Execute (StrSql) if rs_chk.BOF or rs_chk.EOF then '# Invalid Password ChkUser = 0 Else if cint(rs_chk("Member_ID"))= cint(Request.Form("Author")) then ChkUser = 1 ' Author Else Select case cint(rs_chk("M_Level")) case 1 ChkUser = 2' Normal User case 2 ChkUser = 3' Moderator case 3 ChkUser = 4' Admin case else ChkUser = cint(rs_chk("M_Level")) End Select End If End if rs_chk.close set rs_chk = nothing End Function Function ForumModerator(Forum_ID, M_Name) strSQL = "SELECT Members.M_Name, Forum.Forum_ID FROM Members INNER JOIN " & _ " Forum ON Members.Member_id = Forum.F_Moderator WHERE Forum.Forum_ID = " & cint(Forum_ID) & _ " and Members.M_Name = '" & M_Name & "'" set rsChk = my_conn.Execute (strSQL) if rsChk.bof or rsChk.eof then ForumModerator = "False" Else ForumModerator = "true" End if rsChk.close set rsChk = nothing End function %> Cerrar tema vLink="<% =ActiveLinkColor %>"> <% if Request.QueryString("mode") = "doit" then set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open ConnString mlev = cint(ChkUser(Request.Form("user"), Request.Form("pass"))) if mlev > 0 then ' is Member if (ForumModerator(Request.Form("Forum_id"), Request.Form("user"))) = "true" or mlev =4 then StrSQL = "Update Topics set T_Status = false where Topic_ID = " & Request.Form("topic_id") my_conn.Execute (strSQL) Response.Write "

Tema cerrado!

" Else Response.Write "

No tiene permiso para cerrar este tema

" Response.Write "Back

" End if Else Response.Write "

No tiene permiso para cerrar este tema

" Response.Write "Back

" End if my_conn.Close set my_Conn = nothing else %>
<% =BBTitle %>  

Cerrar tema : <%=Request.QueryString("topic_title") %>

"> ">
User Name
Password
<% end if %> Cerrar ventana