merge
This commit is contained in:
commit
c5f9f76d51
30 changed files with 566 additions and 129 deletions
|
@ -5428,9 +5428,7 @@ GO
|
|||
/*Remote Desktop Services*/
|
||||
|
||||
/*Remote Desktop Services Tables*/
|
||||
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionUsers')
|
||||
DROP TABLE RDSCollectionUsers
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionUsers')
|
||||
CREATE TABLE RDSCollectionUsers
|
||||
(
|
||||
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
|
@ -5440,9 +5438,7 @@ CREATE TABLE RDSCollectionUsers
|
|||
GO
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSServers')
|
||||
DROP TABLE RDSServers
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSServers')
|
||||
CREATE TABLE RDSServers
|
||||
(
|
||||
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
|
@ -5456,9 +5452,7 @@ CREATE TABLE RDSServers
|
|||
GO
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollections')
|
||||
DROP TABLE RDSCollections
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollections')
|
||||
CREATE TABLE RDSCollections
|
||||
(
|
||||
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
|
@ -5468,6 +5462,20 @@ CREATE TABLE RDSCollections
|
|||
)
|
||||
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])
|
||||
REFERENCES [dbo].[RDSCollections] ([ID])
|
||||
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')
|
||||
END
|
||||
GO
|
||||
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', N'<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
DECLARE @DomainExpirationLetterHtmlBody nvarchar(2500)
|
||||
|
||||
Set @DomainExpirationLetterHtmlBody = N'<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Domain Expiration Information</title>
|
||||
<style type="text/css">
|
||||
|
@ -6352,6 +6361,7 @@ Please, find below details of your domain expiration information.
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Domain</th>
|
||||
<th>Registrar</th>
|
||||
<th>Customer</th>
|
||||
<th>Expiration Date</th>
|
||||
</tr>
|
||||
|
@ -6360,8 +6370,9 @@ Please, find below details of your domain expiration information.
|
|||
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
||||
<tr>
|
||||
<td>#Domain.DomainName#</td>
|
||||
<td>#iif(isnull(Domain.Registrar), "", Domain.Registrar)#</td>
|
||||
<td>#Domain.Customer#</td>
|
||||
<td>#Domain.ExpirationDate#</td>
|
||||
<td>#iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#</td>
|
||||
</tr>
|
||||
</ad:foreach>
|
||||
</tbody>
|
||||
|
@ -6397,9 +6408,17 @@ If you have any questions regarding your hosting account, feel free to contact o
|
|||
|
||||
<p>
|
||||
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
|
||||
ELSE
|
||||
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainExpirationLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'HtmlBody'
|
||||
GO
|
||||
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'Priority' )
|
||||
BEGIN
|
||||
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')
|
||||
END
|
||||
GO
|
||||
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', N'=================================
|
||||
|
||||
DECLARE @DomainExpirationLetterTextBody nvarchar(2500)
|
||||
|
||||
Set @DomainExpirationLetterTextBody = N'=================================
|
||||
Domain Expiration Information
|
||||
=================================
|
||||
<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">
|
||||
Domain: #Domain.DomainName#
|
||||
Registrar: #iif(isnull(Domain.Registrar), "", Domain.Registrar)#
|
||||
Customer: #Domain.Customer#
|
||||
Expiration Date: #Domain.ExpirationDate#
|
||||
Expiration Date: #iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#
|
||||
|
||||
</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.
|
||||
|
||||
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
|
||||
ELSE
|
||||
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainExpirationLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainExpirationLetter' AND [PropertyName]= N'TextBody'
|
||||
GO
|
||||
|
||||
|
||||
|
@ -6458,9 +6485,10 @@ BEGIN
|
|||
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'From', N'support@HostingCompany.com')
|
||||
END
|
||||
GO
|
||||
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', N'<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
DECLARE @DomainLookupLetterHtmlBody nvarchar(2500)
|
||||
|
||||
Set @DomainLookupLetterHtmlBody = N'<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>MX and NS Changes Information</title>
|
||||
<style type="text/css">
|
||||
|
@ -6470,6 +6498,7 @@ INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [Property
|
|||
.Summary { font-family: Tahoma; font-size: 9pt; }
|
||||
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
|
||||
.Summary H2 { font-size: 1.3em; color: ##1F4978; }
|
||||
.Summary H3 { font-size: 1em; color: ##1F4978; }
|
||||
.Summary TABLE { border: solid 1px ##e5e5e5; }
|
||||
.Summary TH,
|
||||
.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">
|
||||
<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>
|
||||
<thead>
|
||||
|
@ -6530,9 +6560,17 @@ If you have any questions regarding your hosting account, feel free to contact o
|
|||
|
||||
<p>
|
||||
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
|
||||
ELSE
|
||||
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainLookupLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'HtmlBody'
|
||||
GO
|
||||
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'Priority' )
|
||||
BEGIN
|
||||
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')
|
||||
END
|
||||
GO
|
||||
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', N'=================================
|
||||
|
||||
DECLARE @DomainLookupLetterTextBody nvarchar(2500)
|
||||
|
||||
Set @DomainLookupLetterTextBody = N'=================================
|
||||
MX and NS Changes Information
|
||||
=================================
|
||||
<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">
|
||||
|
||||
#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">
|
||||
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.
|
||||
|
||||
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
|
||||
ELSE
|
||||
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @DomainLookupLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'TextBody'
|
||||
GO
|
||||
|
||||
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'NoChangesHtmlBody' )
|
||||
BEGIN
|
||||
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
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
@ -7155,3 +7204,174 @@ ORDER BY
|
|||
DisplayName
|
||||
RETURN
|
||||
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
|
|
@ -151,5 +151,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
public DateTime? CreationDate { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public DateTime? LastUpdateDate { get; set; }
|
||||
public string RegistrarName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -284,6 +284,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
catch (Exception ex)
|
||||
{
|
||||
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex);
|
||||
throw TaskManager.WriteError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -599,19 +600,26 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
try
|
||||
{
|
||||
if (1 == 1)//(CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||
if (CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||
{
|
||||
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
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
|
||||
{
|
||||
|
@ -1167,18 +1175,12 @@ namespace WebsitePanel.EnterpriseServer
|
|||
private static bool CheckRDSServerAvaliable(string hostname)
|
||||
{
|
||||
bool result = false;
|
||||
var ping = new Ping();
|
||||
var reply = ping.Send(hostname, 1000);
|
||||
|
||||
try
|
||||
if (reply.Status == IPStatus.Success)
|
||||
{
|
||||
var ping = new Ping();
|
||||
var reply = ping.Send(hostname, 1000); // 1 second time out (in ms)
|
||||
|
||||
if (reply.Status == IPStatus.Success)
|
||||
result = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result = false;
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -183,9 +183,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
items["user"] = user;
|
||||
|
||||
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) })
|
||||
.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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -8,6 +8,8 @@ namespace WebsitePanel.Providers.DomainLookup
|
|||
public class DomainDnsChanges
|
||||
{
|
||||
public string DomainName { get; set; }
|
||||
public string Registrar { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public int PackageId { get; set; }
|
||||
|
||||
public List<DnsRecordInfoChange> DnsChanges { get; set; }
|
||||
|
|
|
@ -63,5 +63,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
bool CheckServerAvailability(string hostName);
|
||||
string[] GetApplicationUsers(string collectionName, string applicationName);
|
||||
bool SetApplicationUsers(string collectionName, RemoteApplication remoteApp, string[] users);
|
||||
bool CheckRDSServerAvaliable(string hostname);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -377,11 +377,9 @@ namespace WebsitePanel.Providers.FTP
|
|||
{
|
||||
CanRead = permission.Read,
|
||||
CanWrite = permission.Write,
|
||||
CreatedDate = user.CreatedDate,
|
||||
Enabled = !user.AccountDisabled,
|
||||
Folder = path,
|
||||
GroupName = user.GroupName,
|
||||
Name = user.Name
|
||||
Name = accountName
|
||||
};
|
||||
|
||||
return account;
|
||||
|
|
|
@ -165,6 +165,20 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
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
|
||||
|
||||
#region RDS Collections
|
||||
|
@ -199,26 +213,26 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
|
||||
public bool CreateCollection(string organizationId, RdsCollection collection)
|
||||
{
|
||||
{
|
||||
var result = true;
|
||||
|
||||
Runspace runSpace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runSpace = OpenRunspace();
|
||||
{
|
||||
runSpace = OpenRunspace();
|
||||
|
||||
foreach (var server in collection.Servers)
|
||||
{
|
||||
//If server will restart it will not be added to collection
|
||||
//Do not install feature here
|
||||
//Do not install feature here
|
||||
|
||||
if (!ExistRdsServerInDeployment(runSpace, server))
|
||||
{
|
||||
AddRdsServerToDeployment(runSpace, server);
|
||||
{
|
||||
AddRdsServerToDeployment(runSpace, server);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Command cmd = new Command("New-RDSessionCollection");
|
||||
cmd.Parameters.Add("CollectionName", collection.Name);
|
||||
cmd.Parameters.Add("SessionHost", collection.Servers.Select(x => x.FqdName).ToArray());
|
||||
|
@ -229,7 +243,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
cmd.Parameters.Add("CollectionDescription", collection.Description);
|
||||
}
|
||||
|
||||
var collectionPs = ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault();
|
||||
var collectionPs = ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault();
|
||||
|
||||
if (collectionPs == null)
|
||||
{
|
||||
|
@ -279,11 +293,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
{
|
||||
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runSpace);
|
||||
|
@ -695,15 +705,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
var showCmd = new Command("netsh nps show np");
|
||||
|
||||
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 userGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(userGroupAd, "objectSid");
|
||||
|
||||
var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count, ConvertByteToStringSid(userGroupSid));
|
||||
|
||||
var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count + 1, ConvertByteToStringSid(userGroupSid));
|
||||
Command addCmd = new Command(addCmdString);
|
||||
|
||||
var result = ExecuteRemoteShellCommand(runSpace, centralNpshost, addCmd);
|
||||
|
@ -920,7 +937,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
runSpace = OpenRunspace();
|
||||
var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true);
|
||||
installationResult = (bool)GetPSObjectProperty(feature, "Success");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runSpace);
|
||||
|
@ -1411,10 +1428,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
if (pipeLine.Error != null && pipeLine.Error.Count > 0)
|
||||
{
|
||||
foreach (object item in pipeLine.Error.ReadToEnd())
|
||||
{
|
||||
{
|
||||
errorList.Add(item);
|
||||
string errorMessage = string.Format("Invoke error: {0}", item);
|
||||
Log.WriteWarning(errorMessage);
|
||||
Log.WriteWarning(errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,6 +69,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
|
||||
private System.Threading.SendOrPostCallback SetApplicationUsersOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback CheckRDSServerAvaliableOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public RemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
|
||||
|
@ -134,6 +136,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
/// <remarks/>
|
||||
public event SetApplicationUsersCompletedEventHandler SetApplicationUsersCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event CheckRDSServerAvaliableCompletedEventHandler CheckRDSServerAvaliableCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[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)]
|
||||
|
@ -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/>
|
||||
public new void CancelAsync(object 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]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -503,8 +503,8 @@ namespace WebsitePanel.Providers.Utils
|
|||
// fill user
|
||||
SystemUser user = new SystemUser();
|
||||
user.Name = GetObjectProperty(objUser, "cn").ToString();
|
||||
user.FullName = GetObjectProperty(objUser, "givenName").ToString() + " " +
|
||||
GetObjectProperty(objUser, "sn").ToString();
|
||||
user.FullName = (GetObjectProperty(objUser, "givenName").ToString() + " " +
|
||||
GetObjectProperty(objUser, "sn").ToString()).Trim();
|
||||
user.Description = GetObjectProperty(objUser, "description").ToString();
|
||||
|
||||
ADAccountOptions userFlags = (ADAccountOptions)objUser.Properties["userAccountControl"].Value;
|
||||
|
|
|
@ -393,5 +393,22 @@ namespace WebsitePanel.Server
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5620,5 +5620,10 @@
|
|||
<data name="SchedulerTask.SCHEDULE_TASK_DOMAIN_EXPIRATION" xml:space="preserve">
|
||||
<value>Check domain expiration date</value>
|
||||
</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>
|
|
@ -216,4 +216,7 @@
|
|||
<data name="DomainLookup.TooltipHeader" xml:space="preserve">
|
||||
<value>Current Real DNS Values</value>
|
||||
</data>
|
||||
<data name="DomainLookup.TooltipHeader.Registrar" xml:space="preserve">
|
||||
<value>Registrar:</value>
|
||||
</data>
|
||||
</root>
|
|
@ -38,12 +38,16 @@
|
|||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvDomainsExpirationDate">
|
||||
<ItemStyle Width="15%"></ItemStyle>
|
||||
<ItemStyle Width="11%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%>
|
||||
|
||||
<div style="display:inline-block" runat="server" Visible='<%# ShowDomainDnsInfo(Eval("ExpirationDate"), Eval("LastUpdateDate"), !(bool)Eval("IsSubDomain") && !(bool)Eval("IsInstantAlias") && !(bool)Eval("IsDomainPointer")) %>'>
|
||||
<img style="border-width: 0px;" src="App_Themes/Default/Images/information_icon_small.gif" title="<%# GetDomainDnsRecords((int)Eval("DomainId")) %>">
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<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>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
|
|
@ -45,16 +45,20 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
public partial class Domains : WebsitePanelModuleBase
|
||||
{
|
||||
public Dictionary<int, string> dnsRecords;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
dnsRecords = new Dictionary<int, string>();
|
||||
|
||||
gvDomains.PageSize = UsersHelper.GetDisplayItemsPerPage();
|
||||
|
||||
// visibility
|
||||
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;
|
||||
gvDomains.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
|
||||
gvDomains.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
|
||||
gvDomains.Columns[6].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
|
||||
gvDomains.Columns[7].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
@ -154,11 +158,18 @@ namespace WebsitePanel.Portal
|
|||
|
||||
public string GetDomainDnsRecords(int domainId)
|
||||
{
|
||||
if(dnsRecords.ContainsKey(domainId))
|
||||
{
|
||||
return dnsRecords[domainId];
|
||||
}
|
||||
|
||||
var records = ES.Services.Servers.GetDomainDnsRecords(domainId);
|
||||
|
||||
if (!records.Any())
|
||||
{
|
||||
return "No Dns Records";
|
||||
dnsRecords.Add(domainId, string.Empty);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var header = GetLocalizedString("DomainLookup.TooltipHeader");
|
||||
|
@ -169,7 +180,25 @@ namespace WebsitePanel.Portal
|
|||
tooltipLines.Add(" ");
|
||||
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)
|
||||
|
|
|
@ -10,12 +10,8 @@
|
|||
<div class="FormBody">
|
||||
|
||||
<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 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"
|
||||
TargetControlID="OptionsPanel" resourcekey="OptionsPanelHeader" Text="Provisioning options">
|
||||
|
|
|
@ -157,6 +157,8 @@ namespace WebsitePanel.Portal
|
|||
|
||||
// allow sub-domains
|
||||
AllowSubDomainsPanel.Visible = (type == DomainType.Domain) && PanelSecurity.EffectiveUser.Role != UserRole.User;
|
||||
|
||||
CheckForCorrectIdnDomainUsage(DomainName.Text);
|
||||
}
|
||||
|
||||
private DomainType GetDomainType(string typeName)
|
||||
|
@ -260,15 +262,27 @@ namespace WebsitePanel.Portal
|
|||
}
|
||||
protected void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddDomain();
|
||||
if (CheckForCorrectIdnDomainUsage(DomainName.Text))
|
||||
{
|
||||
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)
|
||||
{
|
||||
// If the choosen domain is a idn domain, don't allow to create mail
|
||||
var isIdn = Utils.IsIdnDomain(e.DomainName);
|
||||
PointMailDomainPanel.Enabled = !isIdn;
|
||||
PointMailDomain.Checked = !isIdn;
|
||||
CheckForCorrectIdnDomainUsage(e.DomainName);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,7 +28,7 @@
|
|||
</table>
|
||||
|
||||
<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" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -67,8 +67,7 @@
|
|||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgRemove1" runat="server" Text="Remove" Visible='<%# Eval("RdsCollectionId") == null %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
|
||||
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>
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to remove selected server?')"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</fieldset>
|
||||
|
||||
<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>
|
||||
|
|
|
@ -41,6 +41,8 @@ namespace WebsitePanel.Portal.RDS
|
|||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
remoreApps.Module = Module;
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
||||
|
@ -48,8 +50,8 @@ namespace WebsitePanel.Portal.RDS
|
|||
|
||||
locCName.Text = collection.Name;
|
||||
|
||||
remoreApps.SetApps(collectionApps, Module);
|
||||
}
|
||||
remoreApps.SetApps(collectionApps);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -43,16 +43,16 @@
|
|||
<Columns>
|
||||
<asp:BoundField DataField="Name" HtmlEncode="true" SortExpression="Name" HeaderText="Server name">
|
||||
<HeaderStyle Wrap="false" />
|
||||
<ItemStyle Wrap="False" Width="35%"/>
|
||||
<ItemStyle Wrap="False" Width="25%"/>
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="20%"/></asp:BoundField>
|
||||
<asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="35%"/></asp:BoundField>
|
||||
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="15%"/></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>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
|
||||
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>
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected rds server?')"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
<tr>
|
||||
<td class="FormLabel150"><asp:Localize ID="locServerComments" runat="server" meta:resourcekey="locServerComments" Text="Server Comments:"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="valServerComments" runat="server" ErrorMessage="*" ControlToValidate="txtServerComments"></asp:RequiredFieldValidator>
|
||||
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -75,15 +75,6 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
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>
|
||||
/// btnAdd control.
|
||||
/// </summary>
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<asp:Localize ID="locDomainName" runat="server" meta:resourcekey="locDomainName" Text="Domain name:"></asp:Localize>
|
||||
</td>
|
||||
<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>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -31,6 +31,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.Portal.UserControls;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
|
@ -249,7 +250,10 @@ namespace WebsitePanel.Portal
|
|||
|
||||
protected void btnCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
CreateHostingSpace();
|
||||
if (CheckForCorrectIdnDomainUsage())
|
||||
{
|
||||
CreateHostingSpace();
|
||||
}
|
||||
}
|
||||
|
||||
protected void rbFtpAccountName_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
@ -266,5 +270,30 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue