Merge tip of default branch
This commit is contained in:
commit
cac9401322
6 changed files with 127 additions and 31 deletions
|
@ -559,6 +559,17 @@ GO
|
||||||
UPDATE [dbo].[ResourceGroups] SET ShowGroup=1
|
UPDATE [dbo].[ResourceGroups] SET ShowGroup=1
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Quotas' AND COLS.name='ShowGroup')
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[Quotas] ADD [HideQuota] [bit] NULL
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
UPDATE [dbo].[Quotas] SET [HideQuota] = 1 WHERE [QuotaName] = N'OS.DomainPointers'
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with SubscriberNumber ******/
|
/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with SubscriberNumber ******/
|
||||||
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Users' AND COLS.name='SubscriberNumber')
|
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Users' AND COLS.name='SubscriberNumber')
|
||||||
|
@ -3925,6 +3936,7 @@ SELECT
|
||||||
dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS ParentQuotaValue
|
dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS ParentQuotaValue
|
||||||
FROM Quotas AS Q
|
FROM Quotas AS Q
|
||||||
LEFT OUTER JOIN HostingPlanQuotas AS HPQ ON Q.QuotaID = HPQ.QuotaID AND HPQ.PlanID = @PlanID
|
LEFT OUTER JOIN HostingPlanQuotas AS HPQ ON Q.QuotaID = HPQ.QuotaID AND HPQ.PlanID = @PlanID
|
||||||
|
WHERE Q.HideQuota IS NULL OR Q.HideQuota = 0
|
||||||
ORDER BY Q.QuotaOrder
|
ORDER BY Q.QuotaOrder
|
||||||
RETURN
|
RETURN
|
||||||
GO
|
GO
|
||||||
|
@ -6424,3 +6436,6 @@ BEGIN
|
||||||
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'LYNC_REPORT', N'Boolean', N'true', 5)
|
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'LYNC_REPORT', N'Boolean', N'true', 5)
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const int ERROR_WEB_SITE_SHARED_IP_ADDRESS_NOT_SPECIFIED = -608;
|
public const int ERROR_WEB_SITE_SHARED_IP_ADDRESS_NOT_SPECIFIED = -608;
|
||||||
public const int ERROR_WEB_SHARED_SSL_QUOTA_LIMIT = -609;
|
public const int ERROR_WEB_SHARED_SSL_QUOTA_LIMIT = -609;
|
||||||
public const int ERROR_GLOBALDNS_FOR_DEDICATEDIP = -610;
|
public const int ERROR_GLOBALDNS_FOR_DEDICATEDIP = -610;
|
||||||
|
public const int ERROR_PUBLICSHAREDIP_FOR_SHAREDIP = -611;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Mail
|
#region Mail
|
||||||
|
|
|
@ -1847,8 +1847,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
else if (isDomainPointer)
|
else if (isDomainPointer)
|
||||||
{
|
{
|
||||||
// domain pointer
|
// domain pointer
|
||||||
if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted)
|
//if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted)
|
||||||
return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT;
|
//return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2495,10 +2495,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
instantAlias = GetDomainItem(instantAliasId);
|
instantAlias = GetDomainItem(instantAliasId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string parentZone = domain.ZoneName;
|
||||||
|
if (string.IsNullOrEmpty(parentZone))
|
||||||
|
{
|
||||||
|
DomainInfo parentDomain = GetDomain(domain.DomainId);
|
||||||
|
parentZone = parentDomain.DomainName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (domain.WebSiteId > 0)
|
if (domain.WebSiteId > 0)
|
||||||
{
|
{
|
||||||
WebServerController.AddWebSitePointer(domain.WebSiteId,
|
WebServerController.AddWebSitePointer(domain.WebSiteId,
|
||||||
(domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : domain.DomainName.Replace("." + domain.ZoneName, ""),
|
((domain.DomainName.Replace("." + parentZone, "") == parentZone) |
|
||||||
|
(domain.DomainName == parentZone))
|
||||||
|
? "" : domain.DomainName.Replace("." + parentZone, ""),
|
||||||
instantAlias.DomainId);
|
instantAlias.DomainId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2507,12 +2517,14 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
List<DomainInfo> domains = GetDomainsByDomainItemId(domain.DomainId);
|
List<DomainInfo> domains = GetDomainsByDomainItemId(domain.DomainId);
|
||||||
foreach (DomainInfo d in domains)
|
foreach (DomainInfo d in domains)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (d.WebSiteId > 0)
|
if (d.WebSiteId > 0)
|
||||||
{
|
{
|
||||||
WebServerController.AddWebSitePointer(d.WebSiteId,
|
WebServerController.AddWebSitePointer(d.WebSiteId,
|
||||||
(d.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : d.DomainName.Replace("." + domain.ZoneName, ""),
|
((d.DomainName.Replace("." + parentZone, "") == parentZone) |
|
||||||
|
(d.DomainName == parentZone))
|
||||||
|
? "" : d.DomainName.Replace("." + parentZone, ""),
|
||||||
instantAlias.DomainId);
|
instantAlias.DomainId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,15 +172,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return AddWebSite(packageId, hostName, domainId, ipAddressId, false, true);
|
return AddWebSite(packageId, hostName, domainId, ipAddressId, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Regex regIP = new Regex(
|
|
||||||
@"(?<First>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Second>2[0-4]\d|25"
|
private static bool IsValidIPAdddress(string addr)
|
||||||
+ @"[0-5]|[01]?\d\d?)\.(?<Third>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?"
|
{
|
||||||
+ @"<Fourth>2[0-4]\d|25[0-5]|[01]?\d\d?)",
|
System.Net.IPAddress ip;
|
||||||
RegexOptions.IgnoreCase
|
if (System.Net.IPAddress.TryParse(addr, out ip))
|
||||||
| RegexOptions.CultureInvariant
|
{
|
||||||
| RegexOptions.IgnorePatternWhitespace
|
return ((ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6) |
|
||||||
| RegexOptions.Compiled
|
(ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork));
|
||||||
);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static int AddWebSite(int packageId, string hostName, int domainId, int packageAddressId,
|
public static int AddWebSite(int packageId, string hostName, int domainId, int packageAddressId,
|
||||||
bool addInstantAlias, bool ignoreGlobalDNSRecords)
|
bool addInstantAlias, bool ignoreGlobalDNSRecords)
|
||||||
|
@ -274,10 +279,19 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(d.ExternalIP))
|
if (!string.IsNullOrEmpty(d.ExternalIP))
|
||||||
{
|
{
|
||||||
if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (domain.ZoneItemId > 0)
|
||||||
|
{
|
||||||
|
StringDictionary settings = ServerController.GetServiceSettings(serviceId);
|
||||||
|
if (string.IsNullOrEmpty(settings["PublicSharedIP"]))
|
||||||
|
return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// prepare site bindings
|
// prepare site bindings
|
||||||
List<ServerBinding> bindings = new List<ServerBinding>();
|
List<ServerBinding> bindings = new List<ServerBinding>();
|
||||||
|
@ -681,7 +695,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(d.ExternalIP))
|
if (!string.IsNullOrEmpty(d.ExternalIP))
|
||||||
{
|
{
|
||||||
if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,7 +709,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
// remove all web site pointers
|
// remove all web site pointers
|
||||||
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
|
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
|
||||||
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
|
DomainInfo ZoneInfo = ServerController.GetDomain(domain.DomainItemId);
|
||||||
|
|
||||||
if (ZoneInfo == null)
|
if (ZoneInfo == null)
|
||||||
throw new Exception("Parent zone not found");
|
throw new Exception("Parent zone not found");
|
||||||
|
@ -763,16 +777,36 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
ServerController.AddItemIPAddress(siteItemId, ipAddressId);
|
ServerController.AddItemIPAddress(siteItemId, ipAddressId);
|
||||||
|
|
||||||
|
|
||||||
|
string parentZone = domain.ZoneName;
|
||||||
|
if (string.IsNullOrEmpty(parentZone))
|
||||||
|
{
|
||||||
|
DomainInfo parentDomain = ServerController.GetDomain(domain.DomainItemId);
|
||||||
|
parentZone = parentDomain.DomainName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AddWebSitePointer(siteItemId,
|
AddWebSitePointer(siteItemId,
|
||||||
(domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "": domain.DomainName.Replace("." + domain.ZoneName,"")
|
((domain.DomainName.Replace("." + parentZone, "") == parentZone) |
|
||||||
|
(domain.DomainName == parentZone))
|
||||||
|
? "" : domain.DomainName.Replace("." + parentZone, "")
|
||||||
, ZoneInfo.DomainId, true, true, true);
|
, ZoneInfo.DomainId, true, true, true);
|
||||||
|
|
||||||
foreach (DomainInfo pointer in pointers)
|
foreach (DomainInfo pointer in pointers)
|
||||||
{
|
{
|
||||||
ZoneInfo = ServerController.GetDomain(pointer.ZoneName);
|
string pointerParentZone = pointer.ZoneName;
|
||||||
|
if (string.IsNullOrEmpty(pointerParentZone))
|
||||||
|
{
|
||||||
|
DomainInfo parentDomain = ServerController.GetDomain(pointer.DomainItemId);
|
||||||
|
pointerParentZone = parentDomain.DomainName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ZoneInfo = ServerController.GetDomain(pointerParentZone);
|
||||||
|
|
||||||
AddWebSitePointer(siteItemId,
|
AddWebSitePointer(siteItemId,
|
||||||
(pointer.DomainName.Replace("." + pointer.ZoneName, "") == pointer.ZoneName) ? "" : pointer.DomainName.Replace("." + pointer.ZoneName, "")
|
((pointer.DomainName.Replace("." + pointerParentZone, "") == pointerParentZone) |
|
||||||
|
(pointer.DomainName == pointerParentZone))
|
||||||
|
? "" : pointer.DomainName.Replace("." + pointerParentZone, "")
|
||||||
, ZoneInfo.DomainId, true, true, true);
|
, ZoneInfo.DomainId, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,6 +873,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (siteItem == null)
|
if (siteItem == null)
|
||||||
return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;
|
return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// place log record
|
// place log record
|
||||||
TaskManager.StartTask("WEB_SITE", "SWITCH_TO_SHARED_IP", siteItem.Name);
|
TaskManager.StartTask("WEB_SITE", "SWITCH_TO_SHARED_IP", siteItem.Name);
|
||||||
TaskManager.ItemId = siteItemId;
|
TaskManager.ItemId = siteItemId;
|
||||||
|
@ -848,11 +884,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
IPAddressInfo ip;
|
IPAddressInfo ip;
|
||||||
|
|
||||||
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
|
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
|
||||||
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
|
DomainInfo ZoneInfo = ServerController.GetDomain(domain.DomainItemId);
|
||||||
|
|
||||||
if (ZoneInfo == null)
|
if (ZoneInfo == null)
|
||||||
throw new Exception("Parent zone not found");
|
throw new Exception("Parent zone not found");
|
||||||
|
|
||||||
|
|
||||||
|
if (ZoneInfo.ZoneItemId > 0)
|
||||||
|
{
|
||||||
|
StringDictionary settings = ServerController.GetServiceSettings(siteItem.ServiceId);
|
||||||
|
if (string.IsNullOrEmpty(settings["PublicSharedIP"]))
|
||||||
|
return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//cleanup certificates
|
//cleanup certificates
|
||||||
List<SSLCertificate> certificates = GetCertificatesForSite(siteItemId);
|
List<SSLCertificate> certificates = GetCertificatesForSite(siteItemId);
|
||||||
foreach (SSLCertificate c in certificates)
|
foreach (SSLCertificate c in certificates)
|
||||||
|
@ -931,16 +976,35 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
siteItem.SiteIPAddressId = 0;
|
siteItem.SiteIPAddressId = 0;
|
||||||
PackageController.UpdatePackageItem(siteItem);
|
PackageController.UpdatePackageItem(siteItem);
|
||||||
|
|
||||||
|
string parentZone = domain.ZoneName;
|
||||||
|
if (string.IsNullOrEmpty(parentZone))
|
||||||
|
{
|
||||||
|
DomainInfo parentDomain = ServerController.GetDomain(domain.DomainItemId);
|
||||||
|
parentZone = parentDomain.DomainName;
|
||||||
|
}
|
||||||
|
|
||||||
AddWebSitePointer(siteItemId,
|
AddWebSitePointer(siteItemId,
|
||||||
(domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : domain.DomainName.Replace("." + domain.ZoneName, "")
|
((domain.DomainName.Replace("." + parentZone, "") == parentZone) |
|
||||||
|
(domain.DomainName == parentZone))
|
||||||
|
? "" : domain.DomainName.Replace("." + parentZone, "")
|
||||||
, ZoneInfo.DomainId, true, true, true);
|
, ZoneInfo.DomainId, true, true, true);
|
||||||
|
|
||||||
foreach (DomainInfo pointer in pointers)
|
foreach (DomainInfo pointer in pointers)
|
||||||
{
|
{
|
||||||
ZoneInfo = ServerController.GetDomain(pointer.ZoneName);
|
string pointerParentZone = pointer.ZoneName;
|
||||||
|
if (string.IsNullOrEmpty(pointerParentZone))
|
||||||
|
{
|
||||||
|
DomainInfo parentDomain = ServerController.GetDomain(pointer.DomainItemId);
|
||||||
|
pointerParentZone = parentDomain.DomainName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ZoneInfo = ServerController.GetDomain(pointerParentZone);
|
||||||
|
|
||||||
AddWebSitePointer(siteItemId,
|
AddWebSitePointer(siteItemId,
|
||||||
(pointer.DomainName.Replace("." + pointer.ZoneName, "") == pointer.ZoneName) ? "" : pointer.DomainName.Replace("." + pointer.ZoneName, "")
|
((pointer.DomainName.Replace("." + pointerParentZone, "") == pointerParentZone) |
|
||||||
|
(pointer.DomainName == pointerParentZone))
|
||||||
|
? "" : pointer.DomainName.Replace("." + pointerParentZone, "")
|
||||||
, ZoneInfo.DomainId, true, true, true);
|
, ZoneInfo.DomainId, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1059,6 +1059,9 @@
|
||||||
<data name="Error.610" xml:space="preserve">
|
<data name="Error.610" xml:space="preserve">
|
||||||
<value>Invalid Global DNS entries in platform server configuration for dedicated IP address usage. Contact you platform administrator</value>
|
<value>Invalid Global DNS entries in platform server configuration for dedicated IP address usage. Contact you platform administrator</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Error.611" xml:space="preserve">
|
||||||
|
<value>Invalid public shared ip address in platform server configuration for shared IP address usage. Contact you platform administrator</value>
|
||||||
|
</data>
|
||||||
<data name="Error.700" xml:space="preserve">
|
<data name="Error.700" xml:space="preserve">
|
||||||
<value>Specified mail domain already exists on the service</value>
|
<value>Specified mail domain already exists on the service</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -148,7 +148,8 @@ namespace WebsitePanel.Portal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (HideInstantAlias && domain.IsInstantAlias)
|
|
||||||
|
if (HideInstantAlias && domain.IsInstantAlias)
|
||||||
continue;
|
continue;
|
||||||
else if (HideMailDomains && domain.MailDomainId > 0)
|
else if (HideMailDomains && domain.MailDomainId > 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue