home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1999-06-16 | 41.2 KB | 1,332 lines
'//////////////////////////////////////////////////////////////////// '// '// Source File uniprof_src.htm '// '// Windows Media Administrator, ver 3.0 '// Copyright 2/4/98 Microsoft Corporation '// '//////////////////////////////////////////////////////////////////// Dim L_TenAsterisks_Text L_TenAsterisks_Text = "**********" Dim L_CannotApplyLogDir_Text L_CannotApplyLogDir_Text = "Cannot apply log file directory." Dim L_PathTooShort_Text L_PathTooShort_Text = "Path is to short to be valid." Dim L_PathNotValid_Text L_PathNotValid_Text = "Log file path is not valid." Dim L_PathInvalidChars1_Text L_PathInvalidChars1_Text = "Invalid characters found in log file path." Dim L_PathInvalidChars2_Text L_PathInvalidChars2_Text = "Invalid characters include '*','?','|','/','<','>' and quotes." Dim L_PathNotValid2_Text L_PathNotValid2_Text = "A valid path must begin with \\ or <drive>:\ where <drive> is between A and Z." Dim L_WrongPassword_Text L_WrongPassword_Text = "The password you entered was incorrect. Enter the password again." Dim L_ConfirmPassword_Text L_ConfirmPassword_Text = "Validate the password you specified in the Distribution Authentication tab." Dim L_ProxyNameRequired_Text L_ProxyNameRequired_Text = "A proxy name is required." Dim L_UserNameRequired_Text L_UserNameRequired_Text = "A user name is required." Dim L_PasswordRequired_Text L_PasswordRequired_Text = "A password is required." Dim L_PageHeader_Text L_PageHeader_Text = "Configure Server - Server Properties" Dim L_CurrentValue_Text L_CurrentValue_Text = "Current value: " Dim L_MaxClients_Text L_MaxClients_Text = "Maximum clients: " Dim L_Clients_Text L_Clients_Text = "Clients" Dim L_MaxBandWidth_Text L_MaxBandWidth_Text = "Maximum bandwidth: " Dim L_MaxBandUnit_Text L_MaxBandUnit_Text = "Kbits/sec" Dim L_MaxFileBitrate_Text L_MaxFileBitrate_Text = "Maximum file bitrate: " Dim L_Apply_Text L_Apply_Text = "Apply" Dim L_PeriodTime_Text L_PeriodTime_Text = "Period:" Dim L_Refresh_Text L_Refresh_Text = "Refresh" Dim L_General_Text L_General_Text = "General" Dim L_PubPointSecurity_Text L_PubPointSecurity_Text = "Publishing Point Security" Dim L_DistAuthentication_Text L_DistAuthentication_Text = "Distribution Authentication" dim L_PubPointLogging_Text L_PubPointLogging_Text = "Publishing Point Logging" Dim L_EnableACL_Text L_EnableACL_Text = "Enable Access Control List (ACL) checking" Dim L_EnableAuth_Text L_EnableAuth_Text = "Enable server authentication" Dim L_Proxy_Text L_Proxy_Text = "Proxy: " Dim L_BandLessThanBitRate_Text L_BandLessThanBitRate_Text = "The maximum bandwidth value specified is less than the maximum filebitrate." Dim L_UserID_Text L_UserID_Text = "User ID: " Dim L_NewPassword_Text L_NewPassword_Text = "Password: " Dim L_ChooseEnable_Text L_ChooseEnable_Text = "Choose Enable Logging to log Unicast events to a text file. A new log can be generated daily, weekly, monthly, or when the log file reaches a specified size. The log directory path must be a directory that resides on the server being administered. To learn how to analyze Windows Media log files," Dim L_ChooseEnable2_Text L_ChooseEnable2_Text = "click here" Dim L_EnableLog_Text L_EnableLog_Text = "Enable logging" Dim L_Daily_Text L_Daily_Text = "Daily" Dim L_Weekly_Text L_Weekly_Text = "Weekly" Dim L_Monthly_Text L_Monthly_Text = "Monthly" Dim L_Period_Text L_Period_Text = "When file size reaches:" Dim L_LogUnit_Text L_LogUnit_Text = "Kbytes" Dim L_LogFileDir_Text L_LogFileDir_Text = "Log file directory" Dim L_DirNote_Text L_DirNote_Text = "(Directory is referenced from the Windows Media server currently being administered)" Dim RestartUnicast RestartUnicast=false 'Constants Dim NSOADM_PLUGIN_ERROR NSOADM_PLUGIN_ERROR=1 Dim NSOADM_PLUGIN_LOADED NSOADM_PLUGIN_LOADED=2 Dim NSOADM_PLUGIN_ENABLED NSOADM_PLUGIN_ENABLED=4 Dim NSOADM_PLUGIN_RUNNING NSOADM_PLUGIN_RUNNING=8 Dim NSOADM_PLUGIN_LOAD_NEXT_RESTART NSOADM_PLUGIN_LOAD_NEXT_RESTART=16 Dim NSOADM_PLUGIN_UNLOAD_NEXT_RESTART NSOADM_PLUGIN_UNLOAD_NEXT_RESTART=32 Dim Authenabled Dim AuthPending Dim SelPackCLSID Dim L_AuthenticationPkg_Text L_AuthenticationPkg_Text = "Authentication Packages" Dim L_ChangeAuth1_Text L_ChangeAuth1_Text ="You have chosen to change the authentication setting for this server." Dim L_ChangeAuth2_Text L_ChangeAuth2_Text = "Are you sure you want to change this setting?" Dim L_RequireMember1_Text L_RequireMember1_Text = "This option requires Microsoft Membership services to be installed" Dim L_RequreMember2_Text L_RequireMember2_Text = "and running on this server in order to run successfully." Dim L_RequireMember3_Text L_RequireMember3_Text = "Are you sure you want to change this setting?" Dim L_RestartUni1_Text L_RestartUni1_Text = "The Windows Media Unicast service will have to be stopped and restarted before the change will take effect." Dim L_RestartUni2_Text L_RestartUni2_Text = "WARNING: You must restart the Windows Media Administrator after you have restarted the Windows Media Unicast service." Dim L_Pending_Text L_Pending_Text = "Pending" Dim L_Selected_Text L_Selected_Text = "Selected" Dim L_RuntimeFailure_Text L_RuntimeFialure_Text = "Runtime failure" Dim L_LoadFailure_Text L_LoadFailure_Text = "Load failure" Dim L_Active_Text L_Active_Text = "Active" Dim L_DontUseAuth_Text L_DontUseAuth_Text = "Do not use authentication" Dim L_Status_Text L_Status_Text = "Status" Dim L_SpecifyDirectory_Text L_SpecifyDirectory_Text = "A directory must be specified when trying to enable logging." Dim L_MaxFileSizeNumeric_Text L_MaxFileSizeNumeric_Text = "The maximum file size field contains non-numeric characters. Specify only numeric characters." Dim L_LogFileSizeLimit_Text L_LogFileSizeLimit_Text = "The log file size must be a value between 8 and 1,000,000 Kbytes inclusive." Dim L_ValidEntries_Text L_ValidEntries_Text = "Valid entries required in all fields." Dim L_MaxBandZero_Text L_MaxBandZero_Text = "Please enter a maximum bandwidth value greater than 0." Dim L_MaxClientZero_Text L_MaxClientZero_Text = "Please enter a maximum client value of zero or higher." Dim L_MaxBitRateZero_Text L_MaxBitRateZero_Text = "Please enter a maximum file bitrate value greater than 0." Dim L_HTTPStreaming_Text L_HTTPStreaming_Text = "HTTP Streaming and Distribution" Dim L_NoHTTPStreaming_Text L_NoHTTPStreaming_Text = "Do not enable HTTP streaming or distribution." Dim L_EnableHTTPUnicast_Text L_EnableHTTPUnicast_Text = "Enable HTTP streaming for Windows Media Unicast service" Dim L_EnableHTTPMulticast_Text L_EnableHTTPMulticast_Text = "Enable HTTP distribution for Windows Media Station service" Dim L_MustRebootStream_Text L_MustRebootStream_Text = "You must reboot this machine before the changes take effect" Dim L_LogFileFormat_Text L_LogFileFormat_Text = "Note: Windows Media log files in the above directory have the form 'NetShow.yymmddiii.log,' for instance, 'NetShow.980201000.log.'" Dim L_LocalizedFontName_Text L_LocalizedFontName_Text = "Arial" '*********************************************************** 'CODE '*********************************************************** Dim Sorting, Col1, Col2 '------------------------------------------------------------------------------ 'GENERAL TAB BEGINS '------------------------------------------------------------------------------ Sub GetGeneralTabData() On Error Resume Next if(nsadmin.MaxClients > 0) Then Maxclients.value = nsadmin.MaxClients document.all.SelClientLimit.value = 1 Maxclients.disabled=false Maxclients.style.backgroundColor = gMAXCLIENTS.style.backgroundColor else Maxclients.style.backgroundColor = document.body.bgcolor SelClientLimit.value = -1 Maxclients.value="" Maxclients.disabled=true end if if(nsadmin.MaxBandWidth > 0) then Maxbitrate.value = Round(nsadmin.MaxBandWidth/1024) BitrateLimit.value = 1 Maxbitrate.disabled=false Maxbitrate.style.backgroundColor = gMAXBANDWIDTH.style.backgroundColor else BitrateLimit.value = -1 Maxbitrate.value="" Maxbitrate.disabled=true Maxbitrate.style.backgroundColor = document.body.bgcolor end if if(nsadmin.MaxFileBitRate > 0) then Maxfilerate.value = Round(nsadmin.MaxFileBitRate/1024) FilerateLimit.value = 1 Maxfilerate.disabled=false Maxfilerate.style.backgroundColor = gMAXFILEBITRATE.style.backgroundColor else Maxfilerate.style.backgroundColor = document.body.bgcolor FilerateLimit.value = -1 Maxfilerate.value="" Maxfilerate.disabled=true end if End Sub function ActivateApply() if(Apply.disabled) then Apply.disabled=false end if end function Function ChangeSelClientLimit() on error resume next err.clear() document.all.Maxclients.value ="" 'If user selected No Limit then grey out and set maxclients to 0xffffffff if SelClientLimit.options(SelClientLimit.selectedIndex).Text = Top.Code.L_NoLimit_Text then document.all.Maxclients.disabled = true document.all.Maxclients.style.backgroundColor = document.body.bgcolor document.all.Apply.disabled=false document.all.Maxclients.value = "" else if nsadmin.MaxClients <> -1 then document.all.Maxclients.value = Top.Code.NSUniMgr.MaxClients end if document.all.Maxclients.disabled = false document.all.Maxclients.style.backgroundColor = gMAXCLIENTS.style.backgroundColor document.all.Apply.disabled=false end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text end if end function function ChangeTxtClientLimit() on error resume next err.clear() document.all.Apply.disabled=false if IsNumeric(document.all.Maxclients.value) then if (document.all.Maxclients.value - CLng(document.all.Maxclients.value)) = 0 And CLng(document.all.Maxclients.value) >= 0 then document.all.Apply.disabled=false else msgbox(L_MaxClientZero_Text),vbExclamation,Top.Code.L_Title_Text if Top.Code.NSUniMgr.MaxClients < 0 then document.all.Maxclients.value = "" else document.all.Maxclients.value=Top.Code.NSUniMgr.MaxClients end if end if else msgbox(L_MaxClientZero_Text),vbExclamation,Top.Code.L_Title_Text if Top.Code.NSUniMgr.MaxClients < 0 then document.all.Maxclients.value = "" else document.all.Maxclients.value=Top.Code.NSUniMgr.MaxClients end if end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text end if end function function ChangeSelBitrateLimit() on error resume next err.clear() document.all.Maxbitrate.value ="" if window.event.srcElement.value <>1 then document.all.Maxbitrate.disabled = true document.all.Maxbitrate.style.backgroundColor = document.body.bgcolor document.all.Apply.disabled=false document.all.Maxbitrate.value = "" else if Top.Code.NSUniMgr.MaxBandWidth <> -1 then document.all.Maxbitrate.value = Top.Code.NSUniMgr.MaxBandWidth \ 1024 end if document.all.Maxbitrate.disabled = false document.all.Maxbitrate.style.backgroundColor = gMAXBANDWIDTH.style.backgroundColor document.all.Apply.disabled=false end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text end if end function function ChangeSelFileRateLimit() on error resume next err.clear() document.all.Maxfilerate.value ="" if window.event.srcElement.value <>1 then document.all.Maxfilerate.disabled = true document.all.Maxfilerate.style.backgroundColor = document.body.bgcolor document.all.Apply.disabled=false else if Top.Code.NSUniMgr.MaxFileBitRate <> -1 then document.all.Maxfilerate.value = Top.Code.NSUniMgr.MaxFileBitRate \ 1024 end if document.all.Maxfilerate.disabled = false document.all.Maxfilerate.style.backgroundColor = gMAXFILEBITRATE.style.backgroundColor document.all.Apply.disabled=false end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text end if end function function ChangeTxtMaxbitrate() on error resume next err.clear() document.all.Apply.disabled=false if IsNumeric(document.all.Maxbitrate.value) then if (document.all.Maxbitrate.value - CLng(document.all.Maxbitrate.value)) = 0 And CLng(document.all.Maxbitrate.value) > 0 then document.all.Apply.disabled=false else msgbox(L_MaxBandZero_Text),vbExclamation,Top.Code.L_Title_Text if Top.Code.NSUniMgr.MaxBandWidth < 0 then document.all.Maxbitrate.value="" else document.all.Maxbitrate.value=Top.Code.NSUniMgr.MaxBandWidth \ 1024 end if end if else msgbox(L_MaxBandZero_Text),vbExclamation,Top.Code.L_Title_Text if Top.Code.NSUniMgr.MaxBandWidth < 0 then document.all.Maxbitrate.value="" else document.all.Maxbitrate.value=Top.Code.NSUniMgr.MaxBandWidth \ 1024 end if end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text end if end function function ChangeTxtMaxfilerate() on error resume next err.clear() document.all.Apply.disabled=false if IsNumeric(document.all.Maxfilerate.value) then if (document.all.Maxfilerate.value - CLng(document.all.Maxfilerate.value)) = 0 And CLng(document.all.Maxfilerate.value) > 0 then document.all.Apply.disabled=false else msgbox(L_MaxBitRateZero_Text),vbExclamation,Top.Code.L_Title_Text if Top.Code.NSUniMgr.MaxFileBitRate < 0 then document.all.Maxfilerate.value="" else document.all.Maxfilerate.value=Top.Code.NSUniMgr.MaxFileBitRate \ 1024 end if end if else msgbox(L_MaxBitRateZero_Text),vbExclamation,Top.Code.L_Title_Text if Top.Code.NSUniMgr.MaxFileBitRate < 0 then document.all.Maxfilerate.value="" else document.all.Maxfilerate.value=Top.Code.NSUniMgr.MaxFileBitRate \ 1024 end if end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text end if end function function OnApplyGeneral() on error resume next err.clear() if (document.all.Maxfilerate.value <> "" AND document.all.Maxbitrate.value <> "") then if (document.all.Maxfilerate.value * 1024) > (document.all.Maxbitrate.value *1024 ) then msgbox L_BandLessThanBitRate_Text,vbExclamation,Top.Code.L_Title_Text end if end if if document.all.FilerateLimit.value > 0 then if Not IsNumeric(document.all.Maxfilerate.value) then msgbox(L_MaxBitRateZero_Text),vbExclamation,Top.Code.L_Title_Text document.all.Maxfilerate.value = "" Call document.all.Maxfilerate.focus() exit function end if if (document.all.Maxfilerate.value * 1024) <> top.Code.NSUniMgr.MaxFileBitRate Then if (document.all.Maxfilerate.value - CLng(document.all.Maxfilerate.value)) = 0 And CLng(document.all.Maxfilerate.value) > 0 then top.Code.NSUniMgr.MaxFileBitRate = document.all.Maxfilerate.value * 1024 else msgbox(L_MaxBitRateZero_Text),vbExclamation,Top.Code.L_Title_Text document.all.Maxfilerate.value = "" exit function end if end if else top.Code.NSUniMgr.MaxFileBitRate = -1 end if Call err.clear() if document.all.BitrateLimit.value > 0 then if IsNumeric(document.all.Maxbitrate.value) then if (document.all.Maxbitrate.value * 1024) <> top.Code.NSUniMgr.MaxBandWidth Then if (document.all.Maxbitrate.value - CLng(document.all.Maxbitrate.value)) = 0 And CLng(document.all.Maxbitrate.value) > 0 then top.Code.NSUniMgr.MaxBandWidth = document.all.Maxbitrate.value * 1024 else msgbox(L_ZMaxBandero_Text),vbExclamation,Top.Code.L_Title_Text document.all.Maxbitrate.value="" exit function end if end if else msgbox(L_MaxBandZero_Text),vbExclamation,Top.Code.L_Title_Text document.all.Maxbitrate.value="" exit function end if else top.Code.NSUniMgr.MaxBandWidth = -1 end if err.clear() if SelClientLimit.options(SelClientLimit.selectedIndex).Text <> Top.Code.L_NoLimit_Text then if IsNumeric(document.all.Maxclients.value) then if (document.all.Maxclients.value - CLng(document.all.Maxclients.value)) = 0 And CLng(document.all.Maxclients.value) >= 0 then top.Code.NSUniMgr.MaxClients = document.all.Maxclients.value else msgbox(L_MaxClientZero_Text),vbExclamation,Top.Code.L_Title_Text document.all.Maxclients.value = "" exit function end if else msgbox(L_MaxClientZero_Text),vbExclamation,Top.Code.L_Title_Text document.all.Maxclients.value = "" exit function end if else top.Code.NSUniMgr.MaxClients = -1 end if document.all.Apply.disabled=true end function function OnRefreshKey() if window.event.keycode = 9 then window.event.cancelbubble = true document.all.SelClientLimit.focus() end if end function function OnRefreshGeneral() on error resume next err.clear() if(Top.Code.NSUniMgr.MaxClients < 0) then document.all.SelClientLimit.value = -1 document.all.Maxclients.disabled = true document.all.Maxclients.style.backgroundColor = document.body.bgcolor document.all.Apply.disabled=false document.all.Maxclients.value = "" else document.all.Maxclients.value = Top.Code.NSUniMgr.MaxClients document.all.SelClientLimit.value = 1 document.all.Maxclients.disabled = false document.all.Maxclients.style.backgroundColor = gMAXCLIENTS.style.backgroundColor document.all.Apply.disabled=false end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text err.clear() end if if Top.Code.NSUniMgr.MaxBandWidth < 0 then document.all.BitrateLimit.value = -1 document.all.Maxbitrate.disabled = true document.all.Maxbitrate.style.backgroundColor = document.body.bgcolor document.all.Apply.disabled=false document.all.Maxbitrate.value = "" else document.all.Maxbitrate.value=(Top.Code.NSUniMgr.MaxBandWidth \ 1024) document.all.BitrateLimit.value = 1 document.all.Maxbitrate.disabled = false document.all.Maxbitrate.style.backgroundColor = gMAXBANDWIDTH.style.backgroundColor document.all.Apply.disabled=false end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text err.clear() end if if Top.Code.NSUniMgr.MaxFileBitRate < 0 then document.all.FilerateLimit.value = -1 document.all.Maxfilerate.disabled = true document.all.Maxfilerate.style.backgroundColor = document.body.bgcolor document.all.Apply.disabled=false document.all.Maxfilerate.value = "" else document.all.Maxfilerate.value = (Top.Code.NSUniMgr.MaxFileBitRate \ 1024) document.all.FilerateLimit.value = 1 document.all.Maxfilerate.disabled = false document.all.Maxfilerate.style.backgroundColor = gMAXFILEBITRATE.style.backgroundColor document.all.Apply.disabled=false end if if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text end if document.all.Apply.disabled=true end function '-------------------------------------------------------------------------------------------- 'GENERAL TAB ENDS '------------------------------------------------------------------------------------------- '---------------------------------------------------------------------------------------------- 'Authentication TAB Begins '--------------------------------------------------------------------------------------------- function OnPubRefreshKey() if window.event.keycode = 9 then window.event.cancelbubble = true document.all.AuthFlexGrid.focus() end if end function function ToggleACL() document.all.Authorization.Click() end function function AuthorizationClick() AuthApply.disabled = False end function Sub AuthFlexGrid_SelChange() AuthApply.disabled = False End Sub sub AuthFlexGrid_MouseDown(a,b,XPos,YPos) on error resume next Col1W=int(AuthFlexGrid.ColWidth(1)/15.12) Col2W=int(AuthFlexGrid.ColWidth(2)/15.12) if YPos<18 then if XPos < Col1W then AuthFlexGrid.Col=1 if Col1 then AuthFlexGrid.Sort=2 if not Col1 then AuthFlexGrid.Sort=1 Col1=not Col1 elseif XPos > Col1W and XPos < Col1W+Col2W then AuthFlexGrid.Col=2 if Col2 then AuthFlexGrid.Sort=2 if not Col2 then AuthFlexGrid.Sort=1 Col2=not Col2 end if Sorting=true end if end sub function InitializePPSecurity() document.all.AuthFlexGrid.Cols=3 document.all.AuthFlexGrid.fontsize=10 document.all.AuthFlexGrid.ColWidth(0)=0 document.all.AuthFlexGrid.ColWidth(1)=5525 document.all.AuthFlexGrid.ColWidth(2)=1525 document.all.AuthFlexGrid.Col=1 document.all.AuthFlexGrid.Row=0 document.all.AuthFlexGrid.Text= L_AuthenticationPkg_Text document.all.AuthFlexGrid.Col=2 document.all.AuthFlexGrid.Text= L_Status_Text document.all.AuthFlexGrid.font.name=L_LocalizedFontName_Text document.all.AuthFlexGrid.font.italic=false RefreshPPSecurity() end function function AuthRefreshClick() Call Top.Menu.oList.ConnectToUni() end function function RestoreState() SET Plugins = top.code.NSUniMgr.AuthenticationPlugins for i=0 to Plugins.count-1 Set Plugin=Plugins.item(i) if (Plugin.Status AND NSOADM_PLUGIN_ENABLED) then Plugin.Enabled=false end if next for i=0 to Plugins.count-1 Set Plugin=Plugins.item(i) if (Plugin.Status AND NSOADM_PLUGIN_UNLOAD_NEXT_RESTART) then Plugin.Enabled=true end if next end function function RefreshPPSecurity() document.all.AuthFlexGrid.BackColorSel = 16777215 Authenabled = false ActiveRow=1 Plugins = top.code.NSUniMgr.AuthenticationPlugins.count document.all.AuthFlexGrid.rows=Plugins+2 'first option created here: Do not use authentication document.all.AuthFlexGrid.row=1 document.all.AuthFlexGrid.col=1 document.all.AuthFlexGrid.text=L_DontUseAuth_Text document.all.AuthFlexGrid.col=2 document.all.AuthFlexGrid.text="" nUnloadingAndRunning = 0 nloadingOnNextRestart = 0 ErrorState = false for i=0 to Plugins-1 document.all.AuthFlexGrid.row=i+2 document.all.AuthFlexGrid.col=1 document.all.AuthFlexGrid.text=top.code.NSUniMgr.AuthenticationPlugins.item(i).description document.all.AuthFlexGrid.col=2 select case top.code.NSUniMgr.AuthenticationPlugins.item(i).Status Case 0 document.all.AuthFlexGrid.text = "" Case NSOADM_PLUGIN_ERROR document.all.AuthFlexGrid.text=L_LoadFailure_Text bLoadFailure = True ActiveRow=document.all.AuthFlexGrid.Row ErrorState = True Case NSOADM_PLUGIN_RUNNING + NSOADM_PLUGIN_LOADED + NSOADM_PLUGIN_ENABLED document.all.AuthFlexGrid.text= L_Active_Text ActiveRow=document.all.AuthFlexGrid.Row Case NSOADM_PLUGIN_LOADED + NSOADM_PLUGIN_RUNNING + NSOADM_PLUGIN_UNLOAD_NEXT_RESTART document.all.AuthFlexGrid.text= L_Active_Text bActiveRow = True ActiveRow=document.all.AuthFlexGrid.Row nUnloadingAndRunning = ActiveRow Case NSOADM_PLUGIN_LOAD_NEXT_RESTART + NSOADM_PLUGIN_ENABLED document.all.AuthFlexGrid.text=L_Pending_Text nloadingOnNextRestart = document.all.AuthFlexGrid.Row Case NSOADM_PLUGIN_ENABLED + NSOADM_PLUGIN_ERROR document.all.AuthFlexGrid.text=L_LoadFailure_Text bLoadFailure = True ActiveRow=document.all.AuthFlexGrid.Row Case NSOADM_PLUGIN_UNLOAD_NEXT_RESTART + NSOADM_PLUGIN_ERROR document.all.AuthFlexGrid.text=L_LoadFailure_Text nUnloadingAndRunning = ActiveRow Case NSOADM_PLUGIN_LOAD_NEXT_RESTART + NSOADM_PLUGIN_ENABLED + NSOADM_PLUGIN_ERROR document.all.AuthFlexGrid.text= L_Pending_Text nloadingOnNextRestart = document.all.AuthFlexGrid.Row Case 35 document.all.AuthFlexGrid.text= L_RuntimeFailure_Text end select next document.all.AuthFlexGrid.Row=1 document.all.AuthFlexGrid.Col=2 if ActiveRow>1 then document.all.Authorization.disabled=false if disabledPending then document.all.AuthFlexGrid.text= L_Pending_Text else document.all.AuthFlexGrid.text="" end if if ACLRunning then document.all.Authorization.checked=true else document.all.Authorization.checked=false end if else document.all.AuthFlexGrid.text= L_Selected_Text document.all.Authorization.disabled=true call disableACL() end if If (nUnloadingAndRunning > 0 AND nloadingOnNextRestart = 0) OR (Not AnyEnabled AND ErrorState) Then document.all.AuthFlexGrid.row = 1 document.all.AuthFlexGrid.col = 2 document.all.AuthFlexGrid.Text = L_Pending_Text End If document.all.AuthFlexGrid.Row=ActiveRow document.all.AuthFlexGrid.Col=0 document.all.AuthFlexGrid.ColSel=2 if ACLRunning then document.all.authorization.checked=true end if document.all.AuthFlexGrid.BackColorSel= 2147483661 document.all.AuthApply.disabled = true end function function disabledPending() Pendingload=false ActivePendingUnload=false SET Plugins = top.code.NSUniMgr.AuthenticationPlugins for i=0 to Plugins.count-1 Set Plugin=Plugins.item(i) if (Plugin.Status AND (NSOADM_PLUGIN_LOADED + NSOADM_PLUGIN_RUNNING + NSOADM_PLUGIN_UNLOAD_NEXT_RESTART)) then ActivePendingUnload=true end if if (Plugin.Status AND (NSOADM_PLUGIN_LOAD_NEXT_RESTART + NSOADM_PLUGIN_ENABLED)) then Pendingload=true end if next if (NOT PendingLoad) AND (ActivePendingUnload) then disabledPending=true else disabledPending=false end if end function function AnyEnabled() AnyEnabled=false SET Plugins = top.code.NSUniMgr.AuthenticationPlugins for i=0 to Plugins.count-1 Set Plugin=Plugins.item(i) if Plugin.Status AND NSOADM_PLUGIN_ENABLED OR Plugin.Status = NSOADM_PLUGIN_ENABLED + NSOADM_PLUGIN_ERROR OR Plugin.Status AND NSOADM_PLUGIN_LOADED then AnyEnabled=true Exit Function end if next end function function clearAllEnables() SET Plugins = top.code.NSUniMgr.AuthenticationPlugins for i=0 to Plugins.count-1 Set Plugin=Plugins.item(i) if (Plugin.Status AND NSOADM_PLUGIN_ENABLED) then Plugin.Enabled=false end if next end function function AuthApplyEnable(ItemNum) SET Plugins = top.code.NSUniMgr.AuthenticationPlugins call clearAllEnables() Plugins.item(ItemNum).Enabled=true if NOT document.all.authorization.disabled then if document.all.authorization.checked then enableACL() else disableACL() end if end if call RefreshPPSecurity() if RestartUnicast then msgbox L_RestartUni1_Text & chr(13) & chr(13) & L_RestartUni2_Text ,vbExclamation,Top.Code.L_Title_Text end if end function function AuthApplyClick() On Error Resume Next RestartUnicast=false if document.all.AuthFlexGrid.row=1 then Any = AnyEnabled If Err.Number <> 0 Then Call AuthRefreshClick() Exit Function End iF if Any then if msgbox (L_ChangeAuth1_Text & L_ChangeAuth2_Text & chr(13) ,292,Top.Code.L_Title_Text)=6 then call clearAllEnables() call RefreshPPSecurity() document.all.AuthFlexGrid.row = 1 document.all.AuthFlexGrid.col = 2 document.all.AuthFlexGrid.Text = L_Pending_Text msgbox L_RestartUni1_Text & chr(13) & chr(13) & L_RestartUni2_Text ,vbExclamation,Top.Code.L_Title_Text else Call RefreshPPSecurity() end if end if exit function end if ItemNum=document.all.AuthFlexGrid.row-2 selPackStat=top.code.NSUniMgr.AuthenticationPlugins.item(ItemNum).status selPackCLSID=top.code.NSUniMgr.AuthenticationPlugins.item(ItemNum).CLSID if selPackstat AND (NSOADM_PLUGIN_RUNNING + NSOADM_PLUGIN_UNLOAD_NEXT_RESTART) then RestartUnicast=false call AuthApplyEnable(ItemNum) end if if selPackstat AND (NSOADM_PLUGIN_ENABLED + NSOADM_PLUGIN_RUNNING) then exit function end if if selPackstat AND (NSOADM_PLUGIN_LOAD_NEXT_RESTART) then exit function end if if NOT (selpack AND NSOADM_PLUGIN_ENABLED) then if selPackCLSID="{d9df823c-4425-11d1-932c-00c04fd919b7}" then if msgbox (L_RequireMember1_Text & Chr(13) & L_RequireMember2_Text & chr(13) & L_RequireMember3_Text ,292,Top.Code.L_Title_Text)=6 then RestartUnicast=true call AuthApplyEnable(ItemNum) else Call RefreshPPSecurity() end if else if msgbox (L_ChangeAuth1_Text & chr(13) & L_ChangeAuth2_Text ,292,Top.Code.L_Title_Text)=6 then RestartUnicast=true call AuthApplyEnable(ItemNum) else Call RefreshPPSecurity() end if end if end if if document.all.Authorization.checked then call enableACL() else call disableACL() end if end function function enableACL() Set EventPlugins = top.code.nsunimgr.EventPlugins for i=0 to EventPlugins.count-1 if Ucase(EventPlugins.item(i).clsid)= Ucase("{A5E8B32E-442A-11D1-9EA0-006097D2D7CF}") then EventPlugins.item(i).Enabled=true end if next end function function disableACL() Set EventPlugins = top.code.nsunimgr.EventPlugins for i=0 to EventPlugins.count-1 if Ucase(EventPlugins.item(i).clsid)= Ucase("{A5E8B32E-442A-11D1-9EA0-006097D2D7CF}") then EventPlugins.item(i).Enabled=false end if next end function function ACLRunning() ACLRunning=false Set EventPlugins = top.code.nsunimgr.EventPlugins for i=0 to EventPlugins.count-1 if Ucase(EventPlugins.item(i).clsid)= Ucase("{A5E8B32E-442A-11D1-9EA0-006097D2D7CF}") then if EventPlugins.item(i).Status AND NSOADM_PLUGIN_ENABLED then ACLRunning=true end if end if next end function function OnDistAuthRefreshKey() if window.event.keycode = 9 then window.event.cancelbubble = true document.all.EnableProxy.focus() end if end function function initDistAuth() on error resume next document.all.EnableProxy.checked = Top.Code.NSUniMgr.EnableProxy If Err.Number <> 0 Then Call Top.Code.CheckCriticalError(err.number, "Unicast") Exit Function End If document.all.Proxy.value = Top.Code.NSUniMgr.ProxyHostName If Err.Number <> 0 Then Call Top.Code.CheckCriticalError(err.number, "Unicast") Exit Function End If document.all.UserID.value = Top.Code.NSUniMgr.ProxyUser If Err.Number <> 0 Then Call Top.Code.CheckCriticalError(err.number, "Unicast") Exit Function End If Call ToggleEnableProxy( document.all.EnableProxy.checked) document.all.DistApply.disabled=true if(document.all.UserID.value <> "" ) then document.all.NewPassword.value = L_TenAsterisks_Text else document.all.NewPassword.value = "" end if end function sub ToggleEnableProxy(b) if b then document.all.Proxy.style.backgroundColor = gPROXY.style.backgroundColor document.all.Proxy.disabled = false document.all.UserID.style.backgroundColor = gPROXY.style.backgroundColor document.all.NewPassword.style.backgroundColor = gPROXY.style.backgroundColor document.all.UserID.disabled = false document.all.NewPassword.disabled=false document.all.DistApply.disabled=false else document.all.Proxy.style.backgroundColor = document.body.bgcolor document.all.Proxy.disabled = true document.all.UserID.style.backgroundColor = document.body.bgcolor document.all.NewPassword.style.backgroundColor= document.body.bgcolor document.all.UserID.disabled = true document.all.NewPassword.disabled=true end if end sub function OnEnableProxy() on error resume next Call ToggleEnableProxy(document.all.EnableProxy.checked) document.all.DistApply.disabled=false end function function EnableApply() document.all.DistApply.disabled=false end function function KeyUpUserID() if(document.all.UserID.value <> Top.Code.NSUniMgr.ProxyUser) then document.all.NewPassword.value = "" EnableApply() end if end function function OnApplyAuthentication() on error resume next Top.Code.NSUniMgr.EnableProxy = document.all.EnableProxy.checked if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text exit function end if Top.Code.NSChanMgr.EnableProxy = document.all.EnableProxy.checked if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text exit function end if if document.all.EnableProxy.checked then if (document.all.Proxy.value = "") then msgbox L_ProxyNameRequired_Text, vbExclamation, Top.Code.L_Title_Text exit function end if Top.Code.NSUniMgr.ProxyHostName = CStr(document.all.Proxy.value) if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text exit function end if Top.Code.NSChanMgr.ProxyHostName = CStr(document.all.Proxy.value) if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text exit function end if if (document.all.UserID.value = "" AND document.all.NewPassword.value <> "") then document.all.NewPassword.value = "" end if if (document.all.UserID.value <> "" AND document.all.NewPassword.value = "") then msgbox L_PasswordRequired_Text, vbExclamation, Top.Code.L_Title_Text exit function end if if (document.all.UserID.value <> "" AND document.all.NewPassword.value <> "") then if (Top.Code.NSUniMgr.ProxyUser <> document.all.UserID.value AND document.all.UserID.value <> "" ) OR (document.all.NewPassword.value <> "**********") then res = validatePassword() if ( res = "-1") then exit function end if end if end if Top.Code.NSUniMgr.SetProxyAuthenticationInfo CStr(document.all.UserID.value),CStr(document.all.NewPassword.value) if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text exit function end if Top.Code.NSChanMgr.SetProxyAuthenticationInfo CStr(document.all.UserID.value),CStr(document.all.NewPassword.value) if err.number<>0 Then msgbox err.description,vbExclamation,Top.Code.L_Title_Text exit function end if end if if (document.all.UserId.value <> "") then document.all.NewPassword.value= L_TenAsterisks_Text else document.all.NewPassword.value="" end if document.all.DistApply.disabled=true end function '----------------------------------------------------------- 'LOGGING function OnLogRefreshKey() if window.event.keycode = 9 then window.event.cancelbubble = true document.all.bEnableLogging.focus() end if end function function LApply() On Error Resume Next if Document.all.period.item(3).checked then if Document.all.bEnableLogging.Checked then if IsNumeric(document.all.UpperLimit.value) then if document.all.UpperLimit.value > 1000000 OR document.all.UpperLimit.value<8 then msgbox L_LogFileSizeLimit_Text ,vbExclamation,Top.Code.L_Title_Text document.all.UpperLimit.value="" exit function end if else msgbox L_MaxFileSizeNumeric_Text ,vbExclamation,Top.Code.L_Title_Text document.all.UpperLimit.value="" exit function end if end if end if if Trim(Document.all.LogFileDir.Value) = "" then msgbox L_SpecifyDirectory_Text,vbExclamation, Top.Code.L_Title_Text exit function end if top.code.NSUniMgr.EnableLogging=Document.all.bEnableLogging.Checked if Document.all.period.item(0).checked then top.code.NSUniMgr.LogFilePeriod = 1 top.code.NSUniMgr.LogFileSize=0 elseif Document.all.period.item(1).checked then top.code.NSUniMgr.LogFilePeriod = 2 top.code.NSUniMgr.LogFileSize=0 elseif Document.all.period.item(2).checked then top.code.NSUniMgr.LogFilePeriod = 3 top.code.NSUniMgr.LogFileSize=0 elseif Document.all.period.item(3).checked then top.code.NSUniMgr.LogFilePeriod = 0 top.code.NSUniMgr.LogFileSize=clng(trim(Document.all.UpperLimit.Value))*1000 end if ErrMsg=ValidatesLogFileDirectory() if ErrMsg="" then top.code.NSUniMgr.LogFileDirectory=Trim(Document.all.LogFileDir.Value) if err.number <> 0 then msgbox err.description,64,Top.Code.L_Title_Text exit function end if else MsgBox L_CannotApplyLogDir_Text & Chr(13) & ErrMsg,64,Top.Code.L_Title_Text end if Document.all.LogApply.disabled=true end function function EnableLogApply() Document.all.LogApply.disabled=false end function function LRefresh() On Error Resume Next Document.all.bEnableLogging.Checked=top.code.NSUniMgr.EnableLogging Select Case top.code.NSUniMgr.LogFilePeriod Case 1 Document.all.Period.item(0).checked=true Case 2 Document.all.Period.item(1).checked=true Case 3 Document.all.Period.item(2).checked=true Case 0 Document.all.Period.item(3).checked=true end select Document.all.UpperLimit.Value=int(top.code.NSUniMgr.LogFileSize/1000) Document.all.LogFileDir.Value=trim(top.code.NSUniMgr.LogFileDirectory) enableLogging() Document.all.LogApply.disabled=true end function function enableLogging() Document.all.LogApply.disabled=false if top.code.regkey.InstServer then Document.all.BrowseLogfile.disabled=NOT Document.all.bEnableLogging.Checked end if Document.all.Period.item(0).disabled=NOT Document.all.bEnableLogging.Checked Document.all.Period.item(1).disabled=NOT Document.all.bEnableLogging.Checked Document.all.Period.item(2).disabled=NOT Document.all.bEnableLogging.Checked Document.all.Period.item(3).disabled=NOT Document.all.bEnableLogging.Checked If Document.all.bEnableLogging.Checked AND Document.all.Period.item(3).checked then Document.all.UpperLimit.disabled=false Document.all.UpperLimit.style.backgroundColor = gENABLELOG.style.backgroundColor else Document.all.UpperLimit.disabled=true Document.all.UpperLimit.style.backgroundColor = document.body.bgcolor end if if Document.all.bEnableLogging.Checked then Document.all.LogFileDir.disabled=false Document.all.LogFileDir.style.backgroundColor = gENABLELOG.style.backgroundColor else Document.all.LogFileDir.disabled=true Document.all.LogFileDir.style.backgroundColor = document.body.bgcolor end if end function function ToggleEnableLogging() Document.all.bEnableLogging.Checked = NOT Document.all.bEnableLogging.Checked enableLogging() end function function enableLimit() if Window.event.srcElement.value = 4 then Document.all.UpperLimit.disabled=NOT Window.event.srcElement.checked Document.all.UpperLimit.style.backgroundColor = gENABLELOG.style.backgroundColor else Document.all.UpperLimit.disabled=true Document.all.UpperLimit.style.backgroundColor = document.body.bgcolor end if Document.all.LogApply.disabled=false end function function textChange() Document.all.LogApply.disabled=false end function function ValidatesLogFileDirectory() document.all.LogFileDir.value = trim(document.all.LogFileDir.value) if Len(document.all.LogFileDir.value)=0 then exit function end if if Len(document.all.LogFileDir.value)<3 then ValidatesLogFileDirectory= L_PathTooShort_Text exit function end if if (Mid(document.all.LogFileDir.value,2,2) <> ":\" ) AND (Left(document.all.LogFileDir.value,2) <> "\\") then ValidatesLogFileDirectory=L_PathNotValid_Text exit function end if if (Left(document.all.LogFileDir.value,2) = "\\") Then MsgBox Top.Code.L_UNCLogFileWarning_Text, vbExclamation, Top.Code.L_Title_Text end if for i = 1 to Len(document.all.LogFileDir.value) If InStr("/<>|*?" & Chr(34),Mid(document.all.LogFileDir.value,i,1))>0 Then ValidatesLogFileDirectory = L_PathInvalidChars1_Text & chr(13) & L_PathInvalidChars2_Text exit function end if next IF (NOT Cbool(InStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ",UCase(left(document.all.LogFileDir.value,1))))) and cBool((Left(document.all.LogFileDir.value,2) <> "\\")) then ValidatesLogFileDirectory = L_PathNotValid2_Text exit function end if end function function BrowseLogFileDir() Temp=trim(document.all.LogFileDir.value) Top.Code.dlgDirPicker.DialogTitle= Top.Code.L_Title_Text Top.Code.dlgDirPicker.PathName="c:\" call Top.Code.dlgDirPicker.ShowDialog() if not Top.Code.dlgDirPicker.WasCanceled then if Temp<>Trim(Top.Code.dlgDirPicker.PathName) then document.all.LogFileDir.value = Top.Code.dlgDirPicker.PathName Document.all.LogApply.disabled=false end if end if end function '/////HTTP STREAMING Dim bCommitedStreamChanges Sub EnableStreamApply() IF nsadmin.EnableHTTPStreaming AND rdStream(1).checked Then Exit Sub End If IF Top.Code.NsChanMgr.EnableHTTPStreaming AND rdStream(2).checked Then Exit Sub End If IF NOT nsadmin.EnableHTTPStreaming AND NOT Top.Code.NsChanMgr.EnableHTTPStreaming AND rdStream(0).checked Then Exit Sub End If StreamApply.disabled = False End Sub Sub ApplyStreaming() On Error Resume Next nsadmin.EnableHTTPStreaming = rdStream(1).checked If Err.Number <> 0 Then Call Top.Code.CheckCriticalError(err.number, "Unicast") End If Top.Code.NsChanMgr.EnableHTTPStreaming = rdStream(2).checked If Err.Number <> 0 Then Call Top.Code.CheckCriticalError(err.number, "Channel") End If MsgBox L_MustRebootStream_Text, , Top.Code.L_Title_Text StreamApply.disabled = True End Sub Sub InitializeHTTPStreaming() On Error Resume Next StreamApply.disabled = True UStream = nsadmin.EnableHTTPStreaming If Err.Number <> 0 Then Call Top.Code.CheckCriticalError(err.number, "Unicast") End If err.clear MStream = Top.Code.NsChanMgr.EnableHTTPStreaming If Err.Number <> 0 Then Call Top.Code.CheckCriticalError(err.number, "Channel") End If If NOT UStream And NOT MStream Then rdStream(0).checked = True Exit Sub Else If UStream AND MStream Then rdStream(1).checked = True rdStream(2).checked = False Exit Sub End If rdStream(1).checked = UStream rdStream(2).checked = MStream End If End Sub Function DoTrim(s) DoTrim = Trim(s) End Function