Remove "managedBy" functionality for security groups and fix bug with
organization naming when create organization user (when Append Org ID)
This commit is contained in:
parent
f7fae8fe2f
commit
3fc3a425e0
19 changed files with 52 additions and 206 deletions
|
@ -825,12 +825,12 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
#region Security Groups
|
||||
|
||||
public int CreateSecurityGroup(string organizationId, string groupName, string managedBy)
|
||||
public int CreateSecurityGroup(string organizationId, string groupName)
|
||||
{
|
||||
return CreateSecurityGroupInternal(organizationId, groupName, managedBy);
|
||||
return CreateSecurityGroupInternal(organizationId, groupName);
|
||||
}
|
||||
|
||||
internal int CreateSecurityGroupInternal(string organizationId, string groupName, string managedBy)
|
||||
internal int CreateSecurityGroupInternal(string organizationId, string groupName)
|
||||
{
|
||||
HostedSolutionLog.LogStart("CreateSecurityGroupInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
|
||||
|
@ -853,19 +853,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
{
|
||||
ActiveDirectoryUtils.CreateGroup(path, groupName);
|
||||
|
||||
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(groupPath);
|
||||
|
||||
string manager = string.Empty;
|
||||
if (!string.IsNullOrEmpty(managedBy))
|
||||
{
|
||||
string managerPath = GetUserPath(organizationId, managedBy);
|
||||
manager = ActiveDirectoryUtils.AdObjectExists(managerPath) ? managerPath : string.Empty;
|
||||
}
|
||||
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ManagedBy, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
||||
|
||||
entry.CommitChanges();
|
||||
|
||||
groupCreated = true;
|
||||
|
||||
HostedSolutionLog.DebugInfo("Security Group created: {0}", groupName);
|
||||
|
@ -922,8 +909,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
OrganizationSecurityGroup securityGroup = new OrganizationSecurityGroup();
|
||||
|
||||
securityGroup.ManagerAccount = GetManager(entry, ADAttributes.ManagedBy);
|
||||
|
||||
securityGroup.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes);
|
||||
|
||||
securityGroup.AccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName);
|
||||
|
@ -968,13 +953,13 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
HostedSolutionLog.LogEnd("DeleteSecurityGroupInternal");
|
||||
}
|
||||
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes)
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes)
|
||||
{
|
||||
|
||||
SetSecurityGroupGeneralSettingsInternal(organizationId, groupName, managedBy, memberAccounts, notes);
|
||||
SetSecurityGroupGeneralSettingsInternal(organizationId, groupName, memberAccounts, notes);
|
||||
}
|
||||
|
||||
internal void SetSecurityGroupGeneralSettingsInternal(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes)
|
||||
internal void SetSecurityGroupGeneralSettingsInternal(string organizationId, string groupName, string[] memberAccounts, string notes)
|
||||
{
|
||||
HostedSolutionLog.LogStart("SetSecurityGroupGeneralSettingsInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
|
||||
|
@ -990,15 +975,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path);
|
||||
|
||||
string manager = string.Empty;
|
||||
if (!string.IsNullOrEmpty(managedBy))
|
||||
{
|
||||
string managerPath = GetUserPath(organizationId, managedBy);
|
||||
manager = ActiveDirectoryUtils.AdObjectExists(managerPath) ? managerPath : string.Empty;
|
||||
}
|
||||
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ManagedBy, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
||||
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes);
|
||||
|
||||
foreach(string userPath in ActiveDirectoryUtils.GetUsersGroup(groupName)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue