Subversion Repositories DevTools

Rev

Rev 1281 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'                 REMOVE Personal View
'               --- PROCESS FORM ---
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
%>

<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "members_personal_view.asp" )
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim parView_id
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parView_id = QStrPar("FRview_id")
'----------------------------------------------
%>
<%
Function Remove_View ( NNview_id )

   On Error Resume Next

   ' Remove view_setting
   objEH.TryORA ( OraSession )
   OraDatabase.ExecuteSQL " DELETE FROM view_settings WHERE view_id = "& NNview_id

   If Err.Number = 0 Then
      ' Remove view definition
      OraDatabase.ExecuteSQL " DELETE FROM view_def WHERE view_id = "& NNview_id

      If Err.Number = 0 Then
         ' Remove view
         OraDatabase.ExecuteSQL " DELETE FROM views WHERE view_id = "& NNview_id
      End If
   End If

   objEH.CatchORA ( OraSession )

End Function
%>
<%
'-----------------------  MAIN LINE  ---------------------------

'--- Process submition ---
If (parView_id <> "") Then
   ' All mandatory parameters FOUND

   ' report errors if found
   If NOT This_View_Owner( parView_id, objAccessControl.UserId ) Then
      Session("reqParam") = ""
      Session("ERRlog") = ""
      Session("ERRlogFULL") = ""
      Response.Redirect("message.asp?msg=401-5")
   End If

   Call Remove_View ( parView_id )

   Response.Redirect("members_personal_view.asp")
Else
   Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
   Response.write QSTR_All
End If
%>

<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->