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:
vfedosevich 2013-08-26 14:33:09 +03:00
parent f7fae8fe2f
commit 3fc3a425e0
19 changed files with 52 additions and 206 deletions

View file

@ -1886,22 +1886,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int CreateSecurityGroup(int itemId, string displayName, string managedBy) public int CreateSecurityGroup(int itemId, string displayName)
{ {
object[] results = this.Invoke("CreateSecurityGroup", new object[] { object[] results = this.Invoke("CreateSecurityGroup", new object[] {
itemId, itemId,
displayName, displayName});
managedBy});
return ((int)(results[0])); return ((int)(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginCreateSecurityGroup(int itemId, string displayName, string managedBy, System.AsyncCallback callback, object asyncState) public System.IAsyncResult BeginCreateSecurityGroup(int itemId, string displayName, System.AsyncCallback callback, object asyncState)
{ {
return this.BeginInvoke("CreateSecurityGroup", new object[] { return this.BeginInvoke("CreateSecurityGroup", new object[] {
itemId, itemId,
displayName, displayName}, callback, asyncState);
managedBy}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -1912,13 +1910,13 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
} }
/// <remarks/> /// <remarks/>
public void CreateSecurityGroupAsync(int itemId, string displayName, string managedBy) public void CreateSecurityGroupAsync(int itemId, string displayName)
{ {
this.CreateSecurityGroupAsync(itemId, displayName, managedBy, null); this.CreateSecurityGroupAsync(itemId, displayName, null);
} }
/// <remarks/> /// <remarks/>
public void CreateSecurityGroupAsync(int itemId, string displayName, string managedBy, object userState) public void CreateSecurityGroupAsync(int itemId, string displayName, object userState)
{ {
if ((this.CreateSecurityGroupOperationCompleted == null)) if ((this.CreateSecurityGroupOperationCompleted == null))
{ {
@ -1926,8 +1924,7 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
} }
this.InvokeAsync("CreateSecurityGroup", new object[] { this.InvokeAsync("CreateSecurityGroup", new object[] {
itemId, itemId,
displayName, displayName}, this.CreateSecurityGroupOperationCompleted, userState);
managedBy}, this.CreateSecurityGroupOperationCompleted, userState);
} }
private void OnCreateSecurityGroupOperationCompleted(object arg) private void OnCreateSecurityGroupOperationCompleted(object arg)
@ -2045,26 +2042,24 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSecurityGroupGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSecurityGroupGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes) public int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes)
{ {
object[] results = this.Invoke("SetSecurityGroupGeneralSettings", new object[] { object[] results = this.Invoke("SetSecurityGroupGeneralSettings", new object[] {
itemId, itemId,
accountId, accountId,
displayName, displayName,
managedBy,
memberAccounts, memberAccounts,
notes}); notes});
return ((int)(results[0])); return ((int)(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState) public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState)
{ {
return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] { return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] {
itemId, itemId,
accountId, accountId,
displayName, displayName,
managedBy,
memberAccounts, memberAccounts,
notes}, callback, asyncState); notes}, callback, asyncState);
} }
@ -2077,13 +2072,13 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
} }
/// <remarks/> /// <remarks/>
public void SetSecurityGroupGeneralSettingsAsync(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes) public void SetSecurityGroupGeneralSettingsAsync(int itemId, int accountId, string displayName, string[] memberAccounts, string notes)
{ {
this.SetSecurityGroupGeneralSettingsAsync(itemId, accountId, displayName, managedBy, memberAccounts, notes, null); this.SetSecurityGroupGeneralSettingsAsync(itemId, accountId, displayName, memberAccounts, notes, null);
} }
/// <remarks/> /// <remarks/>
public void SetSecurityGroupGeneralSettingsAsync(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes, object userState) public void SetSecurityGroupGeneralSettingsAsync(int itemId, int accountId, string displayName, string[] memberAccounts, string notes, object userState)
{ {
if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null)) if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null))
{ {
@ -2093,7 +2088,6 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
itemId, itemId,
accountId, accountId,
displayName, displayName,
managedBy,
memberAccounts, memberAccounts,
notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState); notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState);
} }

View file

@ -1509,6 +1509,10 @@ namespace WebsitePanel.EnterpriseServer
/// <returns> The account name with organization Id. </returns> /// <returns> The account name with organization Id. </returns>
private static string BuildAccountNameWithOrgId(string orgId, string name, int serviceId) private static string BuildAccountNameWithOrgId(string orgId, string name, int serviceId)
{ {
name = name.Length > 5 ? name.Substring(0, 5) : name;
orgId = (orgId.Length + name.Length) > 19 ? orgId.Substring(0, 19 - name.Length) : orgId;
int maxLen = 19 - orgId.Length; int maxLen = 19 - orgId.Length;
// try to choose name // try to choose name
@ -1536,6 +1540,7 @@ namespace WebsitePanel.EnterpriseServer
} }
} }
private static string genSamLogin(string login, string strCounter) private static string genSamLogin(string login, string strCounter)
{ {
int maxLogin = 20; int maxLogin = 20;
@ -2211,7 +2216,7 @@ namespace WebsitePanel.EnterpriseServer
mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()));
} }
public static int CreateSecurityGroup(int itemId, string displayName, string managedBy) public static int CreateSecurityGroup(int itemId, string displayName)
{ {
if (string.IsNullOrEmpty(displayName)) if (string.IsNullOrEmpty(displayName))
throw new ArgumentNullException("displayName"); throw new ArgumentNullException("displayName");
@ -2262,7 +2267,7 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.Write("accountName :" + groupName); TaskManager.Write("accountName :" + groupName);
if (orgProxy.CreateSecurityGroup(org.OrganizationId, groupName, managedBy) == 0) if (orgProxy.CreateSecurityGroup(org.OrganizationId, groupName) == 0)
{ {
OrganizationSecurityGroup retSecurityGroup = orgProxy.GetSecurityGroupGeneralSettings(groupName, org.OrganizationId); OrganizationSecurityGroup retSecurityGroup = orgProxy.GetSecurityGroupGeneralSettings(groupName, org.OrganizationId);
TaskManager.Write("sAMAccountName :" + retSecurityGroup.SAMAccountName); TaskManager.Write("sAMAccountName :" + retSecurityGroup.SAMAccountName);
@ -2395,7 +2400,7 @@ namespace WebsitePanel.EnterpriseServer
} }
} }
public static int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes) public static int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes)
{ {
// check account // check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
@ -2428,7 +2433,6 @@ namespace WebsitePanel.EnterpriseServer
orgProxy.SetSecurityGroupGeneralSettings( orgProxy.SetSecurityGroupGeneralSettings(
org.OrganizationId, org.OrganizationId,
accountName, accountName,
managedBy,
memberAccounts, memberAccounts,
notes); notes);

View file

@ -245,9 +245,9 @@ namespace WebsitePanel.EnterpriseServer
#region Security Groups #region Security Groups
[WebMethod] [WebMethod]
public int CreateSecurityGroup(int itemId, string displayName, string managedBy) public int CreateSecurityGroup(int itemId, string displayName)
{ {
return OrganizationController.CreateSecurityGroup(itemId, displayName, managedBy); return OrganizationController.CreateSecurityGroup(itemId, displayName);
} }
[WebMethod] [WebMethod]
@ -263,9 +263,9 @@ namespace WebsitePanel.EnterpriseServer
} }
[WebMethod] [WebMethod]
public int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes) public int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes)
{ {
return OrganizationController.SetSecurityGroupGeneralSettings(itemId, accountId, displayName, managedBy, memberAccounts, notes); return OrganizationController.SetSecurityGroupGeneralSettings(itemId, accountId, displayName, memberAccounts, notes);
} }
[WebMethod] [WebMethod]

View file

@ -61,7 +61,6 @@ namespace WebsitePanel.Providers.HostedSolution
public const string ExternalEmail = "mail"; public const string ExternalEmail = "mail";
public const string CustomAttribute2 = "extensionAttribute2"; public const string CustomAttribute2 = "extensionAttribute2";
public const string DistinguishedName = "distinguishedName"; public const string DistinguishedName = "distinguishedName";
public const string ManagedBy = "ManagedBy";
} }
} }

View file

@ -42,13 +42,13 @@ namespace WebsitePanel.Providers.HostedSolution
OrganizationUser GetUserGeneralSettings(string loginName, string organizationId); OrganizationUser GetUserGeneralSettings(string loginName, string organizationId);
int CreateSecurityGroup(string organizationId, string groupName, string managedBy); int CreateSecurityGroup(string organizationId, string groupName);
OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId); OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId);
void DeleteSecurityGroup(string groupName, string organizationId); void DeleteSecurityGroup(string groupName, string organizationId);
void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes); void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes);
void AddUserToSecurityGroup(string organizationId, string loginName, string groupName); void AddUserToSecurityGroup(string organizationId, string loginName, string groupName);

View file

@ -25,12 +25,6 @@ namespace WebsitePanel.Providers.HostedSolution
set; set;
} }
public OrganizationUser ManagerAccount
{
get;
set;
}
public string Notes public string Notes
{ {
get; get;

View file

@ -825,12 +825,12 @@ namespace WebsitePanel.Providers.HostedSolution
#region Security Groups #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.LogStart("CreateSecurityGroupInternal");
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
@ -853,19 +853,6 @@ namespace WebsitePanel.Providers.HostedSolution
{ {
ActiveDirectoryUtils.CreateGroup(path, groupName); 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; groupCreated = true;
HostedSolutionLog.DebugInfo("Security Group created: {0}", groupName); HostedSolutionLog.DebugInfo("Security Group created: {0}", groupName);
@ -922,8 +909,6 @@ namespace WebsitePanel.Providers.HostedSolution
OrganizationSecurityGroup securityGroup = new OrganizationSecurityGroup(); OrganizationSecurityGroup securityGroup = new OrganizationSecurityGroup();
securityGroup.ManagerAccount = GetManager(entry, ADAttributes.ManagedBy);
securityGroup.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes); securityGroup.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes);
securityGroup.AccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName); securityGroup.AccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName);
@ -968,13 +953,13 @@ namespace WebsitePanel.Providers.HostedSolution
HostedSolutionLog.LogEnd("DeleteSecurityGroupInternal"); 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.LogStart("SetSecurityGroupGeneralSettingsInternal");
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
@ -990,15 +975,6 @@ namespace WebsitePanel.Providers.HostedSolution
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); 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); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes);
foreach(string userPath in ActiveDirectoryUtils.GetUsersGroup(groupName)) { foreach(string userPath in ActiveDirectoryUtils.GetUsersGroup(groupName)) {

View file

@ -491,22 +491,20 @@ namespace WebsitePanel.Providers.HostedSolution
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int CreateSecurityGroup(string organizationId, string groupName, string managedBy) public int CreateSecurityGroup(string organizationId, string groupName)
{ {
object[] results = this.Invoke("CreateSecurityGroup", new object[] { object[] results = this.Invoke("CreateSecurityGroup", new object[] {
organizationId, organizationId,
groupName, groupName});
managedBy});
return ((int)(results[0])); return ((int)(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginCreateSecurityGroup(string organizationId, string groupName, string managedBy, System.AsyncCallback callback, object asyncState) public System.IAsyncResult BeginCreateSecurityGroup(string organizationId, string groupName, System.AsyncCallback callback, object asyncState)
{ {
return this.BeginInvoke("CreateSecurityGroup", new object[] { return this.BeginInvoke("CreateSecurityGroup", new object[] {
organizationId, organizationId,
groupName, groupName}, callback, asyncState);
managedBy}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -517,13 +515,13 @@ namespace WebsitePanel.Providers.HostedSolution
} }
/// <remarks/> /// <remarks/>
public void CreateSecurityGroupAsync(string organizationId, string groupName, string managedBy) public void CreateSecurityGroupAsync(string organizationId, string groupName)
{ {
this.CreateSecurityGroupAsync(organizationId, groupName, managedBy, null); this.CreateSecurityGroupAsync(organizationId, groupName, null);
} }
/// <remarks/> /// <remarks/>
public void CreateSecurityGroupAsync(string organizationId, string groupName, string managedBy, object userState) public void CreateSecurityGroupAsync(string organizationId, string groupName, object userState)
{ {
if ((this.CreateSecurityGroupOperationCompleted == null)) if ((this.CreateSecurityGroupOperationCompleted == null))
{ {
@ -531,8 +529,7 @@ namespace WebsitePanel.Providers.HostedSolution
} }
this.InvokeAsync("CreateSecurityGroup", new object[] { this.InvokeAsync("CreateSecurityGroup", new object[] {
organizationId, organizationId,
groupName, groupName}, this.CreateSecurityGroupOperationCompleted, userState);
managedBy}, this.CreateSecurityGroupOperationCompleted, userState);
} }
private void OnCreateSecurityGroupOperationCompleted(object arg) private void OnCreateSecurityGroupOperationCompleted(object arg)
@ -651,23 +648,21 @@ namespace WebsitePanel.Providers.HostedSolution
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSecurityGroupGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSecurityGroupGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes) public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes)
{ {
this.Invoke("SetSecurityGroupGeneralSettings", new object[] { this.Invoke("SetSecurityGroupGeneralSettings", new object[] {
organizationId, organizationId,
groupName, groupName,
managedBy,
memberAccounts, memberAccounts,
notes}); notes});
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState) public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState)
{ {
return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] { return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] {
organizationId, organizationId,
groupName, groupName,
managedBy,
memberAccounts, memberAccounts,
notes}, callback, asyncState); notes}, callback, asyncState);
} }
@ -679,13 +674,13 @@ namespace WebsitePanel.Providers.HostedSolution
} }
/// <remarks/> /// <remarks/>
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes) public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string[] memberAccounts, string notes)
{ {
this.SetSecurityGroupGeneralSettingsAsync(organizationId, groupName, managedBy, memberAccounts, notes, null); this.SetSecurityGroupGeneralSettingsAsync(organizationId, groupName, memberAccounts, notes, null);
} }
/// <remarks/> /// <remarks/>
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes, object userState) public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string[] memberAccounts, string notes, object userState)
{ {
if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null)) if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null))
{ {
@ -694,7 +689,6 @@ namespace WebsitePanel.Providers.HostedSolution
this.InvokeAsync("SetSecurityGroupGeneralSettings", new object[] { this.InvokeAsync("SetSecurityGroupGeneralSettings", new object[] {
organizationId, organizationId,
groupName, groupName,
managedBy,
memberAccounts, memberAccounts,
notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState); notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState);
} }

View file

@ -111,9 +111,9 @@ namespace WebsitePanel.Server
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
public int CreateSecurityGroup(string organizationId, string groupName, string managedBy) public int CreateSecurityGroup(string organizationId, string groupName)
{ {
return Organization.CreateSecurityGroup(organizationId, groupName, managedBy); return Organization.CreateSecurityGroup(organizationId, groupName);
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
@ -129,9 +129,9 @@ namespace WebsitePanel.Server
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes) public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes)
{ {
Organization.SetSecurityGroupGeneralSettings(organizationId, groupName, managedBy, memberAccounts, notes); Organization.SetSecurityGroupGeneralSettings(organizationId, groupName, memberAccounts, notes);
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]

View file

@ -126,24 +126,15 @@
<data name="FormComments.Text" xml:space="preserve"> <data name="FormComments.Text" xml:space="preserve">
<value /> <value />
</data> </data>
<data name="locAccount.Text" xml:space="preserve">
<value>E-mail Address: *</value>
</data>
<data name="locDisplayName.Text" xml:space="preserve"> <data name="locDisplayName.Text" xml:space="preserve">
<value>Display Name: *</value> <value>Display Name: *</value>
</data> </data>
<data name="locManagedBy.Text" xml:space="preserve">
<value>Managed by: *</value>
</data>
<data name="locTitle.Text" xml:space="preserve"> <data name="locTitle.Text" xml:space="preserve">
<value>Create New Group</value> <value>Create New Group</value>
</data> </data>
<data name="Text.PageName" xml:space="preserve"> <data name="Text.PageName" xml:space="preserve">
<value>Groups</value> <value>Groups</value>
</data> </data>
<data name="valManager.ErrorMessage" xml:space="preserve">
<value>Please specify a manager</value>
</data>
<data name="valRequireDisplayName.ErrorMessage" xml:space="preserve"> <data name="valRequireDisplayName.ErrorMessage" xml:space="preserve">
<value>Enter Display Name</value> <value>Enter Display Name</value>
</data> </data>

View file

@ -129,9 +129,6 @@
<data name="FormComments.Text" xml:space="preserve"> <data name="FormComments.Text" xml:space="preserve">
<value /> <value />
</data> </data>
<data name="locManager.Text" xml:space="preserve">
<value>Managed By: *</value>
</data>
<data name="locMembers.Text" xml:space="preserve"> <data name="locMembers.Text" xml:space="preserve">
<value>Members:</value> <value>Members:</value>
</data> </data>
@ -144,9 +141,6 @@
<data name="Text.PageName" xml:space="preserve"> <data name="Text.PageName" xml:space="preserve">
<value>Groups</value> <value>Groups</value>
</data> </data>
<data name="valManager.ErrorMessage" xml:space="preserve">
<value>Please specify a manager</value>
</data>
<data name="valRequireDisplayName.ErrorMessage" xml:space="preserve"> <data name="valRequireDisplayName.ErrorMessage" xml:space="preserve">
<value>Enter Display Name</value> <value>Enter Display Name</value>
</data> </data>

View file

@ -5,8 +5,6 @@
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> <%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> <%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register src="UserControls/UserSelector.ascx" tagname="UserSelector" tagprefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/> <wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer"> <div id="ExchangeContainer">
@ -34,15 +32,6 @@
ErrorMessage="Enter Display Name" ValidationGroup="CreateGroup" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator> ErrorMessage="Enter Display Name" ValidationGroup="CreateGroup" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td> </td>
</tr> </tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="locManagedBy" ></asp:Localize></td>
<td>
<wsp:userselector id="manager" IncludeMailboxes="true" runat="server" />
<asp:CustomValidator runat="server"
ValidationGroup="CreateGroup" meta:resourcekey="valManager" ID="valManager"
onservervalidate="valManager_ServerValidate" />
</td>
</tr>
</table> </table>
<div class="FormFooterClean"> <div class="FormFooterClean">
<asp:Button id="btnCreate" runat="server" Text="Create Group" CssClass="Button1" meta:resourcekey="btnCreate" ValidationGroup="CreateGroup" OnClick="btnCreate_Click"></asp:Button> <asp:Button id="btnCreate" runat="server" Text="Create Group" CssClass="Button1" meta:resourcekey="btnCreate" ValidationGroup="CreateGroup" OnClick="btnCreate_Click"></asp:Button>

View file

@ -57,7 +57,7 @@ namespace WebsitePanel.Portal.ExchangeServer
return; return;
try try
{ {
int accountId = ES.Services.Organizations.CreateSecurityGroup(PanelRequest.ItemID, txtDisplayName.Text, manager.GetAccount()); int accountId = ES.Services.Organizations.CreateSecurityGroup(PanelRequest.ItemID, txtDisplayName.Text);
if (accountId < 0) if (accountId < 0)
{ {
@ -74,10 +74,5 @@ namespace WebsitePanel.Portal.ExchangeServer
messageBox.ShowErrorMessage("ORGANIZATION_CREATE_SECURITY_GROUP", ex); messageBox.ShowErrorMessage("ORGANIZATION_CREATE_SECURITY_GROUP", ex);
} }
} }
protected void valManager_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = manager.GetAccountId() != 0;
}
} }
} }

View file

@ -93,33 +93,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName;
/// <summary>
/// Localize1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize Localize1;
/// <summary>
/// manager control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector manager;
/// <summary>
/// valManager control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CustomValidator valManager;
/// <summary> /// <summary>
/// btnCreate control. /// btnCreate control.
/// </summary> /// </summary>

View file

@ -1,7 +1,6 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroupGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSecurityGroupGeneralSettings" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroupGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSecurityGroupGeneralSettings" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/UsersList.ascx" TagName="UsersList" TagPrefix="wsp"%> <%@ Register Src="UserControls/UsersList.ascx" TagName="UsersList" TagPrefix="wsp"%>
<%@ Register Src="UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %>
<%@ Register Src="UserControls/SecurityGroupTabs.ascx" TagName="SecurityGroupTabs" TagPrefix="wsp"%> <%@ Register Src="UserControls/SecurityGroupTabs.ascx" TagName="SecurityGroupTabs" TagPrefix="wsp"%>
<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> <%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
@ -40,16 +39,6 @@
<br /> <br />
</td> </td>
</tr> </tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locManager" runat="server" meta:resourcekey="locManager" Text="Manager:"></asp:Localize></td>
<td>
<wsp:UserSelector id="manager" runat="server" />
<asp:CustomValidator runat="server"
ValidationGroup="EditList" meta:resourcekey="valManager" ID="valManager"
onservervalidate="valManager_ServerValidate" />
</td>
</tr>
<tr><td>&nbsp;</td></tr> <tr><td>&nbsp;</td></tr>
<tr> <tr>

View file

@ -65,8 +65,6 @@ namespace WebsitePanel.Portal.ExchangeServer
// bind form // bind form
txtDisplayName.Text = securityGroup.DisplayName; txtDisplayName.Text = securityGroup.DisplayName;
manager.SetAccount(securityGroup.ManagerAccount);
members.SetAccounts(securityGroup.MembersAccounts); members.SetAccounts(securityGroup.MembersAccounts);
txtNotes.Text = securityGroup.Notes; txtNotes.Text = securityGroup.Notes;
@ -75,7 +73,6 @@ namespace WebsitePanel.Portal.ExchangeServer
{ {
txtDisplayName.ReadOnly = true; txtDisplayName.ReadOnly = true;
txtNotes.ReadOnly = true; txtNotes.ReadOnly = true;
manager.Enabled = false;
members.Enabled = false; members.Enabled = false;
btnSave.Visible = false; btnSave.Visible = false;
@ -98,7 +95,6 @@ namespace WebsitePanel.Portal.ExchangeServer
PanelRequest.ItemID, PanelRequest.ItemID,
PanelRequest.AccountID, PanelRequest.AccountID,
txtDisplayName.Text, txtDisplayName.Text,
manager.GetAccount(),
members.GetAccounts(), members.GetAccounts(),
txtNotes.Text); txtNotes.Text);
@ -122,11 +118,5 @@ namespace WebsitePanel.Portal.ExchangeServer
{ {
SaveSettings(); SaveSettings();
} }
protected void valManager_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = manager.GetAccount() != null;
}
} }
} }

View file

@ -111,33 +111,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName;
/// <summary>
/// locManager control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locManager;
/// <summary>
/// manager control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector manager;
/// <summary>
/// valManager control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CustomValidator valManager;
/// <summary> /// <summary>
/// locMembers control. /// locMembers control.
/// </summary> /// </summary>

View file

@ -4,10 +4,9 @@
<ContentTemplate> <ContentTemplate>
<asp:TextBox ID="txtDisplayName" runat="server" CssClass="TextBox200" ReadOnly="true"></asp:TextBox> <asp:TextBox ID="txtDisplayName" runat="server" CssClass="TextBox200" ReadOnly="true"></asp:TextBox>
<% if (Enabled) { %>
<asp:ImageButton ID="ImageButton1" SkinID="ExchangeAddressBook16" runat="server" CausesValidation="false" OnClick="ImageButton1_Click" /> <asp:ImageButton ID="ImageButton1" SkinID="ExchangeAddressBook16" runat="server" CausesValidation="false" OnClick="ImageButton1_Click" />
<asp:LinkButton ID="cmdClear" runat="server" meta:resourcekey="cmdClear" OnClick="cmdClear_Click" CausesValidation="False"></asp:LinkButton> <asp:LinkButton ID="cmdClear" runat="server" meta:resourcekey="cmdClear" OnClick="cmdClear_Click" CausesValidation="False"></asp:LinkButton>
<% } %>
<asp:Panel ID="AddAccountsPanel" runat="server" CssClass="Popup" style="display:none"> <asp:Panel ID="AddAccountsPanel" runat="server" CssClass="Popup" style="display:none">
<table class="Popup-Header" cellpadding="0" cellspacing="0"> <table class="Popup-Header" cellpadding="0" cellspacing="0">

View file

@ -38,14 +38,6 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
{ {
public const string DirectionString = "DirectionString"; public const string DirectionString = "DirectionString";
private bool _enabled = true;
public bool Enabled
{
get { return _enabled; }
set { _enabled = value; }
}
public bool IncludeMailboxes public bool IncludeMailboxes
{ {
get get