This commit is contained in:
Virtuworks 2012-10-01 17:58:38 -04:00
commit 404b259b8f
4 changed files with 34 additions and 17 deletions

View file

@ -694,6 +694,7 @@ FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
WHERE CHARINDEX('.' + DomainName, @DomainName) > 0
AND (CHARINDEX('.' + DomainName, @DomainName) + LEN('.' + DomainName)) = LEN(@DomainName) + 1
AND IsDomainPointer = 0
-- this is a domain of other user
IF @UserID <> @DomainUserID AND @HostingAllowed = 0

View file

@ -5,6 +5,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\..\LICENSE.txt = ..\..\LICENSE.txt
..\..\Readme.htm = ..\..\Readme.htm
..\..\ReleaseNotes.htm = ..\..\ReleaseNotes.htm
..\Database\update_db.sql = ..\Database\update_db.sql
VersionInfo.vb = VersionInfo.vb
EndProjectSection
EndProject

View file

@ -1800,11 +1800,9 @@ namespace WebsitePanel.EnterpriseServer
else if (isDomainPointer)
{
// domain pointer
/*
if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted)
return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT;
*/
}
}
else
{
// top-level domain
@ -2173,22 +2171,25 @@ namespace WebsitePanel.EnterpriseServer
}
// add web site pointer if required
/*
if (domain.WebSiteId > 0 && instantAlias.WebSiteId == 0)
{
int webRes = WebServerController.AddWebSitePointer(domain.WebSiteId, hostName, domainId);
if (webRes < 0)
return webRes;
}
/*
// add mail domain pointer
if (domain.MailDomainId > 0 && instantAlias.MailDomainId == 0)
{
int mailRes = MailServerController.AddMailDomainPointer(domain.MailDomainId, instantAliasId);
if (mailRes < 0)
return mailRes;
}
*/
// add mail domain pointer
/*
if (domain.MailDomainId > 0 && instantAlias.MailDomainId == 0)
{
int mailRes = MailServerController.AddMailDomainPointer(domain.MailDomainId, instantAliasId);
if (mailRes < 0)
return mailRes;
}
*/
return 0;
}
catch (Exception ex)

View file

@ -275,6 +275,7 @@ namespace WebsitePanel.EnterpriseServer
{
// DEDICATED IP
bindings.Add(new ServerBinding(ipAddr, "80", ""));
bindings.Add(new ServerBinding(ipAddr, "443", ""));
}
UserInfo user = PackageController.GetPackageOwner(packageId);
@ -630,12 +631,18 @@ namespace WebsitePanel.EnterpriseServer
try
{
// remove all web site pointers
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
if (ZoneInfo == null)
throw new Exception("failed to retrieve parent zone");
List<DomainInfo> pointers = GetWebSitePointers(siteItemId);
foreach (DomainInfo pointer in pointers)
DeleteWebSitePointer(siteItemId, pointer.DomainId, true, true, false);
// remove web site main pointer
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
if (domain != null)
DeleteWebSitePointer(siteItemId, domain.DomainId, true, true, false);
@ -653,7 +660,6 @@ namespace WebsitePanel.EnterpriseServer
// associate IP with web site
ServerController.AddItemIPAddress(siteItemId, ipAddressId);
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
AddWebSitePointer(siteItemId,
(domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "": domain.DomainName.Replace("." + domain.ZoneName,"")
@ -679,6 +685,10 @@ namespace WebsitePanel.EnterpriseServer
ServerBinding srvBinding = new ServerBinding(ipAddr, "80", "");
newBindings.Add(srvBinding);
srvBinding = new ServerBinding(ipAddr, "443", "");
newBindings.Add(srvBinding);
foreach (ServerBinding b in web.GetSiteBindings(siteItem.SiteId))
{
if (!((b.Host == srvBinding.Host) &
@ -720,13 +730,19 @@ namespace WebsitePanel.EnterpriseServer
try
{
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
if (ZoneInfo == null)
throw new Exception("failed to retrieve parent zone");
// remove all web site pointers
List<DomainInfo> pointers = GetWebSitePointers(siteItemId);
foreach (DomainInfo pointer in pointers)
DeleteWebSitePointer(siteItemId, pointer.DomainId, true, true, false);
// remove web site main pointer
DomainInfo domain = ServerController.GetDomain(siteItem.Name);
if (domain != null)
DeleteWebSitePointer(siteItemId, domain.DomainId, true, true, false);
@ -758,8 +774,6 @@ namespace WebsitePanel.EnterpriseServer
siteItem.SiteIPAddressId = 0;
PackageController.UpdatePackageItem(siteItem);
DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName);
AddWebSitePointer(siteItemId,
(domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : domain.DomainName.Replace("." + domain.ZoneName, "")
, ZoneInfo.DomainId, true, true, true);