Merge
This commit is contained in:
commit
0b55ae40a3
32 changed files with 2923 additions and 2272 deletions
|
@ -3256,6 +3256,18 @@ namespace WebsitePanel.EnterpriseServer
|
|||
);
|
||||
}
|
||||
|
||||
public static DataSet GetOrganizationObjectsByDomain(int itemId, string domainName)
|
||||
{
|
||||
return SqlHelper.ExecuteDataset(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetOrganizationObjectsByDomain",
|
||||
new SqlParameter("@ItemID", itemId),
|
||||
new SqlParameter("@DomainName", domainName)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region CRM
|
||||
|
@ -4827,6 +4839,20 @@ namespace WebsitePanel.EnterpriseServer
|
|||
);
|
||||
}
|
||||
|
||||
public static void UpdateWhoisDomainInfo(int domainId, DateTime? domainCreationDate, DateTime? domainExpirationDate, DateTime? domainLastUpdateDate, string registrarName)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"UpdateWhoisDomainInfo",
|
||||
new SqlParameter("@DomainId", domainId),
|
||||
new SqlParameter("@DomainCreationDate", domainCreationDate),
|
||||
new SqlParameter("@DomainExpirationDate", domainExpirationDate),
|
||||
new SqlParameter("@DomainLastUpdateDate", domainLastUpdateDate),
|
||||
new SqlParameter("@DomainRegistrarName", registrarName)
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
|
@ -507,6 +507,15 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
}
|
||||
|
||||
public static bool CheckDomainUsedByHostedOrganization(int itemId, int domainId)
|
||||
{
|
||||
DomainInfo domain = ServerController.GetDomain(domainId);
|
||||
if (domain == null)
|
||||
return false;
|
||||
|
||||
return (DataProvider.CheckDomainUsedByHostedOrganization(domain.DomainName) == 1);
|
||||
}
|
||||
|
||||
private static void DeleteOCSUsers(int itemId, ref bool successful)
|
||||
{
|
||||
try
|
||||
|
@ -3080,5 +3089,10 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static DataSet GetOrganizationObjectsByDomain(int itemId, string domainName)
|
||||
{
|
||||
return DataProvider.GetOrganizationObjectsByDomain(itemId, domainName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1505,6 +1505,13 @@ namespace WebsitePanel.EnterpriseServer
|
|||
/// <returns>True if quota will exceed. Otherwise, false.</returns>
|
||||
protected bool VerifyIfQuotaWillBeExceeded(int packageId, string quotaName, int numberOfItemsToAdd)
|
||||
{
|
||||
// Don't bother to check quota if the number of items to add is zero or less otherwise IsQuotasWillExceed
|
||||
// will fail when quota is set to 0 on lists or groups and still thera are no items to import
|
||||
if (numberOfItemsToAdd <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
|
||||
QuotaValueInfo quotaInfo = PackageController.GetPackageQuota(packageId, quotaName);
|
||||
|
|
|
@ -200,11 +200,14 @@ namespace WebsitePanel.EnterpriseServer
|
|||
//TaskManager.Write(String.Format("{0} - Invoke GetServiceItemsDiskSpace method ('{1}' items) - {2} attempt",
|
||||
// DateTime.Now, objItems.Count, attempt));
|
||||
|
||||
ServiceProvider prov = new ServiceProvider();
|
||||
ServiceProviderProxy.Init(prov, serviceId);
|
||||
ServiceProviderItemDiskSpace[] itemsDiskSpace = prov.GetServiceItemsDiskSpace(objItems.ToArray());
|
||||
if (itemsDiskSpace != null && itemsDiskSpace.Length > 0)
|
||||
organizationDiskSpaces.AddRange(itemsDiskSpace);
|
||||
if (objItems.Count > 0)
|
||||
{
|
||||
ServiceProvider prov = new ServiceProvider();
|
||||
ServiceProviderProxy.Init(prov, serviceId);
|
||||
ServiceProviderItemDiskSpace[] itemsDiskSpace = prov.GetServiceItemsDiskSpace(objItems.ToArray());
|
||||
if (itemsDiskSpace != null && itemsDiskSpace.Length > 0)
|
||||
organizationDiskSpaces.AddRange(itemsDiskSpace);
|
||||
}
|
||||
|
||||
return organizationDiskSpaces.ToArray();
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
checkedDomains.Add(domain.DomainId);
|
||||
|
||||
ServerController.UpdateDomainRegistrationData(domain);
|
||||
ServerController.UpdateDomainWhoisData(domain);
|
||||
|
||||
if (CheckDomainExpiration(domain.ExpirationDate, daysBeforeNotify))
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
if (mainDomain != null)
|
||||
{
|
||||
ServerController.UpdateDomainRegistrationData(subDomain, mainDomain.CreationDate, mainDomain.ExpirationDate);
|
||||
ServerController.UpdateDomainWhoisData(subDomain, mainDomain.CreationDate, mainDomain.ExpirationDate, mainDomain.RegistrarName);
|
||||
|
||||
var nonExistenDomain = nonExistenDomains.FirstOrDefault(x => subDomain.DomainId == x.DomainId);
|
||||
|
||||
|
@ -185,6 +185,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
items["Domains"] = domains.Select(x => new { DomainName = x.DomainName,
|
||||
ExpirationDate = x.ExpirationDate < DateTime.Now ? "Expired" : x.ExpirationDate.ToString(),
|
||||
ExpirationDateOrdering = x.ExpirationDate,
|
||||
Registrar = x.RegistrarName,
|
||||
Customer = string.Format("{0} {1}", domainUsers[x.PackageId].FirstName, domainUsers[x.PackageId].LastName) })
|
||||
.OrderBy(x => x.ExpirationDateOrdering).ThenBy(x => x.Customer).ThenBy(x => x.DomainName);
|
||||
|
||||
|
|
|
@ -106,6 +106,8 @@ namespace WebsitePanel.EnterpriseServer
|
|||
DomainDnsChanges domainChanges = new DomainDnsChanges();
|
||||
domainChanges.DomainName = domain.DomainName;
|
||||
domainChanges.PackageId = domain.PackageId;
|
||||
domainChanges.Registrar = domain.RegistrarName;
|
||||
domainChanges.ExpirationDate = domain.ExpirationDate;
|
||||
|
||||
var dbDnsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainAllDnsRecords(domain.DomainId));
|
||||
|
||||
|
|
|
@ -75,6 +75,12 @@ namespace WebsitePanel.EnterpriseServer
|
|||
@"expires:(.+)" //.fi
|
||||
};
|
||||
|
||||
private static List<string> _registrarNamePatterns = new List<string> {
|
||||
@"Created by Registrar:(.+)",
|
||||
@"Registrar:(.+)",
|
||||
@"Registrant Name:(.+)"
|
||||
};
|
||||
|
||||
private static List<string> _datePatterns = new List<string> { @"ddd MMM dd HH:mm:ss G\MT yyyy"
|
||||
};
|
||||
|
||||
|
@ -1837,7 +1843,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, "");
|
||||
}
|
||||
|
||||
UpdateDomainRegistrationData(domain);
|
||||
UpdateDomainWhoisData(domain);
|
||||
}
|
||||
|
||||
// add instant alias
|
||||
|
@ -2691,22 +2697,20 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
}
|
||||
|
||||
public static DomainInfo UpdateDomainRegistrationData(DomainInfo domain)
|
||||
public static DomainInfo UpdateDomainWhoisData(DomainInfo domain)
|
||||
{
|
||||
DateTime? createdDate = null;
|
||||
DateTime? expiredDate = null;
|
||||
|
||||
try
|
||||
{
|
||||
var whoisResult = WhoisClient.Query(domain.DomainName.ToLowerInvariant());
|
||||
|
||||
createdDate = GetDomainInfoDate(whoisResult.Raw, _createdDatePatterns);
|
||||
expiredDate = GetDomainInfoDate(whoisResult.Raw, _expiredDatePatterns);
|
||||
string creationDateString = ParseWhoisDomainInfo(whoisResult.Raw, _createdDatePatterns);
|
||||
string expirationDateString = ParseWhoisDomainInfo(whoisResult.Raw, _expiredDatePatterns);
|
||||
|
||||
domain.CreationDate = createdDate;
|
||||
domain.ExpirationDate = expiredDate;
|
||||
domain.CreationDate = ParseDate(creationDateString);
|
||||
domain.ExpirationDate = ParseDate(expirationDateString);
|
||||
domain.RegistrarName = ParseWhoisDomainInfo(whoisResult.Raw, _registrarNamePatterns);
|
||||
|
||||
DataProvider.UpdateDomainDates(domain.DomainId, createdDate, expiredDate, DateTime.Now);
|
||||
DataProvider.UpdateWhoisDomainInfo(domain.DomainId, domain.CreationDate, domain.ExpirationDate, DateTime.Now, domain.RegistrarName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -2716,17 +2720,18 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return domain;
|
||||
}
|
||||
|
||||
public static DomainInfo UpdateDomainRegistrationData(DomainInfo domain, DateTime? creationDate, DateTime? expirationDate)
|
||||
public static DomainInfo UpdateDomainWhoisData(DomainInfo domain, DateTime? creationDate, DateTime? expirationDate, string registrarName)
|
||||
{
|
||||
DataProvider.UpdateDomainDates(domain.DomainId, creationDate, expirationDate, DateTime.Now);
|
||||
DataProvider.UpdateWhoisDomainInfo(domain.DomainId, creationDate, expirationDate, DateTime.Now, registrarName);
|
||||
|
||||
domain.CreationDate = creationDate;
|
||||
domain.ExpirationDate = expirationDate;
|
||||
domain.RegistrarName = registrarName;
|
||||
|
||||
return domain;
|
||||
}
|
||||
|
||||
private static DateTime? GetDomainInfoDate(string raw, IEnumerable<string> patterns)
|
||||
private static string ParseWhoisDomainInfo(string raw, IEnumerable<string> patterns)
|
||||
{
|
||||
foreach (var createdRegex in patterns)
|
||||
{
|
||||
|
@ -2736,7 +2741,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
if (match.Success && match.Groups.Count == 2)
|
||||
{
|
||||
return ParseDate(match.Groups[1].ToString().Trim());
|
||||
return match.Groups[1].ToString().Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2746,6 +2751,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
private static DateTime? ParseDate(string dateString)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dateString))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var result = DateTime.MinValue;
|
||||
|
||||
foreach (var datePattern in _datePatterns)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue