This commit is contained in:
dev_amdtel 2015-01-05 23:40:06 +03:00
commit c5f9f76d51
30 changed files with 566 additions and 129 deletions

View file

@ -5428,9 +5428,7 @@ GO
/*Remote Desktop Services*/ /*Remote Desktop Services*/
/*Remote Desktop Services Tables*/ /*Remote Desktop Services Tables*/
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionUsers') IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionUsers')
DROP TABLE RDSCollectionUsers
GO
CREATE TABLE RDSCollectionUsers CREATE TABLE RDSCollectionUsers
( (
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
@ -5440,9 +5438,7 @@ CREATE TABLE RDSCollectionUsers
GO GO
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSServers') IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSServers')
DROP TABLE RDSServers
GO
CREATE TABLE RDSServers CREATE TABLE RDSServers
( (
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
@ -5456,9 +5452,7 @@ CREATE TABLE RDSServers
GO GO
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollections') IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollections')
DROP TABLE RDSCollections
GO
CREATE TABLE RDSCollections CREATE TABLE RDSCollections
( (
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
@ -5468,6 +5462,20 @@ CREATE TABLE RDSCollections
) )
GO GO
ALTER TABLE [dbo].[RDSCollectionUsers]
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
GO
ALTER TABLE [dbo].[RDSCollectionUsers]
DROP CONSTRAINT [FK_RDSCollectionUsers_UserId]
GO
ALTER TABLE [dbo].[RDSServers]
DROP CONSTRAINT [FK_RDSServers_RDSCollectionId]
GO
ALTER TABLE [dbo].[RDSCollectionUsers] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] FOREIGN KEY([RDSCollectionId]) ALTER TABLE [dbo].[RDSCollectionUsers] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] FOREIGN KEY([RDSCollectionId])
REFERENCES [dbo].[RDSCollections] ([ID]) REFERENCES [dbo].[RDSCollections] ([ID])
ON DELETE CASCADE ON DELETE CASCADE
@ -6310,9 +6318,10 @@ BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'From', N'support@HostingCompany.com') INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'From', N'support@HostingCompany.com')
END END
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'HtmlBody' )
BEGIN DECLARE @DomainExpirationLetterHtmlBody nvarchar(2500)
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'HtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
Set @DomainExpirationLetterHtmlBody = N'<html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>Domain Expiration Information</title> <title>Domain Expiration Information</title>
<style type="text/css"> <style type="text/css">
@ -6352,6 +6361,7 @@ Please, find below details of your domain expiration information.
<thead> <thead>
<tr> <tr>
<th>Domain</th> <th>Domain</th>
<th>Registrar</th>
<th>Customer</th> <th>Customer</th>
<th>Expiration Date</th> <th>Expiration Date</th>
</tr> </tr>
@ -6360,8 +6370,9 @@ Please, find below details of your domain expiration information.
<ad:foreach collection="#Domains#" var="Domain" index="i"> <ad:foreach collection="#Domains#" var="Domain" index="i">
<tr> <tr>
<td>#Domain.DomainName#</td> <td>#Domain.DomainName#</td>
<td>#iif(isnull(Domain.Registrar), "", Domain.Registrar)#</td>
<td>#Domain.Customer#</td> <td>#Domain.Customer#</td>
<td>#Domain.ExpirationDate#</td> <td>#iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#</td>
</tr> </tr>
</ad:foreach> </ad:foreach>
</tbody> </tbody>
@ -6397,9 +6408,17 @@ If you have any questions regarding your hosting account, feel free to contact o
<p> <p>
Best regards Best regards
</p>') </p>';
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'HtmlBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'HtmlBody', @DomainExpirationLetterHtmlBody)
END END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainExpirationLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'HtmlBody'
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'Priority' ) IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'Priority' )
BEGIN BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'Priority', N'Normal') INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'Priority', N'Normal')
@ -6410,9 +6429,10 @@ BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'Subject', N'Domain expiration notification') INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'Subject', N'Domain expiration notification')
END END
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'TextBody' )
BEGIN DECLARE @DomainExpirationLetterTextBody nvarchar(2500)
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'TextBody', N'=================================
Set @DomainExpirationLetterTextBody = N'=================================
Domain Expiration Information Domain Expiration Information
================================= =================================
<ad:if test="#user#"> <ad:if test="#user#">
@ -6424,8 +6444,9 @@ Please, find below details of your domain expiration information.
<ad:foreach collection="#Domains#" var="Domain" index="i"> <ad:foreach collection="#Domains#" var="Domain" index="i">
Domain: #Domain.DomainName# Domain: #Domain.DomainName#
Registrar: #iif(isnull(Domain.Registrar), "", Domain.Registrar)#
Customer: #Domain.Customer# Customer: #Domain.Customer#
Expiration Date: #Domain.ExpirationDate# Expiration Date: #iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#
</ad:foreach> </ad:foreach>
@ -6441,8 +6462,14 @@ Please, find below details of your non-existen domains.
If you have any questions regarding your hosting account, feel free to contact our support department at any time. If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards') Best regards'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'TextBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainExpirationLetter', N'TextBody', @DomainExpirationLetterTextBody)
END END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainExpirationLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'TextBody'
GO GO
@ -6458,9 +6485,10 @@ BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'From', N'support@HostingCompany.com') INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'From', N'support@HostingCompany.com')
END END
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'HtmlBody' )
BEGIN DECLARE @DomainLookupLetterHtmlBody nvarchar(2500)
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'HtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
Set @DomainLookupLetterHtmlBody = N'<html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>MX and NS Changes Information</title> <title>MX and NS Changes Information</title>
<style type="text/css"> <style type="text/css">
@ -6470,6 +6498,7 @@ INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [Property
.Summary { font-family: Tahoma; font-size: 9pt; } .Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; } .Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.3em; color: ##1F4978; } .Summary H2 { font-size: 1.3em; color: ##1F4978; }
.Summary H3 { font-size: 1em; color: ##1F4978; }
.Summary TABLE { border: solid 1px ##e5e5e5; } .Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH, .Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; } .Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
@ -6498,6 +6527,7 @@ Please, find below details of MX and NS changes.
<ad:foreach collection="#Domains#" var="Domain" index="i"> <ad:foreach collection="#Domains#" var="Domain" index="i">
<h2>#Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName#</h2> <h2>#Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName#</h2>
<h3>#iif(isnull(Domain.Registrar), "", Domain.Registrar)# #iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#</h3>
<table> <table>
<thead> <thead>
@ -6530,9 +6560,17 @@ If you have any questions regarding your hosting account, feel free to contact o
<p> <p>
Best regards Best regards
</p>') </p>'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'HtmlBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'HtmlBody', @DomainLookupLetterHtmlBody)
END END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainLookupLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'HtmlBody'
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'Priority' ) IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'Priority' )
BEGIN BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'Priority', N'Normal') INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'Priority', N'Normal')
@ -6543,9 +6581,10 @@ BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'Subject', N'MX and NS changes notification') INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'Subject', N'MX and NS changes notification')
END END
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'TextBody' )
BEGIN DECLARE @DomainLookupLetterTextBody nvarchar(2500)
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'TextBody', N'=================================
Set @DomainLookupLetterTextBody = N'=================================
MX and NS Changes Information MX and NS Changes Information
================================= =================================
<ad:if test="#user#"> <ad:if test="#user#">
@ -6558,6 +6597,8 @@ Please, find below details of MX and NS changes.
<ad:foreach collection="#Domains#" var="Domain" index="i"> <ad:foreach collection="#Domains#" var="Domain" index="i">
#Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName# #Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName#
Registrar: #iif(isnull(Domain.Registrar), "", Domain.Registrar)#
ExpirationDate: #iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#
<ad:foreach collection="#Domain.DnsChanges#" var="DnsChange" index="j"> <ad:foreach collection="#Domain.DnsChanges#" var="DnsChange" index="j">
DNS: #DnsChange.DnsServer# DNS: #DnsChange.DnsServer#
@ -6574,9 +6615,18 @@ Please, find below details of MX and NS changes.
If you have any questions regarding your hosting account, feel free to contact our support department at any time. If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards Best regards
') '
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'TextBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'TextBody',@DomainLookupLetterTextBody )
END END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainLookupLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'TextBody'
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'NoChangesHtmlBody' ) IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'NoChangesHtmlBody' )
BEGIN BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'NoChangesHtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml"> INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'NoChangesHtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
@ -6965,7 +7015,6 @@ exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @Fil
RETURN RETURN
GO GO
@ -7155,3 +7204,174 @@ ORDER BY
DisplayName DisplayName
RETURN RETURN
GO GO
IF NOT EXISTS(SELECT * FROM sys.columns
WHERE [name] = N'RegistrarName' AND [object_id] = OBJECT_ID(N'Domains'))
BEGIN
ALTER TABLE [dbo].[Domains] ADD RegistrarName nvarchar(max);
END
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateWhoisDomainInfo')
DROP PROCEDURE UpdateWhoisDomainInfo
GO
CREATE PROCEDURE [dbo].UpdateWhoisDomainInfo
(
@DomainId INT,
@DomainCreationDate DateTime,
@DomainExpirationDate DateTime,
@DomainLastUpdateDate DateTime,
@DomainRegistrarName nvarchar(max)
)
AS
UPDATE [dbo].[Domains] SET [CreationDate] = @DomainCreationDate, [ExpirationDate] = @DomainExpirationDate, [LastUpdateDate] = @DomainLastUpdateDate, [RegistrarName] = @DomainRegistrarName WHERE [DomainID] = @DomainId
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetDomainsPaged')
DROP PROCEDURE GetDomainsPaged
GO
CREATE PROCEDURE [dbo].[GetDomainsPaged]
(
@ActorID int,
@PackageID int,
@ServerID int,
@Recursive bit,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
SET NOCOUNT ON
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2500)
IF @SortColumn = '' OR @SortColumn IS NULL
SET @SortColumn = 'DomainName'
SET @sql = '
DECLARE @Domains TABLE
(
ItemPosition int IDENTITY(1,1),
DomainID int
)
INSERT INTO @Domains (DomainID)
SELECT
D.DomainID
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
LEFT OUTER JOIN Services AS S ON Z.ServiceID = S.ServiceID
LEFT OUTER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
WHERE (D.IsInstantAlias = 0 AND D.IsDomainPointer = 0) AND
((@Recursive = 0 AND D.PackageID = @PackageID)
OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, D.PackageID) = 1))
AND (@ServerID = 0 OR (@ServerID > 0 AND S.ServerID = @ServerID))
'
IF @FilterColumn <> '' AND @FilterValue <> ''
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(DomainID) FROM @Domains;SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(WS.ItemID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(MD.ItemID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer,
D.ExpirationDate,
D.LastUpdateDate,
D.RegistrarName,
P.PackageName,
ISNULL(SRV.ServerID, 0) AS ServerID,
ISNULL(SRV.ServerName, '''') AS ServerName,
ISNULL(SRV.Comments, '''') AS ServerComments,
ISNULL(SRV.VirtualServer, 0) AS VirtualServer,
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Domains AS SD
INNER JOIN Domains AS D ON SD.DomainID = D.DomainID
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
LEFT OUTER JOIN Services AS S ON Z.ServiceID = S.ServiceID
LEFT OUTER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
WHERE SD.ItemPosition BETWEEN @StartRow + 1 AND @StartRow + @MaximumRows'
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @FilterValue nvarchar(50), @ServerID int, @Recursive bit',
@StartRow, @MaximumRows, @PackageID, @FilterValue, @ServerID, @Recursive
RETURN
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetDomains')
DROP PROCEDURE GetDomains
GO
CREATE PROCEDURE [dbo].[GetDomains]
(
@ActorID int,
@PackageID int,
@Recursive bit = 1
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(WS.ItemID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(MD.ItemID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.CreationDate,
D.ExpirationDate,
D.LastUpdateDate,
D.IsDomainPointer,
D.RegistrarName
FROM Domains AS D
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON D.PackageID = PT.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
RETURN
GO

View file

@ -151,5 +151,6 @@ namespace WebsitePanel.EnterpriseServer
public DateTime? CreationDate { get; set; } public DateTime? CreationDate { get; set; }
public DateTime? ExpirationDate { get; set; } public DateTime? ExpirationDate { get; set; }
public DateTime? LastUpdateDate { get; set; } public DateTime? LastUpdateDate { get; set; }
public string RegistrarName { get; set; }
} }
} }

View file

@ -4839,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 #endregion
} }

View file

@ -1505,6 +1505,13 @@ namespace WebsitePanel.EnterpriseServer
/// <returns>True if quota will exceed. Otherwise, false.</returns> /// <returns>True if quota will exceed. Otherwise, false.</returns>
protected bool VerifyIfQuotaWillBeExceeded(int packageId, string quotaName, int numberOfItemsToAdd) 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; bool result = false;
QuotaValueInfo quotaInfo = PackageController.GetPackageQuota(packageId, quotaName); QuotaValueInfo quotaInfo = PackageController.GetPackageQuota(packageId, quotaName);

View file

@ -284,6 +284,7 @@ namespace WebsitePanel.EnterpriseServer
catch (Exception ex) catch (Exception ex)
{ {
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex); result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex);
throw TaskManager.WriteError(ex);
} }
finally finally
{ {
@ -599,19 +600,26 @@ namespace WebsitePanel.EnterpriseServer
try try
{ {
if (1 == 1)//(CheckRDSServerAvaliable(rdsServer.FqdName)) if (CheckRDSServerAvaliable(rdsServer.FqdName))
{ {
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description); rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
} }
else else
{ {
result.AddError("", new Exception("The server that you are adding, is not available")); result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", new Exception("The server that you are adding, is not available"));
return result; return result;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", ex); if (ex.InnerException != null)
{
result.AddError("Unable to add RDS Server", ex.InnerException);
}
else
{
result.AddError("Unable to add RDS Server", ex);
}
} }
finally finally
{ {
@ -1167,18 +1175,12 @@ namespace WebsitePanel.EnterpriseServer
private static bool CheckRDSServerAvaliable(string hostname) private static bool CheckRDSServerAvaliable(string hostname)
{ {
bool result = false; bool result = false;
try
{
var ping = new Ping(); var ping = new Ping();
var reply = ping.Send(hostname, 1000); // 1 second time out (in ms) var reply = ping.Send(hostname, 1000);
if (reply.Status == IPStatus.Success) if (reply.Status == IPStatus.Success)
result = true;
}
catch (Exception)
{ {
result = false; result = true;
} }
return result; return result;

View file

@ -80,7 +80,7 @@ namespace WebsitePanel.EnterpriseServer
checkedDomains.Add(domain.DomainId); checkedDomains.Add(domain.DomainId);
ServerController.UpdateDomainRegistrationData(domain); ServerController.UpdateDomainWhoisData(domain);
if (CheckDomainExpiration(domain.ExpirationDate, daysBeforeNotify)) if (CheckDomainExpiration(domain.ExpirationDate, daysBeforeNotify))
{ {
@ -105,7 +105,7 @@ namespace WebsitePanel.EnterpriseServer
if (mainDomain != null) 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); var nonExistenDomain = nonExistenDomains.FirstOrDefault(x => subDomain.DomainId == x.DomainId);
@ -183,9 +183,11 @@ namespace WebsitePanel.EnterpriseServer
items["user"] = user; items["user"] = user;
items["Domains"] = domains.Select(x => new { DomainName = x.DomainName, items["Domains"] = domains.Select(x => new { DomainName = x.DomainName,
ExpirationDate = x.ExpirationDate, 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) }) Customer = string.Format("{0} {1}", domainUsers[x.PackageId].FirstName, domainUsers[x.PackageId].LastName) })
.OrderBy(x => x.ExpirationDate).ThenBy(x => x.Customer).ThenBy(x => x.DomainName); .OrderBy(x => x.ExpirationDateOrdering).ThenBy(x => x.Customer).ThenBy(x => x.DomainName);
items["IncludeNonExistenDomains"] = includeNonExistenDomains; items["IncludeNonExistenDomains"] = includeNonExistenDomains;

View file

@ -106,6 +106,8 @@ namespace WebsitePanel.EnterpriseServer
DomainDnsChanges domainChanges = new DomainDnsChanges(); DomainDnsChanges domainChanges = new DomainDnsChanges();
domainChanges.DomainName = domain.DomainName; domainChanges.DomainName = domain.DomainName;
domainChanges.PackageId = domain.PackageId; domainChanges.PackageId = domain.PackageId;
domainChanges.Registrar = domain.RegistrarName;
domainChanges.ExpirationDate = domain.ExpirationDate;
var dbDnsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainAllDnsRecords(domain.DomainId)); var dbDnsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainAllDnsRecords(domain.DomainId));

View file

@ -75,6 +75,12 @@ namespace WebsitePanel.EnterpriseServer
@"expires:(.+)" //.fi @"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" 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, ""); ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, "");
} }
UpdateDomainRegistrationData(domain); UpdateDomainWhoisData(domain);
} }
// add instant alias // 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 try
{ {
var whoisResult = WhoisClient.Query(domain.DomainName.ToLowerInvariant()); var whoisResult = WhoisClient.Query(domain.DomainName.ToLowerInvariant());
createdDate = GetDomainInfoDate(whoisResult.Raw, _createdDatePatterns); string creationDateString = ParseWhoisDomainInfo(whoisResult.Raw, _createdDatePatterns);
expiredDate = GetDomainInfoDate(whoisResult.Raw, _expiredDatePatterns); string expirationDateString = ParseWhoisDomainInfo(whoisResult.Raw, _expiredDatePatterns);
domain.CreationDate = createdDate; domain.CreationDate = ParseDate(creationDateString);
domain.ExpirationDate = expiredDate; 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) catch (Exception e)
{ {
@ -2716,17 +2720,18 @@ namespace WebsitePanel.EnterpriseServer
return domain; 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.CreationDate = creationDate;
domain.ExpirationDate = expirationDate; domain.ExpirationDate = expirationDate;
domain.RegistrarName = registrarName;
return domain; 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) foreach (var createdRegex in patterns)
{ {
@ -2736,7 +2741,7 @@ namespace WebsitePanel.EnterpriseServer
{ {
if (match.Success && match.Groups.Count == 2) 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) private static DateTime? ParseDate(string dateString)
{ {
if (string.IsNullOrEmpty(dateString))
{
return null;
}
var result = DateTime.MinValue; var result = DateTime.MinValue;
foreach (var datePattern in _datePatterns) foreach (var datePattern in _datePatterns)

View file

@ -8,6 +8,8 @@ namespace WebsitePanel.Providers.DomainLookup
public class DomainDnsChanges public class DomainDnsChanges
{ {
public string DomainName { get; set; } public string DomainName { get; set; }
public string Registrar { get; set; }
public DateTime? ExpirationDate { get; set; }
public int PackageId { get; set; } public int PackageId { get; set; }
public List<DnsRecordInfoChange> DnsChanges { get; set; } public List<DnsRecordInfoChange> DnsChanges { get; set; }

View file

@ -63,5 +63,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
bool CheckServerAvailability(string hostName); bool CheckServerAvailability(string hostName);
string[] GetApplicationUsers(string collectionName, string applicationName); string[] GetApplicationUsers(string collectionName, string applicationName);
bool SetApplicationUsers(string collectionName, RemoteApplication remoteApp, string[] users); bool SetApplicationUsers(string collectionName, RemoteApplication remoteApp, string[] users);
bool CheckRDSServerAvaliable(string hostname);
} }
} }

View file

@ -377,11 +377,9 @@ namespace WebsitePanel.Providers.FTP
{ {
CanRead = permission.Read, CanRead = permission.Read,
CanWrite = permission.Write, CanWrite = permission.Write,
CreatedDate = user.CreatedDate,
Enabled = !user.AccountDisabled, Enabled = !user.AccountDisabled,
Folder = path, Folder = path,
GroupName = user.GroupName, Name = accountName
Name = user.Name
}; };
return account; return account;

View file

@ -165,6 +165,20 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
return new string[]{}; return new string[]{};
} }
public bool CheckRDSServerAvaliable(string hostname)
{
bool result = false;
var ping = new Ping();
var reply = ping.Send(hostname, 1000);
if (reply.Status == IPStatus.Success)
{
result = true;
}
return result;
}
#endregion #endregion
#region RDS Collections #region RDS Collections
@ -280,10 +294,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer); AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
} }
} }
catch (Exception e)
{
result = false;
}
finally finally
{ {
CloseRunspace(runSpace); CloseRunspace(runSpace);
@ -695,15 +705,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
var showCmd = new Command("netsh nps show np"); var showCmd = new Command("netsh nps show np");
var showResult = ExecuteRemoteShellCommand(runSpace, centralNpshost, showCmd); var showResult = ExecuteRemoteShellCommand(runSpace, centralNpshost, showCmd);
var processingOrders = showResult.Where(x => Convert.ToString(x).ToLower().Contains("processing order")).Select(x => Convert.ToString(x));
var count = 0;
var count = showResult.Count(x => Convert.ToString(x).Contains("policy conf")) + 1001; foreach(var processingOrder in processingOrders)
{
var order = Convert.ToInt32(processingOrder.Remove(0, processingOrder.LastIndexOf("=") + 1).Replace(" ", ""));
if (order > count)
{
count = order;
}
}
var userGroupAd = ActiveDirectoryUtils.GetADObject(GetUsersGroupPath(organizationId, collectionName)); var userGroupAd = ActiveDirectoryUtils.GetADObject(GetUsersGroupPath(organizationId, collectionName));
var userGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(userGroupAd, "objectSid"); var userGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(userGroupAd, "objectSid");
var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count + 1, ConvertByteToStringSid(userGroupSid));
var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count, ConvertByteToStringSid(userGroupSid));
Command addCmd = new Command(addCmdString); Command addCmd = new Command(addCmdString);
var result = ExecuteRemoteShellCommand(runSpace, centralNpshost, addCmd); var result = ExecuteRemoteShellCommand(runSpace, centralNpshost, addCmd);

View file

@ -69,6 +69,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
private System.Threading.SendOrPostCallback SetApplicationUsersOperationCompleted; private System.Threading.SendOrPostCallback SetApplicationUsersOperationCompleted;
private System.Threading.SendOrPostCallback CheckRDSServerAvaliableOperationCompleted;
/// <remarks/> /// <remarks/>
public RemoteDesktopServices() { public RemoteDesktopServices() {
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
@ -134,6 +136,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
/// <remarks/> /// <remarks/>
public event SetApplicationUsersCompletedEventHandler SetApplicationUsersCompleted; public event SetApplicationUsersCompletedEventHandler SetApplicationUsersCompleted;
/// <remarks/>
public event CheckRDSServerAvaliableCompletedEventHandler CheckRDSServerAvaliableCompleted;
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
@ -1021,6 +1026,48 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
} }
} }
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckRDSServerAvaliable", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool CheckRDSServerAvaliable(string hostname) {
object[] results = this.Invoke("CheckRDSServerAvaliable", new object[] {
hostname});
return ((bool)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginCheckRDSServerAvaliable(string hostname, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("CheckRDSServerAvaliable", new object[] {
hostname}, callback, asyncState);
}
/// <remarks/>
public bool EndCheckRDSServerAvaliable(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void CheckRDSServerAvaliableAsync(string hostname) {
this.CheckRDSServerAvaliableAsync(hostname, null);
}
/// <remarks/>
public void CheckRDSServerAvaliableAsync(string hostname, object userState) {
if ((this.CheckRDSServerAvaliableOperationCompleted == null)) {
this.CheckRDSServerAvaliableOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckRDSServerAvaliableOperationCompleted);
}
this.InvokeAsync("CheckRDSServerAvaliable", new object[] {
hostname}, this.CheckRDSServerAvaliableOperationCompleted, userState);
}
private void OnCheckRDSServerAvaliableOperationCompleted(object arg) {
if ((this.CheckRDSServerAvaliableCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.CheckRDSServerAvaliableCompleted(this, new CheckRDSServerAvaliableCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/> /// <remarks/>
public new void CancelAsync(object userState) { public new void CancelAsync(object userState) {
base.CancelAsync(userState); base.CancelAsync(userState);
@ -1436,4 +1483,30 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
} }
} }
} }
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void CheckRDSServerAvaliableCompletedEventHandler(object sender, CheckRDSServerAvaliableCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class CheckRDSServerAvaliableCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal CheckRDSServerAvaliableCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
} }

View file

@ -503,8 +503,8 @@ namespace WebsitePanel.Providers.Utils
// fill user // fill user
SystemUser user = new SystemUser(); SystemUser user = new SystemUser();
user.Name = GetObjectProperty(objUser, "cn").ToString(); user.Name = GetObjectProperty(objUser, "cn").ToString();
user.FullName = GetObjectProperty(objUser, "givenName").ToString() + " " + user.FullName = (GetObjectProperty(objUser, "givenName").ToString() + " " +
GetObjectProperty(objUser, "sn").ToString(); GetObjectProperty(objUser, "sn").ToString()).Trim();
user.Description = GetObjectProperty(objUser, "description").ToString(); user.Description = GetObjectProperty(objUser, "description").ToString();
ADAccountOptions userFlags = (ADAccountOptions)objUser.Properties["userAccountControl"].Value; ADAccountOptions userFlags = (ADAccountOptions)objUser.Properties["userAccountControl"].Value;

View file

@ -393,5 +393,22 @@ namespace WebsitePanel.Server
throw; throw;
} }
} }
[WebMethod, SoapHeader("settings")]
public bool CheckRDSServerAvaliable(string hostname)
{
try
{
Log.WriteStart("'{0}' CheckRDSServerAvaliable", ProviderSettings.ProviderName);
var result = RDSProvider.CheckRDSServerAvaliable(hostname);
Log.WriteEnd("'{0}' CheckRDSServerAvaliable", ProviderSettings.ProviderName);
return result;
}
catch (Exception ex)
{
Log.WriteError(String.Format("'{0}' CheckRDSServerAvaliable", ProviderSettings.ProviderName), ex);
throw;
}
}
} }
} }

View file

@ -5620,5 +5620,10 @@
<data name="SchedulerTask.SCHEDULE_TASK_DOMAIN_EXPIRATION" xml:space="preserve"> <data name="SchedulerTask.SCHEDULE_TASK_DOMAIN_EXPIRATION" xml:space="preserve">
<value>Check domain expiration date</value> <value>Check domain expiration date</value>
</data> </data>
<data name="ERROR.IDNDOMAIN_NO_MAIL" xml:space="preserve">
<value>You cannot use a IDN domain name for mail</value>
</data>
<data name="ERROR.IDNDOMAIN_NO_ORGANIZATION" xml:space="preserve">
<value>You cannot use a IDN domain name for organizations</value>
</data>
</root> </root>

View file

@ -216,4 +216,7 @@
<data name="DomainLookup.TooltipHeader" xml:space="preserve"> <data name="DomainLookup.TooltipHeader" xml:space="preserve">
<value>Current Real DNS Values</value> <value>Current Real DNS Values</value>
</data> </data>
<data name="DomainLookup.TooltipHeader.Registrar" xml:space="preserve">
<value>Registrar:</value>
</data>
</root> </root>

View file

@ -38,12 +38,16 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="gvDomainsExpirationDate"> <asp:TemplateField HeaderText="gvDomainsExpirationDate">
<ItemStyle Width="15%"></ItemStyle> <ItemStyle Width="11%"></ItemStyle>
<ItemTemplate> <ItemTemplate>
<%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%> <%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%>
</ItemTemplate>
<div style="display:inline-block" runat="server" Visible='<%# ShowDomainDnsInfo(Eval("ExpirationDate"), Eval("LastUpdateDate"), !(bool)Eval("IsSubDomain") && !(bool)Eval("IsInstantAlias") && !(bool)Eval("IsDomainPointer")) %>'> </asp:TemplateField>
<img style="border-width: 0px;" src="App_Themes/Default/Images/information_icon_small.gif" title="<%# GetDomainDnsRecords((int)Eval("DomainId")) %>"> <asp:TemplateField HeaderText="">
<ItemStyle Width="5%"></ItemStyle>
<ItemTemplate>
<div style="display:inline-block" runat="server" Visible='<%# ShowDomainDnsInfo(Eval("ExpirationDate"), Eval("LastUpdateDate"), !(bool)Eval("IsSubDomain") && !(bool)Eval("IsInstantAlias") && !(bool)Eval("IsDomainPointer")) && !string.IsNullOrEmpty(GetDomainDnsRecords((int)Eval("DomainId"))) %>'>
<img style="border-width: 0px;" src="App_Themes/Default/Images/information_icon_small.gif" title="<%# GetDomainTooltip((int)Eval("DomainId"), Eval("RegistrarName") != DBNull.Value ? (string)Eval("RegistrarName"):string.Empty) %>">
</div> </div>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>

View file

@ -45,16 +45,20 @@ namespace WebsitePanel.Portal
{ {
public partial class Domains : WebsitePanelModuleBase public partial class Domains : WebsitePanelModuleBase
{ {
public Dictionary<int, string> dnsRecords;
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
dnsRecords = new Dictionary<int, string>();
gvDomains.PageSize = UsersHelper.GetDisplayItemsPerPage(); gvDomains.PageSize = UsersHelper.GetDisplayItemsPerPage();
// visibility // visibility
chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User); chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User);
gvDomains.Columns[3].Visible = gvDomains.Columns[3].Visible = gvDomains.Columns[4].Visible = gvDomains.Columns[5].Visible =
(PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked; (PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
gvDomains.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator); gvDomains.Columns[6].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
gvDomains.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); gvDomains.Columns[7].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
if (!IsPostBack) if (!IsPostBack)
{ {
@ -154,11 +158,18 @@ namespace WebsitePanel.Portal
public string GetDomainDnsRecords(int domainId) public string GetDomainDnsRecords(int domainId)
{ {
if(dnsRecords.ContainsKey(domainId))
{
return dnsRecords[domainId];
}
var records = ES.Services.Servers.GetDomainDnsRecords(domainId); var records = ES.Services.Servers.GetDomainDnsRecords(domainId);
if (!records.Any()) if (!records.Any())
{ {
return "No Dns Records"; dnsRecords.Add(domainId, string.Empty);
return string.Empty;
} }
var header = GetLocalizedString("DomainLookup.TooltipHeader"); var header = GetLocalizedString("DomainLookup.TooltipHeader");
@ -169,7 +180,25 @@ namespace WebsitePanel.Portal
tooltipLines.Add(" "); tooltipLines.Add(" ");
tooltipLines.AddRange( records.Select(x=>string.Format("{0}: {1}", x.RecordType, x.Value))); tooltipLines.AddRange( records.Select(x=>string.Format("{0}: {1}", x.RecordType, x.Value)));
return string.Join("\r\n", tooltipLines); dnsRecords.Add(domainId, string.Join("\r\n", tooltipLines));
return dnsRecords[domainId];
}
public string GetDomainTooltip(int domainId, string registrar)
{
var dnsString = GetDomainDnsRecords(domainId);
var tooltipLines = new List<string>();
if (!string.IsNullOrEmpty(registrar))
{
var header = GetLocalizedString("DomainLookup.TooltipHeader.Registrar");
tooltipLines.Add(header + " " + registrar);
tooltipLines.Add("\r\n");
}
return string.Join("\r\n", tooltipLines) + dnsString;
} }
protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)

View file

@ -10,12 +10,8 @@
<div class="FormBody"> <div class="FormBody">
<p id="DomainPanel" runat="server" style="padding: 15px 0 15px 5px;"> <p id="DomainPanel" runat="server" style="padding: 15px 0 15px 5px;">
<wsp:DomainControl ID="DomainName" runat="server" RequiredEnabled="True" ValidationGroup="Domain" AutoPostBack="True" OnTextChanged="DomainName_TextChanged"></wsp:DomainControl> <wsp:DomainControl ID="DomainName" runat="server" RequiredEnabled="True" ValidationGroup="Domain" OnTextChanged="DomainName_TextChanged"></wsp:DomainControl>
</p> </p>
<%--
<p id="SubDomainPanel" runat="server" style="padding: 15px 0 15px 5px;" visible="false">
<wsp:DomainControl ID="SubDomainName" runat="server" RequiredEnabled="True" IsSubDomain="True" ValidationGroup="Domain"></wsp:DomainControl>
</p>--%>
<wsp:CollapsiblePanel id="OptionsPanelHeader" runat="server" <wsp:CollapsiblePanel id="OptionsPanelHeader" runat="server"
TargetControlID="OptionsPanel" resourcekey="OptionsPanelHeader" Text="Provisioning options"> TargetControlID="OptionsPanel" resourcekey="OptionsPanelHeader" Text="Provisioning options">

View file

@ -157,6 +157,8 @@ namespace WebsitePanel.Portal
// allow sub-domains // allow sub-domains
AllowSubDomainsPanel.Visible = (type == DomainType.Domain) && PanelSecurity.EffectiveUser.Role != UserRole.User; AllowSubDomainsPanel.Visible = (type == DomainType.Domain) && PanelSecurity.EffectiveUser.Role != UserRole.User;
CheckForCorrectIdnDomainUsage(DomainName.Text);
} }
private DomainType GetDomainType(string typeName) private DomainType GetDomainType(string typeName)
@ -259,16 +261,28 @@ namespace WebsitePanel.Portal
RedirectBack(); RedirectBack();
} }
protected void btnAdd_Click(object sender, EventArgs e) protected void btnAdd_Click(object sender, EventArgs e)
{
if (CheckForCorrectIdnDomainUsage(DomainName.Text))
{ {
AddDomain(); AddDomain();
} }
}
private bool CheckForCorrectIdnDomainUsage(string domainName)
{
// If the choosen domain is a idn domain, don't allow to create mail
if (Utils.IsIdnDomain(domainName) && PointMailDomain.Checked)
{
ShowErrorMessage("IDNDOMAIN_NO_MAIL");
return false;
}
return true;
}
protected void DomainName_TextChanged(object sender, DomainControl.DomainNameEventArgs e) protected void DomainName_TextChanged(object sender, DomainControl.DomainNameEventArgs e)
{ {
// If the choosen domain is a idn domain, don't allow to create mail CheckForCorrectIdnDomainUsage(e.DomainName);
var isIdn = Utils.IsIdnDomain(e.DomainName);
PointMailDomainPanel.Enabled = !isIdn;
PointMailDomain.Checked = !isIdn;
} }
} }
} }

View file

@ -28,7 +28,7 @@
</table> </table>
<div class="FormFooterClean"> <div class="FormFooterClean">
<asp:Button id="btnAdd" runat="server" Text="Add" CssClass="Button1" meta:resourcekey="btnAdd" ValidationGroup="AddRDSServer" OnClick="btnAdd_Click"></asp:Button> <asp:Button id="btnAdd" runat="server" Text="Add" CssClass="Button1" meta:resourcekey="btnAdd" ValidationGroup="AddRDSServer" OnClick="btnAdd_Click" OnClientClick="ShowProgressDialog('Adding server...');"></asp:Button>
<asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="AddRDSServer" /> <asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="AddRDSServer" />
</div> </div>
</div> </div>

View file

@ -68,7 +68,6 @@
<asp:LinkButton ID="imgRemove1" runat="server" Text="Remove" Visible='<%# Eval("RdsCollectionId") == null %>' <asp:LinkButton ID="imgRemove1" runat="server" Text="Remove" Visible='<%# Eval("RdsCollectionId") == null %>'
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>' CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to remove selected server?')"></asp:LinkButton> meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to remove selected server?')"></asp:LinkButton>
<asp:Label ID="lbRemove" Text="Remove" runat="server" Visible='<%# Eval("RdsCollectionId") != null %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>

View file

@ -37,7 +37,7 @@
</fieldset> </fieldset>
<div class="FormFooter"> <div class="FormFooter">
<asp:Button id="btnSave" runat="server" Text="Save" CssClass="Button1" meta:resourcekey="btnSave" OnClick="btnSave_Click" ValidationGroup="SaveRDSCollection"></asp:Button> <asp:Button id="btnSave" runat="server" Text="Save" CssClass="Button1" meta:resourcekey="btnSave" OnClick="btnSave_Click" OnClientClick="ShowProgressDialog('Adding collection...');" ValidationGroup="SaveRDSCollection"></asp:Button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -41,6 +41,8 @@ namespace WebsitePanel.Portal.RDS
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
remoreApps.Module = Module;
if (!IsPostBack) if (!IsPostBack)
{ {
RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
@ -48,7 +50,7 @@ namespace WebsitePanel.Portal.RDS
locCName.Text = collection.Name; locCName.Text = collection.Name;
remoreApps.SetApps(collectionApps, Module); remoreApps.SetApps(collectionApps);
} }
} }

View file

@ -43,16 +43,16 @@
<Columns> <Columns>
<asp:BoundField DataField="Name" HtmlEncode="true" SortExpression="Name" HeaderText="Server name"> <asp:BoundField DataField="Name" HtmlEncode="true" SortExpression="Name" HeaderText="Server name">
<HeaderStyle Wrap="false" /> <HeaderStyle Wrap="false" />
<ItemStyle Wrap="False" Width="35%"/> <ItemStyle Wrap="False" Width="25%"/>
</asp:BoundField> </asp:BoundField>
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="20%"/></asp:BoundField> <asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="15%"/></asp:BoundField>
<asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="35%"/></asp:BoundField> <asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="20%"/></asp:BoundField>
<asp:BoundField DataField="Description" HeaderText="Comments"><ItemStyle Width="30%"/></asp:BoundField>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>' <asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>'
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>' CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected rds server?')"></asp:LinkButton> meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected rds server?')"></asp:LinkButton>
<asp:Label ID="lbRemove" Text="Remove" runat="server" Visible='<%# Eval("ItemId") != null %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>

View file

@ -21,7 +21,6 @@
<td class="FormLabel150"><asp:Localize ID="locServerComments" runat="server" meta:resourcekey="locServerComments" Text="Server Comments:"></asp:Localize></td> <td class="FormLabel150"><asp:Localize ID="locServerComments" runat="server" meta:resourcekey="locServerComments" Text="Server Comments:"></asp:Localize></td>
<td> <td>
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox> <asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valServerComments" runat="server" ErrorMessage="*" ControlToValidate="txtServerComments"></asp:RequiredFieldValidator>
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -75,15 +75,6 @@ namespace WebsitePanel.Portal {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtServerComments; protected global::System.Web.UI.WebControls.TextBox txtServerComments;
/// <summary>
/// valServerComments 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.RequiredFieldValidator valServerComments;
/// <summary> /// <summary>
/// btnAdd control. /// btnAdd control.
/// </summary> /// </summary>

View file

@ -73,7 +73,7 @@
<asp:Localize ID="locDomainName" runat="server" meta:resourcekey="locDomainName" Text="Domain name:"></asp:Localize> <asp:Localize ID="locDomainName" runat="server" meta:resourcekey="locDomainName" Text="Domain name:"></asp:Localize>
</td> </td>
<td class="Normal" width="100%"> <td class="Normal" width="100%">
<wsp:DomainControl ID="txtDomainName" runat="server" RequiredEnabled="True" ValidationGroup="CreateSpace"></wsp:DomainControl> <wsp:DomainControl ID="txtDomainName" runat="server" RequiredEnabled="True" ValidationGroup="CreateSpace" OnTextChanged="txtDomainName_OnTextChanged"></wsp:DomainControl>
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer; using WebsitePanel.EnterpriseServer;
using WebsitePanel.Portal.UserControls;
using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.HostedSolution;
namespace WebsitePanel.Portal namespace WebsitePanel.Portal
@ -248,9 +249,12 @@ namespace WebsitePanel.Portal
} }
protected void btnCreate_Click(object sender, EventArgs e) protected void btnCreate_Click(object sender, EventArgs e)
{
if (CheckForCorrectIdnDomainUsage())
{ {
CreateHostingSpace(); CreateHostingSpace();
} }
}
protected void rbFtpAccountName_SelectedIndexChanged(object sender, EventArgs e) protected void rbFtpAccountName_SelectedIndexChanged(object sender, EventArgs e)
{ {
@ -266,5 +270,30 @@ namespace WebsitePanel.Portal
{ {
BindHostingPlan(); BindHostingPlan();
} }
private bool CheckForCorrectIdnDomainUsage()
{
if (Utils.IsIdnDomain(txtDomainName.Text))
{
if (chkIntegratedOUProvisioning.Checked)
{
ShowErrorMessage("IDNDOMAIN_NO_ORGANIZATION");
return false;
}
if (chkCreateMailAccount.Checked)
{
ShowErrorMessage("IDNDOMAIN_NO_MAIL");
return false;
}
}
return true;
}
protected void txtDomainName_OnTextChanged(object sender, DomainControl.DomainNameEventArgs e)
{
CheckForCorrectIdnDomainUsage();
}
} }
} }