%@ LANGUAGE="VBSCRIPT" %>
<% PageStrings = "359, 397, 401, 402, 444, 445, 448, 568, 569, 398, 917, 918"
strThisBackPage = "config" %>
<%
'===============================================
' CactuShop ASP Shopping Cart
' ©1999-2004 Cactusoft Ltd. www.cactusoft.com
'===============================================
' All rights reserved.
' Use of this code is covered by the terms and
' conditions in the license agreement. No
' unauthorized duplication or distribution is
' permitted. Cactusoft's copyright notices must
' remain in the ASP sections of the code.
'===============================================
'-----------------------------------------------
'COLLECT VALUES FROM FORM
'-----------------------------------------------
LOGIN_ID = request.form("LOGIN_ID")
LOGIN_Username = request.form("LOGIN_Username")
LOGIN_Password = request.form("LOGIN_Password")
LOGIN_Orders = request.form("LOGIN_Orders")
LOGIN_Products = request.form("LOGIN_Products")
LOGIN_Config = request.form("LOGIN_Config")
LOGIN_Live = request.form("LOGIN_Live")
LOGIN_Protected = request.form("LOGIN_Protected")
LOGIN_Language = request.Form("LOGIN_Language")
If LOGIN_Orders <> "y" then LOGIN_Orders = "n"
If LOGIN_Products <> "y" then LOGIN_Products = "n"
If LOGIN_Config <> "y" then LOGIN_Config = "n"
'-----------------------------------------------
'ERROR CHECKING
'-----------------------------------------------
strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_Username"), LOGIN_Username)
strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_Password"), LOGIN_Password)
If LOGIN_Protected <> "y" then
strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("ContentText_Live"), LOGIN_Live)
strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_Username"), LOGIN_Username, Application(LICENSENUMBER & "LOGIN_Username_AL"))
strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_Password"), LOGIN_Password, Application(LICENSENUMBER & "LOGIN_Password_AL"))
End if
'-----------------------------------------------
'UPDATE DATABASE RECORDS
'-----------------------------------------------
If strErrorText ="" then
If LOGIN_ID = 0 then
strQuery = "INSERT INTO tblCactuShopLogins (LOGIN_Username, LOGIN_Password, LOGIN_Orders, LOGIN_Products, LOGIN_Config, LOGIN_Live, LOGIN_Protected, LOGIN_Language) VALUES ('" &_
sqlsafe(LOGIN_Username) & "','" &_
sqlsafe(LOGIN_Password) & "','" &_
sqlsafe(LOGIN_Orders) & "','" &_
sqlsafe(LOGIN_Products) & "','" &_
sqlsafe(LOGIN_Config) & "','" &_
sqlsafe(LOGIN_Live) & "','" &_
"n" & "'," &_
sqlsafe(LOGIN_Language) & ")"
else
If LOGIN_Protected = "y" then
strQuery = "UPDATE tblCactuShopLogins SET LOGIN_Username='" & sqlsafe(LOGIN_Username) & "'," &_
"LOGIN_Password = '" & sqlsafe(LOGIN_Password) & "'," &_
"LOGIN_Language = " & sqlsafe(LOGIN_Language) & " WHERE LOGIN_ID=" & LOGIN_ID
else
strQuery = "UPDATE tblCactuShopLogins SET LOGIN_Username='" & sqlsafe(LOGIN_Username) & "'," &_
"LOGIN_Password = '" & sqlsafe(LOGIN_Password) & "'," &_
"LOGIN_Orders = '" & sqlsafe(LOGIN_Orders) & "'," &_
"LOGIN_Products = '" & sqlsafe(LOGIN_Products) & "'," &_
"LOGIN_Config = '" & sqlsafe(LOGIN_Config) & "'," &_
"LOGIN_Live = '" & sqlsafe(LOGIN_Live) & "'," &_
"LOGIN_Language = " & sqlsafe(LOGIN_Language) & " WHERE LOGIN_ID=" & LOGIN_ID
end if
end if
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
'If the login changed is the current login, then change
'the user's language in their cookie
If numThisUserLOGIN_ID = LOGIN_ID * 1 then
response.cookies(Application(LICENSENUMBER & "cookiename") & " security")("LOGIN_Language") = LOGIN_Language
end if
response.redirect("_login_list.asp")
else %>
<% =GetString("Config_headtitle") %>
<% end if %>