add functionallity allow default default security groups

This commit is contained in:
vfedosevich 2013-09-23 16:59:41 +03:00
parent eaa655cf4e
commit 5d273cee9e
18 changed files with 546 additions and 115 deletions

View file

@ -304,6 +304,21 @@ namespace WebsitePanel.EnterpriseServer
if (OrganizationIdentifierExists(organizationId)) if (OrganizationIdentifierExists(organizationId))
return BusinessErrorCodes.ERROR_ORG_ID_EXISTS; return BusinessErrorCodes.ERROR_ORG_ID_EXISTS;
// load user info
UserInfo user = PackageController.GetPackageOwner(packageId);
// get letter settings
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.EXCHANGE_POLICY);
bool enableDefaultGroup = true;
try
{
// parse settings
string[] parts = settings["OrgPolicy"].Split(';');
enableDefaultGroup = Convert.ToBoolean(parts[0]) && Convert.ToBoolean(parts[1]);
}
catch { /* skip */ }
// Create Organization Unit // Create Organization Unit
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedOrganizations); int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedOrganizations);
@ -311,7 +326,7 @@ namespace WebsitePanel.EnterpriseServer
Organization org = null; Organization org = null;
if (!orgProxy.OrganizationExists(organizationId)) if (!orgProxy.OrganizationExists(organizationId))
{ {
org = orgProxy.CreateOrganization(organizationId); org = orgProxy.CreateOrganization(organizationId, enableDefaultGroup);
} }
else else
return BusinessErrorCodes.ERROR_ORG_ID_EXISTS; return BusinessErrorCodes.ERROR_ORG_ID_EXISTS;
@ -366,16 +381,18 @@ namespace WebsitePanel.EnterpriseServer
itemId = AddOrganizationToPackageItems(org, serviceId, packageId, organizationName, organizationId, domainName); itemId = AddOrganizationToPackageItems(org, serviceId, packageId, organizationName, organizationId, domainName);
// register org ID // register org ID
DataProvider.AddExchangeOrganization(itemId, organizationId); DataProvider.AddExchangeOrganization(itemId, organizationId);
// register domain // register domain
DataProvider.AddExchangeOrganizationDomain(itemId, domainId, true); DataProvider.AddExchangeOrganizationDomain(itemId, domainId, true);
if (enableDefaultGroup)
{
//add to exchangeAcounts //add to exchangeAcounts
AddAccount(itemId, ExchangeAccountType.DefaultSecurityGroup, org.GroupName, AddAccount(itemId, ExchangeAccountType.DefaultSecurityGroup, org.GroupName,
org.GroupName, null, false, org.GroupName, null, false,
0, org.GroupName, null, 0, null); 0, org.GroupName, null, 0, null);
}
// register organization domain service item // register organization domain service item
OrganizationDomain orgDomain = new OrganizationDomain OrganizationDomain orgDomain = new OrganizationDomain
@ -386,9 +403,6 @@ namespace WebsitePanel.EnterpriseServer
}; };
PackageController.AddPackageItem(orgDomain); PackageController.AddPackageItem(orgDomain);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1337,7 +1351,6 @@ 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 upn = string.Format("{0}@{1}", name, domain);
@ -1346,7 +1359,9 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.Write("accountName :" + sAMAccountName); TaskManager.Write("accountName :" + sAMAccountName);
TaskManager.Write("upn :" + upn); TaskManager.Write("upn :" + upn);
if (orgProxy.CreateUser(org.OrganizationId, sAMAccountName, displayName, upn, password, enabled) == 0) bool enableDefaultGroup = !string.IsNullOrEmpty(org.SecurityGroup);
if (orgProxy.CreateUser(org.OrganizationId, sAMAccountName, displayName, upn, password, enabled, enableDefaultGroup) == 0)
{ {
accountName = sAMAccountName; accountName = sAMAccountName;
OrganizationUser retUser = orgProxy.GetUserGeneralSettings(sAMAccountName, org.OrganizationId); OrganizationUser retUser = orgProxy.GetUserGeneralSettings(sAMAccountName, org.OrganizationId);

View file

@ -32,11 +32,11 @@ namespace WebsitePanel.Providers.HostedSolution
{ {
public interface IOrganization public interface IOrganization
{ {
Organization CreateOrganization(string organizationId); Organization CreateOrganization(string organizationId, bool enableDefaultGroup);
void DeleteOrganization(string organizationId); void DeleteOrganization(string organizationId);
int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled); int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup);
void DeleteUser(string loginName, string organizationId); void DeleteUser(string loginName, string organizationId);

View file

@ -771,28 +771,42 @@ namespace WebsitePanel.Providers.HostedSolution
string server = GetServerName(); string server = GetServerName();
string securityGroupPath = AddADPrefix(securityGroup); string securityGroupPath = AddADPrefix(securityGroup);
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{
//Create mail enabled organization security group //Create mail enabled organization security group
EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId); EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId);
transaction.RegisterMailEnabledDistributionGroup(securityGroup); transaction.RegisterMailEnabledDistributionGroup(securityGroup);
UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer); UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer);
}
//create GAL //create GAL
string galId = CreateGlobalAddressList(runSpace, organizationId); string galId = CreateGlobalAddressList(runSpace, organizationId);
transaction.RegisterNewGlobalAddressList(galId); transaction.RegisterNewGlobalAddressList(galId);
ExchangeLog.LogInfo(" Global Address List: {0}", galId); ExchangeLog.LogInfo(" Global Address List: {0}", galId);
if (enableDefaultGroup)
{
UpdateGlobalAddressList(runSpace, galId, securityGroupPath); UpdateGlobalAddressList(runSpace, galId, securityGroupPath);
}
//create AL //create AL
string alId = CreateAddressList(runSpace, organizationId); string alId = CreateAddressList(runSpace, organizationId);
transaction.RegisterNewAddressList(alId); transaction.RegisterNewAddressList(alId);
ExchangeLog.LogInfo(" Address List: {0}", alId); ExchangeLog.LogInfo(" Address List: {0}", alId);
if (enableDefaultGroup)
{
UpdateAddressList(runSpace, alId, securityGroupPath); UpdateAddressList(runSpace, alId, securityGroupPath);
}
//create RAL //create RAL
string ralId = CreateRoomsAddressList(runSpace, organizationId); string ralId = CreateRoomsAddressList(runSpace, organizationId);
transaction.RegisterNewRoomsAddressList(ralId); transaction.RegisterNewRoomsAddressList(ralId);
ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId); ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId);
if (enableDefaultGroup)
{
UpdateAddressList(runSpace, ralId, securityGroupPath); UpdateAddressList(runSpace, ralId, securityGroupPath);
}
//create ActiveSync policy //create ActiveSync policy
string asId = CreateActiveSyncPolicy(runSpace, organizationId); string asId = CreateActiveSyncPolicy(runSpace, organizationId);
@ -880,12 +894,18 @@ namespace WebsitePanel.Providers.HostedSolution
string server = GetOABGenerationServerName(); string server = GetOABGenerationServerName();
string securityGroupId = AddADPrefix(securityGroup);
//create OAB //create OAB
string oabId = CreateOfflineAddressBook(runSpace, organizationId, server, oabVirtualDir); string oabId = CreateOfflineAddressBook(runSpace, organizationId, server, oabVirtualDir);
transaction.RegisterNewOfflineAddressBook(oabId); transaction.RegisterNewOfflineAddressBook(oabId);
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{
string securityGroupId = AddADPrefix(securityGroup);
UpdateOfflineAddressBook(runSpace, oabId, securityGroupId); UpdateOfflineAddressBook(runSpace, oabId, securityGroupId);
}
info.OfflineAddressBook = oabId; info.OfflineAddressBook = oabId;
} }
catch (Exception ex) catch (Exception ex)
@ -1077,9 +1097,14 @@ namespace WebsitePanel.Providers.HostedSolution
//disable mail security distribution group //disable mail security distribution group
try try
{
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{ {
DisableMailSecurityDistributionGroup(runSpace, securityGroup); DisableMailSecurityDistributionGroup(runSpace, securityGroup);
} }
}
catch (Exception ex) catch (Exception ex)
{ {
ret = false; ret = false;
@ -4318,7 +4343,12 @@ namespace WebsitePanel.Providers.HostedSolution
string id = AddPublicFolder(runSpace, folderName, parentFolder, orgCanonicalName+"/"+GetPublicFolderMailboxName(organizationId)); string id = AddPublicFolder(runSpace, folderName, parentFolder, orgCanonicalName+"/"+GetPublicFolderMailboxName(organizationId));
transaction.RegisterNewPublicFolder(GetPublicFolderMailboxName(organizationId), id); transaction.RegisterNewPublicFolder(GetPublicFolderMailboxName(organizationId), id);
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{
SetPublicFolderPermissions(runSpace, id, securityGroup); SetPublicFolderPermissions(runSpace, id, securityGroup);
}
if (mailEnabled) if (mailEnabled)
{ {

View file

@ -718,28 +718,42 @@ namespace WebsitePanel.Providers.HostedSolution
string server = GetServerName(); string server = GetServerName();
string securityGroupPath = AddADPrefix(securityGroup); string securityGroupPath = AddADPrefix(securityGroup);
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{
//Create mail enabled organization security group //Create mail enabled organization security group
EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId); EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId);
transaction.RegisterMailEnabledDistributionGroup(securityGroup); transaction.RegisterMailEnabledDistributionGroup(securityGroup);
UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer); UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer);
}
//create GAL //create GAL
string galId = CreateGlobalAddressList(runSpace, organizationId); string galId = CreateGlobalAddressList(runSpace, organizationId);
transaction.RegisterNewGlobalAddressList(galId); transaction.RegisterNewGlobalAddressList(galId);
ExchangeLog.LogInfo(" Global Address List: {0}", galId); ExchangeLog.LogInfo(" Global Address List: {0}", galId);
if (enableDefaultGroup)
{
UpdateGlobalAddressList(runSpace, galId, securityGroupPath); UpdateGlobalAddressList(runSpace, galId, securityGroupPath);
}
//create AL //create AL
string alId = CreateAddressList(runSpace, organizationId); string alId = CreateAddressList(runSpace, organizationId);
transaction.RegisterNewAddressList(alId); transaction.RegisterNewAddressList(alId);
ExchangeLog.LogInfo(" Address List: {0}", alId); ExchangeLog.LogInfo(" Address List: {0}", alId);
if (enableDefaultGroup)
{
UpdateAddressList(runSpace, alId, securityGroupPath); UpdateAddressList(runSpace, alId, securityGroupPath);
}
//create RAL //create RAL
string ralId = CreateRoomsAddressList(runSpace, organizationId); string ralId = CreateRoomsAddressList(runSpace, organizationId);
transaction.RegisterNewRoomsAddressList(ralId); transaction.RegisterNewRoomsAddressList(ralId);
ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId); ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId);
if (enableDefaultGroup)
{
UpdateAddressList(runSpace, ralId, securityGroupPath); UpdateAddressList(runSpace, ralId, securityGroupPath);
}
//create ActiveSync policy //create ActiveSync policy
string asId = CreateActiveSyncPolicy(runSpace, organizationId); string asId = CreateActiveSyncPolicy(runSpace, organizationId);
@ -837,12 +851,18 @@ namespace WebsitePanel.Providers.HostedSolution
string server = GetOABGenerationServerName(); string server = GetOABGenerationServerName();
string securityGroupId = AddADPrefix(securityGroup);
//create OAB //create OAB
string oabId = CreateOfflineAddressBook(runSpace, organizationId, server, oabVirtualDir); string oabId = CreateOfflineAddressBook(runSpace, organizationId, server, oabVirtualDir);
transaction.RegisterNewOfflineAddressBook(oabId); transaction.RegisterNewOfflineAddressBook(oabId);
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{
string securityGroupId = AddADPrefix(securityGroup);
UpdateOfflineAddressBook(runSpace, oabId, securityGroupId); UpdateOfflineAddressBook(runSpace, oabId, securityGroupId);
}
info.OfflineAddressBook = oabId; info.OfflineAddressBook = oabId;
} }
catch (Exception ex) catch (Exception ex)
@ -995,9 +1015,14 @@ namespace WebsitePanel.Providers.HostedSolution
//disable mail security distribution group //disable mail security distribution group
try try
{
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{ {
DisableMailSecurityDistributionGroup(runSpace, securityGroup); DisableMailSecurityDistributionGroup(runSpace, securityGroup);
} }
}
catch (Exception ex) catch (Exception ex)
{ {
ret = false; ret = false;
@ -4068,7 +4093,12 @@ namespace WebsitePanel.Providers.HostedSolution
string id = AddPublicFolder(runSpace, folderName, parentFolder); string id = AddPublicFolder(runSpace, folderName, parentFolder);
transaction.RegisterNewPublicFolder(string.Empty, id); transaction.RegisterNewPublicFolder(string.Empty, id);
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{
SetPublicFolderPermissions(runSpace, id, securityGroup); SetPublicFolderPermissions(runSpace, id, securityGroup);
}
if (mailEnabled) if (mailEnabled)
{ {

View file

@ -92,28 +92,42 @@ namespace WebsitePanel.Providers.HostedSolution
string server = GetServerName(); string server = GetServerName();
string securityGroupPath = AddADPrefix(securityGroup); string securityGroupPath = AddADPrefix(securityGroup);
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{
//Create mail enabled organization security group //Create mail enabled organization security group
EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId); EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId);
transaction.RegisterMailEnabledDistributionGroup(securityGroup); transaction.RegisterMailEnabledDistributionGroup(securityGroup);
UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer); UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer);
}
//create GAL //create GAL
string galId = CreateGlobalAddressList(runSpace, organizationId); string galId = CreateGlobalAddressList(runSpace, organizationId);
transaction.RegisterNewGlobalAddressList(galId); transaction.RegisterNewGlobalAddressList(galId);
ExchangeLog.LogInfo(" Global Address List: {0}", galId); ExchangeLog.LogInfo(" Global Address List: {0}", galId);
if (enableDefaultGroup)
{
UpdateGlobalAddressList(runSpace, galId, securityGroupPath); UpdateGlobalAddressList(runSpace, galId, securityGroupPath);
}
//create AL //create AL
string alId = CreateAddressList(runSpace, organizationId); string alId = CreateAddressList(runSpace, organizationId);
transaction.RegisterNewAddressList(alId); transaction.RegisterNewAddressList(alId);
ExchangeLog.LogInfo(" Address List: {0}", alId); ExchangeLog.LogInfo(" Address List: {0}", alId);
if (enableDefaultGroup)
{
UpdateAddressList(runSpace, alId, securityGroupPath); UpdateAddressList(runSpace, alId, securityGroupPath);
}
//create RAL //create RAL
string ralId = CreateRoomsAddressList(runSpace, organizationId); string ralId = CreateRoomsAddressList(runSpace, organizationId);
transaction.RegisterNewRoomsAddressList(ralId); transaction.RegisterNewRoomsAddressList(ralId);
ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId); ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId);
if (enableDefaultGroup)
{
UpdateAddressList(runSpace, ralId, securityGroupPath); UpdateAddressList(runSpace, ralId, securityGroupPath);
}
//create ActiveSync policy //create ActiveSync policy
string asId = CreateActiveSyncPolicy(runSpace, organizationId); string asId = CreateActiveSyncPolicy(runSpace, organizationId);
@ -282,9 +296,14 @@ namespace WebsitePanel.Providers.HostedSolution
//disable mail security distribution group //disable mail security distribution group
try try
{
bool enableDefaultGroup = !string.IsNullOrEmpty(securityGroup);
if (enableDefaultGroup)
{ {
DisableMailSecurityDistributionGroup(runSpace, securityGroup); DisableMailSecurityDistributionGroup(runSpace, securityGroup);
} }
}
catch (Exception ex) catch (Exception ex)
{ {
ret = false; ret = false;

View file

@ -206,12 +206,12 @@ namespace WebsitePanel.Providers.HostedSolution
return ActiveDirectoryUtils.AdObjectExists(orgPath); return ActiveDirectoryUtils.AdObjectExists(orgPath);
} }
public Organization CreateOrganization(string organizationId) public Organization CreateOrganization(string organizationId, bool enableDefaultGroup)
{ {
return CreateOrganizationInternal(organizationId); return CreateOrganizationInternal(organizationId, enableDefaultGroup);
} }
internal Organization CreateOrganizationInternal(string organizationId) internal Organization CreateOrganizationInternal(string organizationId, bool enableDefaultGroup)
{ {
HostedSolutionLog.LogStart("CreateOrganizationInternal"); HostedSolutionLog.LogStart("CreateOrganizationInternal");
HostedSolutionLog.DebugInfo("OrganizationId : {0}", organizationId); HostedSolutionLog.DebugInfo("OrganizationId : {0}", organizationId);
@ -232,15 +232,20 @@ namespace WebsitePanel.Providers.HostedSolution
ActiveDirectoryUtils.CreateOrganizationalUnit(organizationId, parentPath); ActiveDirectoryUtils.CreateOrganizationalUnit(organizationId, parentPath);
ouCreated = true; ouCreated = true;
if (enableDefaultGroup)
{
//Create security group //Create security group
ActiveDirectoryUtils.CreateGroup(orgPath, organizationId); ActiveDirectoryUtils.CreateGroup(orgPath, organizationId);
groupCreated = true; groupCreated = true;
}
org = new Organization(); org = new Organization();
org.OrganizationId = organizationId; org.OrganizationId = organizationId;
org.DistinguishedName = ActiveDirectoryUtils.RemoveADPrefix(orgPath); org.DistinguishedName = ActiveDirectoryUtils.RemoveADPrefix(orgPath);
org.SecurityGroup = ActiveDirectoryUtils.RemoveADPrefix(GetGroupPath(organizationId)); org.SecurityGroup = enableDefaultGroup
? ActiveDirectoryUtils.RemoveADPrefix(GetGroupPath(organizationId))
: "";
org.GroupName = organizationId; org.GroupName = organizationId;
} }
catch (Exception ex) catch (Exception ex)
@ -356,13 +361,15 @@ namespace WebsitePanel.Providers.HostedSolution
throw new ArgumentNullException("organizationId"); throw new ArgumentNullException("organizationId");
string groupPath = GetGroupPath(organizationId); string groupPath = GetGroupPath(organizationId);
try
{
ActiveDirectoryUtils.DeleteADObject(groupPath); ActiveDirectoryUtils.DeleteADObject(groupPath);
}
catch { /* skip */ }
string path = GetOrganizationPath(organizationId); string path = GetOrganizationPath(organizationId);
ActiveDirectoryUtils.DeleteADObject(path, true); ActiveDirectoryUtils.DeleteADObject(path, true);
HostedSolutionLog.LogEnd("DeleteOrganizationInternal"); HostedSolutionLog.LogEnd("DeleteOrganizationInternal");
} }
@ -371,12 +378,12 @@ namespace WebsitePanel.Providers.HostedSolution
#region Users #region Users
public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup)
{ {
return CreateUserInternal(organizationId, loginName, displayName, upn, password, enabled); return CreateUserInternal(organizationId, loginName, displayName, upn, password, enabled, enableDefaultGroup);
} }
internal int CreateUserInternal(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) internal int CreateUserInternal(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup)
{ {
HostedSolutionLog.LogStart("CreateUserInternal"); HostedSolutionLog.LogStart("CreateUserInternal");
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
@ -414,13 +421,15 @@ namespace WebsitePanel.Providers.HostedSolution
return Errors.AD_OBJECT_ALREADY_EXISTS; return Errors.AD_OBJECT_ALREADY_EXISTS;
} }
if (enableDefaultGroup)
{
string groupPath = GetGroupPath(organizationId); string groupPath = GetGroupPath(organizationId);
HostedSolutionLog.DebugInfo("Group retrieved: {0}", groupPath); HostedSolutionLog.DebugInfo("Group retrieved: {0}", groupPath);
ActiveDirectoryUtils.AddObjectToGroup(userPath, groupPath); ActiveDirectoryUtils.AddObjectToGroup(userPath, groupPath);
HostedSolutionLog.DebugInfo("Added to group: {0}", groupPath); HostedSolutionLog.DebugInfo("Added to group: {0}", groupPath);
} }
}
catch (Exception e) catch (Exception e)
{ {
HostedSolutionLog.LogError(e); HostedSolutionLog.LogError(e);

View file

@ -224,18 +224,20 @@ namespace WebsitePanel.Providers.HostedSolution
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", 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/CreateOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public Organization CreateOrganization(string organizationId) public Organization CreateOrganization(string organizationId, bool enableDefaultGroup)
{ {
object[] results = this.Invoke("CreateOrganization", new object[] { object[] results = this.Invoke("CreateOrganization", new object[] {
organizationId}); organizationId,
enableDefaultGroup});
return ((Organization)(results[0])); return ((Organization)(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginCreateOrganization(string organizationId, System.AsyncCallback callback, object asyncState) public System.IAsyncResult BeginCreateOrganization(string organizationId, bool enableDefaultGroup, System.AsyncCallback callback, object asyncState)
{ {
return this.BeginInvoke("CreateOrganization", new object[] { return this.BeginInvoke("CreateOrganization", new object[] {
organizationId}, callback, asyncState); organizationId,
enableDefaultGroup}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -246,20 +248,21 @@ namespace WebsitePanel.Providers.HostedSolution
} }
/// <remarks/> /// <remarks/>
public void CreateOrganizationAsync(string organizationId) public void CreateOrganizationAsync(string organizationId, bool enableDefaultGroup)
{ {
this.CreateOrganizationAsync(organizationId, null); this.CreateOrganizationAsync(organizationId, enableDefaultGroup, null);
} }
/// <remarks/> /// <remarks/>
public void CreateOrganizationAsync(string organizationId, object userState) public void CreateOrganizationAsync(string organizationId, bool enableDefaultGroup, object userState)
{ {
if ((this.CreateOrganizationOperationCompleted == null)) if ((this.CreateOrganizationOperationCompleted == null))
{ {
this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted);
} }
this.InvokeAsync("CreateOrganization", new object[] { this.InvokeAsync("CreateOrganization", new object[] {
organizationId}, this.CreateOrganizationOperationCompleted, userState); organizationId,
enableDefaultGroup}, this.CreateOrganizationOperationCompleted, userState);
} }
private void OnCreateOrganizationOperationCompleted(object arg) private void OnCreateOrganizationOperationCompleted(object arg)
@ -322,7 +325,7 @@ namespace WebsitePanel.Providers.HostedSolution
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", 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/CreateUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup)
{ {
object[] results = this.Invoke("CreateUser", new object[] { object[] results = this.Invoke("CreateUser", new object[] {
organizationId, organizationId,
@ -330,12 +333,13 @@ namespace WebsitePanel.Providers.HostedSolution
displayName, displayName,
upn, upn,
password, password,
enabled}); enabled,
enableDefaultGroup});
return ((int)(results[0])); return ((int)(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginCreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, System.AsyncCallback callback, object asyncState) public System.IAsyncResult BeginCreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup, System.AsyncCallback callback, object asyncState)
{ {
return this.BeginInvoke("CreateUser", new object[] { return this.BeginInvoke("CreateUser", new object[] {
organizationId, organizationId,
@ -343,7 +347,8 @@ namespace WebsitePanel.Providers.HostedSolution
displayName, displayName,
upn, upn,
password, password,
enabled}, callback, asyncState); enabled,
enableDefaultGroup}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -354,13 +359,13 @@ namespace WebsitePanel.Providers.HostedSolution
} }
/// <remarks/> /// <remarks/>
public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup)
{ {
this.CreateUserAsync(organizationId, loginName, displayName, upn, password, enabled, null); this.CreateUserAsync(organizationId, loginName, displayName, upn, password, enabled, enableDefaultGroup, null);
} }
/// <remarks/> /// <remarks/>
public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, object userState) public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup, object userState)
{ {
if ((this.CreateUserOperationCompleted == null)) if ((this.CreateUserOperationCompleted == null))
{ {
@ -372,7 +377,8 @@ namespace WebsitePanel.Providers.HostedSolution
displayName, displayName,
upn, upn,
password, password,
enabled}, this.CreateUserOperationCompleted, userState); enabled,
enableDefaultGroup}, this.CreateUserOperationCompleted, userState);
} }
private void OnCreateUserOperationCompleted(object arg) private void OnCreateUserOperationCompleted(object arg)

View file

@ -70,12 +70,12 @@ namespace WebsitePanel.Server
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
public Organization CreateOrganization(string organizationId) public Organization CreateOrganization(string organizationId, bool enableDefaultGroup)
{ {
try try
{ {
Log.WriteStart("'{0}' CreateOrganization", ProviderSettings.ProviderName); Log.WriteStart("'{0}' CreateOrganization", ProviderSettings.ProviderName);
Organization ret = Organization.CreateOrganization(organizationId); Organization ret = Organization.CreateOrganization(organizationId, enableDefaultGroup);
Log.WriteEnd("'{0}' CreateOrganization", ProviderSettings.ProviderName); Log.WriteEnd("'{0}' CreateOrganization", ProviderSettings.ProviderName);
return ret; return ret;
} }
@ -93,9 +93,9 @@ namespace WebsitePanel.Server
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, bool enableDefaultGroup)
{ {
return Organization.CreateUser(organizationId, loginName, displayName, upn, password, enabled); return Organization.CreateUser(organizationId, loginName, displayName, upn, password, enabled, enableDefaultGroup);
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]

View file

@ -19,7 +19,7 @@
</UpgradeBackupLocation> </UpgradeBackupLocation>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<UseIISExpress>false</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort /> <IISExpressSSLPort />
<IISExpressAnonymousAuthentication /> <IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
@ -257,8 +257,7 @@
<AutoAssignPort>False</AutoAssignPort> <AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>9004</DevelopmentServerPort> <DevelopmentServerPort>9004</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath> <DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl> <IISUrl>http://localhost:9004/</IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication> <NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer> <UseCustomServer>False</UseCustomServer>
<CustomServerUrl> <CustomServerUrl>

View file

@ -123,4 +123,7 @@
<data name="secOrg.Text" xml:space="preserve"> <data name="secOrg.Text" xml:space="preserve">
<value>Organization Id Policy</value> <value>Organization Id Policy</value>
</data> </data>
<data name="threeOrg.Text" xml:space="preserve">
<value>Organization Policy</value>
</data>
</root> </root>

View file

@ -1,6 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsExchangePolicy.ascx.cs" Inherits="WebsitePanel.Portal.SettingsExchangePolicy" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsExchangePolicy.ascx.cs" Inherits="WebsitePanel.Portal.SettingsExchangePolicy" %>
<%@ Register Src="UserControls/PasswordPolicyEditor.ascx" TagName="PasswordPolicyEditor" TagPrefix="wsp" %> <%@ Register Src="UserControls/PasswordPolicyEditor.ascx" TagName="PasswordPolicyEditor" TagPrefix="wsp" %>
<%@ Register Src="UserControls/OrgIdPolicyEditor.ascx" TagName="OrgIdPolicyEditor" TagPrefix="wsp" %> <%@ Register Src="UserControls/OrgIdPolicyEditor.ascx" TagName="OrgIdPolicyEditor" TagPrefix="wsp" %>
<%@ Register Src="UserControls/OrgPolicyEditor.ascx" TagName="OrgPolicyEditor" TagPrefix="wsp" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %> <%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
<wsp:CollapsiblePanel id="secMailboxPassword" runat="server" <wsp:CollapsiblePanel id="secMailboxPassword" runat="server"
@ -30,3 +31,16 @@
</tr> </tr>
</table> </table>
</asp:Panel> </asp:Panel>
<wsp:CollapsiblePanel id="threeOrg" runat="server" TargetControlID="OrgPanel" meta:resourcekey="threeOrg" Text="Organization Policy"/>
<asp:Panel ID="OrgPanel" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="SubHead" width="150" nowrap>
</td>
<td>
<wsp:OrgPolicyEditor id="orgPolicy" runat="server" />
</td>
</tr>
</table>
</asp:Panel>

View file

@ -39,12 +39,14 @@ namespace WebsitePanel.Portal
// mailbox // mailbox
mailboxPasswordPolicy.Value = settings["MailboxPasswordPolicy"]; mailboxPasswordPolicy.Value = settings["MailboxPasswordPolicy"];
orgIdPolicy.Value = settings["OrgIdPolicy"]; orgIdPolicy.Value = settings["OrgIdPolicy"];
orgPolicy.Value = settings["OrgPolicy"];
} }
public void SaveSettings(UserSettings settings) public void SaveSettings(UserSettings settings)
{ {
settings["MailboxPasswordPolicy"] = mailboxPasswordPolicy.Value; settings["MailboxPasswordPolicy"] = mailboxPasswordPolicy.Value;
settings["OrgIdPolicy"] = orgIdPolicy.Value; settings["OrgIdPolicy"] = orgIdPolicy.Value;
settings["OrgPolicy"] = orgPolicy.Value;
} }
#endregion #endregion

View file

@ -1,31 +1,3 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@ -93,5 +65,32 @@ namespace WebsitePanel.Portal {
/// 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::WebsitePanel.Portal.UserControls.OrgIdPolicyEditor orgIdPolicy; protected global::WebsitePanel.Portal.UserControls.OrgIdPolicyEditor orgIdPolicy;
/// <summary>
/// threeOrg control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel threeOrg;
/// <summary>
/// OrgPanel 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 OrgPanel;
/// <summary>
/// orgPolicy control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.OrgPolicyEditor orgPolicy;
} }
} }

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="enablePolicyCheckBox.Text" xml:space="preserve">
<value>Enable Policy</value>
</data>
</root>

View file

@ -0,0 +1,16 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrgPolicyEditor.ascx.cs" Inherits="WebsitePanel.Portal.UserControls.OrgPolicyEditor" %>
<asp:UpdatePanel runat="server" ID="OrgPolicyPanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:CheckBox id="enablePolicyCheckBox" runat="server" meta:resourcekey="enablePolicyCheckBox" Text="Enable Policy" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="EnablePolicy_CheckedChanged"/>
<table id="PolicyTable" runat="server" cellpadding="2">
<tr>
<td class="Normal" style="width:150px;">
<asp:Label ID="lblEnableDefaultGroups" runat="server" meta:resourcekey="lblEnableDefaultGroups" Text="Enable Default Groups:"/>
</td>
<td class="Normal">
<asp:CheckBox ID="chkEnableDefaultGroups" runat="server" CssClass="NormalTextBox" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

View file

@ -0,0 +1,97 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Text;
using System.Web.UI;
namespace WebsitePanel.Portal.UserControls
{
public partial class OrgPolicyEditor : UserControl
{
#region Properties
public string Value
{
get
{
var sb = new StringBuilder();
sb.Append(enablePolicyCheckBox.Checked.ToString()).Append(";");
sb.Append(chkEnableDefaultGroups.Checked.ToString()).Append(";");
return sb.ToString();
}
set
{
if (String.IsNullOrEmpty(value))
{
enablePolicyCheckBox.Checked = true;
chkEnableDefaultGroups.Checked = true;
}
else
{
try
{
string[] parts = value.Split(';');
enablePolicyCheckBox.Checked = Utils.ParseBool(parts[0], true);
chkEnableDefaultGroups.Checked = Utils.ParseBool(parts[1], true);
}
catch
{
}
}
ToggleControls();
}
}
#endregion
#region Methods
protected void Page_Load(object sender, EventArgs e)
{
}
private void ToggleControls()
{
PolicyTable.Visible = enablePolicyCheckBox.Checked;
}
#endregion
#region Event Handlers
protected void EnablePolicy_CheckedChanged(object sender, EventArgs e)
{
ToggleControls();
}
#endregion
}
}

View file

@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.UserControls {
public partial class OrgPolicyEditor {
/// <summary>
/// OrgPolicyPanel 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 OrgPolicyPanel;
/// <summary>
/// enablePolicyCheckBox 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.CheckBox enablePolicyCheckBox;
/// <summary>
/// PolicyTable control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTable PolicyTable;
/// <summary>
/// lblEnableDefaultGroups 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.Label lblEnableDefaultGroups;
/// <summary>
/// chkEnableDefaultGroups 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.CheckBox chkEnableDefaultGroups;
}
}

View file

@ -493,6 +493,13 @@
<Compile Include="SettingsLyncUserPlansPolicy.ascx.designer.cs"> <Compile Include="SettingsLyncUserPlansPolicy.ascx.designer.cs">
<DependentUpon>SettingsLyncUserPlansPolicy.ascx</DependentUpon> <DependentUpon>SettingsLyncUserPlansPolicy.ascx</DependentUpon>
</Compile> </Compile>
<Compile Include="UserControls\OrgPolicyEditor.ascx.cs">
<DependentUpon>OrgPolicyEditor.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\OrgPolicyEditor.ascx.designer.cs">
<DependentUpon>OrgPolicyEditor.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\DomainListControlBase.cs"> <Compile Include="UserControls\DomainListControlBase.cs">
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
@ -4021,6 +4028,7 @@
<Content Include="ScheduleTaskControls\NotifyOverusedDatabases.ascx" /> <Content Include="ScheduleTaskControls\NotifyOverusedDatabases.ascx" />
<Content Include="SettingsExchangeMailboxPlansPolicy.ascx" /> <Content Include="SettingsExchangeMailboxPlansPolicy.ascx" />
<Content Include="SettingsLyncUserPlansPolicy.ascx" /> <Content Include="SettingsLyncUserPlansPolicy.ascx" />
<Content Include="UserControls\OrgPolicyEditor.ascx" />
<Content Include="UserControls\EditFeedsList.ascx" /> <Content Include="UserControls\EditFeedsList.ascx" />
<Content Include="UserControls\OrgIdPolicyEditor.ascx" /> <Content Include="UserControls\OrgIdPolicyEditor.ascx" />
<Content Include="UserControls\PackagePhoneNumbers.ascx" /> <Content Include="UserControls\PackagePhoneNumbers.ascx" />
@ -5209,6 +5217,7 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>
<Content Include="ExchangeServer\App_LocalResources\OrganizationSecurityGroupMemberOf.ascx.resx" /> <Content Include="ExchangeServer\App_LocalResources\OrganizationSecurityGroupMemberOf.ascx.resx" />
<Content Include="UserControls\App_LocalResources\OrgPolicyEditor.ascx.resx" />
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx"> <EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>