%@ Language=VBScript %>
<% Option Explicit %>
<%
'------------------------------------------------------------------------
' nfsclientgroups_new.asp: New ClientGroups Page
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' Date Description
' 27-09-2000 Creation date
'------------------------------------------------------------------------
%>
<%
Err.Clear
On Error Resume Next
'------------------------------------------------------------------------
' Form Variables
'------------------------------------------------------------------------
Dim F_groupname 'to get the group name from form
Dim F_groupMembers 'to get the members in the list box from form
'-------------------------------------------------------------------------
' End of Form Variables
'-------------------------------------------------------------------------
'-------------------------------------------------------------------------
' Create the page and Event handler
'-------------------------------------------------------------------------
Dim page
Dim rc
rc = SA_CreatePage(L_TASKTITLE_NEW_TEXT, "", PT_PROPERTY, page)
If rc = 0 Then
SA_ShowPage( page )
End If
Public Function OnInitPage( ByRef PageIn, ByRef EventArg)
OnInitPage = True
End Function
Public Function OnPostBackPage( ByRef PageIn, ByRef EventArg)
OnPostBackPage = True
SetVariablesFromForm()
End Function
Public Function OnServePropertyPage( ByRef PageIn, ByRef EventArg)
Call ServeCommonJavaScript()
%>
>
<%
OnServePropertyPage = True
End Function
Public Function OnSubmitPage( ByRef PageIn, ByRef EventArg)
OnSubmitPage = AddGroups
End Function
Public Function OnClosePage( ByRef PageIn, ByRef EventArg)
OnClosePage = True
End Function
Function ServeCommonJavaScript()
%>
<%
End Function
'-------------------------------------------------------------------------
'Function Name: SetVariablesFromForm
'Description: Serves in Getting the data from Client
'Input Variables: None
'Output Variables: None
'Returns: None
'Global Variables: In: F_groupMembers
' In: F_groupname
' Out:None
'-------------------------------------------------------------------------
Function SetVariablesFromForm
Err.Clear
On Error Resume Next
F_groupMembers=Request.Form("HdnGroupMembers")
F_groupname=Request.Form("txtgroupname")
End Function
'-------------------------------------------------------------------------
'Function Name: Addgroups
'Description: Serves in adding the new groups and memebers
'Input Variables: None
'Output Variables: None
'Returns: None
'Global Variables: In: L_*
' Out:None
'-------------------------------------------------------------------------
Function AddGroups
Err.Clear
On Error Resume Next
AddGroups=False
'enters into the loop only when group name is not empty.
If not F_groupname="" then
Dim ObjClientGroups
Dim Member
Dim intGroupsCount
Dim intGroup
Dim nRetValue
Call SA_MungeURL(mstrReturnURL, "PKey",F_groupname)
nRetValue = NFS_CreateGroup( F_groupname )
If Not HandleError( nRetValue ) Then
Exit Function
End If
' Add Members to group
If F_groupMembers<>"" Then
nRetValue = NFS_AddMembersToGroup( F_groupname, F_groupMembers )
Call SA_TraceOut( " nRetValue: " , nRetValue )
If Not HandleError( nRetValue ) Then
Call NFS_DeleteGroup( F_groupname )
Exit Function
End If
End if
AddGroups=True
else
SetErrMsg L_GROUPNAMEBLANK_ERRORMESSAGE
end if
End Function
'-------------------------------------------------------------------------
'Function name: DisplayMembers
'Description: Serves in Displaying the Members from the form in the
' list box.
'Input Variables: None
'Output Variables: None
'Returns: None
'Global Variables: In:F_groupMembers -Group members in the list box
'-------------------------------------------------------------------------
Function DisplayMembers
Err.Clear
On Error Resume Next
Dim strMembers
Dim intMembers
Dim intMembersCount
strMembers = Split(F_groupMembers,",")
intMembersCount = ubound(strMembers)
'for displaying each member in the list box
For intMembers=0 to intMembersCount
If strMembers(intMembers) = g_strMemberAtFault then
Response.Write ""
else
Response.Write ""
end if
next
End Function
%>