merge commit

This commit is contained in:
robvde 2013-01-19 09:56:31 +04:00
commit 5309b1d973
13 changed files with 191 additions and 154 deletions

View file

@ -31,6 +31,7 @@ using System.IO;
using System.Net;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace WebsitePanel.EnterpriseServer
{
@ -166,6 +167,7 @@ namespace WebsitePanel.EnterpriseServer
WebSiteResponse result = new WebSiteResponse();
HttpWebResponse resp = null;
StringBuilder sb = new StringBuilder();
Stream respStream = null;
try
{
WebRequest req = WebRequest.Create(url);
@ -177,7 +179,7 @@ namespace WebsitePanel.EnterpriseServer
}
resp = (HttpWebResponse)req.GetResponse();
Stream respStream = resp.GetResponseStream();
respStream = resp.GetResponseStream();
string charSet = !String.IsNullOrEmpty(resp.CharacterSet) ? resp.CharacterSet : "utf-8";
Encoding encode = System.Text.Encoding.GetEncoding(charSet);
@ -196,6 +198,9 @@ namespace WebsitePanel.EnterpriseServer
result.Status = (int)resp.StatusCode;
result.Text = sb.ToString();
}
catch (ThreadAbortException)
{
}
catch (WebException ex)
{
result.Status = (int)((HttpWebResponse)ex.Response).StatusCode;
@ -210,10 +215,16 @@ namespace WebsitePanel.EnterpriseServer
}
finally
{
if (respStream != null)
{
respStream.Close();
}
if (resp != null)
{
resp.Close();
}
}
return result;

View file

@ -165,7 +165,7 @@ namespace WebsitePanel.EnterpriseServer
// create domain
int domainId = 0;
if ((createWebSite || createMailAccount) && !String.IsNullOrEmpty(domainName))
if ((createWebSite || createMailAccount || createZoneRecord) && !String.IsNullOrEmpty(domainName))
{
try
{
@ -193,7 +193,7 @@ namespace WebsitePanel.EnterpriseServer
}
}
if (createWebSite && !String.IsNullOrEmpty(domainName))
if (createWebSite && (domainId > 0))
{
// create web site
try
@ -252,7 +252,7 @@ namespace WebsitePanel.EnterpriseServer
}
}
if (createMailAccount && !String.IsNullOrEmpty(domainName))
if (createMailAccount && (domainId > 0))
{
// create default mailbox
try
@ -310,25 +310,25 @@ namespace WebsitePanel.EnterpriseServer
// error while creating mail account
throw new Exception("Could not create mail account", ex);
}
}
// Instant Alias / Temporary URL
if (tempDomain && (domainId > 0))
// Instant Alias / Temporary URL
if (tempDomain && (domainId > 0))
{
int instantAliasId = ServerController.CreateDomainInstantAlias("", domainId);
if (instantAliasId < 0)
{
int instantAliasId = ServerController.CreateDomainInstantAlias("", domainId);
if (instantAliasId < 0)
{
// rollback wizard
Rollback();
// rollback wizard
Rollback();
return instantAliasId;
}
return instantAliasId;
}
}
// Domain DNS Zone
if (createZoneRecord && (domainId > 0))
{
ServerController.EnableDomainDns(domainId);
}
// Domain DNS Zone
if (createZoneRecord && (domainId > 0))
{
ServerController.EnableDomainDns(domainId);
}
}