add "security groups" functional excepting "users memberof"
This commit is contained in:
parent
52cf12187f
commit
4eff42511b
25 changed files with 468 additions and 163 deletions
|
@ -127,6 +127,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
|
|||
|
||||
private System.Threading.SendOrPostCallback GetOrganizationSecurityGroupsPagedOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback AddUserToSecurityGroupOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public esOrganizations()
|
||||
{
|
||||
|
@ -226,6 +228,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
|
|||
/// <remarks/>
|
||||
public event GetOrganizationSecurityGroupsPagedCompletedEventHandler GetOrganizationSecurityGroupsPagedCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event AddUserToSecurityGroupCompletedEventHandler AddUserToSecurityGroupCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckOrgIdExists", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public bool CheckOrgIdExists(string orgId)
|
||||
|
@ -2151,6 +2156,61 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddUserToSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public int AddUserToSecurityGroup(int itemId, int userAccountId, int groupAccountId)
|
||||
{
|
||||
object[] results = this.Invoke("AddUserToSecurityGroup", new object[] {
|
||||
itemId,
|
||||
userAccountId,
|
||||
groupAccountId});
|
||||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginAddUserToSecurityGroup(int itemId, int userAccountId, int groupAccountId, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return this.BeginInvoke("AddUserToSecurityGroup", new object[] {
|
||||
itemId,
|
||||
userAccountId,
|
||||
groupAccountId}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public int EndAddUserToSecurityGroup(System.IAsyncResult asyncResult)
|
||||
{
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void AddUserToSecurityGroupAsync(int itemId, int userAccountId, int groupAccountId)
|
||||
{
|
||||
this.AddUserToSecurityGroupAsync(itemId, userAccountId, groupAccountId, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void AddUserToSecurityGroupAsync(int itemId, int userAccountId, int groupAccountId, object userState)
|
||||
{
|
||||
if ((this.AddUserToSecurityGroupOperationCompleted == null))
|
||||
{
|
||||
this.AddUserToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddUserToSecurityGroupOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("AddUserToSecurityGroup", new object[] {
|
||||
itemId,
|
||||
userAccountId,
|
||||
groupAccountId}, this.AddUserToSecurityGroupOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnAddUserToSecurityGroupOperationCompleted(object arg)
|
||||
{
|
||||
if ((this.AddUserToSecurityGroupCompleted != null))
|
||||
{
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.AddUserToSecurityGroupCompleted(this, new AddUserToSecurityGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState)
|
||||
{
|
||||
|
@ -3087,4 +3147,34 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void AddUserToSecurityGroupCompletedEventHandler(object sender, AddUserToSecurityGroupCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class AddUserToSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
|
||||
{
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal AddUserToSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState)
|
||||
{
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public int Result
|
||||
{
|
||||
get
|
||||
{
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((int)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -371,6 +371,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
// register domain
|
||||
DataProvider.AddExchangeOrganizationDomain(itemId, domainId, true);
|
||||
|
||||
//add to exchangeAcounts
|
||||
AddAccount(itemId, ExchangeAccountType.DefaultSecurityGroup, org.GroupName,
|
||||
org.GroupName, null, false,
|
||||
0, org.GroupName, null, 0, null);
|
||||
|
||||
// register organization domain service item
|
||||
OrganizationDomain orgDomain = new OrganizationDomain
|
||||
{
|
||||
|
@ -1718,61 +1723,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return (account);
|
||||
}
|
||||
|
||||
|
||||
private static OrganizationSecurityGroup GetDemoSecurityGroupGeneralSettings()
|
||||
{
|
||||
OrganizationSecurityGroup c = new OrganizationSecurityGroup();
|
||||
c.DisplayName = "Fabrikam Sales";
|
||||
c.AccountName = "sales_fabrikam";
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public static OrganizationSecurityGroup GetSecurityGroupGeneralSettings(int itemId, int accountId)
|
||||
{
|
||||
#region Demo Mode
|
||||
if (IsDemoMode)
|
||||
{
|
||||
return GetDemoSecurityGroupGeneralSettings();
|
||||
}
|
||||
#endregion
|
||||
|
||||
// place log record
|
||||
TaskManager.StartTask("ORGANIZATION", "GET_SECURITY_GROUP_GENERAL", itemId);
|
||||
|
||||
try
|
||||
{
|
||||
// load organization
|
||||
Organization org = GetOrganization(itemId);
|
||||
if (org == null)
|
||||
return null;
|
||||
|
||||
OrganizationUser account = GetAccount(itemId, accountId);
|
||||
|
||||
// get mailbox settings
|
||||
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
||||
|
||||
OrganizationSecurityGroup securityGroup = orgProxy.GetSecurityGroupGeneralSettings("test2.com"/*account.AccountName*/, org.OrganizationId);
|
||||
|
||||
return securityGroup;
|
||||
|
||||
/*foreach (OrganizationUser user in securityGroup.MembersAccounts)
|
||||
{
|
||||
OrganizationUser userAccount = GetAccount(itemId, user.SamAccountName);
|
||||
|
||||
user.AccountId = user
|
||||
}*/
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw TaskManager.WriteError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
TaskManager.CompleteTask();
|
||||
}
|
||||
}
|
||||
|
||||
public static int SetUserGeneralSettings(int itemId, int accountId, string displayName,
|
||||
string password, bool hideAddressBook, bool disabled, bool locked, string firstName, string initials,
|
||||
string lastName, string address, string city, string state, string zip, string country,
|
||||
|
@ -2307,18 +2257,16 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
||||
|
||||
string accountName = BuildAccountName(org.OrganizationId, displayName, org.ServiceId);
|
||||
TaskManager.Write("accountName :" + displayName);
|
||||
|
||||
TaskManager.Write("accountName :" + accountName);
|
||||
|
||||
if (orgProxy.CreateSecurityGroup(org.OrganizationId, accountName, displayName, managedBy) == 0)
|
||||
if (orgProxy.CreateSecurityGroup(org.OrganizationId, displayName, managedBy) == 0)
|
||||
{
|
||||
OrganizationSecurityGroup retSecurityGroup = orgProxy.GetSecurityGroupGeneralSettings(accountName, org.OrganizationId);
|
||||
TaskManager.Write("sAMAccountName :" + retSecurityGroup.AccountName);
|
||||
OrganizationSecurityGroup retSecurityGroup = orgProxy.GetSecurityGroupGeneralSettings(displayName, org.OrganizationId);
|
||||
TaskManager.Write("sAMAccountName :" + retSecurityGroup.SAMAccountName);
|
||||
|
||||
securityGroupId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName,
|
||||
securityGroupId = AddAccount(itemId, ExchangeAccountType.SecurityGroup, displayName,
|
||||
displayName, null, false,
|
||||
0, retSecurityGroup.AccountName, null, 0, null);
|
||||
0, retSecurityGroup.SAMAccountName, null, 0, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2337,6 +2285,67 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return securityGroupId;
|
||||
}
|
||||
|
||||
private static OrganizationSecurityGroup GetDemoSecurityGroupGeneralSettings()
|
||||
{
|
||||
OrganizationSecurityGroup c = new OrganizationSecurityGroup();
|
||||
c.DisplayName = "Fabrikam Sales";
|
||||
c.AccountName = "sales_fabrikam";
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public static OrganizationSecurityGroup GetSecurityGroupGeneralSettings(int itemId, int accountId)
|
||||
{
|
||||
#region Demo Mode
|
||||
if (IsDemoMode)
|
||||
{
|
||||
return GetDemoSecurityGroupGeneralSettings();
|
||||
}
|
||||
#endregion
|
||||
|
||||
// place log record
|
||||
TaskManager.StartTask("ORGANIZATION", "GET_SECURITY_GROUP_GENERAL", itemId);
|
||||
|
||||
try
|
||||
{
|
||||
// load organization
|
||||
Organization org = GetOrganization(itemId);
|
||||
if (org == null)
|
||||
return null;
|
||||
|
||||
OrganizationUser account = GetAccount(itemId, accountId);
|
||||
|
||||
// get mailbox settings
|
||||
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
||||
|
||||
OrganizationSecurityGroup securityGroup = orgProxy.GetSecurityGroupGeneralSettings(account.AccountName, org.OrganizationId);
|
||||
|
||||
securityGroup.DisplayName = account.DisplayName;
|
||||
|
||||
securityGroup.IsDefault = account.AccountType == ExchangeAccountType.DefaultSecurityGroup;
|
||||
|
||||
foreach (OrganizationUser user in securityGroup.MembersAccounts)
|
||||
{
|
||||
OrganizationUser userAccount = GetAccountByAccountName(itemId, user.SamAccountName);
|
||||
|
||||
user.AccountId = userAccount.AccountId;
|
||||
user.AccountName = userAccount.AccountName;
|
||||
user.PrimaryEmailAddress = userAccount.PrimaryEmailAddress;
|
||||
user.AccountType = userAccount.AccountType;
|
||||
}
|
||||
|
||||
return securityGroup;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw TaskManager.WriteError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
TaskManager.CompleteTask();
|
||||
}
|
||||
}
|
||||
|
||||
public static int DeleteSecurityGroup(int itemId, int accountId)
|
||||
{
|
||||
// check account
|
||||
|
@ -2407,7 +2416,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
orgProxy.SetSecurityGroupGeneralSettings(
|
||||
org.OrganizationId,
|
||||
accountName,
|
||||
displayName,
|
||||
managedBy,
|
||||
memberAccounts,
|
||||
notes);
|
||||
|
@ -2461,8 +2469,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
#endregion
|
||||
|
||||
string accountTypes = string.Format("{0}", ((int)ExchangeAccountType.SecurityGroup));
|
||||
|
||||
string accountTypes = string.Format("{0}, {1}", ((int)ExchangeAccountType.SecurityGroup), ((int)ExchangeAccountType.DefaultSecurityGroup));
|
||||
|
||||
DataSet ds =
|
||||
DataProvider.GetExchangeAccountsPaged(SecurityContext.User.UserId, itemId, accountTypes, filterColumn,
|
||||
|
@ -2489,6 +2496,44 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int AddUserToSecurityGroup(int itemId, int userAccountId, int groupAccountId)
|
||||
{
|
||||
// check account
|
||||
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
|
||||
if (accountCheck < 0) return accountCheck;
|
||||
|
||||
// place log record
|
||||
TaskManager.StartTask("ORGANIZATION", "ADD_USER_TO_SECURITY_GROUP", itemId);
|
||||
|
||||
try
|
||||
{
|
||||
// load organization
|
||||
Organization org = GetOrganization(itemId);
|
||||
if (org == null)
|
||||
return -1;
|
||||
|
||||
// load user account
|
||||
OrganizationUser userAccount = GetAccount(itemId, userAccountId);
|
||||
|
||||
//load group account
|
||||
ExchangeAccount groupAccount = ExchangeServerController.GetAccount(itemId, groupAccountId);
|
||||
|
||||
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
||||
|
||||
orgProxy.AddUserToSecurityGroup(org.OrganizationId, userAccount.AccountName, groupAccount.AccountName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw TaskManager.WriteError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
TaskManager.CompleteTask();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -275,6 +275,12 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return OrganizationController.GetOrganizationSecurityGroupsPaged(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public int AddUserToSecurityGroup(int itemId, int userAccountId, int groupAccountId)
|
||||
{
|
||||
return OrganizationController.AddUserToSecurityGroup(itemId, userAccountId, groupAccountId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
public const string ExternalEmail = "mail";
|
||||
public const string CustomAttribute2 = "extensionAttribute2";
|
||||
public const string DistinguishedName = "distinguishedName";
|
||||
public const string ManagedBy = "ManagedBy";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -349,11 +349,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
}
|
||||
|
||||
public static void CreateGroup(string path, string group)
|
||||
{
|
||||
CreateGroup(path, group, "");
|
||||
}
|
||||
|
||||
public static void CreateGroup(string path, string group, string manager)
|
||||
{
|
||||
DirectoryEntry currentADObject = new DirectoryEntry(path);
|
||||
|
||||
|
@ -363,11 +358,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
newGroupObject.Properties[ADAttributes.GroupType].Add(-2147483640);
|
||||
|
||||
if (!string.IsNullOrEmpty(manager))
|
||||
{
|
||||
newGroupObject.Properties[ADAttributes.Manager].Add(manager);
|
||||
}
|
||||
|
||||
newGroupObject.CommitChanges();
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
Room = 5,
|
||||
Equipment = 6,
|
||||
User = 7,
|
||||
SecurityGroup = 8
|
||||
SecurityGroup = 8,
|
||||
DefaultSecurityGroup = 9
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,13 +42,15 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
OrganizationUser GetUserGeneralSettings(string loginName, string organizationId);
|
||||
|
||||
int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy);
|
||||
int CreateSecurityGroup(string organizationId, string groupName, string managedBy);
|
||||
|
||||
OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId);
|
||||
|
||||
void DeleteSecurityGroup(string groupName, string organizationId);
|
||||
|
||||
void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes);
|
||||
void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes);
|
||||
|
||||
void AddUserToSecurityGroup(string organizationId, string loginName, string groupName);
|
||||
|
||||
void SetUserGeneralSettings(string organizationId, string accountName, string displayName, string password,
|
||||
bool hideFromAddressBook, bool disabled, bool locked, string firstName, string initials,
|
||||
|
|
|
@ -42,5 +42,11 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool IsDefault
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -227,6 +227,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
org.OrganizationId = organizationId;
|
||||
org.DistinguishedName = ActiveDirectoryUtils.RemoveADPrefix(orgPath);
|
||||
org.SecurityGroup = ActiveDirectoryUtils.RemoveADPrefix(GetGroupPath(organizationId));
|
||||
org.GroupName = organizationId;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -547,7 +548,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
retUser.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes);
|
||||
retUser.ExternalEmail = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.ExternalEmail);
|
||||
retUser.Disabled = (bool)entry.InvokeGet(ADAttributes.AccountDisabled);
|
||||
retUser.Manager = GetManager(entry);
|
||||
retUser.Manager = GetManager(entry, ADAttributes.Manager);
|
||||
retUser.SamAccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName);
|
||||
retUser.DomainUserName = GetDomainName(ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName));
|
||||
retUser.DistinguishedName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DistinguishedName);
|
||||
|
@ -564,10 +565,10 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
return ret;
|
||||
}
|
||||
|
||||
private OrganizationUser GetManager(DirectoryEntry entry)
|
||||
private OrganizationUser GetManager(DirectoryEntry entry, string adAttribute)
|
||||
{
|
||||
OrganizationUser retUser = null;
|
||||
string path = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Manager);
|
||||
string path = ActiveDirectoryUtils.GetADObjectStringProperty(entry, adAttribute);
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
path = ActiveDirectoryUtils.AddADPrefix(path, PrimaryDomainController);
|
||||
|
@ -824,12 +825,12 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
#region Security Groups
|
||||
|
||||
public int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy)
|
||||
public int CreateSecurityGroup(string organizationId, string groupName, string managedBy)
|
||||
{
|
||||
return CreateSecurityGroupInternal(organizationId, groupName, displayName, managedBy);
|
||||
return CreateSecurityGroupInternal(organizationId, groupName, managedBy);
|
||||
}
|
||||
|
||||
internal int CreateSecurityGroupInternal(string organizationId, string groupName, string displayName, string managedBy)
|
||||
internal int CreateSecurityGroupInternal(string organizationId, string groupName, string managedBy)
|
||||
{
|
||||
HostedSolutionLog.LogStart("CreateSecurityGroupInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
|
||||
|
@ -850,6 +851,10 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(groupPath))
|
||||
{
|
||||
ActiveDirectoryUtils.CreateGroup(path, groupName);
|
||||
|
||||
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(groupPath);
|
||||
|
||||
string manager = string.Empty;
|
||||
if (!string.IsNullOrEmpty(managedBy))
|
||||
{
|
||||
|
@ -857,7 +862,9 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
manager = ActiveDirectoryUtils.AdObjectExists(managerPath) ? managerPath : string.Empty;
|
||||
}
|
||||
|
||||
ActiveDirectoryUtils.CreateGroup(path, groupName, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ManagedBy, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
||||
|
||||
entry.CommitChanges();
|
||||
|
||||
groupCreated = true;
|
||||
|
||||
|
@ -915,9 +922,11 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
OrganizationSecurityGroup securityGroup = new OrganizationSecurityGroup();
|
||||
|
||||
securityGroup.DisplayName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DisplayName);
|
||||
securityGroup.ManagerAccount = GetManager(entry);
|
||||
securityGroup.ManagerAccount = GetManager(entry, ADAttributes.ManagedBy);
|
||||
|
||||
securityGroup.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes);
|
||||
|
||||
securityGroup.AccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName);
|
||||
securityGroup.SAMAccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName);
|
||||
|
||||
List<OrganizationUser> members = new List<OrganizationUser>();
|
||||
|
@ -959,13 +968,13 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
HostedSolutionLog.LogEnd("DeleteSecurityGroupInternal");
|
||||
}
|
||||
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes)
|
||||
{
|
||||
|
||||
SetSecurityGroupGeneralSettingsInternal(organizationId, groupName, displayName, managedBy, memberAccounts, notes);
|
||||
SetSecurityGroupGeneralSettingsInternal(organizationId, groupName, managedBy, memberAccounts, notes);
|
||||
}
|
||||
|
||||
internal void SetSecurityGroupGeneralSettingsInternal(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||
internal void SetSecurityGroupGeneralSettingsInternal(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes)
|
||||
{
|
||||
HostedSolutionLog.LogStart("SetSecurityGroupGeneralSettingsInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
|
||||
|
@ -981,8 +990,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path);
|
||||
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.DisplayName, displayName);
|
||||
|
||||
string manager = string.Empty;
|
||||
if (!string.IsNullOrEmpty(managedBy))
|
||||
{
|
||||
|
@ -990,7 +997,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
manager = ActiveDirectoryUtils.AdObjectExists(managerPath) ? managerPath : string.Empty;
|
||||
}
|
||||
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Manager, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ManagedBy, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
||||
|
||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes);
|
||||
|
||||
|
@ -1006,6 +1013,34 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
entry.CommitChanges();
|
||||
}
|
||||
|
||||
public void AddUserToSecurityGroup(string organizationId, string loginName, string groupName)
|
||||
{
|
||||
AddUserToSecurityGroupInternal(organizationId, loginName, groupName);
|
||||
}
|
||||
|
||||
internal void AddUserToSecurityGroupInternal(string organizationId, string loginName, string groupName)
|
||||
{
|
||||
HostedSolutionLog.LogStart("AddUserToSecurityGroupInternal");
|
||||
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("loginName : {0}", loginName);
|
||||
HostedSolutionLog.DebugInfo("groupName : {0}", groupName);
|
||||
|
||||
if (string.IsNullOrEmpty(organizationId))
|
||||
throw new ArgumentNullException("organizationId");
|
||||
|
||||
if (string.IsNullOrEmpty(loginName))
|
||||
throw new ArgumentNullException("loginName");
|
||||
|
||||
if (string.IsNullOrEmpty(groupName))
|
||||
throw new ArgumentNullException("groupName");
|
||||
|
||||
string userPath = GetUserPath(organizationId, loginName);
|
||||
|
||||
string groupPath = GetGroupPath(organizationId, groupName);
|
||||
|
||||
ActiveDirectoryUtils.AddUserToGroup(userPath, groupPath);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override bool IsInstalled()
|
||||
|
|
|
@ -85,6 +85,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
private System.Threading.SendOrPostCallback SetSecurityGroupGeneralSettingsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback AddUserToSecurityGroupOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback SetUserPasswordOperationCompleted;
|
||||
|
@ -137,6 +139,9 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
/// <remarks/>
|
||||
public event SetSecurityGroupGeneralSettingsCompletedEventHandler SetSecurityGroupGeneralSettingsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event AddUserToSecurityGroupCompletedEventHandler AddUserToSecurityGroupCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted;
|
||||
|
||||
|
@ -481,23 +486,21 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
/// <remarks/>
|
||||
[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)]
|
||||
public int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy)
|
||||
public int CreateSecurityGroup(string organizationId, string groupName, string managedBy)
|
||||
{
|
||||
object[] results = this.Invoke("CreateSecurityGroup", new object[] {
|
||||
organizationId,
|
||||
groupName,
|
||||
displayName,
|
||||
managedBy});
|
||||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginCreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy, System.AsyncCallback callback, object asyncState)
|
||||
public System.IAsyncResult BeginCreateSecurityGroup(string organizationId, string groupName, string managedBy, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return this.BeginInvoke("CreateSecurityGroup", new object[] {
|
||||
organizationId,
|
||||
groupName,
|
||||
displayName,
|
||||
managedBy}, callback, asyncState);
|
||||
}
|
||||
|
||||
|
@ -509,13 +512,13 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void CreateSecurityGroupAsync(string organizationId, string groupName, string displayName, string managedBy)
|
||||
public void CreateSecurityGroupAsync(string organizationId, string groupName, string managedBy)
|
||||
{
|
||||
this.CreateSecurityGroupAsync(organizationId, groupName, displayName, managedBy, null);
|
||||
this.CreateSecurityGroupAsync(organizationId, groupName, managedBy, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void CreateSecurityGroupAsync(string organizationId, string groupName, string displayName, string managedBy, object userState)
|
||||
public void CreateSecurityGroupAsync(string organizationId, string groupName, string managedBy, object userState)
|
||||
{
|
||||
if ((this.CreateSecurityGroupOperationCompleted == null))
|
||||
{
|
||||
|
@ -524,7 +527,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
this.InvokeAsync("CreateSecurityGroup", new object[] {
|
||||
organizationId,
|
||||
groupName,
|
||||
displayName,
|
||||
managedBy}, this.CreateSecurityGroupOperationCompleted, userState);
|
||||
}
|
||||
|
||||
|
@ -644,24 +646,22 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
/// <remarks/>
|
||||
[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)]
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes)
|
||||
{
|
||||
this.Invoke("SetSecurityGroupGeneralSettings", new object[] {
|
||||
organizationId,
|
||||
groupName,
|
||||
displayName,
|
||||
managedBy,
|
||||
memberAccounts,
|
||||
notes});
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState)
|
||||
public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] {
|
||||
organizationId,
|
||||
groupName,
|
||||
displayName,
|
||||
managedBy,
|
||||
memberAccounts,
|
||||
notes}, callback, asyncState);
|
||||
|
@ -674,13 +674,13 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes)
|
||||
{
|
||||
this.SetSecurityGroupGeneralSettingsAsync(organizationId, groupName, displayName, managedBy, memberAccounts, notes, null);
|
||||
this.SetSecurityGroupGeneralSettingsAsync(organizationId, groupName, managedBy, memberAccounts, notes, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes, object userState)
|
||||
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes, object userState)
|
||||
{
|
||||
if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null))
|
||||
{
|
||||
|
@ -689,7 +689,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
this.InvokeAsync("SetSecurityGroupGeneralSettings", new object[] {
|
||||
organizationId,
|
||||
groupName,
|
||||
displayName,
|
||||
managedBy,
|
||||
memberAccounts,
|
||||
notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState);
|
||||
|
@ -704,6 +703,60 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddUserToSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public void AddUserToSecurityGroup(string organizationId, string loginName, string groupName)
|
||||
{
|
||||
this.Invoke("AddUserToSecurityGroup", new object[] {
|
||||
organizationId,
|
||||
loginName,
|
||||
groupName});
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginAddUserToSecurityGroup(string organizationId, string loginName, string groupName, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return this.BeginInvoke("AddUserToSecurityGroup", new object[] {
|
||||
organizationId,
|
||||
loginName,
|
||||
groupName}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void EndAddUserToSecurityGroup(System.IAsyncResult asyncResult)
|
||||
{
|
||||
this.EndInvoke(asyncResult);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void AddUserToSecurityGroupAsync(string organizationId, string loginName, string groupName)
|
||||
{
|
||||
this.AddUserToSecurityGroupAsync(organizationId, loginName, groupName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void AddUserToSecurityGroupAsync(string organizationId, string loginName, string groupName, object userState)
|
||||
{
|
||||
if ((this.AddUserToSecurityGroupOperationCompleted == null))
|
||||
{
|
||||
this.AddUserToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddUserToSecurityGroupOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("AddUserToSecurityGroup", new object[] {
|
||||
organizationId,
|
||||
loginName,
|
||||
groupName}, this.AddUserToSecurityGroupOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnAddUserToSecurityGroupOperationCompleted(object arg)
|
||||
{
|
||||
if ((this.AddUserToSecurityGroupCompleted != null))
|
||||
{
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.AddUserToSecurityGroupCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
|
@ -1511,6 +1564,10 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void SetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void AddUserToSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
|
|
@ -111,9 +111,9 @@ namespace WebsitePanel.Server
|
|||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy)
|
||||
public int CreateSecurityGroup(string organizationId, string groupName, string managedBy)
|
||||
{
|
||||
return Organization.CreateSecurityGroup(organizationId, groupName, displayName, managedBy);
|
||||
return Organization.CreateSecurityGroup(organizationId, groupName, managedBy);
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
|
@ -129,9 +129,15 @@ namespace WebsitePanel.Server
|
|||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||
public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes)
|
||||
{
|
||||
Organization.SetSecurityGroupGeneralSettings(organizationId, groupName, displayName, managedBy, memberAccounts, notes);
|
||||
Organization.SetSecurityGroupGeneralSettings(organizationId, groupName, managedBy, memberAccounts, notes);
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void AddUserToSecurityGroup(string organizationId, string loginName, string groupName)
|
||||
{
|
||||
Organization.AddUserToSecurityGroup(organizationId, loginName, groupName);
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
|
|
|
@ -135,9 +135,6 @@
|
|||
<data name="ddlSearchColumnDisplayName.Text" xml:space="preserve">
|
||||
<value>Display Name</value>
|
||||
</data>
|
||||
<data name="ddlSearchColumnEmail.Text" xml:space="preserve">
|
||||
<value>E-mail Address</value>
|
||||
</data>
|
||||
<data name="FormComments.Text" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<%@ 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/AccountsList.ascx" TagName="AccountsList" 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"%>
|
||||
|
@ -17,13 +16,13 @@
|
|||
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
|
||||
</div>
|
||||
<div class="Left">
|
||||
<wsp:Menu id="menu" runat="server" SelectedItem="dlists" />
|
||||
<wsp:Menu id="menu" runat="server" SelectedItem="secur_groups" />
|
||||
</div>
|
||||
<div class="Content">
|
||||
<div class="Center">
|
||||
<div class="Title">
|
||||
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Distribution List"></asp:Localize>
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Security Group"></asp:Localize>
|
||||
|
||||
<asp:Literal ID="litDisplayName" runat="server" Text="John Smith" />
|
||||
</div>
|
||||
|
|
|
@ -70,10 +70,18 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
members.SetAccounts(securityGroup.MembersAccounts);
|
||||
|
||||
txtNotes.Text = securityGroup.Notes;
|
||||
|
||||
if (securityGroup.IsDefault)
|
||||
{
|
||||
txtDisplayName.ReadOnly = true;
|
||||
txtNotes.ReadOnly = true;
|
||||
manager.Enabled = false;
|
||||
members.Enabled = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_SETTINGS", ex);
|
||||
messageBox.ShowErrorMessage("ORGANIZATION_GET_SECURITY_GROUP_SETTINGS", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,15 +92,12 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
try
|
||||
{
|
||||
int result = ES.Services.ExchangeServer.SetDistributionListGeneralSettings(
|
||||
PanelRequest.ItemID, PanelRequest.AccountID,
|
||||
int result = ES.Services.Organizations.SetSecurityGroupGeneralSettings(
|
||||
PanelRequest.ItemID,
|
||||
PanelRequest.AccountID,
|
||||
txtDisplayName.Text,
|
||||
false,
|
||||
|
||||
manager.GetAccount(),
|
||||
|
||||
members.GetAccounts(),
|
||||
|
||||
txtNotes.Text);
|
||||
|
||||
if (result < 0)
|
||||
|
@ -103,11 +108,11 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
litDisplayName.Text = PortalAntiXSS.Encode(txtDisplayName.Text);
|
||||
|
||||
messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_SETTINGS");
|
||||
messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_SECURITY_GROUP_SETTINGS");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
messageBox.ShowErrorMessage("EXCHANGE_UPDATE_DLIST_SETTINGS", ex);
|
||||
messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_SECURITY_GROUP_SETTINGS", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||
<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
|
||||
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||
|
||||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||
|
@ -13,13 +12,13 @@
|
|||
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
|
||||
</div>
|
||||
<div class="Left">
|
||||
<wsp:Menu id="menu" runat="server" SelectedItem="dlists" />
|
||||
<wsp:Menu id="menu" runat="server" SelectedItem="secur_groups" />
|
||||
</div>
|
||||
<div class="Content">
|
||||
<div class="Center">
|
||||
<div class="Title">
|
||||
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Lists"></asp:Localize>
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Groups"></asp:Localize>
|
||||
</div>
|
||||
|
||||
<div class="FormBody">
|
||||
|
@ -42,7 +41,6 @@
|
|||
|
||||
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
|
||||
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
|
||||
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
|
||||
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
|
||||
CausesValidation="false"/>
|
||||
</asp:Panel>
|
||||
|
@ -51,7 +49,7 @@
|
|||
|
||||
<asp:GridView ID="gvGroups" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
||||
Width="100%" EmptyDataText="gvGroups" CssSelectorClass="NormalGridView"
|
||||
OnRowCommand="gvLists_RowCommand" AllowPaging="True" AllowSorting="True"
|
||||
OnRowCommand="gvSecurityGroups_RowCommand" AllowPaging="True" AllowSorting="True"
|
||||
DataSourceID="odsSecurityGroupsPaged" PageSize="20">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="gvGroupsDisplayName" SortExpression="DisplayName">
|
||||
|
@ -66,7 +64,7 @@
|
|||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="cmdDelete" runat="server" Text="Delete" SkinID="ExchangeDelete"
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("AccountId") %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("AccountId") %>' Visible='<%# IsNotDefault(Eval("AccountType").ToString()) %>'
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Remove this item?');"></asp:ImageButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
@ -80,7 +78,7 @@
|
|||
OnSelected="odsSecurityGroupsPaged_Selected">
|
||||
<SelectParameters>
|
||||
<asp:QueryStringParameter Name="itemId" QueryStringField="ItemID" DefaultValue="0" />
|
||||
<asp:Parameter Name="accountTypes" DefaultValue="3" />
|
||||
<asp:Parameter Name="accountTypes" DefaultValue="8" />
|
||||
<asp:ControlParameter Name="filterColumn" ControlID="ddlSearchColumn" PropertyName="SelectedValue" />
|
||||
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
||||
</SelectParameters>
|
||||
|
|
|
@ -46,14 +46,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BindStats();
|
||||
}
|
||||
}
|
||||
|
||||
private void BindStats()
|
||||
{
|
||||
}
|
||||
|
||||
protected void btnCreateGroup_Click(object sender, EventArgs e)
|
||||
|
@ -69,6 +62,11 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
"ItemID=" + PanelRequest.ItemID.ToString());
|
||||
}
|
||||
|
||||
public bool IsNotDefault(string accountType)
|
||||
{
|
||||
return (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), accountType) != ExchangeAccountType.DefaultSecurityGroup;
|
||||
}
|
||||
|
||||
protected void odsSecurityGroupsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
if (e.Exception != null)
|
||||
|
@ -78,7 +76,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
}
|
||||
}
|
||||
|
||||
protected void gvLists_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||
protected void gvSecurityGroups_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||
{
|
||||
if (e.CommandName == "DeleteItem")
|
||||
{
|
||||
|
@ -96,8 +94,6 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
// rebind grid
|
||||
gvGroups.DataBind();
|
||||
|
||||
BindStats();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -113,9 +109,6 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
// rebind grid
|
||||
gvGroups.DataBind();
|
||||
|
||||
// bind stats
|
||||
BindStats();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@
|
|||
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
|
||||
<%@ Register Src="UserControls/EmailAddress.ascx" TagName="EmailAddress" TagPrefix="wsp" %>
|
||||
<%@ Register Src="UserControls/AccountsList.ascx" TagName="AccountsList" TagPrefix="wsp" %>
|
||||
<%@ Register Src="UserControls/UsersList.ascx" TagName="UsersList" TagPrefix="wsp" %>
|
||||
|
||||
|
||||
|
||||
|
@ -42,9 +43,9 @@
|
|||
<uc1:MailboxTabs ID="MailboxTabsId" runat="server" SelectedTab="user_memberof" />
|
||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||
|
||||
<wsp:CollapsiblePanel id="secDistributionLists" runat="server" TargetControlID="DistributionLists" meta:resourcekey="secDistributionLists" Text="Distribution Lists"></wsp:CollapsiblePanel>
|
||||
<asp:Panel ID="DistributionLists" runat="server" Height="0" style="overflow:hidden;">
|
||||
<asp:UpdatePanel ID="GeneralUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<wsp:CollapsiblePanel id="secDistributionLists" runat="server" TargetControlID="DistributionListsPanel" meta:resourcekey="secDistributionLists" Text="Distribution Lists"></wsp:CollapsiblePanel>
|
||||
<asp:Panel ID="DistributionListsPanel" runat="server" Height="0" style="overflow:hidden;">
|
||||
<asp:UpdatePanel ID="DLGeneralUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<ContentTemplate>
|
||||
|
||||
<wsp:AccountsList id="distrlists" runat="server"
|
||||
|
@ -57,6 +58,20 @@
|
|||
</asp:UpdatePanel>
|
||||
</asp:Panel>
|
||||
|
||||
<wsp:CollapsiblePanel id="secSecurityGroups" runat="server" TargetControlID="SecurityGroupsPanel" meta:resourcekey="secSecurityGroups" Text="Security Groups"></wsp:CollapsiblePanel>
|
||||
<asp:Panel ID="SecurityGroupsPanel" runat="server" Height="0" style="overflow:hidden;">
|
||||
<asp:UpdatePanel ID="SCGeneralUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<ContentTemplate>
|
||||
|
||||
<wsp:AccountsList id="securegroups" runat="server"
|
||||
MailboxesEnabled="false"
|
||||
EnableMailboxOnly="false"
|
||||
ContactsEnabled="false"
|
||||
DistributionListsEnabled="false" />
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Panel>
|
||||
|
||||
<div class="FormFooterClean">
|
||||
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1"
|
||||
|
|
|
@ -62,7 +62,6 @@ namespace WebsitePanel.Portal.HostedSolution
|
|||
ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID);
|
||||
|
||||
distrlists.SetAccounts(dLists);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -103,22 +103,22 @@ namespace WebsitePanel.Portal.HostedSolution {
|
|||
protected global::WebsitePanel.Portal.CollapsiblePanel secDistributionLists;
|
||||
|
||||
/// <summary>
|
||||
/// DistributionLists control.
|
||||
/// DistributionListsPanel 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.Panel DistributionLists;
|
||||
protected global::System.Web.UI.WebControls.Panel DistributionListsPanel;
|
||||
|
||||
/// <summary>
|
||||
/// GeneralUpdatePanel control.
|
||||
/// DLGeneralUpdatePanel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel;
|
||||
protected global::System.Web.UI.UpdatePanel DLGeneralUpdatePanel;
|
||||
|
||||
/// <summary>
|
||||
/// distrlists control.
|
||||
|
@ -129,6 +129,42 @@ namespace WebsitePanel.Portal.HostedSolution {
|
|||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList distrlists;
|
||||
|
||||
/// <summary>
|
||||
/// secSecurityGroups control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel secSecurityGroups;
|
||||
|
||||
/// <summary>
|
||||
/// SecurityGroupsPanel 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.Panel SecurityGroupsPanel;
|
||||
|
||||
/// <summary>
|
||||
/// SCGeneralUpdatePanel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel SCGeneralUpdatePanel;
|
||||
|
||||
/// <summary>
|
||||
/// securegroups 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.AccountsList securegroups;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave control.
|
||||
/// </summary>
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
<ContentTemplate>
|
||||
|
||||
<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: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">
|
||||
<table class="Popup-Header" cellpadding="0" cellspacing="0">
|
||||
|
|
|
@ -38,6 +38,14 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
{
|
||||
public const string DirectionString = "DirectionString";
|
||||
|
||||
private bool _enabled = true;
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get { return _enabled; }
|
||||
set { _enabled = value; }
|
||||
}
|
||||
|
||||
public bool IncludeMailboxes
|
||||
{
|
||||
get
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
|
||||
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
||||
|
||||
if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx))
|
||||
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT, cntx) || Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx))
|
||||
tabsList.Add(CreateTab("user_memberof", "Tab.MemberOf"));
|
||||
|
||||
// find selected menu item
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
|
||||
<asp:UpdatePanel ID="AccountsUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="FormButtonsBarClean">
|
||||
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
|
||||
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
|
||||
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
|
||||
</div>
|
||||
<asp:GridView ID="gvAccounts" runat="server" meta:resourcekey="gvAccounts" AutoGenerateColumns="False"
|
||||
|
|
|
@ -38,6 +38,14 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
{
|
||||
public const string DirectionString = "DirectionString";
|
||||
|
||||
private bool _enabled = true;
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get { return _enabled; }
|
||||
set { _enabled = value; }
|
||||
}
|
||||
|
||||
private enum SelectedState
|
||||
{
|
||||
All,
|
||||
|
@ -150,6 +158,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
Page.ClientScript.RegisterClientScriptBlock(typeof(AccountsList), "SelectAllCheckboxes",
|
||||
script, true);
|
||||
}
|
||||
|
||||
btnAdd.Visible = Enabled;
|
||||
btnDelete.Visible = Enabled;
|
||||
|
||||
gvAccounts.Columns[0].Visible = Enabled;
|
||||
}
|
||||
|
||||
protected void btnAdd_Click(object sender, EventArgs e)
|
||||
|
@ -279,7 +292,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
bool exists = false;
|
||||
foreach (OrganizationUser account in accounts)
|
||||
{
|
||||
if (String.Compare(newAccount.SamAccountName, account.SamAccountName, true) == 0)
|
||||
if (String.Compare(newAccount.AccountName, account.AccountName, true) == 0)
|
||||
{
|
||||
exists = true;
|
||||
break;
|
||||
|
|
|
@ -299,9 +299,10 @@
|
|||
</Compile>
|
||||
<Compile Include="ExchangeServer\UserControls\UsersList.ascx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
<DependentUpon>UsersList.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ExchangeServer\UserControls\UsersList.ascx.designer.cs">
|
||||
<DependentUpon>UsersList.ascx.cs</DependentUpon>
|
||||
<DependentUpon>UsersList.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ExchangeServer\UserControls\UserTabs.ascx.cs">
|
||||
<DependentUpon>UserTabs.ascx</DependentUpon>
|
||||
|
@ -3928,6 +3929,7 @@
|
|||
<Content Include="ExchangeServer\OrganizationSecurityGroups.ascx" />
|
||||
<Content Include="ExchangeServer\OrganizationUserMemberOf.ascx" />
|
||||
<Content Include="ExchangeServer\UserControls\SecurityGroupTabs.ascx" />
|
||||
<Content Include="ExchangeServer\UserControls\UsersList.ascx" />
|
||||
<Content Include="Lync\UserControls\LyncUserSettings.ascx" />
|
||||
<Content Include="ProviderControls\CRM2011_Settings.ascx" />
|
||||
<Content Include="ProviderControls\HeliconZoo_Settings.ascx" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue