% 'Include Security Server.Execute("/admin/includes/popup_security.asp") %> <%'Include Data Connection%> <%'Include ADO constants include file for VBScript%> <% 'open data connection OpenConn() %> <%'Include Utility Scripts%> <% 'dim strMode - The strMode variable is defined in the header_inc.asp file. dim strFirstName dim strLastName dim strUsername dim strPassword dim strEmail dim intAdminUserId If Request.Form <> "" Then 'BEGIN: ADD/EDIT (DB TRANSACTION) dim strDel dim arAdminModules dim intAdminModuleCounter dim strUserFeedback 'get form elements values strMode = Request.Form("txtMode") strFirstName = Request.Form("txtFirstName") strLastName = Request.Form("txtLastName") strUsername = Request.Form("txtUsername") strPassword = Request.Form("txtPassword") strEmail = Request.Form("txtEmail") intAdminUserId = Request.Form("txtId") strDel = Request.Form("txtDelimiter") arAdminModules = Split(Request.Form("txtSelected"), strDel) 'if the application is in 'edit' mode If LCase(strMode) = "edit" Then 'modify user Call ModifyUser(CInt(intAdminUserId), strFirstName, strLastName, strEmail, strUsername, strPassword) 'delete posting type records related to the selected user id Call Delete_User_AdminModule(intAdminUserId) 'if the application is in 'add' mode Else 'add Subscriber intAdminUserId = AddUser(strFirstName, strLastName, strEmail, strUsername, strPassword) End If 'for each posting type... For intAdminModuleCounter = LBound(arAdminModules) To UBound(arAdminModules) 'if the array item is not an empty string then... If Trim(arAdminModules(intAdminModuleCounter)) <> "" Then 'add a posting type record related to the user Call Add_User_AdminModule(arAdminModules(intAdminModuleCounter), intAdminUserId) End If Next 'give the user feedback with regards to the success of the add/edit database transaction Session("FeedbackMode") = LCase(strMode) Session("FeedbackError") = err.number Session("FeedbackModule") = "user" 'Response.Write("") Server.Execute("/admin/feedback.asp") 'END: ADD/EDIT (DB TRANSACTION) Else 'BEGIN: INPUT (ADD/EDIT) 'get the application's transaction mode strMode = Trim(Request.QueryString("mode")) 'if application is in edit mode then... If LCase(strMode) = "edit" Then 'begin: get current Posting Type info to be edited dim rsAdminUser intAdminUserId = Trim(Request.QueryString("id")) 'if intAdminUserId is not a valid value then... If Not IsNumeric(intAdminUserId) or Not (intAdminUserId <> "") Then 'close the window Response.write("") 'if intAdminUserId is a valid value then... Else 'get the related user information Set rsAdminUser = GetSelectedUser(CInt(intAdminUserId)) End If 'if intAdminUserId does not relate to an existing user id then... If rsAdminUser.EOF Then 'release the recordset from memory rsAdminUser.Close set rsAdminUser = Nothing 'release the connection object from memory before closing the window conn.Close Set conn = Nothing 'close the window Response.write("") 'if intAdminUserId does relate to an existing user id then... Else 'get the user information into the relevant variables strFirstName = rsAdminUser("USER_FIRST_NAME") strLastName = rsAdminUser("USER_LAST_NAME") strEmail = rsAdminUser("USER_EMAIL") strUsername = rsAdminUser("USER_USERNAME") strPassword = rsAdminUser("USER_PASSWORD") 'release the recordset from memory rsAdminUser.Close set rsAdminUser = Nothing End If 'end: get current user info to be edited 'if application is in add mode then... Else strFirstName = "" strLastName = "" strUsername = "" strPassword = "" End If %>
<% 'END: INPUT (ADD/EDIT) End If %> <% 'close data connection CloseConn() %>