<% '-------------------------------------------------------------------------- ' nfsusermap_prop.asp: Used for the Advanced mappping for the NFS users ' ' 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 user and group mappings ' Dim F_strSystemName ' Used by user mappings Dim F_strMapsToUser 'To store the mappings of user Dim F_strSysAccountToUser 'To store the system user account Dim F_strNisAccountToUser 'To store the Nis user account Dim F_strDomainUser 'To store the input of domain user mappings Dim F_strNisUserName 'Format: username:mapvalue Dim F_strNTSelectedIDToUser 'To store the selected index of NT user Dim F_strNISSelectedIDToUser 'To store the selected index of NIS user Dim F_strMapsSelectedToUser 'To store the selected index of maps 'init hidden form value F_strNTSelectedIDToUser = "-1" F_strNISSelectedIDToUser = "-1" F_strMapsSelectedToUser = "-1" ' Check whether the service is there or not if not isServiceStarted("mapsvc") then SA_ServeFailurePage L_SERVICENOTSTARTED_ERRORMESSAGE end if %> <% '------------------------------------------------------------------------- ' Function name: ServeEXPUSERMAPPage(ByRef PageIn, ByVal bIsVisible) ' Description: Serves in displaying the page Header, Middle and ' Footer Parts (the User Interface) ' Input Variables: PageIn ' bIsVisible - the tab page be displayed? ' Output Variables: None ' Returns: None ' Global Variables: L_(*) - Localization content ' F_(*) - Form Variables '------------------------------------------------------------------------- Function ServeEXPUSERMAPPage(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_LISTUNIXUSERS_TEXT, "", "GetUNIXUsers()", 110, 0, "","btnUNIXUsers") %>
<%=L_WINDOWSUSERS_TEXT%>
<%=L_UNIXUSERS_TEXT%>
<%=L_USERMAPINFO_TEXT%>     <% Call SA_ServeOnClickButtonEx(L_ADD_LABEL_TEXT, "", "fnAddLocalUserMap()", 50, 0, "DISABLED","btnAddLocalUserMap") %>
 
<%=L_NFS_ADD_DOMAIN_USERMAP%>
     <% Call SA_ServeOnClickButtonEx(L_ADD_LABEL_TEXT, "", "fnAddDomainUserMap()", 50, 0, "DISABLED","btnAddDomainUserMap") %>
<%=L_MAPPEDUSER_TEXT%>
<% Call SA_ServeOnClickButtonEx(L_SETPRIMARY_LABEL_TEXT, "", "fnSetUserPrimary()", 0, 0, "DISABLED","btnSetPrimary") %>    <% Call SA_ServeOnClickButtonEx(L_REMOVE_LABEL_TEXT, "", "fnbRemove(document.frmTask.selMappedUsers,this,document.frmTask.btnSetPrimary);", 0, 0, "DISABLED","btnRemoveMappedUser") %>
<% End If ServeEXPUSERMAPFooter() ServeEXPUSERMAPPage = 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 GetEXPUSERMAPVariablesFromForm F_strSystemName = Request.Form("hdnSystemName") F_strMapsToUser = Request.Form("hdnMapsToUser") F_strSysAccountToUser = Request.Form("hdnSysAccountToUser") F_strNisAccountToUser = Request.Form("hdnNisAccountToUser") F_strDomainUser = Request.Form("hdnDomainUser") F_strNisUserName = Request.Form("hdnNisUserName") F_strNTSelectedIDToUser = Request.Form("hdnNTSelectedIDToUser") F_strNISSelectedIDToUser = Request.Form("hdnNISSelectedIDToUser") F_strMapsSelectedToUser = Request.Form("hdnMapsSelectedToUser") End Function '------------------------------------------------------------------------- ' Function name: SetEXPUSERMAPVariablesFromSystem ' Description: Serves in getting the values from system ' Input Variables: None ' Output Variables: None ' Returns: None ' Global Variables: OUT: ' F_strSystemName ' F_arrMapsToUser ' F_arrSysAccountToUser '------------------------------------------------------------------------- Sub GetEXPUSERMAPVariablesFromSystem On Error Resume Next Err.Clear ' Get system name F_strSystemName = "\\"&GetComputerName() ' Get user mappings F_strMapsToUser = NFS_GetUserMappings(NFS_GetSFUConnection()) ' Get system account F_strSysAccountToUser = NFS_GetNTDomainUsers(F_strSystemName) End Sub Function DisplayNTLocalUsers(strUsers) On Error Resume Next Err.Clear Dim nIndex Dim arrUsers,arrField If strUsers = "" Then Exit Function End If arrUsers = Split(strUsers,"#") If isnull(arrUsers) Then Exit Function End If 'display the users Response.Write "" For nIndex = 0 To ubound(arrUsers) arrField = Split(arrUsers(nIndex),":") Response.Write "" Next DisplayNTLocalUsers = True End Function Function DisplayNISUsers(strUsers) On Error Resume Next Err.Clear Dim i Dim nIndex Dim strValue Dim arrDomainUsers,arrField If strUsers = "" Then Exit Function End If ' Display the users of NIS arrDomainUsers = VBSortStringArray(strUsers) Response.Write "" For nIndex = 0 to ubound(arrDomainUsers) 'Split the enum value to get the USER name, ID and other specific details arrField = split(arrDomainUsers(nIndex),":") strValue = "" 'Check for the format if len(arrField) >= 4 then 'Get the Ids of the Groups for i= 1 to ubound(arrField) strValue = strValue+ arrField(i)+":" next strValue = left(strValue,len(strValue)-1) 'Display in format as UNIX user name & User ID Response.write"" end if next DisplayNISUsers = True End Function Function DisplayUserMappings(strMappings) On Error Resume Next Err.Clear Dim nIndex Dim intIdx Dim strValue, strOutput Dim arrMappings, arrField,strSimpleMap 'Display heads Response.Write "