<% '-------------------------------------------------------------------------- ' nfsgroupmap_prop.asp: Used for the Advanced mappping for the NFS groups ' ' Copyright (c) Microsoft Corporation. All rights reserved. ' ' Date Description ' 25-09-2000 Created date ' ' 03-04-2001 In order to implement an stable program, decide to ' rewrite the code of nfs mappings '-------------------------------------------------------------------------- '-------------------------------------------------------------------------- 'Form variables '-------------------------------------------------------------------------- ' Used by group mappings Dim F_strMapsToGroup 'To store the mappings of group Dim F_strSysAccountToGroup 'To store the system group account Dim F_strNisAccountToGroup 'To store the Nis group account Dim F_strDomainGroup 'To store the input of domain group mappings Dim F_strNisGroupName 'Format: groupname:mapvalue Dim F_strNTSelectedIDToGroup 'To store the selected index of NT group Dim F_strNISSelectedIDToGroup 'To store the selected index of NIS group Dim F_strMapsSelectedToGroup 'To store the selected index of maps 'init hidden form value F_strNTSelectedIDToGroup = "-1" F_strNISSelectedIDToGroup = "-1" F_strMapsSelectedToGroup = "-1" ' Check whether the service is there or not if not isServiceStarted("mapsvc") then SA_ServeFailurePage L_SERVICENOTSTARTED_ERRORMESSAGE end if %> <% '------------------------------------------------------------------------- ' Function name: ServeEXPGROUPMAPPage(ByRef PageIn, ByVal bIsVisible) ' Description: Serves in displaying the page Header, Middle and ' Footer Parts (the group Interface) ' Input Variables: PageIn ' bIsVisible - the tab page be displayed? ' Output Variables: None ' Returns: None ' Global Variables: L_(*) - Localization content ' F_(*) - Form Variables '------------------------------------------------------------------------- Function ServeEXPGROUPMAPPage(ByRef PageIn, ByVal bIsVisible) On Error Resume Next Err.Clear If bIsVisible Then mstrPageName = "Intro" %> <% If CInt(F_intGen_SelectedRadio) <> CONST_RADIO_USE_NISSERVER Then %> <% else %> <% end if%>
  
<%=L_NIS_DOMAIN_LABEL_TEXT%>
  <%=L_NISSERVER_TEXT%>
  <% Call SA_ServeOnClickButtonEx(L_LISTUNIXGROUPS_LABEL_TEXT, "", "GetUNIXGroups()", 110, 0, "","btnUNIXGroups") %>
<%=L_WINDOWSGROUPS_LABEL_TEXT%>
<%=L_UNIXGROUPS_LABEL_TEXT%>
<%=L_GROUPMAP_NOTE_TEXT%>     <% Call SA_ServeOnClickButtonEx(L_ADD_LABEL_TEXT, "", "fnAddLocalGroupMap()", 50, 0, "DISABLED","btnAddLocalGroupMap") %>
 
<%=L_NFS_ADD_DOMAIN_GROUPMAP%>
     <% Call SA_ServeOnClickButtonEx(L_ADD_LABEL_TEXT, "", "fnAddDomainGroupMap()", 50, 0, "DISABLED","btnAddDomainGroupMap") %>
<%=L_EXPLICITLYMAPPEDGROUPS_LABEL_TEXT%>
<% Call SA_ServeOnClickButtonEx(L_SETPRIMARY_LABEL_TEXT, "", "fnSetGroupPrimary()", 0, 0, "DISABLED","btnSetPrimary") %>    <% Call SA_ServeOnClickButtonEx(L_REMOVE_LABEL_TEXT, "", "fnbRemove(document.frmTask.selMappedGroups,this,document.frmTask.btnSetPrimary);", 0, 0, "DISABLED","btnRemoveMappedGroup") %>
<% End If ServeEXPGROUPMAPFooter() ServeEXPGROUPMAPPage = gc_ERR_SUCCESS End Function '------------------------------------------------------------------------- 'Function name: SetVariablesFromForm 'Description: Getting the data from Client 'Input Variables: None 'Output Variables: None 'Returns: None 'Global Variables: None ' Out:F_strLogonDomain 'Logon Domain Name ' Out:F_strGen_NisDomain 'NIS Domain ' Out:F_strGen_NisServer 'NIS Server ' Out:F_isNISDomain '-------------------------------------------------------------------------- Function GetEXPGROUPMAPVariablesFromForm F_strMapsToGroup = Request.Form("hdnMapsToGroup") F_strSysAccountToGroup = Request.Form("hdnSysAccountToGroup") F_strNisAccountToGroup = Request.Form("hdnNisAccountToGroup") F_strDomainGroup = Request.Form("hdnDomainGroup") F_strNisGroupName = Request.Form("hdnNisGroupName") F_strNTSelectedIDToGroup = Request.Form("hdnNTSelectedIDToGroup") F_strNISSelectedIDToGroup = Request.Form("hdnNISSelectedIDToGroup") F_strMapsSelectedToGroup = Request.Form("hdnMapsSelectedToGroup") End Function '------------------------------------------------------------------------- ' Function name: SetEXPGROUPMAPVariablesFromSystem ' Description: Serves in getting the values from system ' Input Variables: None ' Output Variables: None ' Returns: None ' Global Variables: OUT: ' F_arrMapsToGroup ' F_arrSysAccountToGroup '------------------------------------------------------------------------- Sub GetEXPGROUPMAPVariablesFromSystem On Error Resume Next Err.Clear ' Get group mappings F_strMapsToGroup = NFS_GetGroupMappings(NFS_GetSFUConnection()) ' Get system account F_strSysAccountToGroup = NFS_GetNTDomainGroups(F_strSystemName) End Sub Function DisplayNTLocalGroups(strGroups) On Error Resume Next Err.Clear Dim nIndex Dim arrGroups,arrField If strGroups = "" Then Exit Function End If arrGroups = Split(strGroups,"#") If isnull(arrGroups) Then Exit Function End If 'display the Groups Response.Write "" For nIndex = 0 To ubound(arrGroups) arrField = Split(arrGroups(nIndex),":") Response.Write "" Next DisplayNTLocalGroups = True End Function Function DisplayNISGroups(strGroups) On Error Resume Next Err.Clear Dim i Dim nIndex Dim strValue Dim arrDomainGroups,arrField If strGroups = "" Then Exit Function End If ' Display the Groups of NIS arrDomainGroups = VBSortStringArray(strGroups) Response.Write "" For nIndex = 0 to ubound(arrDomainGroups) 'Split the enum value to get the Group name, ID and other specific details arrField = split(arrDomainGroups(nIndex),":") strValue = "" 'Check for the format if len(arrField) >= 2 then 'Display in format as UNIX Group name & Group ID Response.write"" end if next DisplayNISGroups = True End Function Function DisplayGroupMappings(strMappings) On Error Resume Next Err.Clear Dim nIndex Dim intIdx Dim strValue, strOutput Dim arrMappings, arrField,strSimpleMap 'Display heads Response.Write "