update functionallity for security groups
This commit is contained in:
parent
14e505a502
commit
52cf12187f
18 changed files with 1849 additions and 979 deletions
File diff suppressed because it is too large
Load diff
|
@ -1640,20 +1640,6 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static OrganizationUser GetAccount(int itemId, string samAccountName)
|
|
||||||
{
|
|
||||||
OrganizationUser account = ObjectUtils.FillObjectFromDataReader<OrganizationUser>(
|
|
||||||
DataProvider.GetExchangeAccount(itemId, userId));
|
|
||||||
|
|
||||||
if (account == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
// decrypt password
|
|
||||||
account.AccountPassword = CryptoUtils.Decrypt(account.AccountPassword);
|
|
||||||
|
|
||||||
return account;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static OrganizationUser GetAccountByAccountName(int itemId, string AccountName)
|
public static OrganizationUser GetAccountByAccountName(int itemId, string AccountName)
|
||||||
{
|
{
|
||||||
OrganizationUser account = ObjectUtils.FillObjectFromDataReader<OrganizationUser>(
|
OrganizationUser account = ObjectUtils.FillObjectFromDataReader<OrganizationUser>(
|
||||||
|
@ -2265,6 +2251,15 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return ocs;
|
return ocs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int AddAccount(int itemId, ExchangeAccountType accountType,
|
||||||
|
string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder,
|
||||||
|
MailboxManagerActions mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber)
|
||||||
|
{
|
||||||
|
return DataProvider.AddExchangeAccount(itemId, (int)accountType,
|
||||||
|
accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder,
|
||||||
|
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, string managedBy)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(displayName))
|
if (string.IsNullOrEmpty(displayName))
|
||||||
|
@ -2281,19 +2276,11 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
TaskManager.Write("Organization ID :" + itemId);
|
TaskManager.Write("Organization ID :" + itemId);
|
||||||
TaskManager.Write("display name :" + displayName);
|
TaskManager.Write("display name :" + displayName);
|
||||||
|
|
||||||
int userId = -1;
|
int securityGroupId = -1;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
/*displayName = displayName.Trim();
|
displayName = displayName.Trim();
|
||||||
name = name.Trim();
|
|
||||||
domain = domain.Trim();
|
|
||||||
|
|
||||||
// e-mail
|
|
||||||
string email = name + "@" + domain;
|
|
||||||
|
|
||||||
if (EmailAddressExists(email))
|
|
||||||
return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS;
|
|
||||||
|
|
||||||
// load organization
|
// load organization
|
||||||
Organization org = GetOrganization(itemId);
|
Organization org = GetOrganization(itemId);
|
||||||
|
@ -2318,35 +2305,25 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (!CheckUserQuota(org.Id, out errorCode))
|
if (!CheckUserQuota(org.Id, out errorCode))
|
||||||
return errorCode;
|
return errorCode;
|
||||||
|
|
||||||
|
|
||||||
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
||||||
|
|
||||||
string upn = string.Format("{0}@{1}", name, domain);
|
string accountName = BuildAccountName(org.OrganizationId, displayName, org.ServiceId);
|
||||||
string sAMAccountName = AppendOrgId(serviceSettings) ? BuildAccountNameWithOrgId(org.OrganizationId, name, org.ServiceId) : BuildAccountName(org.OrganizationId, name, org.ServiceId);
|
|
||||||
|
|
||||||
TaskManager.Write("accountName :" + sAMAccountName);
|
TaskManager.Write("accountName :" + accountName);
|
||||||
TaskManager.Write("upn :" + upn);
|
|
||||||
|
|
||||||
if (orgProxy.CreateUser(org.OrganizationId, sAMAccountName, displayName, upn, password, enabled) == 0)
|
if (orgProxy.CreateSecurityGroup(org.OrganizationId, accountName, displayName, managedBy) == 0)
|
||||||
{
|
{
|
||||||
accountName = sAMAccountName;
|
OrganizationSecurityGroup retSecurityGroup = orgProxy.GetSecurityGroupGeneralSettings(accountName, org.OrganizationId);
|
||||||
OrganizationUser retUser = orgProxy.GetUserGeneralSettings(sAMAccountName, org.OrganizationId);
|
TaskManager.Write("sAMAccountName :" + retSecurityGroup.AccountName);
|
||||||
TaskManager.Write("sAMAccountName :" + retUser.DomainUserName);
|
|
||||||
|
|
||||||
userId = AddOrganizationUser(itemId, sAMAccountName, displayName, email, retUser.DomainUserName, password, subscriberNumber);
|
securityGroupId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName,
|
||||||
|
displayName, null, false,
|
||||||
// register email address
|
0, retSecurityGroup.AccountName, null, 0, null);
|
||||||
AddAccountEmailAddress(userId, email);
|
|
||||||
|
|
||||||
if (sendNotification)
|
|
||||||
{
|
|
||||||
SendSummaryLetter(org.Id, userId, true, to, "");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TaskManager.WriteError("Failed to create user");
|
TaskManager.WriteError("Failed to create securitygroup");
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -2357,7 +2334,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
TaskManager.CompleteTask();
|
TaskManager.CompleteTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
return userId;
|
return securityGroupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int DeleteSecurityGroup(int itemId, int accountId)
|
public static int DeleteSecurityGroup(int itemId, int accountId)
|
||||||
|
@ -2377,11 +2354,11 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// load account
|
// load account
|
||||||
ExchangeAccount account = GetAccount(itemId, accountId);
|
ExchangeAccount account = ExchangeServerController.GetAccount(itemId, accountId);
|
||||||
|
|
||||||
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
|
||||||
|
|
||||||
orgProxy.DeleteSecurityGroup(itemId, account.AccountName);
|
orgProxy.DeleteSecurityGroup(account.AccountName, org.OrganizationId);
|
||||||
|
|
||||||
DeleteUserFromMetabase(itemId, accountId);
|
DeleteUserFromMetabase(itemId, accountId);
|
||||||
|
|
||||||
|
@ -2397,7 +2374,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int SetUserGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes)
|
public static int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||||
{
|
{
|
||||||
// check account
|
// check account
|
||||||
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
|
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
|
||||||
|
@ -2477,8 +2454,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
demoSecurityGroups.Add(r2);
|
demoSecurityGroups.Add(r2);
|
||||||
|
|
||||||
|
|
||||||
res.PageUsers = demoSecurityGroups.ToArray();
|
res.PageItems = demoSecurityGroups.ToArray();
|
||||||
res.RecordsCount = res.PageUsers.Length;
|
res.RecordsCount = res.PageItems.Length;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -2496,7 +2473,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
List<ExchangeAccount> Tmpaccounts = new List<ExchangeAccount>();
|
List<ExchangeAccount> Tmpaccounts = new List<ExchangeAccount>();
|
||||||
ObjectUtils.FillCollectionFromDataView(Tmpaccounts, ds.Tables[1].DefaultView);
|
ObjectUtils.FillCollectionFromDataView(Tmpaccounts, ds.Tables[1].DefaultView);
|
||||||
result.PageUsers = Tmpaccounts.ToArray();
|
result.PageItems = Tmpaccounts.ToArray();
|
||||||
|
|
||||||
List<ExchangeAccount> accounts = new List<ExchangeAccount>();
|
List<ExchangeAccount> accounts = new List<ExchangeAccount>();
|
||||||
|
|
||||||
|
@ -2504,11 +2481,11 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
OrganizationSecurityGroup tmpSecurityGroup = GetSecurityGroupGeneralSettings(itemId, account.AccountId);
|
OrganizationSecurityGroup tmpSecurityGroup = GetSecurityGroupGeneralSettings(itemId, account.AccountId);
|
||||||
|
|
||||||
if (tmpUser != null)
|
if (tmpSecurityGroup != null)
|
||||||
accounts.Add(account);
|
accounts.Add(account);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.PageUsers = accounts.ToArray();
|
result.PageItems = accounts.ToArray();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,6 +244,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
#region Security Groups
|
#region Security Groups
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public int CreateSecurityGroup(int itemId, string displayName, string managedBy)
|
||||||
|
{
|
||||||
|
return OrganizationController.CreateSecurityGroup(itemId, displayName, managedBy);
|
||||||
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(int itemId, int accountId)
|
public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(int itemId, int accountId)
|
||||||
{
|
{
|
||||||
|
@ -257,11 +263,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public int SetUserGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes)
|
public int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||||
{
|
{
|
||||||
return OrganizationController.SetUserGeneralSettings(itemId, accountId, displayName, managedBy, memberAccounts, notes)
|
return OrganizationController.SetSecurityGroupGeneralSettings(itemId, accountId, displayName, managedBy, memberAccounts, notes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
public ExchangeAccountsPaged GetOrganizationSecurityGroupsPaged(int itemId, string filterColumn, string filterValue, string sortColumn,
|
public ExchangeAccountsPaged GetOrganizationSecurityGroupsPaged(int itemId, string filterColumn, string filterValue, string sortColumn,
|
||||||
int startRow, int maximumRows)
|
int startRow, int maximumRows)
|
||||||
{
|
{
|
||||||
|
|
|
@ -349,6 +349,11 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CreateGroup(string path, string group)
|
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);
|
DirectoryEntry currentADObject = new DirectoryEntry(path);
|
||||||
|
|
||||||
|
@ -357,6 +362,12 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
newGroupObject.Properties[ADAttributes.SAMAccountName].Add(group);
|
newGroupObject.Properties[ADAttributes.SAMAccountName].Add(group);
|
||||||
|
|
||||||
newGroupObject.Properties[ADAttributes.GroupType].Add(-2147483640);
|
newGroupObject.Properties[ADAttributes.GroupType].Add(-2147483640);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(manager))
|
||||||
|
{
|
||||||
|
newGroupObject.Properties[ADAttributes.Manager].Add(manager);
|
||||||
|
}
|
||||||
|
|
||||||
newGroupObject.CommitChanges();
|
newGroupObject.CommitChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
PublicFolder = 4,
|
PublicFolder = 4,
|
||||||
Room = 5,
|
Room = 5,
|
||||||
Equipment = 6,
|
Equipment = 6,
|
||||||
User = 7
|
User = 7,
|
||||||
|
SecurityGroup = 8
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
OrganizationUser GetUserGeneralSettings(string loginName, string organizationId);
|
OrganizationUser GetUserGeneralSettings(string loginName, string organizationId);
|
||||||
|
|
||||||
|
int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy);
|
||||||
|
|
||||||
OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId);
|
OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId);
|
||||||
|
|
||||||
void DeleteSecurityGroup(string groupName, string organizationId);
|
void DeleteSecurityGroup(string groupName, string organizationId);
|
||||||
|
|
|
@ -824,12 +824,12 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
#region Security Groups
|
#region Security Groups
|
||||||
|
|
||||||
public int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy, string notes)
|
public int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy)
|
||||||
{
|
{
|
||||||
return CreateSecurityGroupInternal(organizationId, groupName, displayName, managedBy, notes);
|
return CreateSecurityGroupInternal(organizationId, groupName, displayName, managedBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal int CreateSecurityGroupInternal(string organizationId, string groupName, string displayName, string managedBy, string notes)
|
internal int CreateSecurityGroupInternal(string organizationId, string groupName, string displayName, string managedBy)
|
||||||
{
|
{
|
||||||
HostedSolutionLog.LogStart("CreateSecurityGroupInternal");
|
HostedSolutionLog.LogStart("CreateSecurityGroupInternal");
|
||||||
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
|
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
|
||||||
|
@ -850,12 +850,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(groupPath))
|
if (!ActiveDirectoryUtils.AdObjectExists(groupPath))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.CreateGroup(path, groupName);
|
|
||||||
|
|
||||||
DirectoryEntry entry = new DirectoryEntry(groupPath);
|
|
||||||
|
|
||||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.DisplayName, displayName);
|
|
||||||
|
|
||||||
string manager = string.Empty;
|
string manager = string.Empty;
|
||||||
if (!string.IsNullOrEmpty(managedBy))
|
if (!string.IsNullOrEmpty(managedBy))
|
||||||
{
|
{
|
||||||
|
@ -863,11 +857,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
manager = ActiveDirectoryUtils.AdObjectExists(managerPath) ? managerPath : string.Empty;
|
manager = ActiveDirectoryUtils.AdObjectExists(managerPath) ? managerPath : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Manager, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
ActiveDirectoryUtils.CreateGroup(path, groupName, ActiveDirectoryUtils.RemoveADPrefix(manager));
|
||||||
|
|
||||||
ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes);
|
|
||||||
entry.CommitChanges();
|
|
||||||
|
|
||||||
groupCreated = true;
|
groupCreated = true;
|
||||||
|
|
||||||
HostedSolutionLog.DebugInfo("Security Group created: {0}", groupName);
|
HostedSolutionLog.DebugInfo("Security Group created: {0}", groupName);
|
||||||
|
|
|
@ -77,8 +77,14 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted;
|
private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback CreateSecurityGroupOperationCompleted;
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback GetSecurityGroupGeneralSettingsOperationCompleted;
|
private System.Threading.SendOrPostCallback GetSecurityGroupGeneralSettingsOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback DeleteSecurityGroupOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback SetSecurityGroupGeneralSettingsOperationCompleted;
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted;
|
private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted;
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback SetUserPasswordOperationCompleted;
|
private System.Threading.SendOrPostCallback SetUserPasswordOperationCompleted;
|
||||||
|
@ -119,9 +125,18 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted;
|
public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event CreateSecurityGroupCompletedEventHandler CreateSecurityGroupCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event GetSecurityGroupGeneralSettingsCompletedEventHandler GetSecurityGroupGeneralSettingsCompleted;
|
public event GetSecurityGroupGeneralSettingsCompletedEventHandler GetSecurityGroupGeneralSettingsCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event DeleteSecurityGroupCompletedEventHandler DeleteSecurityGroupCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event SetSecurityGroupGeneralSettingsCompletedEventHandler SetSecurityGroupGeneralSettingsCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted;
|
public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted;
|
||||||
|
|
||||||
|
@ -463,6 +478,65 @@ 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)
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
return this.BeginInvoke("CreateSecurityGroup", new object[] {
|
||||||
|
organizationId,
|
||||||
|
groupName,
|
||||||
|
displayName,
|
||||||
|
managedBy}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public int EndCreateSecurityGroup(System.IAsyncResult asyncResult)
|
||||||
|
{
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((int)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void CreateSecurityGroupAsync(string organizationId, string groupName, string displayName, string managedBy)
|
||||||
|
{
|
||||||
|
this.CreateSecurityGroupAsync(organizationId, groupName, displayName, managedBy, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void CreateSecurityGroupAsync(string organizationId, string groupName, string displayName, string managedBy, object userState)
|
||||||
|
{
|
||||||
|
if ((this.CreateSecurityGroupOperationCompleted == null))
|
||||||
|
{
|
||||||
|
this.CreateSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateSecurityGroupOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("CreateSecurityGroup", new object[] {
|
||||||
|
organizationId,
|
||||||
|
groupName,
|
||||||
|
displayName,
|
||||||
|
managedBy}, this.CreateSecurityGroupOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnCreateSecurityGroupOperationCompleted(object arg)
|
||||||
|
{
|
||||||
|
if ((this.CreateSecurityGroupCompleted != null))
|
||||||
|
{
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.CreateSecurityGroupCompleted(this, new CreateSecurityGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSecurityGroupGeneralSettings", 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/GetSecurityGroupGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
@ -516,6 +590,120 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
public void DeleteSecurityGroup(string groupName, string organizationId)
|
||||||
|
{
|
||||||
|
this.Invoke("DeleteSecurityGroup", new object[] {
|
||||||
|
groupName,
|
||||||
|
organizationId});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginDeleteSecurityGroup(string groupName, string organizationId, System.AsyncCallback callback, object asyncState)
|
||||||
|
{
|
||||||
|
return this.BeginInvoke("DeleteSecurityGroup", new object[] {
|
||||||
|
groupName,
|
||||||
|
organizationId}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void EndDeleteSecurityGroup(System.IAsyncResult asyncResult)
|
||||||
|
{
|
||||||
|
this.EndInvoke(asyncResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void DeleteSecurityGroupAsync(string groupName, string organizationId)
|
||||||
|
{
|
||||||
|
this.DeleteSecurityGroupAsync(groupName, organizationId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void DeleteSecurityGroupAsync(string groupName, string organizationId, object userState)
|
||||||
|
{
|
||||||
|
if ((this.DeleteSecurityGroupOperationCompleted == null))
|
||||||
|
{
|
||||||
|
this.DeleteSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSecurityGroupOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("DeleteSecurityGroup", new object[] {
|
||||||
|
groupName,
|
||||||
|
organizationId}, this.DeleteSecurityGroupOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDeleteSecurityGroupOperationCompleted(object arg)
|
||||||
|
{
|
||||||
|
if ((this.DeleteSecurityGroupCompleted != null))
|
||||||
|
{
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.DeleteSecurityGroupCompleted(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/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)
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] {
|
||||||
|
organizationId,
|
||||||
|
groupName,
|
||||||
|
displayName,
|
||||||
|
managedBy,
|
||||||
|
memberAccounts,
|
||||||
|
notes}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void EndSetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult)
|
||||||
|
{
|
||||||
|
this.EndInvoke(asyncResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes)
|
||||||
|
{
|
||||||
|
this.SetSecurityGroupGeneralSettingsAsync(organizationId, groupName, displayName, managedBy, memberAccounts, notes, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string displayName, string managedBy, string[] memberAccounts, string notes, object userState)
|
||||||
|
{
|
||||||
|
if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null))
|
||||||
|
{
|
||||||
|
this.SetSecurityGroupGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetSecurityGroupGeneralSettingsOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("SetSecurityGroupGeneralSettings", new object[] {
|
||||||
|
organizationId,
|
||||||
|
groupName,
|
||||||
|
displayName,
|
||||||
|
managedBy,
|
||||||
|
memberAccounts,
|
||||||
|
notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSetSecurityGroupGeneralSettingsOperationCompleted(object arg)
|
||||||
|
{
|
||||||
|
if ((this.SetSecurityGroupGeneralSettingsCompleted != null))
|
||||||
|
{
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.SetSecurityGroupGeneralSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
[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)]
|
[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)]
|
||||||
|
@ -1255,6 +1443,36 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void CreateSecurityGroupCompletedEventHandler(object sender, CreateSecurityGroupCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class CreateSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
|
||||||
|
{
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal CreateSecurityGroupCompletedEventArgs(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]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
public delegate void GetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, GetSecurityGroupGeneralSettingsCompletedEventArgs e);
|
public delegate void GetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, GetSecurityGroupGeneralSettingsCompletedEventArgs e);
|
||||||
|
@ -1285,6 +1503,14 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void DeleteSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void SetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
|
|
|
@ -110,6 +110,12 @@ namespace WebsitePanel.Server
|
||||||
return Organization.GetUserGeneralSettings(loginName, organizationId);
|
return Organization.GetUserGeneralSettings(loginName, organizationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public int CreateSecurityGroup(string organizationId, string groupName, string displayName, string managedBy)
|
||||||
|
{
|
||||||
|
return Organization.CreateSecurityGroup(organizationId, groupName, displayName, managedBy);
|
||||||
|
}
|
||||||
|
|
||||||
[WebMethod, SoapHeader("settings")]
|
[WebMethod, SoapHeader("settings")]
|
||||||
public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId)
|
public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,5 +83,30 @@ namespace WebsitePanel.Portal
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Security Groups
|
||||||
|
|
||||||
|
ExchangeAccountsPaged accounts;
|
||||||
|
|
||||||
|
public int GetOrganizationSecurityGroupsPagedCount(int itemId, string accountTypes,
|
||||||
|
string filterColumn, string filterValue)
|
||||||
|
{
|
||||||
|
return accounts.RecordsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExchangeAccount[] GetOrganizationSecurityGroupsPaged(int itemId, string accountTypes,
|
||||||
|
string filterColumn, string filterValue,
|
||||||
|
int maximumRows, int startRowIndex, string sortColumn)
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(filterValue))
|
||||||
|
filterValue = filterValue + "%";
|
||||||
|
|
||||||
|
accounts = ES.Services.Organizations.GetOrganizationSecurityGroupsPaged(itemId,
|
||||||
|
filterColumn, filterValue, sortColumn, startRowIndex, maximumRows);
|
||||||
|
|
||||||
|
return accounts.PageItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,10 +118,10 @@
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="btnCreate.OnClientClick" xml:space="preserve">
|
<data name="btnCreate.OnClientClick" xml:space="preserve">
|
||||||
<value>ShowProgressDialog('Creating security group ...');</value>
|
<value>ShowProgressDialog('Creating group ...');</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="btnCreate.Text" xml:space="preserve">
|
<data name="btnCreate.Text" xml:space="preserve">
|
||||||
<value>Create Security Group</value>
|
<value>Create Group</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FormComments.Text" xml:space="preserve">
|
<data name="FormComments.Text" xml:space="preserve">
|
||||||
<value />
|
<value />
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
<value>Managed by: *</value>
|
<value>Managed by: *</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="locTitle.Text" xml:space="preserve">
|
<data name="locTitle.Text" xml:space="preserve">
|
||||||
<value>Create New Security Group</value>
|
<value>Create New Group</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.PageName" xml:space="preserve">
|
<data name="Text.PageName" xml:space="preserve">
|
||||||
<value>Security Groups</value>
|
<value>Security Groups</value>
|
||||||
|
|
|
@ -118,7 +118,7 @@
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="btnSave.OnClientClick" xml:space="preserve">
|
<data name="btnSave.OnClientClick" xml:space="preserve">
|
||||||
<value>ShowProgressDialog('Updating security group settings...');</value>
|
<value>ShowProgressDialog('Updating group settings...');</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="btnSave.Text" xml:space="preserve">
|
<data name="btnSave.Text" xml:space="preserve">
|
||||||
<value>Save Changes</value>
|
<value>Save Changes</value>
|
||||||
|
@ -139,10 +139,10 @@
|
||||||
<value>Notes:</value>
|
<value>Notes:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="locTitle.Text" xml:space="preserve">
|
<data name="locTitle.Text" xml:space="preserve">
|
||||||
<value>Edit Security Group</value>
|
<value>Edit Group</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.PageName" xml:space="preserve">
|
<data name="Text.PageName" xml:space="preserve">
|
||||||
<value>Security Group</value>
|
<value>Security Groups</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="valManager.ErrorMessage" xml:space="preserve">
|
<data name="valManager.ErrorMessage" xml:space="preserve">
|
||||||
<value>Please specify a manager</value>
|
<value>Please specify a manager</value>
|
||||||
|
|
|
@ -117,17 +117,17 @@
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="btnCreateList.Text" xml:space="preserve">
|
<data name="btnCreateGroup.Text" xml:space="preserve">
|
||||||
<value>Create New Security Group</value>
|
<value>Create New Group</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmdDelete.OnClientClick" xml:space="preserve">
|
<data name="cmdDelete.OnClientClick" xml:space="preserve">
|
||||||
<value>if(!confirm('Are you sure you want to delete this security group?')) return false; else ShowProgressDialog('Deleting security group...');</value>
|
<value>if(!confirm('Are you sure you want to delete this group?')) return false; else ShowProgressDialog('Deleting group...');</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmdDelete.Text" xml:space="preserve">
|
<data name="cmdDelete.Text" xml:space="preserve">
|
||||||
<value>Delete</value>
|
<value>Delete</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmdDelete.ToolTip" xml:space="preserve">
|
<data name="cmdDelete.ToolTip" xml:space="preserve">
|
||||||
<value>Delete Security Group</value>
|
<value>Delete Group</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmdSearch.AlternateText" xml:space="preserve">
|
<data name="cmdSearch.AlternateText" xml:space="preserve">
|
||||||
<value>Search</value>
|
<value>Search</value>
|
||||||
|
@ -141,20 +141,14 @@
|
||||||
<data name="FormComments.Text" xml:space="preserve">
|
<data name="FormComments.Text" xml:space="preserve">
|
||||||
<value />
|
<value />
|
||||||
</data>
|
</data>
|
||||||
<data name="gvLists.Empty" xml:space="preserve">
|
<data name="gvGroups.Empty" xml:space="preserve">
|
||||||
<value>No security groups have been created. To create a new security group click "Create New Security Group" button.</value>
|
<value>No groups have been created. To create a new group click "Create New Group" button.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gvListsDisplayName.Header" xml:space="preserve">
|
<data name="gvGroupsDisplayName.Header" xml:space="preserve">
|
||||||
<value>Display Name</value>
|
<value>Display Name</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gvListsEmail.Header" xml:space="preserve">
|
|
||||||
<value>E-mail Address</value>
|
|
||||||
</data>
|
|
||||||
<data name="locQuota.Text" xml:space="preserve">
|
|
||||||
<value>Total Security Groups Created:</value>
|
|
||||||
</data>
|
|
||||||
<data name="locTitle.Text" xml:space="preserve">
|
<data name="locTitle.Text" xml:space="preserve">
|
||||||
<value>Security Groups</value>
|
<value>Groups</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.PageName" xml:space="preserve">
|
<data name="Text.PageName" xml:space="preserve">
|
||||||
<value>Security Groups</value>
|
<value>Security Groups</value>
|
||||||
|
|
|
@ -21,33 +21,32 @@
|
||||||
<div class="Center">
|
<div class="Center">
|
||||||
<div class="Title">
|
<div class="Title">
|
||||||
<asp:Image ID="Image1" SkinID="ExchangeListAdd48" runat="server" />
|
<asp:Image ID="Image1" SkinID="ExchangeListAdd48" runat="server" />
|
||||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Create Distribution List"></asp:Localize>
|
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Create Group"></asp:Localize>
|
||||||
</div>
|
</div>
|
||||||
<div class="FormBody">
|
<div class="FormBody">
|
||||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="FormLabel150"><asp:Localize ID="locDisplayName" runat="server" meta:resourcekey="locDisplayName" Text="Display Name: *"></asp:Localize></td>
|
<td class="FormLabel150"><asp:Localize ID="locDisplayName" runat="server" meta:resourcekey="locDisplayName" Text="Display Name: *"></asp:Localize></td>
|
||||||
<td>
|
<td>
|
||||||
<asp:TextBox ID="txtDisplayName" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
|
<asp:TextBox ID="txtDisplayName" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="valRequireDisplayName" runat="server" meta:resourcekey="valRequireDisplayName" ControlToValidate="txtDisplayName"
|
<asp:RequiredFieldValidator ID="valRequireDisplayName" runat="server" meta:resourcekey="valRequireDisplayName" ControlToValidate="txtDisplayName"
|
||||||
ErrorMessage="Enter Display Name" ValidationGroup="CreateList" 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>
|
<tr>
|
||||||
<td class="FormLabel150"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="locManagedBy" ></asp:Localize></td>
|
<td class="FormLabel150"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="locManagedBy" ></asp:Localize></td>
|
||||||
<td>
|
<td>
|
||||||
<wsp:userselector id="manager" runat="server" />
|
<wsp:userselector id="manager" IncludeMailboxes="true" runat="server" />
|
||||||
<asp:CustomValidator runat="server"
|
<asp:CustomValidator runat="server"
|
||||||
ValidationGroup="CreateList" meta:resourcekey="valManager" ID="valManager"
|
ValidationGroup="CreateGroup" meta:resourcekey="valManager" ID="valManager"
|
||||||
onservervalidate="valManager_ServerValidate" />
|
onservervalidate="valManager_ServerValidate" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="FormFooterClean">
|
<div class="FormFooterClean">
|
||||||
<asp:Button id="btnCreate" runat="server" Text="Create Distribution List" CssClass="Button1" meta:resourcekey="btnCreate" ValidationGroup="CreateList" 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>
|
||||||
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="CreateList" />
|
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="CreateGroup" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -44,7 +44,6 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
{
|
{
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void btnCreate_Click(object sender, EventArgs e)
|
protected void btnCreate_Click(object sender, EventArgs e)
|
||||||
|
@ -54,43 +53,31 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
|
|
||||||
private void CreateSecurityGroup()
|
private void CreateSecurityGroup()
|
||||||
{
|
{
|
||||||
/*if (!Page.IsValid)
|
if (!Page.IsValid)
|
||||||
return;*/
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
int accountId = ES.Services.Organizations.CreateSecurityGroup(PanelRequest.ItemID, txtDisplayName.Text, manager.GetAccount());
|
||||||
|
|
||||||
//int accountId = ES.Services.ExchangeServer.CreateDistributionList(PanelRequest.ItemID,
|
if (accountId < 0)
|
||||||
// txtDisplayName.Text.Trim(),
|
{
|
||||||
// email.AccountName,
|
messageBox.ShowResultMessage(accountId);
|
||||||
// email.DomainName,
|
return;
|
||||||
// manager.GetAccountId());
|
}
|
||||||
|
|
||||||
|
Response.Redirect(EditUrl("AccountID", accountId.ToString(), "secur_group_settings",
|
||||||
//if (accountId < 0)
|
"SpaceID=" + PanelSecurity.PackageId.ToString(),
|
||||||
//{
|
"ItemID=" + PanelRequest.ItemID.ToString()));
|
||||||
// messageBox.ShowResultMessage(accountId);
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//Response.Redirect(EditUrl("AccountID", accountId.ToString(), "dlist_settings",
|
|
||||||
// "SpaceID=" + PanelSecurity.PackageId.ToString(),
|
|
||||||
// "ItemID=" + PanelRequest.ItemID.ToString()));
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
messageBox.ShowErrorMessage("EXCHANGE_CREATE_DISTRIBUTION_LIST", ex);
|
messageBox.ShowErrorMessage("ORGANIZATION_CREATE_SECURITY_GROUP", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void valManager_ServerValidate(object source, ServerValidateEventArgs args)
|
protected void valManager_ServerValidate(object source, ServerValidateEventArgs args)
|
||||||
{
|
{
|
||||||
args.IsValid = manager.GetAccountId() != 0;
|
args.IsValid = manager.GetAccountId() != 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -26,8 +26,8 @@
|
||||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||||
<div class="FormButtonsBarClean">
|
<div class="FormButtonsBarClean">
|
||||||
<div class="FormButtonsBarCleanLeft">
|
<div class="FormButtonsBarCleanLeft">
|
||||||
<asp:Button ID="btnCreateList" runat="server" meta:resourcekey="btnCreateList"
|
<asp:Button ID="btnCreateGroup" runat="server" meta:resourcekey="btnCreateGroup"
|
||||||
Text="Create New Distribution List" CssClass="Button1" OnClick="btnCreateList_Click" />
|
Text="Create New Group" CssClass="Button1" OnClick="btnCreateGroup_Click" />
|
||||||
</div>
|
</div>
|
||||||
<div class="FormButtonsBarCleanRight">
|
<div class="FormButtonsBarCleanRight">
|
||||||
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
|
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
|
||||||
|
@ -49,12 +49,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<asp:GridView ID="gvLists" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
<asp:GridView ID="gvGroups" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
||||||
Width="100%" EmptyDataText="gvLists" CssSelectorClass="NormalGridView"
|
Width="100%" EmptyDataText="gvGroups" CssSelectorClass="NormalGridView"
|
||||||
OnRowCommand="gvLists_RowCommand" AllowPaging="True" AllowSorting="True"
|
OnRowCommand="gvLists_RowCommand" AllowPaging="True" AllowSorting="True"
|
||||||
DataSourceID="odsAccountsPaged" PageSize="20">
|
DataSourceID="odsSecurityGroupsPaged" PageSize="20">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="gvListsDisplayName" SortExpression="DisplayName">
|
<asp:TemplateField HeaderText="gvGroupsDisplayName" SortExpression="DisplayName">
|
||||||
<ItemStyle Width="50%"></ItemStyle>
|
<ItemStyle Width="50%"></ItemStyle>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:hyperlink id="lnk1" runat="server"
|
<asp:hyperlink id="lnk1" runat="server"
|
||||||
|
@ -63,7 +63,6 @@
|
||||||
</asp:hyperlink>
|
</asp:hyperlink>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField HeaderText="gvListsEmail" DataField="PrimaryEmailAddress" SortExpression="PrimaryEmailAddress" ItemStyle-Width="50%" />
|
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:ImageButton ID="cmdDelete" runat="server" Text="Delete" SkinID="ExchangeDelete"
|
<asp:ImageButton ID="cmdDelete" runat="server" Text="Delete" SkinID="ExchangeDelete"
|
||||||
|
@ -73,12 +72,12 @@
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
<asp:ObjectDataSource ID="odsAccountsPaged" runat="server" EnablePaging="True"
|
<asp:ObjectDataSource ID="odsSecurityGroupsPaged" runat="server" EnablePaging="True"
|
||||||
SelectCountMethod="GetExchangeAccountsPagedCount"
|
SelectCountMethod="GetOrganizationSecurityGroupsPagedCount"
|
||||||
SelectMethod="GetExchangeAccountsPaged"
|
SelectMethod="GetOrganizationSecurityGroupsPaged"
|
||||||
SortParameterName="sortColumn"
|
SortParameterName="sortColumn"
|
||||||
TypeName="WebsitePanel.Portal.ExchangeHelper"
|
TypeName="WebsitePanel.Portal.OrganizationsHelper"
|
||||||
OnSelected="odsAccountsPaged_Selected">
|
OnSelected="odsSecurityGroupsPaged_Selected">
|
||||||
<SelectParameters>
|
<SelectParameters>
|
||||||
<asp:QueryStringParameter Name="itemId" QueryStringField="ItemID" DefaultValue="0" />
|
<asp:QueryStringParameter Name="itemId" QueryStringField="ItemID" DefaultValue="0" />
|
||||||
<asp:Parameter Name="accountTypes" DefaultValue="3" />
|
<asp:Parameter Name="accountTypes" DefaultValue="3" />
|
||||||
|
@ -86,12 +85,6 @@
|
||||||
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
||||||
</SelectParameters>
|
</SelectParameters>
|
||||||
</asp:ObjectDataSource>
|
</asp:ObjectDataSource>
|
||||||
<br />
|
|
||||||
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Distribution Lists Created:"></asp:Localize>
|
|
||||||
|
|
||||||
<wsp:QuotaViewer ID="listsQuota" runat="server" QuotaTypeId="2" />
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -50,21 +50,13 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
{
|
{
|
||||||
BindStats();
|
BindStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BindStats()
|
private void BindStats()
|
||||||
{
|
{
|
||||||
// quota values
|
|
||||||
OrganizationStatistics stats = ES.Services.ExchangeServer.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
|
||||||
OrganizationStatistics tenantStats = ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID);
|
|
||||||
listsQuota.QuotaUsedValue = stats.CreatedDistributionLists;
|
|
||||||
listsQuota.QuotaValue = stats.AllocatedDistributionLists;
|
|
||||||
if (stats.AllocatedDistributionLists != -1) listsQuota.QuotaAvailable = tenantStats.AllocatedDistributionLists - tenantStats.CreatedDistributionLists;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void btnCreateList_Click(object sender, EventArgs e)
|
protected void btnCreateGroup_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "create_secur_group",
|
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "create_secur_group",
|
||||||
"SpaceID=" + PanelSecurity.PackageId.ToString()));
|
"SpaceID=" + PanelSecurity.PackageId.ToString()));
|
||||||
|
@ -77,11 +69,11 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
"ItemID=" + PanelRequest.ItemID.ToString());
|
"ItemID=" + PanelRequest.ItemID.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void odsAccountsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
|
protected void odsSecurityGroupsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Exception != null)
|
if (e.Exception != null)
|
||||||
{
|
{
|
||||||
messageBox.ShowErrorMessage("EXCHANGE_GET_LISTS", e.Exception);
|
messageBox.ShowErrorMessage("ORGANIZATION_GET_SECURITY_GROUP", e.Exception);
|
||||||
e.ExceptionHandled = true;
|
e.ExceptionHandled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,12 +82,12 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
{
|
{
|
||||||
if (e.CommandName == "DeleteItem")
|
if (e.CommandName == "DeleteItem")
|
||||||
{
|
{
|
||||||
// delete distribution list
|
// delete security group
|
||||||
int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0);
|
int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int result = ES.Services.ExchangeServer.DeleteDistributionList(PanelRequest.ItemID, accountId);
|
int result = ES.Services.Organizations.DeleteSecurityGroup(PanelRequest.ItemID, accountId);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
{
|
{
|
||||||
messageBox.ShowResultMessage(result);
|
messageBox.ShowResultMessage(result);
|
||||||
|
@ -103,28 +95,27 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
}
|
}
|
||||||
|
|
||||||
// rebind grid
|
// rebind grid
|
||||||
gvLists.DataBind();
|
gvGroups.DataBind();
|
||||||
|
|
||||||
BindStats();
|
BindStats();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
messageBox.ShowErrorMessage("EXCHANGE_DELETE_DISTRIBUTION_LIST", ex);
|
messageBox.ShowErrorMessage("ORGANIZATION_DELETE_SECURITY_GROUP", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
gvLists.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue);
|
gvGroups.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue);
|
||||||
|
|
||||||
// rebind grid
|
// rebind grid
|
||||||
gvLists.DataBind();
|
gvGroups.DataBind();
|
||||||
|
|
||||||
// bind stats
|
// bind stats
|
||||||
BindStats();
|
BindStats();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -67,13 +67,13 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
||||||
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnCreateList control.
|
/// btnCreateGroup control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.Button btnCreateList;
|
protected global::System.Web.UI.WebControls.Button btnCreateGroup;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SearchPanel control.
|
/// SearchPanel control.
|
||||||
|
@ -130,39 +130,21 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
||||||
protected global::System.Web.UI.WebControls.ImageButton cmdSearch;
|
protected global::System.Web.UI.WebControls.ImageButton cmdSearch;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// gvLists control.
|
/// gvGroups control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.GridView gvLists;
|
protected global::System.Web.UI.WebControls.GridView gvGroups;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// odsAccountsPaged control.
|
/// odsSecurityGroupsPaged control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsAccountsPaged;
|
protected global::System.Web.UI.WebControls.ObjectDataSource odsSecurityGroupsPaged;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// locQuota 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 locQuota;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// listsQuota control.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Auto-generated field.
|
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
|
||||||
/// </remarks>
|
|
||||||
protected global::WebsitePanel.Portal.QuotaViewer listsQuota;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue