@@ -10279,7 +10385,7 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'
@@ -10318,15 +10424,15 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'https://mail.virtuworks.net/owa
+
Outlook (Windows Clients)
- To configure Outlook 2013 to work with the VirtuWorks servers, please reference:
+ To configure Outlook 2013 to work with the servers, please reference:
@@ -10373,13 +10479,13 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'Control Panel.
+ Passwords can be changed at any time using Webmail or the Control Panel.
Control Panel
- If you need to change the details of your account, you can easily do this using Control Panel.
+ If you need to change the details of your account, you can easily do this using Control Panel.
@@ -10448,7 +10554,7 @@ END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'Subject' )
BEGIN
-INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'Subject', N'Virtuworks Hosted Exchange Mailbox Setup')
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'Subject', N' Hosted Exchange Mailbox Setup')
END
GO
@@ -10458,7 +10564,7 @@ DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500)
Set @ExchangeMailboxSetupLetterTextBody = N'
Hello #Account.DisplayName#,
-Thanks for choosing VirtuWorks as your Exchange hosting provider.
+Thanks for choosing as your Exchange hosting provider.
User Accounts
@@ -10484,22 +10590,21 @@ In order for us to accept mail for your domain, you will need to point your MX r
Webmail (OWA, Outlook Web Access)
=================================
-https://mail.virtuworks.net/owa
+
=================================
Outlook (Windows Clients)
=================================
-To configure Outlook 2010 to work with VirtuWorks servers, please reference:
+To configure Outlook 2010 to work with servers, please reference:
+
-https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2
If you need to download and install the Outlook 2010 client:
Outlook 2010 Download URL:
-32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip
-64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip
-KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49
+
+KEY:
=================================
ActiveSync, iPhone, iPad
@@ -10514,21 +10619,21 @@ Your username: #SamUsername#
Password Changes
=================================
-Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net).
+Passwords can be changed at any time using Webmail or the Control Panel
=================================
Control Panel
=================================
-If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net).
+If you need to change the details of your account, you can easily do this using the Control Panel
=================================
Support
=================================
-You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/contact/'
+You have 2 options, email or use the web interface at '
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' )
BEGIN
diff --git a/WebsitePanel/Database/wix_update_db.sql b/WebsitePanel/Database/wix_update_db.sql
index 4f342f1d..4131b41b 100644
--- a/WebsitePanel/Database/wix_update_db.sql
+++ b/WebsitePanel/Database/wix_update_db.sql
@@ -8197,11 +8197,13 @@ AS
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3)
ELSE IF @QuotaID = 558 BEGIN -- RAM of VPS2012
- DECLARE @Result1 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
+ DECLARE @Result1 int
+ SET @Result1 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID)
- DECLARE @Result2 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
+ DECLARE @Result2 int
+ SET @Result2 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN ServiceItemProperties AS SIP2 ON
SIP2.ItemID = SI.ItemID AND SIP2.PropertyName = 'DynamicMemory.Enabled' AND SIP2.PropertyValue = 'True'
@@ -8910,6 +8912,12 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe
END
GO
+IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaID] = '572')
+BEGIN
+ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (572, 33, 20, N'VPS2012.ReplicationEnabled', N'Allow user to Replication', 1, 0, NULL, NULL)
+END
+GO
+
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2')
BEGIN
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 33, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1)
@@ -9590,6 +9598,13 @@ IF EXISTS (SELECT * FROM ResourceGroups WHERE GroupName = 'SharePoint')
BEGIN
DECLARE @group_id INT
SELECT @group_id = GroupId FROM ResourceGroups WHERE GroupName = 'SharePoint'
+ DELETE FROM PackageQuotas WHERE QuotaID IN (SELECT QuotaID FROM Quotas WHERE GroupID = @group_id)
+ DELETE FROM HostingPlanQuotas WHERE QuotaID IN (SELECT QuotaID FROM Quotas WHERE GroupID = @group_id)
+ DELETE FROM HostingPlanResources WHERE GroupId = @group_id
+ DELETE FROM PackagesBandwidth WHERE GroupId = @group_id
+ DELETE FROM PackagesDiskspace WHERE GroupId = @group_id
+ DELETE FROM PackageResources WHERE GroupId = @group_id
+ DELETE FROM ResourceGroupDnsRecords WHERE GroupId = @group_id
DELETE FROM Providers WHERE GroupID = @group_id
DELETE FROM Quotas WHERE GroupID = @group_id
DELETE FROM VirtualGroups WHERE GroupID = @group_id
@@ -10020,6 +10035,145 @@ UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetLetterTextBo
GO
+
+
+DECLARE @UserPasswordResetSMSBody nvarchar(2500)
+
+Set @UserPasswordResetSMSBody = N'Password reset link:
+#passwordResetLink#
+'
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'PasswordResetLinkSmsBody', @UserPasswordResetSMSBody)
+END
+ELSE
+UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody'
+GO
+
+-- USER PASSWORD RESET EMAIL PINCODE TEMPLATE
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'From' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'From', N'support@HostingCompany.com')
+END
+GO
+
+DECLARE @UserPasswordResetPincodeLetterHtmlBody nvarchar(2500)
+
+Set @UserPasswordResetPincodeLetterHtmlBody = N'
+
+ Password reset notification
+
+
+
+
+
+
+
+
Password reset notification
+
+
+
+Hello #user.FirstName#,
+
+
+
+
+We received a request to reset the password for your account. Your password reset pincode:
+
+
+#passwordResetPincode#
+
+
+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'UserPasswordResetPincodeLetter' AND [PropertyName]= N'HtmlBody' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'HtmlBody', @UserPasswordResetPincodeLetterHtmlBody)
+END
+ELSE
+UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetPincodeLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'HtmlBody'
+GO
+
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'Priority' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'Priority', N'Normal')
+END
+GO
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'Subject' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'Subject', N'Password reset notification')
+END
+GO
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'LogoUrl' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'LogoUrl', N'https://controlpanel.virtuworks.net/App_Themes/Default/Images/logo.png')
+END
+GO
+
+
+DECLARE @UserPasswordResetPincodeLetterTextBody nvarchar(2500)
+
+Set @UserPasswordResetPincodeLetterTextBody = N'=========================================
+ Password reset notification
+=========================================
+
+
+Hello #user.FirstName#,
+
+
+We received a request to reset the password for your account. Your password reset pincode:
+
+#passwordResetPincode#
+
+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'UserPasswordResetPincodeLetter' AND [PropertyName]= N'TextBody' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'TextBody', @UserPasswordResetPincodeLetterTextBody)
+END
+ELSE
+UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetPincodeLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'TextBody'
+GO
+
+DECLARE @UserPasswordPincodeSMSBody nvarchar(2500)
+
+Set @UserPasswordPincodeSMSBody = N'
+Your password reset pincode:
+#passwordResetPincode#'
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'PasswordResetPincodeSmsBody', @UserPasswordPincodeSMSBody)
+END
+ELSE
+UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordPincodeSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody'
+GO
+
-- Exchange setup EMAIL TEMPLATE
@@ -10289,79 +10443,79 @@ GO
DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500)
-Set @ExchangeMailboxSetupLetterTextBody = N'
-Hello #Account.DisplayName#,
-
-Thanks for choosing VirtuWorks as your Exchange hosting provider.
-
-
-User Accounts
-
-The following user accounts have been created for you.
-
-Username: #Account.UserPrincipalName#
-E-mail: #Account.PrimaryEmailAddress#
-
-Password Reset Url: #PswResetUrl#
-
-
-
-=================================
-DNS
-=================================
-
-In order for us to accept mail for your domain, you will need to point your MX records to:
-
-#SmtpServer#
-
-=================================
-Webmail (OWA, Outlook Web Access)
-=================================
-
-https://mail.virtuworks.net/owa
-
-=================================
-Outlook (Windows Clients)
-=================================
-
-To configure Outlook 2010 to work with VirtuWorks servers, please reference:
-
-https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2
-
-If you need to download and install the Outlook 2010 client:
-
-Outlook 2010 Download URL:
-32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip
-64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip
-KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49
-
-=================================
-ActiveSync, iPhone, iPad
-=================================
-
-Server: #ActiveSyncServer#
-Domain: #SamDomain#
-SSL: must be checked
-Your username: #SamUsername#
-
-=================================
-Password Changes
-=================================
-
-Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net).
-
-
-=================================
-Control Panel
-=================================
-
-If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net).
-
-
-=================================
-Support
-=================================
-
+Set @ExchangeMailboxSetupLetterTextBody = N'
+Hello #Account.DisplayName#,
+
+Thanks for choosing VirtuWorks as your Exchange hosting provider.
+
+
+User Accounts
+
+The following user accounts have been created for you.
+
+Username: #Account.UserPrincipalName#
+E-mail: #Account.PrimaryEmailAddress#
+
+Password Reset Url: #PswResetUrl#
+
+
+
+=================================
+DNS
+=================================
+
+In order for us to accept mail for your domain, you will need to point your MX records to:
+
+#SmtpServer#
+
+=================================
+Webmail (OWA, Outlook Web Access)
+=================================
+
+https://mail.virtuworks.net/owa
+
+=================================
+Outlook (Windows Clients)
+=================================
+
+To configure Outlook 2010 to work with VirtuWorks servers, please reference:
+
+https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2
+
+If you need to download and install the Outlook 2010 client:
+
+Outlook 2010 Download URL:
+32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip
+64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip
+KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49
+
+=================================
+ActiveSync, iPhone, iPad
+=================================
+
+Server: #ActiveSyncServer#
+Domain: #SamDomain#
+SSL: must be checked
+Your username: #SamUsername#
+
+=================================
+Password Changes
+=================================
+
+Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net).
+
+
+=================================
+Control Panel
+=================================
+
+If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net).
+
+
+=================================
+Support
+=================================
+
You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/contact/'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' )
@@ -10674,3 +10828,265 @@ SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
+
+
+IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetSearchObject')
+DROP PROCEDURE GetSearchObject
+GO
+CREATE PROCEDURE [dbo].[GetSearchObject]
+(
+ @ActorID int,
+ @UserID int,
+ @FilterColumn nvarchar(50) = '',
+ @FilterValue nvarchar(50) = '',
+ @StatusID int,
+ @RoleID int,
+ @SortColumn nvarchar(50),
+ @StartRow int,
+ @MaximumRows int = 0,
+ @Recursive bit,
+ @ColType nvarchar(50) = '',
+ @FullType nvarchar(50) = '',
+ @OnlyFind bit
+)
+AS
+
+IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
+RAISERROR('You are not allowed to access this account', 16, 1)
+
+DECLARE @columnUsername nvarchar(20)
+SET @columnUsername = 'Username'
+
+DECLARE @columnEmail nvarchar(20)
+SET @columnEmail = 'Email'
+
+DECLARE @columnCompanyName nvarchar(20)
+SET @columnCompanyName = 'CompanyName'
+
+DECLARE @columnFullName nvarchar(20)
+SET @columnFullName = 'FullName'
+
+DECLARE @curUsers cursor
+DECLARE @curSpace cursor
+
+DECLARE @sqlSpace nvarchar(2000)
+DECLARE @sqlUsers nvarchar(2000)
+DECLARE @sqlReturn nvarchar(4000)
+
+IF @FilterColumn = '' AND @FilterValue <> ''
+SET @FilterColumn = 'TextSearch'
+
+SET @sqlUsers = '
+DECLARE @HasUserRights bit
+SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
+DECLARE @Users TABLE
+(
+ ItemPosition int IDENTITY(0,1),
+ UserID int
+)
+INSERT INTO @Users (UserID)
+SELECT '
+
+IF @OnlyFind = 1
+SET @sqlUsers = @sqlUsers + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
+
+SET @sqlUsers = @sqlUsers + 'U.UserID
+FROM UsersDetailed AS U
+WHERE
+ U.UserID <> @UserID AND U.IsPeer = 0 AND
+ (
+ (@Recursive = 0 AND OwnerID = @UserID) OR
+ (@Recursive = 1 AND dbo.CheckUserParent(@UserID, U.UserID) = 1)
+ )
+ AND ((@StatusID = 0) OR (@StatusID > 0 AND U.StatusID = @StatusID))
+ AND ((@RoleID = 0) OR (@RoleID > 0 AND U.RoleID = @RoleID))
+ AND @HasUserRights = 1
+SET @curValue = cursor local for
+SELECT
+ U.ItemID,
+ U.TextSearch,
+ U.ColumnType,
+ ''Users'' as FullType,
+ 0 as PackageID,
+ 0 as AccountID
+FROM @Users AS TU
+INNER JOIN
+(
+SELECT ItemID, TextSearch, ColumnType
+FROM(
+SELECT U0.UserID as ItemID, U0.Username as TextSearch, @columnUsername as ColumnType
+FROM dbo.Users AS U0
+UNION
+SELECT U1.UserID as ItemID, U1.Email as TextSearch, @columnEmail as ColumnType
+FROM dbo.Users AS U1
+UNION
+SELECT U2.UserID as ItemID, U2.CompanyName as TextSearch, @columnCompanyName as ColumnType
+FROM dbo.Users AS U2
+UNION
+SELECT U3.UserID as ItemID, U3.FirstName + '' '' + U3.LastName as TextSearch, @columnFullName as ColumnType
+FROM dbo.Users AS U3) as U
+WHERE TextSearch<>'' '' OR ISNULL(TextSearch, 0) > 0
+)
+ AS U ON TU.UserID = U.ItemID'
+
+SET @sqlUsers = @sqlUsers + ' open @curValue'
+
+exec sp_executesql @sqlUsers, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @Recursive bit, @StatusID int, @RoleID int, @columnUsername nvarchar(20), @columnEmail nvarchar(20), @columnCompanyName nvarchar(20), @columnFullName nvarchar(20), @curValue cursor output',
+@UserID, @FilterValue, @ActorID, @Recursive, @StatusID, @RoleID, @columnUsername, @columnEmail, @columnCompanyName, @columnFullName, @curValue=@curUsers output
+
+SET @sqlSpace = '
+ DECLARE @ItemsService TABLE
+ (
+ ItemID int
+ )
+ INSERT INTO @ItemsService (ItemID)
+ SELECT '
+
+IF @OnlyFind = 1
+SET @sqlSpace = @sqlSpace + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
+
+SET @sqlSpace = @sqlSpace + 'SI.ItemID
+ FROM ServiceItems AS SI
+ INNER JOIN Packages AS P ON P.PackageID = SI.PackageID
+ INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
+ WHERE
+ dbo.CheckUserParent(@UserID, P.UserID) = 1
+ DECLARE @ItemsDomain TABLE
+ (
+ ItemID int
+ )
+ INSERT INTO @ItemsDomain (ItemID)
+ SELECT
+ D.DomainID
+ FROM Domains AS D
+ INNER JOIN Packages AS P ON P.PackageID = D.PackageID
+ INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
+ WHERE
+ dbo.CheckUserParent(@UserID, P.UserID) = 1
+
+ SET @curValue = cursor local for
+ SELECT
+
+ SI.ItemID as ItemID,
+ SI.ItemName as TextSearch,
+ STYPE.DisplayName as ColumnType,
+ STYPE.DisplayName as FullType,
+ SI.PackageID as PackageID,
+ 0 as AccountID
+ FROM @ItemsService AS I
+ INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
+ INNER JOIN ServiceItemTypes AS STYPE ON SI.ItemTypeID = STYPE.ItemTypeID
+ WHERE STYPE.Searchable = 1
+ UNION
+ SELECT
+ D.DomainID AS ItemID,
+ D.DomainName as TextSearch,
+ ''Domain'' as ColumnType,
+ ''Domain'' as FullType,
+ D.PackageID as PackageID,
+ 0 as AccountID
+ FROM @ItemsDomain AS I
+ INNER JOIN Domains AS D ON I.ItemID = D.DomainID
+ WHERE D.IsDomainPointer=0
+ UNION
+ SELECT
+ EA.ItemID AS ItemID,
+ EA.AccountName as TextSearch,
+ ''ExchangeAccount'' as ColumnType,
+ ''ExchangeAccount'' as FullType,
+ SI2.PackageID as PackageID,
+ EA.AccountID as AccountID
+ FROM @ItemsService AS I2
+ INNER JOIN ServiceItems AS SI2 ON I2.ItemID = SI2.ItemID
+ INNER JOIN ExchangeAccounts AS EA ON I2.ItemID = EA.ItemID
+';
+
+SET @sqlSpace = @sqlSpace + ' open @curValue'
+
+exec sp_executesql @sqlSpace, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @curValue cursor output',
+@UserID, @FilterValue, @ActorID, @curValue=@curSpace output
+
+SET @sqlReturn = '
+DECLARE @ItemID int
+DECLARE @TextSearch nvarchar(500)
+DECLARE @ColumnType nvarchar(50)
+DECLARE @FullType nvarchar(50)
+DECLARE @PackageID int
+DECLARE @AccountID int
+DECLARE @EndRow int
+SET @EndRow = @StartRow + @MaximumRows
+DECLARE @ItemsAll TABLE
+ (
+ ItemPosition int IDENTITY(1,1),
+ ItemID int,
+ TextSearch nvarchar(500),
+ ColumnType nvarchar(50),
+ FullType nvarchar(50),
+ PackageID int,
+ AccountID int
+ )
+
+FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
+WHILE @@FETCH_STATUS = 0
+BEGIN
+INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID)
+VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID)
+FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
+END
+
+FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
+WHILE @@FETCH_STATUS = 0
+BEGIN
+INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID)
+VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID)
+FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID
+END
+
+DECLARE @ItemsReturn TABLE
+ (
+ ItemPosition int IDENTITY(1,1),
+ ItemID int,
+ TextSearch nvarchar(500),
+ ColumnType nvarchar(50),
+ FullType nvarchar(50),
+ PackageID int,
+ AccountID int
+ )
+INSERT INTO @ItemsReturn(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID)
+SELECT ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID
+FROM @ItemsAll AS IA WHERE (1 = 1) '
+
+
+IF @ColType <> ''
+SET @sqlReturn = @sqlReturn + ' AND IA.ColumnType in ( ' + @ColType + ' ) ';
+
+IF @FullType <> ''
+SET @sqlReturn = @sqlReturn + ' AND IA.FullType = ''' + @FullType + '''';
+
+IF @FilterValue <> ''
+SET @sqlReturn = @sqlReturn + ' AND IA.' + @FilterColumn + ' LIKE @FilterValue '
+
+IF @SortColumn <> '' AND @SortColumn IS NOT NULL
+SET @sqlReturn = @sqlReturn + ' ORDER BY ' + @SortColumn + ' '
+SET @sqlReturn = @sqlReturn + '
+SELECT COUNT(ItemID) FROM @ItemsReturn;
+SELECT DISTINCT(ColumnType) FROM @ItemsReturn WHERE (1 = 1) ';
+IF @FullType <> ''
+SET @sqlReturn = @sqlReturn + ' AND FullType = ''' + @FullType + '''';
+SET @sqlReturn = @sqlReturn + '; ';
+SET @sqlReturn = @sqlReturn + '
+SELECT ItemPosition, ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID
+FROM @ItemsReturn AS IR WHERE (1 = 1)
+'
+
+IF @MaximumRows > 0
+SET @sqlReturn = @sqlReturn + ' AND IR.ItemPosition BETWEEN @StartRow AND @EndRow';
+
+exec sp_executesql @sqlReturn, N'@StartRow int, @MaximumRows int, @FilterValue nvarchar(50), @curSpaceValue cursor, @curUsersValue cursor',
+@StartRow, @MaximumRows, @FilterValue, @curSpace, @curUsers
+
+CLOSE @curSpace
+DEALLOCATE @curSpace
+CLOSE @curUsers
+DEALLOCATE @curUsers
+RETURN
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs
index 259d0c53..1850c5bf 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs
@@ -51,7 +51,7 @@ namespace WebsitePanel.EnterpriseServer
private bool isDemo;
private string comments;
private string username;
- private string password;
+// private string password;
private string firstName;
private string lastName;
private string email;
@@ -78,6 +78,39 @@ namespace WebsitePanel.EnterpriseServer
{
}
+ public UserInfo(UserInfo src)
+ {
+ userId = src.userId;
+ ownerId = src.ownerId;
+ roleId = src.roleId;
+ statusId = src.statusId;
+ loginStatusId = src.loginStatusId;
+ failedLogins = src.failedLogins;
+ created = src.created;
+ changed = src.changed;
+ isPeer = src.isPeer;
+ isDemo = src.isDemo;
+ comments = src.comments;
+ username = src.username;
+ firstName = src.firstName;
+ lastName = src.lastName;
+ email = src.email;
+ secondaryEmail = src.secondaryEmail;
+ address = src.address;
+ city = src.city;
+ country = src.country;
+ state = src.state;
+ zip = src.zip;
+ primaryPhone = src.primaryPhone;
+ secondaryPhone = src.secondaryPhone;
+ fax = src.fax;
+ instantMessenger = src.instantMessenger;
+ htmlMail = src.htmlMail;
+ companyName = src.companyName;
+ ecommerceEnabled = src.ecommerceEnabled;
+ subscriberNumber = src.subscriberNumber;
+ }
+
///
/// User role ID:
/// Administrator = 1,
@@ -200,11 +233,11 @@ namespace WebsitePanel.EnterpriseServer
set { this.username = value; }
}
- public string Password
- {
- get { return this.password; }
- set { this.password = value; }
- }
+// public string Password
+// {
+// get { return this.password; }
+// set { this.password = value; }
+// }
public string FirstName
{
@@ -347,7 +380,18 @@ namespace WebsitePanel.EnterpriseServer
{
public ushort VLanID { get; set; }
public string Comment { get; set; }
- }
+ };
+
+ public class UserInfoInternal : UserInfo
+ {
+ private string password;
+
+ public string Password
+ {
+ get { return this.password; }
+ set { this.password = value; }
+ }
+ };
}
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs
index aeaff4d3..c4d011eb 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs
@@ -67,6 +67,7 @@ namespace WebsitePanel.EnterpriseServer
public const string RDS_POLICY = "RdsPolicy";
public const string USER_PASSWORD_EXPIRATION_LETTER = "UserPasswordExpirationLetter";
public const string USER_PASSWORD_RESET_LETTER = "UserPasswordResetLetter";
+ public const string USER_PASSWORD_REQUEST_LETTER = "OrganizationUserPasswordRequestLetter";
public const string USER_PASSWORD_RESET_PINCODE_LETTER = "UserPasswordResetPincodeLetter";
public const string HOSTED_ORGANIZATION_PASSWORD_POLICY = "MailboxPasswordPolicy";
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs
index 3d729acc..33f50dec 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs
@@ -12,7 +12,6 @@
// This source code was auto-generated by wsdl, Version=2.0.50727.3038.
//
-
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.Providers;
using WebsitePanel.Providers.Common;
@@ -37,6 +36,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
[System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))]
public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol {
+ private System.Threading.SendOrPostCallback UpdateSupportServiceLevelOperationCompleted;
+
+ private System.Threading.SendOrPostCallback DeleteSupportServiceLevelOperationCompleted;
+
private System.Threading.SendOrPostCallback AddSupportServiceLevelOperationCompleted;
private System.Threading.SendOrPostCallback GetSupportServiceLevelOperationCompleted;
@@ -93,6 +96,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
private System.Threading.SendOrPostCallback SendResetUserPasswordPincodeEmailOperationCompleted;
+ private System.Threading.SendOrPostCallback SendUserPasswordRequestSmsOperationCompleted;
+
+ private System.Threading.SendOrPostCallback SendUserPasswordRequestEmailOperationCompleted;
+
private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted;
private System.Threading.SendOrPostCallback ChangeOrganizationDomainTypeOperationCompleted;
@@ -165,15 +172,17 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
private System.Threading.SendOrPostCallback GetSupportServiceLevelsOperationCompleted;
- private System.Threading.SendOrPostCallback UpdateSupportServiceLevelOperationCompleted;
-
- private System.Threading.SendOrPostCallback DeleteSupportServiceLevelOperationCompleted;
-
///
public esOrganizations() {
this.Url = "http://localhost:9002/esOrganizations.asmx";
}
+ ///
+ public event UpdateSupportServiceLevelCompletedEventHandler UpdateSupportServiceLevelCompleted;
+
+ ///
+ public event DeleteSupportServiceLevelCompletedEventHandler DeleteSupportServiceLevelCompleted;
+
///
public event AddSupportServiceLevelCompletedEventHandler AddSupportServiceLevelCompleted;
@@ -258,6 +267,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
///
public event SendResetUserPasswordPincodeEmailCompletedEventHandler SendResetUserPasswordPincodeEmailCompleted;
+ ///
+ public event SendUserPasswordRequestSmsCompletedEventHandler SendUserPasswordRequestSmsCompleted;
+
+ ///
+ public event SendUserPasswordRequestEmailCompletedEventHandler SendUserPasswordRequestEmailCompleted;
+
///
public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted;
@@ -367,10 +382,90 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
public event GetSupportServiceLevelsCompletedEventHandler GetSupportServiceLevelsCompleted;
///
- public event UpdateSupportServiceLevelCompletedEventHandler UpdateSupportServiceLevelCompleted;
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) {
+ this.Invoke("UpdateSupportServiceLevel", new object[] {
+ levelID,
+ levelName,
+ levelDescription});
+ }
///
- public event DeleteSupportServiceLevelCompletedEventHandler DeleteSupportServiceLevelCompleted;
+ public System.IAsyncResult BeginUpdateSupportServiceLevel(int levelID, string levelName, string levelDescription, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("UpdateSupportServiceLevel", new object[] {
+ levelID,
+ levelName,
+ levelDescription}, callback, asyncState);
+ }
+
+ ///
+ public void EndUpdateSupportServiceLevel(System.IAsyncResult asyncResult) {
+ this.EndInvoke(asyncResult);
+ }
+
+ ///
+ public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription) {
+ this.UpdateSupportServiceLevelAsync(levelID, levelName, levelDescription, null);
+ }
+
+ ///
+ public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription, object userState) {
+ if ((this.UpdateSupportServiceLevelOperationCompleted == null)) {
+ this.UpdateSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSupportServiceLevelOperationCompleted);
+ }
+ this.InvokeAsync("UpdateSupportServiceLevel", new object[] {
+ levelID,
+ levelName,
+ levelDescription}, this.UpdateSupportServiceLevelOperationCompleted, userState);
+ }
+
+ private void OnUpdateSupportServiceLevelOperationCompleted(object arg) {
+ if ((this.UpdateSupportServiceLevelCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.UpdateSupportServiceLevelCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public ResultObject DeleteSupportServiceLevel(int levelId) {
+ object[] results = this.Invoke("DeleteSupportServiceLevel", new object[] {
+ levelId});
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginDeleteSupportServiceLevel(int levelId, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("DeleteSupportServiceLevel", new object[] {
+ levelId}, callback, asyncState);
+ }
+
+ ///
+ public ResultObject EndDeleteSupportServiceLevel(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public void DeleteSupportServiceLevelAsync(int levelId) {
+ this.DeleteSupportServiceLevelAsync(levelId, null);
+ }
+
+ ///
+ public void DeleteSupportServiceLevelAsync(int levelId, object userState) {
+ if ((this.DeleteSupportServiceLevelOperationCompleted == null)) {
+ this.DeleteSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSupportServiceLevelOperationCompleted);
+ }
+ this.InvokeAsync("DeleteSupportServiceLevel", new object[] {
+ levelId}, this.DeleteSupportServiceLevelOperationCompleted, userState);
+ }
+
+ private void OnDeleteSupportServiceLevelOperationCompleted(object arg) {
+ if ((this.DeleteSupportServiceLevelCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.DeleteSupportServiceLevelCompleted(this, new DeleteSupportServiceLevelCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
@@ -1603,6 +1698,107 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendUserPasswordRequestSms", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public ResultObject SendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo) {
+ object[] results = this.Invoke("SendUserPasswordRequestSms", new object[] {
+ itemId,
+ accountId,
+ reason,
+ phoneTo});
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginSendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("SendUserPasswordRequestSms", new object[] {
+ itemId,
+ accountId,
+ reason,
+ phoneTo}, callback, asyncState);
+ }
+
+ ///
+ public ResultObject EndSendUserPasswordRequestSms(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public void SendUserPasswordRequestSmsAsync(int itemId, int accountId, string reason, string phoneTo) {
+ this.SendUserPasswordRequestSmsAsync(itemId, accountId, reason, phoneTo, null);
+ }
+
+ ///
+ public void SendUserPasswordRequestSmsAsync(int itemId, int accountId, string reason, string phoneTo, object userState) {
+ if ((this.SendUserPasswordRequestSmsOperationCompleted == null)) {
+ this.SendUserPasswordRequestSmsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendUserPasswordRequestSmsOperationCompleted);
+ }
+ this.InvokeAsync("SendUserPasswordRequestSms", new object[] {
+ itemId,
+ accountId,
+ reason,
+ phoneTo}, this.SendUserPasswordRequestSmsOperationCompleted, userState);
+ }
+
+ private void OnSendUserPasswordRequestSmsOperationCompleted(object arg) {
+ if ((this.SendUserPasswordRequestSmsCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.SendUserPasswordRequestSmsCompleted(this, new SendUserPasswordRequestSmsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendUserPasswordRequestEmail", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public void SendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep) {
+ this.Invoke("SendUserPasswordRequestEmail", new object[] {
+ itemId,
+ accountId,
+ reason,
+ mailTo,
+ finalStep});
+ }
+
+ ///
+ public System.IAsyncResult BeginSendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("SendUserPasswordRequestEmail", new object[] {
+ itemId,
+ accountId,
+ reason,
+ mailTo,
+ finalStep}, callback, asyncState);
+ }
+
+ ///
+ public void EndSendUserPasswordRequestEmail(System.IAsyncResult asyncResult) {
+ this.EndInvoke(asyncResult);
+ }
+
+ ///
+ public void SendUserPasswordRequestEmailAsync(int itemId, int accountId, string reason, string mailTo, bool finalStep) {
+ this.SendUserPasswordRequestEmailAsync(itemId, accountId, reason, mailTo, finalStep, null);
+ }
+
+ ///
+ public void SendUserPasswordRequestEmailAsync(int itemId, int accountId, string reason, string mailTo, bool finalStep, object userState) {
+ if ((this.SendUserPasswordRequestEmailOperationCompleted == null)) {
+ this.SendUserPasswordRequestEmailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendUserPasswordRequestEmailOperationCompleted);
+ }
+ this.InvokeAsync("SendUserPasswordRequestEmail", new object[] {
+ itemId,
+ accountId,
+ reason,
+ mailTo,
+ finalStep}, this.SendUserPasswordRequestEmailOperationCompleted, userState);
+ }
+
+ private void OnSendUserPasswordRequestEmailOperationCompleted(object arg) {
+ if ((this.SendUserPasswordRequestEmailCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.SendUserPasswordRequestEmailCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int AddOrganizationDomain(int itemId, string domainName) {
@@ -3517,98 +3713,42 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) {
- this.Invoke("UpdateSupportServiceLevel", new object[] {
- levelID,
- levelName,
- levelDescription});
- }
-
- ///
- public System.IAsyncResult BeginUpdateSupportServiceLevel(int levelID, string levelName, string levelDescription, System.AsyncCallback callback, object asyncState) {
- return this.BeginInvoke("UpdateSupportServiceLevel", new object[] {
- levelID,
- levelName,
- levelDescription}, callback, asyncState);
- }
-
- ///
- public void EndUpdateSupportServiceLevel(System.IAsyncResult asyncResult) {
- this.EndInvoke(asyncResult);
- }
-
- ///
- public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription) {
- this.UpdateSupportServiceLevelAsync(levelID, levelName, levelDescription, null);
- }
-
- ///
- public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription, object userState) {
- if ((this.UpdateSupportServiceLevelOperationCompleted == null)) {
- this.UpdateSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSupportServiceLevelOperationCompleted);
- }
- this.InvokeAsync("UpdateSupportServiceLevel", new object[] {
- levelID,
- levelName,
- levelDescription}, this.UpdateSupportServiceLevelOperationCompleted, userState);
- }
-
- private void OnUpdateSupportServiceLevelOperationCompleted(object arg) {
- if ((this.UpdateSupportServiceLevelCompleted != null)) {
- System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
- this.UpdateSupportServiceLevelCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
- }
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public ResultObject DeleteSupportServiceLevel(int levelId) {
- object[] results = this.Invoke("DeleteSupportServiceLevel", new object[] {
- levelId});
- return ((ResultObject)(results[0]));
- }
-
- ///
- public System.IAsyncResult BeginDeleteSupportServiceLevel(int levelId, System.AsyncCallback callback, object asyncState) {
- return this.BeginInvoke("DeleteSupportServiceLevel", new object[] {
- levelId}, callback, asyncState);
- }
-
- ///
- public ResultObject EndDeleteSupportServiceLevel(System.IAsyncResult asyncResult) {
- object[] results = this.EndInvoke(asyncResult);
- return ((ResultObject)(results[0]));
- }
-
- ///
- public void DeleteSupportServiceLevelAsync(int levelId) {
- this.DeleteSupportServiceLevelAsync(levelId, null);
- }
-
- ///
- public void DeleteSupportServiceLevelAsync(int levelId, object userState) {
- if ((this.DeleteSupportServiceLevelOperationCompleted == null)) {
- this.DeleteSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSupportServiceLevelOperationCompleted);
- }
- this.InvokeAsync("DeleteSupportServiceLevel", new object[] {
- levelId}, this.DeleteSupportServiceLevelOperationCompleted, userState);
- }
-
- private void OnDeleteSupportServiceLevelOperationCompleted(object arg) {
- if ((this.DeleteSupportServiceLevelCompleted != null)) {
- System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
- this.DeleteSupportServiceLevelCompleted(this, new DeleteSupportServiceLevelCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
- }
- }
-
///
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void UpdateSupportServiceLevelCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void DeleteSupportServiceLevelCompletedEventHandler(object sender, DeleteSupportServiceLevelCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class DeleteSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal DeleteSupportServiceLevelCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ ///
+ public ResultObject Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((ResultObject)(this.results[0]));
+ }
+ }
+ }
+
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddSupportServiceLevelCompletedEventHandler(object sender, AddSupportServiceLevelCompletedEventArgs e);
@@ -4227,6 +4367,36 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void SendUserPasswordRequestSmsCompletedEventHandler(object sender, SendUserPasswordRequestSmsCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class SendUserPasswordRequestSmsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal SendUserPasswordRequestSmsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ ///
+ public ResultObject Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((ResultObject)(this.results[0]));
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void SendUserPasswordRequestEmailCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
+
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e);
@@ -5096,34 +5266,4 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
}
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
- public delegate void UpdateSupportServiceLevelCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
- public delegate void DeleteSupportServiceLevelCompletedEventHandler(object sender, DeleteSupportServiceLevelCompletedEventArgs e);
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- public partial class DeleteSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
-
- private object[] results;
-
- internal DeleteSupportServiceLevelCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
- base(exception, cancelled, userState) {
- this.results = results;
- }
-
- ///
- public ResultObject Result {
- get {
- this.RaiseExceptionIfNecessary();
- return ((ResultObject)(this.results[0]));
- }
- }
- }
}
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/SystemProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/SystemProxy.cs
index d96d0a27..9cf076a6 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/SystemProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/SystemProxy.cs
@@ -31,6 +31,8 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback GetSystemSettingsActiveOperationCompleted;
+ private System.Threading.SendOrPostCallback CheckIsTwilioEnabledOperationCompleted;
+
private System.Threading.SendOrPostCallback SetSystemSettingsOperationCompleted;
///
@@ -44,6 +46,9 @@ namespace WebsitePanel.EnterpriseServer {
///
public event GetSystemSettingsActiveCompletedEventHandler GetSystemSettingsActiveCompleted;
+ ///
+ public event CheckIsTwilioEnabledCompletedEventHandler CheckIsTwilioEnabledCompleted;
+
///
public event SetSystemSettingsCompletedEventHandler SetSystemSettingsCompleted;
@@ -132,6 +137,44 @@ namespace WebsitePanel.EnterpriseServer {
}
}
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckIsTwilioEnabled", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public bool CheckIsTwilioEnabled() {
+ object[] results = this.Invoke("CheckIsTwilioEnabled", new object[0]);
+ return ((bool)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginCheckIsTwilioEnabled(System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("CheckIsTwilioEnabled", new object[0], callback, asyncState);
+ }
+
+ ///
+ public bool EndCheckIsTwilioEnabled(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((bool)(results[0]));
+ }
+
+ ///
+ public void CheckIsTwilioEnabledAsync() {
+ this.CheckIsTwilioEnabledAsync(null);
+ }
+
+ ///
+ public void CheckIsTwilioEnabledAsync(object userState) {
+ if ((this.CheckIsTwilioEnabledOperationCompleted == null)) {
+ this.CheckIsTwilioEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckIsTwilioEnabledOperationCompleted);
+ }
+ this.InvokeAsync("CheckIsTwilioEnabled", new object[0], this.CheckIsTwilioEnabledOperationCompleted, userState);
+ }
+
+ private void OnCheckIsTwilioEnabledOperationCompleted(object arg) {
+ if ((this.CheckIsTwilioEnabledCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.CheckIsTwilioEnabledCompleted(this, new CheckIsTwilioEnabledCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSystemSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int SetSystemSettings(string settingsName, SystemSettings settings) {
@@ -234,6 +277,32 @@ namespace WebsitePanel.EnterpriseServer {
}
}
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void CheckIsTwilioEnabledCompletedEventHandler(object sender, CheckIsTwilioEnabledCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class CheckIsTwilioEnabledCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal CheckIsTwilioEnabledCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ ///
+ public bool Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((bool)(this.results[0]));
+ }
+ }
+ }
+
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SetSystemSettingsCompletedEventHandler(object sender, SetSystemSettingsCompletedEventArgs e);
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs
index d19bafce..0b3fc9dd 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs
@@ -840,20 +840,23 @@ namespace WebsitePanel.EnterpriseServer
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddUser", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public int AddUser(UserInfo user, bool sendLetter)
+ public int AddUser(UserInfo user, bool sendLetter, string password)
{
object[] results = this.Invoke("AddUser", new object[] {
user,
- sendLetter});
+ sendLetter,
+ password
+ });
return ((int)(results[0]));
}
///
- public System.IAsyncResult BeginAddUser(UserInfo user, bool sendLetter, System.AsyncCallback callback, object asyncState)
+ public System.IAsyncResult BeginAddUser(UserInfo user, bool sendLetter, string password, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("AddUser", new object[] {
user,
- sendLetter}, callback, asyncState);
+ sendLetter,
+ password}, callback, asyncState);
}
///
@@ -864,13 +867,13 @@ namespace WebsitePanel.EnterpriseServer
}
///
- public void AddUserAsync(UserInfo user, bool sendLetter)
+ public void AddUserAsync(UserInfo user, bool sendLetter, string password)
{
- this.AddUserAsync(user, sendLetter, null);
+ this.AddUserAsync(user, sendLetter, password, null);
}
///
- public void AddUserAsync(UserInfo user, bool sendLetter, object userState)
+ public void AddUserAsync(UserInfo user, bool sendLetter, string password, object userState)
{
if ((this.AddUserOperationCompleted == null))
{
@@ -878,7 +881,8 @@ namespace WebsitePanel.EnterpriseServer
}
this.InvokeAsync("AddUser", new object[] {
user,
- sendLetter}, this.AddUserOperationCompleted, userState);
+ sendLetter,
+ password}, this.AddUserOperationCompleted, userState);
}
private void OnAddUserOperationCompleted(object arg)
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs
index eb81f69f..1902f125 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs
@@ -69,7 +69,7 @@ namespace WebsitePanel.EnterpriseServer
protected override string AuthenticateToken(UsernameToken token)
{
// try to load user account
- UserInfo user = UserController.GetUserInternally(token.Username);
+ UserInfoInternal user = UserController.GetUserInternally(token.Username);
if (user == null)
return null;
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs
index aac2727c..0d870c89 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs
@@ -182,7 +182,7 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer.ContractSystem
//
if (customerId > -1)
{
- ES.UserInfo userInfo = (internally) ? ES.UserController.GetUserInternally(customerId) :
+ ES.UserInfoInternal userInfo = (internally) ? ES.UserController.GetUserInternally(customerId) :
ES.UserController.GetUser(customerId);
//
if (internally)
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs
index a4140b9e..c50b4aba 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs
@@ -520,12 +520,12 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer
return settings;
}
- private CommandParams PrepeareAccountParams(UserInfo userInfo)
+ private CommandParams PrepeareAccountParams(UserInfo userInfo, string password)
{
CommandParams args = new CommandParams();
args[CommandParams.USERNAME] = userInfo.Username;
- args[CommandParams.PASSWORD] = userInfo.Password;
+ args[CommandParams.PASSWORD] = password;
args[CommandParams.FIRST_NAME] = userInfo.FirstName;
args[CommandParams.LAST_NAME] = userInfo.LastName;
args[CommandParams.EMAIL] = userInfo.Email;
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs
index e749e42c..b4906d20 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs
@@ -113,7 +113,7 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer
// create user account
ES.UserInfo userInfo = new ES.UserInfo();
userInfo.Username = account[ContractAccount.USERNAME];
- userInfo.Password = account[ContractAccount.PASSWORD];
+// userInfo.Password = account[ContractAccount.PASSWORD];
userInfo.Email = account[ContractAccount.EMAIL];
userInfo.FirstName = account[ContractAccount.FIRST_NAME];
userInfo.LastName = account[ContractAccount.LAST_NAME];
@@ -133,7 +133,7 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer
userInfo.OwnerId = contract.ResellerId;
userInfo.Created = DateTime.Now;
// create account
- int resultCode = ES.UserController.AddUser(userInfo, true);
+ int resultCode = ES.UserController.AddUser(userInfo, true, account[ContractAccount.PASSWORD]);
//
if (resultCode > 0)
{
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs
index 05fbb37b..e33e9be2 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs
@@ -1632,6 +1632,73 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
+ public static ResultObject SendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo = null)
+ {
+ var result = TaskManager.StartResultTask("ORGANIZATION", "SEND_USER_PASSWORD_REQUEST_SMS",
+ itemId);
+
+ try
+ {
+
+ // load organization
+ Organization org = GetOrganization(itemId);
+
+ if (org == null)
+ {
+ throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId));
+ }
+
+ UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
+ OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
+
+ user.ItemId = itemId;
+
+ if (string.IsNullOrEmpty(phoneTo))
+ {
+ phoneTo = user.MobilePhone;
+ }
+
+ UserSettings settings = UserController.GetUserSettings(owner.UserId, UserSettings.USER_PASSWORD_REQUEST_LETTER);
+
+
+ string body = settings["SMSBody"];
+
+ var pincode = GeneratePincode();
+ Guid token;
+
+ var items = new Hashtable();
+
+ items["passwordResetLink"] = GenerateUserPasswordResetLink(user.ItemId, user.AccountId, out token, pincode);
+
+ body = PackageController.EvaluateTemplate(body, items);
+
+ TaskManager.Write("Organization ID : " + user.ItemId);
+ TaskManager.Write("Account : " + user.DisplayName);
+ TaskManager.Write("Reason : " + reason);
+ TaskManager.Write("SmsTo : " + phoneTo);
+
+ // send Sms message
+ var response = SendSms(phoneTo, body);
+
+ if (response.RestException != null)
+ {
+ throw new Exception(response.RestException.Message);
+ }
+
+ SetAccessTokenResponse(token, pincode);
+ }
+ catch (Exception ex)
+ {
+ TaskManager.WriteError(ex);
+ TaskManager.CompleteResultTask(result);
+ result.AddError("", ex);
+ return result;
+ }
+
+ TaskManager.CompleteResultTask();
+ return result;
+ }
+
public static ResultObject SendResetUserPasswordPincodeSms(Guid token, string phoneTo = null)
{
var result = TaskManager.StartResultTask("ORGANIZATION", "SEND_USER_PASSWORD_RESET_SMS_PINCODE");
@@ -1851,6 +1918,33 @@ namespace WebsitePanel.EnterpriseServer
SendUserPasswordEmail(owner, user, reason, mailTo, logoUrl, UserSettings.USER_PASSWORD_RESET_LETTER, "USER_PASSWORD_RESET_LETTER", finalStep);
}
+ public static void SendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep)
+ {
+ // load organization
+ Organization org = GetOrganization(itemId);
+
+ if (org == null)
+ {
+ throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId));
+ }
+
+ UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
+ OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
+
+ user.ItemId = itemId;
+
+ if (string.IsNullOrEmpty(mailTo))
+ {
+ mailTo = user.PrimaryEmailAddress;
+ }
+
+ var generalSettings = OrganizationController.GetOrganizationGeneralSettings(itemId);
+
+ var logoUrl = generalSettings != null ? generalSettings.OrganizationLogoUrl : string.Empty;
+
+ SendUserPasswordEmail(owner, user, reason, mailTo, logoUrl, UserSettings.USER_PASSWORD_REQUEST_LETTER, "USER_PASSWORD_REQUEST_LETTER", finalStep);
+ }
+
public static void SendUserExpirationPasswordEmail(UserInfo owner, OrganizationUser user, string reason,
string mailTo, string logoUrl)
{
@@ -1919,8 +2013,6 @@ namespace WebsitePanel.EnterpriseServer
}
}
-
-
public static AccessToken GetAccessToken(Guid accessToken, AccessTokenTypes type)
{
return ObjectUtils.FillObjectFromDataReader(DataProvider.GetAccessTokenByAccessToken(accessToken, type));
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs
index ba78d84c..56aab96f 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs
@@ -422,7 +422,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
// load user info
- UserInfo user = UserController.GetUser(userId);
+ UserInfoInternal user = UserController.GetUser(userId);
if (createFtpAccount)
{
@@ -2086,7 +2086,7 @@ namespace WebsitePanel.EnterpriseServer
items["user"] = user;
// get reseller details
- UserInfo reseller = UserController.GetUser(user.OwnerId);
+ UserInfoInternal reseller = UserController.GetUser(user.OwnerId);
if (reseller != null)
{
reseller.Password = "";
@@ -2123,7 +2123,7 @@ namespace WebsitePanel.EnterpriseServer
items["user"] = user;
// get reseller details
- UserInfo reseller = UserController.GetUser(user.OwnerId);
+ UserInfoInternal reseller = UserController.GetUser(user.OwnerId);
if (reseller != null)
{
reseller.Password = "";
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs
index b28248a6..7c05d896 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs
@@ -112,10 +112,12 @@ namespace WebsitePanel.EnterpriseServer
UserInfo user = PackageController.GetPackageOwner(item.PackageId);
if (user != null)
{
+ UserInfoInternal userInternal = UserController.GetUserInternally(user.UserId);
+
site.StatisticsUrl = Utils.ReplaceStringVariable(site.StatisticsUrl, "username",
- HttpUtility.UrlEncode(user.Username));
+ HttpUtility.UrlEncode(userInternal.Username));
site.StatisticsUrl = Utils.ReplaceStringVariable(site.StatisticsUrl, "password",
- HttpUtility.UrlEncode(user.Password));
+ HttpUtility.UrlEncode(userInternal.Password));
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs
index 1da3365d..2301a79c 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs
@@ -202,5 +202,15 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.CompleteTask();
}
}
+
+ public static bool CheckIsTwilioEnabled()
+ {
+ var settings = SystemController.GetSystemSettingsActive(SystemSettings.TWILIO_SETTINGS, false);
+
+ return settings != null
+ && !string.IsNullOrEmpty(settings.GetValueOrDefault(SystemSettings.TWILIO_ACCOUNTSID_KEY, string.Empty))
+ && !string.IsNullOrEmpty(settings.GetValueOrDefault(SystemSettings.TWILIO_AUTHTOKEN_KEY, string.Empty))
+ && !string.IsNullOrEmpty(settings.GetValueOrDefault(SystemSettings.TWILIO_PHONEFROM_KEY, string.Empty));
+ }
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs
index de9d56c3..fabe98bc 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs
@@ -58,7 +58,7 @@ namespace WebsitePanel.EnterpriseServer
try
{
// try to get user from database
- UserInfo user = GetUserInternally(username);
+ UserInfoInternal user = GetUserInternally(username);
// check if the user exists
if (user == null)
@@ -99,7 +99,7 @@ namespace WebsitePanel.EnterpriseServer
// compare user passwords
- if (user.Password != password)
+ if (CryptoUtils.SHA1(user.Password) != password)
{
if (lockOut >= 0)
DataProvider.UpdateUserFailedLoginAttempt(user.UserId, lockOut, false);
@@ -145,7 +145,7 @@ namespace WebsitePanel.EnterpriseServer
try
{
// try to get user from database
- UserInfo user = GetUserInternally(username);
+ UserInfoInternal user = GetUserInternally(username);
// check if the user exists
if (user == null)
@@ -155,8 +155,8 @@ namespace WebsitePanel.EnterpriseServer
}
// compare user passwords
- if (user.Password == password)
- return user;
+ if (CryptoUtils.SHA1(user.Password) == password)
+ return new UserInfo(user);
return null;
}
@@ -239,7 +239,7 @@ namespace WebsitePanel.EnterpriseServer
items["Email"] = true;
// get reseller details
- UserInfo reseller = UserController.GetUser(user.OwnerId);
+ UserInfoInternal reseller = UserController.GetUser(user.OwnerId);
if (reseller != null)
{
reseller.Password = "";
@@ -264,10 +264,10 @@ namespace WebsitePanel.EnterpriseServer
}
}
- internal static UserInfo GetUserInternally(int userId)
+ internal static UserInfoInternal GetUserInternally(int userId)
{
// try to get user from database
- UserInfo user = ObjectUtils.FillObjectFromDataReader(
+ UserInfoInternal user = ObjectUtils.FillObjectFromDataReader(
DataProvider.GetUserByIdInternally(userId));
if (user != null)
@@ -275,10 +275,10 @@ namespace WebsitePanel.EnterpriseServer
return user;
}
- internal static UserInfo GetUserInternally(string username)
+ internal static UserInfoInternal GetUserInternally(string username)
{
// try to get user from database
- UserInfo user = ObjectUtils.FillObjectFromDataReader(
+ UserInfoInternal user = ObjectUtils.FillObjectFromDataReader(
DataProvider.GetUserByUsernameInternally(username));
if (user != null)
@@ -288,10 +288,10 @@ namespace WebsitePanel.EnterpriseServer
return user;
}
- public static UserInfo GetUser(int userId)
+ public static UserInfoInternal GetUser(int userId)
{
// try to get user from database
- UserInfo user = ObjectUtils.FillObjectFromDataReader(
+ UserInfoInternal user = ObjectUtils.FillObjectFromDataReader(
DataProvider.GetUserById(SecurityContext.User.UserId, userId));
if (user != null)
@@ -299,10 +299,10 @@ namespace WebsitePanel.EnterpriseServer
return user;
}
- public static UserInfo GetUser(string username)
+ public static UserInfoInternal GetUser(string username)
{
// try to get user from database
- UserInfo user = ObjectUtils.FillObjectFromDataReader(
+ UserInfoInternal user = ObjectUtils.FillObjectFromDataReader(
DataProvider.GetUserByUsername(SecurityContext.User.UserId, username));
if (user != null)
@@ -381,7 +381,7 @@ namespace WebsitePanel.EnterpriseServer
return DataProvider.GetUsers(SecurityContext.User.UserId, ownerId, recursive);
}
- public static int AddUser(UserInfo user, bool sendLetter)
+ public static int AddUser(UserInfo user, bool sendLetter, string password)
{
// check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo);
@@ -424,7 +424,7 @@ namespace WebsitePanel.EnterpriseServer
user.IsPeer,
user.Comments,
user.Username.Trim(),
- CryptoUtils.Encrypt(user.Password),
+ CryptoUtils.Encrypt(password),
user.FirstName,
user.LastName,
user.Email,
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs
index e343fccd..d283dfbf 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs
@@ -119,11 +119,11 @@ namespace WebsitePanel.EnterpriseServer
user.Email = email;
user.SecondaryEmail = secondaryEmail;
user.Username = username;
- user.Password = password;
+// user.Password = password;
user.HtmlMail = htmlMail;
// add a new user
- createdUserId = UserController.AddUser(user, false);
+ createdUserId = UserController.AddUser(user, false, password);
if (createdUserId < 0)
{
// exit
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs
index 3e6c1188..8e87cb8b 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs
@@ -211,6 +211,18 @@ namespace WebsitePanel.EnterpriseServer
}
+ [WebMethod]
+ public ResultObject SendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo)
+ {
+ return OrganizationController.SendUserPasswordRequestSms(itemId, accountId, reason, phoneTo);
+ }
+
+ [WebMethod]
+ public void SendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep)
+ {
+ OrganizationController.SendUserPasswordRequestEmail(itemId, accountId, reason, mailTo, finalStep);
+ }
+
#endregion
#region Domains
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs
index 26c44aee..48b23cc0 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs
@@ -59,6 +59,12 @@ namespace WebsitePanel.EnterpriseServer
return SystemController.GetSystemSettingsActive(settingsName, decrypt);
}
+ [WebMethod]
+ public bool CheckIsTwilioEnabled()
+ {
+ return SystemController.CheckIsTwilioEnabled();
+ }
+
[WebMethod]
public int SetSystemSettings(string settingsName, SystemSettings settings)
{
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs
index 64ccb43d..eea1c318 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs
@@ -57,13 +57,15 @@ namespace WebsitePanel.EnterpriseServer
[WebMethod]
public UserInfo GetUserById(int userId)
{
- return UserController.GetUser(userId);
+ UserInfoInternal uinfo = UserController.GetUser(userId);
+ return (uinfo != null) ? new UserInfo(uinfo) : null;
}
[WebMethod]
public UserInfo GetUserByUsername(string username)
{
- return UserController.GetUser(username);
+ UserInfoInternal uinfo = UserController.GetUser(username);
+ return (uinfo != null) ? new UserInfo(uinfo) : null;
}
[WebMethod]
@@ -136,9 +138,9 @@ namespace WebsitePanel.EnterpriseServer
}
[WebMethod]
- public int AddUser(UserInfo user, bool sendLetter)
+ public int AddUser(UserInfo user, bool sendLetter, string password)
{
- return UserController.AddUser(user, sendLetter);
+ return UserController.AddUser(user, sendLetter, password);
}
[WebMethod]
@@ -175,7 +177,7 @@ namespace WebsitePanel.EnterpriseServer
user.IsPeer = isPeer;
user.IsDemo = isDemo;
user.Username = username;
- user.Password = password;
+// user.Password = password;
user.FirstName = firstName;
user.LastName = lastName;
user.Email = email;
@@ -192,7 +194,7 @@ namespace WebsitePanel.EnterpriseServer
user.HtmlMail = htmlMail;
user.CompanyName = companyName;
user.EcommerceEnabled = ecommerceEnabled;
- return UserController.AddUser(user, sendLetter);
+ return UserController.AddUser(user, sendLetter, password);
}
[WebMethod]
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs
index 02dead74..28e536b7 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs
@@ -4479,7 +4479,7 @@ namespace WebsitePanel.Providers.HostedSolution
{
ExchangeLog.LogStart("CheckOrganizationPublicFolderMailbox");
- Collection result = GetPublicFolderMailbox(runSpace, orgCanonicalName, GetPublicFolderMailboxName(organizationId));
+ Collection result = GetPublicFolderMailbox(runSpace, orgCanonicalName, GetPublicFolderMailboxName(organizationId), true);
if (result == null || result.Count == 0)
{
ExchangeTransaction transaction = StartTransaction();
@@ -4501,7 +4501,7 @@ namespace WebsitePanel.Providers.HostedSolution
{
ExchangeLog.LogStart("CheckOrganizationRootFolder");
- Collection result = GetPublicFolderObject(runSpace, orgCanonicalName+"/"+GetPublicFolderMailboxName(organizationId), "\\" + folder);
+ Collection result = GetPublicFolderObject(runSpace, orgCanonicalName+"/"+GetPublicFolderMailboxName(organizationId), "\\" + folder, true);
if (result == null || result.Count == 0)
{
ExchangeTransaction transaction = StartTransaction();
@@ -4617,22 +4617,22 @@ namespace WebsitePanel.Providers.HostedSolution
ExchangeLog.LogEnd("DeletePublicFolderInternal");
}
- private Collection GetPublicFolderObject(Runspace runSpace, string mailbox, string id)
+ private Collection GetPublicFolderObject(Runspace runSpace, string mailbox, string id, bool checkExist = false)
{
Command cmd = new Command("Get-PublicFolder");
cmd.Parameters.Add("Identity", id);
//cmd.Parameters.Add("Mailbox", mailbox);
- Collection result = ExecuteShellCommand(runSpace, cmd);
+ Collection result = ExecuteShellCommand(runSpace, cmd, true, !checkExist);
return result;
}
- private Collection GetPublicFolderMailbox(Runspace runSpace, string organizationDistinguishedName, string name)
+ private Collection GetPublicFolderMailbox(Runspace runSpace, string organizationDistinguishedName, string name, bool checkExist)
{
Command cmd = new Command("Get-Mailbox");
cmd.Parameters.Add("Identity", name);
cmd.Parameters.Add("PublicFolder");
cmd.Parameters.Add("OrganizationalUnit", organizationDistinguishedName);
- Collection result = ExecuteShellCommand(runSpace, cmd);
+ Collection result = ExecuteShellCommand(runSpace, cmd, true, !checkExist);
return result;
}
@@ -5369,7 +5369,7 @@ namespace WebsitePanel.Providers.HostedSolution
string resultObjectDN = null;
Command cmd = new Command("Get-AddressList");
cmd.Parameters.Add("Identity", id);
- Collection result = this.ExecuteShellCommand(runSpace, cmd);
+ Collection result = this.ExecuteShellCommand(runSpace, cmd, true, false);
if ((result != null) && (result.Count > 0))
{
resultObjectDN = this.GetResultObjectDN(result);
@@ -6242,13 +6242,19 @@ namespace WebsitePanel.Providers.HostedSolution
internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd)
{
- return ExecuteShellCommand(runSpace, cmd, true);
+ return ExecuteShellCommand(runSpace, cmd, true, true);
}
internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController)
{
object[] errors;
- return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors);
+ return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors, true);
+ }
+
+ internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, bool writeErrorExchangeLog)
+ {
+ object[] errors;
+ return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors, writeErrorExchangeLog);
}
internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, ResultObject res)
@@ -6272,10 +6278,10 @@ namespace WebsitePanel.Providers.HostedSolution
internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, out object[] errors)
{
- return ExecuteShellCommand(runSpace, cmd, true, out errors);
+ return ExecuteShellCommand(runSpace, cmd, true, out errors, true);
}
- internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, out object[] errors)
+ internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, out object[] errors, bool writeErrorExchangeLog)
{
ExchangeLog.LogStart("ExecuteShellCommand");
List