<!-- #include file="RetrieveIStore.csp" -->
function GetAvailableGroups(IStore)
// This function returns a listbox populated with all available groups.
// If there are no groups, an empty string is returned.
("SELECT SI_ID, SI_NAME FROM CI_SYSTEMOBJECTS WHERE SI_PROGID='CrystalEnterprise.UserGroup'");
var HTMLTable="<select name=GroupList>";
HTMLTable = HTMLTable + "<option value='"+Groups.Item(k).ID+"'>"+Groups.Item(k).Title;
HTMLTable= HTMLTable + "</select>";
function GetMemberGroups(IStore, UserID)
var User = IStore.Query("SELECT TOP 1* FROM CI_SYSTEMOBJECTS WHERE SI_ID="+UserID);
var HTMLTable="<select name=MemberGroups>";
var MemberGroups = User.PluginInterface("").Groups;
for (k=1;k<=MemberGroups.Count;k++)
("SELECT SI_NAME FROM CI_SYSTEMOBJECTS WHERE SI_ID="+MemberGroups.Item(k)).Item(1);
HTMLTable = HTMLTable + "<option value='"+Group.ID+"'>"+Group.Title;
HTMLTable= HTMLTable + "</select>";
Response.Redirect("Start.csp");
var UserID = Request.QueryString.Item("UserID");
Response.Write ("<H2>Manage User's Group Membership</H2>");
var result=IStore.Query("Select SI_NAME From CI_SYSTEMOBJECTS where si_id = "+UserID);
Response.Write (result.Item(1).Title );
Response.Write ("<form action='ModifyGroupMembership.csp
Response.Write ("Available groups:<BR>");
Response.Write (GetAvailableGroups(IStore));
Response.Write ("<input type=submit name='Add' value='Add user to group'><BR>");
Response.Write ("Member of:<BR>");
Response.Write (GetMemberGroups(IStore,UserID));
Response.Write ("<input type=submit name='Remove' value='Remove user from group'><BR>");
Response.Write ("<HR>Create new group and add user:<BR>");
Response.Write ("<input type=text name='NewGroupName'>");
Response.Write ("<input type=submit name='New' value='Create'><BR>");
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |