%@ Language=VBScript %> <% Option Explicit %> <% '------------------------------------------------------------------------- ' AppleTalkSvc_prop.asp : This page configures the parameters of Apple talk service ' ' Copyright (c) Microsoft Corporation. All rights reserved. ' ' Date Description ' 9-Mar-2001 Creation date '------------------------------------------------------------------------- %> <% '------------------------------------------------------------------------- 'Form Variables '------------------------------------------------------------------------ Dim SOURCE_FILE SOURCE_FILE = SA_GetScriptFileName() Dim F_chkSavePassword 'Varible to store the save passwors check box status Dim F_radSessions 'Varible to store the sessins radio button status Dim F_radSessionsUnlimited 'to store "checked" ,if unlimited radio button is checked Dim F_radSessionslimitto 'to store "checked" ,if limitto radio button is checked Dim F_txaLogonMessage 'variable to hold the logon message(text area content) Dim F_txtLimitto 'variable to hold the session limit to number Dim F_cboAuthenticationValues 'variable to hold the Authentication Values Dim F_nServerOptions 'to hold the server options number obtained from registry Dim F_nMaxSessions 'to hold the max session value obtained from registry '------------------------------------------------------------------------- ' Global Variables '------------------------------------------------------------------------- Dim page 'frame work variables Dim G_objRegistry 'registry connection 'Constants Const CONST_MACFILEREGISTRYPATH = "SYSTEM\CurrentControlSet\Services\MacFile\Parameters" Const CONST_MAXVALUE = 4294967295 'Constants for the numbers stored in registry Const CONST_NUM_MICROSOFTONLY = 48 Const CONST_NUM_APPLECLEARTEXT = 18 Const CONST_NUM_APPLEENCRYPTED = 80 Const CONST_NUM_APPLECLEARTEXTORMICROSOFT = 50 Const CONST_NUM_APPLEENCRYPTEDORMICROSOFT = 112 Const CONST_NUM_MICROSOFTONLY_CHECKED = 52 Const CONST_NUM_APPLECLEARTEXT_CHECKED = 22 Const CONST_NUM_APPLEENCRYPTED_CHECKED = 84 Const CONST_NUM_APPLECLEARTEXTORMICROSOFT_CHECKED = 54 Const CONST_NUM_APPLEENCRYPTEDORMICROSOFT_CHECKED = 116 Const CONST_CHECKNUM = 4 Const CONST_MACFILESVC = "MacFile" Const CONST_WORKSTATIONSVC = "lanmanworkstation" Const CONST_CHECKED = "CHECKED" Const CONST_MAXSESSIONS =-1 Const CONST_LIMITVAL =1 Const CONST_UNLIMITED ="unlimited" Const CONST_LIMITTO ="limitto" 'const for reg kay names Const CONST_KEYMAXSESSIONS = "MaxSessions" Const CONST_KEYLOGINMSG = "LoginMsg" Const CONST_KEYSERVEROPTIONS = "ServerOptions" F_nMaxSessions = Cint(0) '------------------------------------------------------------------------- ' Localisation Variables '------------------------------------------------------------------------- Dim g_iTabAppleTalk ' ' Create a Property Page Call SA_CreatePage(L_PAGETITLE_APPLETALK_TEXT, "", PT_TABBED, page ) Call SA_AddTabPage(page, L_GENERALTAB_APPLETALK_TEXT, g_iTabAppleTalk) ' ' Serve the page Call SA_ShowPage( page ) '------------------------------------------------------------------------- 'Function: OnInitPage() 'Description: Called to signal first time processing for this page. ' Use this method to do first time initialization tasks 'Input Variables: PageIn,EventArg 'Output Variables: None 'Returns: True/False 'Global Variables: None '------------------------------------------------------------------------- Public Function OnInitPage(ByRef PageIn, ByRef EventArg) Call RegistryConnection() 'getting the logon message form registry F_txaLogonMessage = GetAppletalkConfigValues(CONST_KEYLOGINMSG,CONST_STRING) 'getting the server options value from registry F_nServerOptions = GetAppletalkConfigValues(CONST_KEYSERVEROPTIONS,CONST_DWORD) 'making the check box checked Select case F_nServerOptions case CONST_NUM_APPLECLEARTEXT_CHECKED,CONST_NUM_APPLECLEARTEXTORMICROSOFT_CHECKED,CONST_NUM_MICROSOFTONLY_CHECKED ,CONST_NUM_APPLEENCRYPTED_CHECKED ,CONST_NUM_APPLEENCRYPTEDORMICROSOFT_CHECKED F_chkSavePassword = CONST_CHECKED End Select 'getting the value of authentication type with reference to the server options value Select case F_nServerOptions case CONST_NUM_MICROSOFTONLY,CONST_NUM_MICROSOFTONLY_CHECKED F_cboAuthenticationValues = CONST_NUM_MICROSOFTONLY case CONST_NUM_APPLECLEARTEXT,CONST_NUM_APPLECLEARTEXT_CHECKED F_cboAuthenticationValues = CONST_NUM_APPLECLEARTEXT case CONST_NUM_APPLEENCRYPTED,CONST_NUM_APPLEENCRYPTED_CHECKED F_cboAuthenticationValues = CONST_NUM_APPLEENCRYPTED case CONST_NUM_APPLECLEARTEXTORMICROSOFT,CONST_NUM_APPLECLEARTEXTORMICROSOFT_CHECKED F_cboAuthenticationValues = CONST_NUM_APPLECLEARTEXTORMICROSOFT case CONST_NUM_APPLEENCRYPTEDORMICROSOFT,CONST_NUM_APPLEENCRYPTEDORMICROSOFT_CHECKED F_cboAuthenticationValues = CONST_NUM_APPLEENCRYPTEDORMICROSOFT case else 'setting the default to "Microsoft only" F_cboAuthenticationValues = CONST_NUM_MICROSOFTONLY End Select 'the max session value obtained from registry F_nMaxSessions = GetAppletalkConfigValues(CONST_KEYMAXSESSIONS,CONST_DWORD) If(F_nMaxSessions = "") then F_nMaxSessions = Cint(0) End If 'making the sessions check box checked If F_nMaxSessions = CONST_MAXSESSIONS then F_radSessionsUnlimited = CONST_CHECKED F_txtLimitto = CONST_LIMITVAL Else F_radSessionslimitto = CONST_CHECKED F_txtLimitto =ConvertSINT_UINT ( F_nMaxSessions) End If OnInitPage = TRUE End Function '--------------------------------------------------------------------- 'Function: OnServeTabbedPropertyPage 'Description: Called when the page needs to be served. 'Input Variables: PageIn,EventArg,iTab,bIsVisible 'Output Variables: PageIn,EventArg 'Returns: TRUE to indicate not problems occured. FALSE to indicate errors. ' Returning FALSE will cause the page to be abandoned. 'Global Variables: g_iTabDNS,g_iTabTCP,g_iTabLMHosts,g_iTabIPX '--------------------------------------------------------------------- Public Function OnServeTabbedPropertyPage(ByRef PageIn, _ ByVal iTab, _ ByVal bIsVisible, ByRef EventArg) Select Case iTab Case g_iTabAppleTalk Call ServeTabGeneral(PageIn, bIsVisible) End Select OnServeTabbedPropertyPage = TRUE End Function '------------------------------------------------------------------------- 'Function: OnPostBackPage() 'Description: Called to signal that the page has been posted-back. 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: None '------------------------------------------------------------------------- Public Function OnPostBackPage(ByRef PageIn, ByRef EventArg) 'get the save passwors check box status F_chkSavePassword = Request.Form("hdnchkSavePassword") 'get the sessins radio button status F_radSessions = Request.Form("hdnradSessions") 'to make the check box selected on submit Select case lcase(F_radSessions) case CONST_UNLIMITED F_radSessionsUnlimited = CONST_CHECKED case CONST_LIMITTO F_radSessionslimitto = CONST_CHECKED End Select 'get the text area content - LogonMessage F_txaLogonMessage = Request.Form("txaLogonMessage") 'get the session limit to number F_txtLimitto = Request.Form("txtLimitto") F_cboAuthenticationValues = Request.Form("hdncboAuthenticationValues") OnPostBackPage = TRUE End Function '------------------------------------------------------------------------- 'Function: OnSubmitPage() 'Description: Called when the page has been submitted for processing. 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: None '------------------------------------------------------------------------- Public Function OnSubmitPage(ByRef PageIn, ByRef EventArg) Dim nReturnValue 'return value Const CONST_MSG_MAXBYTES = 199 ' max bytes allowed for logon message ' check for the maximum number of bytes allowed in the logon message If LenB(F_txaLogonMessage) > CONST_MSG_MAXBYTES Then Call SA_SetErrMsg(L_LONG_LOGONMESSAGE_ERRORMESSAGE) OnSubmitPage = False Exit Function End If Call RegistryConnection() 'updating Loginmsg in registry call UpdateAppletalkConfigValues(CONST_KEYLOGINMSG,F_txaLogonMessage,CONST_STRING) 'Updating the checkbox for save password and authenication type in registry F_nServerOptions = F_cboAuthenticationValues If lcase(F_chkSavePassword) = lcase(CONST_CHECKED) then F_nServerOptions = F_nServerOptions + CONST_CHECKNUM End IF call UpdateAppletalkConfigValues(CONST_KEYSERVEROPTIONS,F_nServerOptions,CONST_DWORD) 'Updating the Sessions-no of clients connected to the value If Lcase(F_radSessions) = Lcase(CONST_UNLIMITED) then call UpdateAppletalkConfigValues(CONST_KEYMAXSESSIONS,CONST_MAXVALUE,CONST_DWORD) Else call UpdateAppletalkConfigValues(CONST_KEYMAXSESSIONS,F_txtLimitto,CONST_DWORD) End IF Call StopAndStartService() OnSubmitPage = True End Function '--------------------------------------------------------------------- 'Function: OnClosePage 'Description: Called when the page is about to be closed. 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: None' '--------------------------------------------------------------------- Public Function OnClosePage(ByRef PageIn, ByRef EventArg) OnClosePage = TRUE End Function '------------------------------------------------------------------------- 'Function: ServeTabGeneral() 'Description: Serves LMHosts hosts tab 'Input Variables: PageIn,bIsVisible 'Output Variables: PageIn 'Returns: gc_ERR_SUCCESS 'Global Variables: None '------------------------------------------------------------------------- Private Function ServeTabGeneral(ByRef PageIn, ByVal bIsVisible) Call SA_TraceOut(SOURCE_FILE, "ServeTabGeneral(PageIn, bIsVisible="+ CStr(bIsVisible) + ")") If ( bIsVisible ) Then Call ServeCommonJavaScript() %>
<%=L_LOGONMESSAGE_TEXT%> | |||
<%=L_SECURITY_TEXT%> | |||
> <%=L_SAVEPASSWORD_TEXT%> | |||
<%=L_ENABLEAUTHENTICATION_TEXT%> | |||
<%=L_SESSIONS_TEXT%> | |||
OnClick="DisableLimittoText()"> <%=L_UNLIMITED_TEXT%> | |||
OnClick="EnableLimittoText()" > <%=L_LIMITTO_TEXT%> |