Merge
This commit is contained in:
commit
4d0d90eac3
25 changed files with 888 additions and 133 deletions
|
@ -10031,6 +10031,37 @@ 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
|
||||
|
||||
|
||||
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'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody' )
|
||||
BEGIN
|
||||
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'PasswordResetPincodeSmsBody', @UserPasswordPincodeSMSBody)
|
||||
END
|
||||
ELSE
|
||||
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordPincodeSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody'
|
||||
GO
|
||||
|
||||
-- Exchange setup EMAIL TEMPLATE
|
||||
|
||||
|
||||
|
@ -10300,79 +10331,79 @@ GO
|
|||
|
||||
DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500)
|
||||
|
||||
Set @ExchangeMailboxSetupLetterTextBody = N'<ad:if test="#Email#">
|
||||
Hello #Account.DisplayName#,
|
||||
|
||||
Thanks for choosing VirtuWorks as your Exchange hosting provider.
|
||||
</ad:if>
|
||||
<ad:if test="#not(PMM)#">
|
||||
User Accounts
|
||||
|
||||
The following user accounts have been created for you.
|
||||
|
||||
Username: #Account.UserPrincipalName#
|
||||
E-mail: #Account.PrimaryEmailAddress#
|
||||
<ad:if test="#PswResetUrl#">
|
||||
Password Reset Url: #PswResetUrl#
|
||||
</ad:if>
|
||||
</ad:if>
|
||||
|
||||
=================================
|
||||
DNS
|
||||
=================================
|
||||
|
||||
In order for us to accept mail for your domain, you will need to point your MX records to:
|
||||
|
||||
<ad:foreach collection="#SmtpServers#" var="SmtpServer" index="i">#SmtpServer#</ad:foreach>
|
||||
|
||||
=================================
|
||||
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'<ad:if test="#Email#">
|
||||
Hello #Account.DisplayName#,
|
||||
|
||||
Thanks for choosing VirtuWorks as your Exchange hosting provider.
|
||||
</ad:if>
|
||||
<ad:if test="#not(PMM)#">
|
||||
User Accounts
|
||||
|
||||
The following user accounts have been created for you.
|
||||
|
||||
Username: #Account.UserPrincipalName#
|
||||
E-mail: #Account.PrimaryEmailAddress#
|
||||
<ad:if test="#PswResetUrl#">
|
||||
Password Reset Url: #PswResetUrl#
|
||||
</ad:if>
|
||||
</ad:if>
|
||||
|
||||
=================================
|
||||
DNS
|
||||
=================================
|
||||
|
||||
In order for us to accept mail for your domain, you will need to point your MX records to:
|
||||
|
||||
<ad:foreach collection="#SmtpServers#" var="SmtpServer" index="i">#SmtpServer#</ad:foreach>
|
||||
|
||||
=================================
|
||||
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' )
|
||||
|
|
6
WebsitePanel/Sources/Tools/.nuget/NuGet.Config
Normal file
6
WebsitePanel/Sources/Tools/.nuget/NuGet.Config
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<solution>
|
||||
<add key="disableSourceControlIntegration" value="true" />
|
||||
</solution>
|
||||
</configuration>
|
BIN
WebsitePanel/Sources/Tools/.nuget/NuGet.exe
Normal file
BIN
WebsitePanel/Sources/Tools/.nuget/NuGet.exe
Normal file
Binary file not shown.
144
WebsitePanel/Sources/Tools/.nuget/NuGet.targets
Normal file
144
WebsitePanel/Sources/Tools/.nuget/NuGet.targets
Normal file
|
@ -0,0 +1,144 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
||||
|
||||
<!-- Enable the restore command to run before builds -->
|
||||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
|
||||
|
||||
<!-- Property that enables building a package from a project -->
|
||||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
||||
|
||||
<!-- Determines if package restore consent is required to restore packages -->
|
||||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
||||
|
||||
<!-- Download NuGet.exe if it does not already exist -->
|
||||
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
||||
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
|
||||
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
|
||||
<!--
|
||||
<PackageSource Include="https://www.nuget.org/api/v2/" />
|
||||
<PackageSource Include="https://my-nuget-source/nuget/" />
|
||||
-->
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
||||
<!-- Windows specific commands -->
|
||||
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
||||
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
|
||||
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
|
||||
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet command -->
|
||||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
|
||||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
||||
|
||||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
||||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
|
||||
|
||||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
||||
|
||||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
||||
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
|
||||
|
||||
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
|
||||
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
|
||||
|
||||
<!-- Commands -->
|
||||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
|
||||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
|
||||
|
||||
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
||||
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
|
||||
RestorePackages;
|
||||
$(BuildDependsOn);
|
||||
</BuildDependsOn>
|
||||
|
||||
<!-- Make the build depend on restore packages -->
|
||||
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
||||
$(BuildDependsOn);
|
||||
BuildPackage;
|
||||
</BuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CheckPrerequisites">
|
||||
<!-- Raise an error if we're unable to locate nuget.exe -->
|
||||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
||||
<!--
|
||||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
|
||||
This effectively acts as a lock that makes sure that the download operation will only happen once and all
|
||||
parallel builds will have to wait for it to complete.
|
||||
-->
|
||||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_DownloadNuGet">
|
||||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(BuildCommand)"
|
||||
Condition=" '$(OS)' != 'Windows_NT' " />
|
||||
|
||||
<Exec Command="$(BuildCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" '$(OS)' == 'Windows_NT' " />
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<OutputFilename ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Reference Include="System.Core" />
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.IO" />
|
||||
<Using Namespace="System.Net" />
|
||||
<Using Namespace="Microsoft.Build.Framework" />
|
||||
<Using Namespace="Microsoft.Build.Utilities" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try {
|
||||
OutputFilename = Path.GetFullPath(OutputFilename);
|
||||
|
||||
Log.LogMessage("Downloading latest version of NuGet.exe...");
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.LogErrorFromException(ex);
|
||||
return false;
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
</Project>
|
|
@ -82,6 +82,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
|
||||
private System.Threading.SendOrPostCallback GetUserGeneralSettingsWithExtraDataOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback SendResetUserPasswordLinkSmsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback SendResetUserPasswordPincodeSmsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback ChangeOrganizationDomainTypeOperationCompleted;
|
||||
|
@ -234,6 +238,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
/// <remarks/>
|
||||
public event GetUserGeneralSettingsWithExtraDataCompletedEventHandler GetUserGeneralSettingsWithExtraDataCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event SendResetUserPasswordLinkSmsCompletedEventHandler SendResetUserPasswordLinkSmsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event SendResetUserPasswordPincodeSmsCompletedEventHandler SendResetUserPasswordPincodeSmsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted;
|
||||
|
||||
|
@ -1359,6 +1369,100 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendResetUserPasswordLinkSms", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public ResultObject SendResetUserPasswordLinkSms(int itemId, int accountId, string reason, string phoneTo) {
|
||||
object[] results = this.Invoke("SendResetUserPasswordLinkSms", new object[] {
|
||||
itemId,
|
||||
accountId,
|
||||
reason,
|
||||
phoneTo});
|
||||
return ((ResultObject)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginSendResetUserPasswordLinkSms(int itemId, int accountId, string reason, string phoneTo, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("SendResetUserPasswordLinkSms", new object[] {
|
||||
itemId,
|
||||
accountId,
|
||||
reason,
|
||||
phoneTo}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ResultObject EndSendResetUserPasswordLinkSms(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((ResultObject)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SendResetUserPasswordLinkSmsAsync(int itemId, int accountId, string reason, string phoneTo) {
|
||||
this.SendResetUserPasswordLinkSmsAsync(itemId, accountId, reason, phoneTo, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SendResetUserPasswordLinkSmsAsync(int itemId, int accountId, string reason, string phoneTo, object userState) {
|
||||
if ((this.SendResetUserPasswordLinkSmsOperationCompleted == null)) {
|
||||
this.SendResetUserPasswordLinkSmsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendResetUserPasswordLinkSmsOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("SendResetUserPasswordLinkSms", new object[] {
|
||||
itemId,
|
||||
accountId,
|
||||
reason,
|
||||
phoneTo}, this.SendResetUserPasswordLinkSmsOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnSendResetUserPasswordLinkSmsOperationCompleted(object arg) {
|
||||
if ((this.SendResetUserPasswordLinkSmsCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.SendResetUserPasswordLinkSmsCompleted(this, new SendResetUserPasswordLinkSmsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendResetUserPasswordPincodeSms", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public ResultObject SendResetUserPasswordPincodeSms(System.Guid token, string phoneTo) {
|
||||
object[] results = this.Invoke("SendResetUserPasswordPincodeSms", new object[] {
|
||||
token,
|
||||
phoneTo});
|
||||
return ((ResultObject)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginSendResetUserPasswordPincodeSms(System.Guid token, string phoneTo, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("SendResetUserPasswordPincodeSms", new object[] {
|
||||
token,
|
||||
phoneTo}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ResultObject EndSendResetUserPasswordPincodeSms(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((ResultObject)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SendResetUserPasswordPincodeSmsAsync(System.Guid token, string phoneTo) {
|
||||
this.SendResetUserPasswordPincodeSmsAsync(token, phoneTo, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SendResetUserPasswordPincodeSmsAsync(System.Guid token, string phoneTo, object userState) {
|
||||
if ((this.SendResetUserPasswordPincodeSmsOperationCompleted == null)) {
|
||||
this.SendResetUserPasswordPincodeSmsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendResetUserPasswordPincodeSmsOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("SendResetUserPasswordPincodeSms", new object[] {
|
||||
token,
|
||||
phoneTo}, this.SendResetUserPasswordPincodeSmsOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnSendResetUserPasswordPincodeSmsOperationCompleted(object arg) {
|
||||
if ((this.SendResetUserPasswordPincodeSmsCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.SendResetUserPasswordPincodeSmsCompleted(this, new SendResetUserPasswordPincodeSmsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[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) {
|
||||
|
@ -3891,6 +3995,58 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void SendResetUserPasswordLinkSmsCompletedEventHandler(object sender, SendResetUserPasswordLinkSmsCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class SendResetUserPasswordLinkSmsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal SendResetUserPasswordLinkSmsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ResultObject Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((ResultObject)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void SendResetUserPasswordPincodeSmsCompletedEventHandler(object sender, SendResetUserPasswordPincodeSmsCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class SendResetUserPasswordPincodeSmsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal SendResetUserPasswordPincodeSmsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ResultObject Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((ResultObject)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e);
|
||||
|
|
|
@ -30,10 +30,13 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Net.Mail;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Twilio;
|
||||
using WebsitePanel.EnterpriseServer.Code.HostedSolution;
|
||||
using WebsitePanel.EnterpriseServer.Code.SharePoint;
|
||||
using WebsitePanel.EnterpriseServer.Extensions;
|
||||
|
@ -1560,6 +1563,162 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return expiredUsersDb;
|
||||
}
|
||||
|
||||
public static ResultObject SendResetUserPasswordLinkSms(int itemId, int accountId, string reason,
|
||||
string phoneTo = null)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("ORGANIZATION", "SEND_USER_PASSWORD_RESET_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_RESET_LETTER);
|
||||
|
||||
|
||||
string body = settings["PasswordResetLinkSmsBody"];
|
||||
|
||||
var items = new Hashtable();
|
||||
|
||||
items["passwordResetLink"] = GenerateUserPasswordResetLink(user.ItemId, user.AccountId);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
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<ResultObject>("ORGANIZATION", "SEND_USER_PASSWORD_RESET_SMS_PINCODE");
|
||||
|
||||
try
|
||||
{
|
||||
var accessToken = OrganizationController.GetAccessToken(token, AccessTokenTypes.PasswrodReset);
|
||||
|
||||
if (accessToken == null)
|
||||
{
|
||||
throw new Exception(string.Format("Access token not found"));
|
||||
}
|
||||
|
||||
// load organization
|
||||
Organization org = GetOrganization(accessToken.ItemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
throw new Exception(string.Format("Organization not found"));
|
||||
}
|
||||
|
||||
UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
|
||||
OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(accessToken.ItemId,
|
||||
accessToken.AccountId);
|
||||
|
||||
if (string.IsNullOrEmpty(phoneTo))
|
||||
{
|
||||
phoneTo = user.MobilePhone;
|
||||
}
|
||||
|
||||
UserSettings settings = UserController.GetUserSettings(owner.UserId, UserSettings.USER_PASSWORD_RESET_LETTER);
|
||||
|
||||
string body = settings["PasswordResetPincodeSmsBody"];
|
||||
|
||||
var items = new Hashtable();
|
||||
|
||||
var pincode = GeneratePincode();
|
||||
|
||||
items["passwordResetPincode"] = pincode;
|
||||
|
||||
body = PackageController.EvaluateTemplate(body, items);
|
||||
|
||||
TaskManager.Write("Organization ID : " + user.ItemId);
|
||||
TaskManager.Write("Account : " + user.DisplayName);
|
||||
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;
|
||||
}
|
||||
|
||||
private static string GeneratePincode()
|
||||
{
|
||||
var random = new Random(Guid.NewGuid().GetHashCode());
|
||||
|
||||
return random.Next(10000, 99999).ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
private static TwilioRestClient GetTwilioRestClient()
|
||||
{
|
||||
string accountSid = ConfigurationManager.AppSettings["WebsitePanel.Twilio.AccountSid"];
|
||||
string authToken = ConfigurationManager.AppSettings["WebsitePanel.Twilio.AuthorizationToken"];
|
||||
|
||||
return new TwilioRestClient(accountSid, authToken);
|
||||
}
|
||||
|
||||
private static SMSMessage SendSms(string to, string body)
|
||||
{
|
||||
var client = GetTwilioRestClient();
|
||||
|
||||
string phoneFrom = ConfigurationManager.AppSettings["WebsitePanel.Twilio.PhoneFrom"];
|
||||
|
||||
return client.SendSmsMessage(phoneFrom, to, body);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send reset user password email
|
||||
/// </summary>
|
||||
|
@ -1583,6 +1742,8 @@ namespace WebsitePanel.EnterpriseServer
|
|||
UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
|
||||
OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
|
||||
|
||||
user.ItemId = itemId;
|
||||
|
||||
if (string.IsNullOrEmpty(mailTo))
|
||||
{
|
||||
mailTo = user.PrimaryEmailAddress;
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
<AssemblyName>WebsitePanel.EnterpriseServer.Code</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -42,6 +44,9 @@
|
|||
<HintPath>..\..\Lib\Microsoft.Web.Services3.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath>..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -55,6 +60,9 @@
|
|||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Twilio.Api">
|
||||
<HintPath>..\packages\Twilio.3.6.29\lib\3.5\Twilio.Api.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WebsitePanel.EnterpriseServer.Base, Version=2.1.0.1, Culture=neutral, PublicKeyToken=da8782a6fc4d0081, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll</HintPath>
|
||||
|
@ -202,8 +210,17 @@
|
|||
<Name>WebsitePanel.Whois</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="RestSharp" version="105.0.1" targetFramework="net40" />
|
||||
<package id="Twilio" version="3.6.29" targetFramework="net40" />
|
||||
</packages>
|
|
@ -20,6 +20,10 @@
|
|||
<add key="WebsitePanel.EnterpriseServer.ServerRequestTimeout" value="3600"/>
|
||||
<add key="WebsitePanel.AltConnectionString" value="ConnectionString"/>
|
||||
<add key="WebsitePanel.AltCryptoKey" value="CryptoKey"/>
|
||||
|
||||
<add key="WebsitePanel.Twilio.AccountSid" value="1"/>
|
||||
<add key="WebsitePanel.Twilio.AuthorizationToken" value="2"/>
|
||||
<add key="WebsitePanel.Twilio.PhoneFrom" value="+15005550006"/>
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<!-- Disable any authentication -->
|
||||
|
|
|
@ -191,6 +191,20 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject SendResetUserPasswordLinkSms(int itemId, int accountId, string reason, string phoneTo = null)
|
||||
{
|
||||
return OrganizationController.SendResetUserPasswordLinkSms(itemId, accountId, reason, phoneTo);
|
||||
}
|
||||
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject SendResetUserPasswordPincodeSms(Guid token, string phoneTo = null)
|
||||
{
|
||||
return OrganizationController.SendResetUserPasswordPincodeSms(token, phoneTo);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Domains
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace WebsitePanel.WebDav.Core.Config.Entities
|
|||
get
|
||||
{
|
||||
SessionKeysElement sessionKey =
|
||||
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.PassswordResetSmsKey);
|
||||
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.PasswordResetSmsKey);
|
||||
return sessionKey != null ? sessionKey.Value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace WebsitePanel.WebDav.Core.Config.WebConfigSections
|
|||
public const string WebDavManagerKey = "WebDavManagerSessionKey";
|
||||
public const string UserGroupsKey = "UserGroupsKey";
|
||||
public const string WebDavRootFolderPermissionsKey = "WebDavRootFolderPermissionsKey";
|
||||
public const string PassswordResetSmsKey = "PassswordResetSmsKey";
|
||||
public const string PasswordResetSmsKey = "PasswordResetSmsKey";
|
||||
public const string ResourseRenderCountKey = "ResourseRenderCountSessionKey";
|
||||
public const string ItemIdSessionKey = "ItemId";
|
||||
public const string OwaEditFoldersSessionKey = "OwaEditFoldersSession";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using log4net;
|
||||
using WebsitePanel.WebDav.Core.Config;
|
||||
using WebsitePanel.WebDav.Core.Interfaces.Security;
|
||||
using WebsitePanel.WebDav.Core.Interfaces.Services;
|
||||
|
@ -9,10 +10,12 @@ namespace WebsitePanel.WebDav.Core.Security.Authentication
|
|||
public class SmsAuthenticationService : ISmsAuthenticationService
|
||||
{
|
||||
private ISmsDistributionService _smsService;
|
||||
private readonly ILog Log;
|
||||
|
||||
public SmsAuthenticationService(ISmsDistributionService smsService)
|
||||
{
|
||||
_smsService = smsService;
|
||||
Log = LogManager.GetLogger(this.GetType());
|
||||
}
|
||||
|
||||
public bool VerifyResponse( Guid token, string response)
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Net;
|
|||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using AutoMapper;
|
||||
using log4net;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
using WebsitePanel.WebDav.Core.Config;
|
||||
using WebsitePanel.WebDav.Core.Security.Authentication;
|
||||
|
@ -27,12 +28,15 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
private readonly ICryptography _cryptography;
|
||||
private readonly IAuthenticationService _authenticationService;
|
||||
private readonly ISmsAuthenticationService _smsAuthService;
|
||||
private readonly ILog Log;
|
||||
|
||||
public AccountController(ICryptography cryptography, IAuthenticationService authenticationService, ISmsAuthenticationService smsAuthService)
|
||||
{
|
||||
_cryptography = cryptography;
|
||||
_authenticationService = authenticationService;
|
||||
_smsAuthService = smsAuthService;
|
||||
|
||||
Log = LogManager.GetLogger(this.GetType());
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
|
@ -205,11 +209,15 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
return View(model);
|
||||
}
|
||||
|
||||
if (accessToken.IsSmsSent == false)
|
||||
{
|
||||
var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId, accessToken.AccountId);
|
||||
|
||||
if (SendPasswordResetSms(accessToken.AccessTokenGuid, user.MobilePhone))
|
||||
if (accessToken != null && accessToken.IsSmsSent == false)
|
||||
{
|
||||
var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId,
|
||||
accessToken.AccountId);
|
||||
|
||||
var result = WspContext.Services.Organizations.SendResetUserPasswordPincodeSms(token, user.MobilePhone);
|
||||
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
AddMessage(MessageType.Success, Resources.Messages.SmsWasSent);
|
||||
}
|
||||
|
@ -308,8 +316,10 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId,
|
||||
accessToken.AccountId);
|
||||
|
||||
var result = WspContext.Services.Organizations.SendResetUserPasswordPincodeSms(accessToken.AccessTokenGuid,
|
||||
user.MobilePhone);
|
||||
|
||||
if (SendPasswordResetSms(accessToken.AccessTokenGuid, user.MobilePhone))
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
AddMessage(MessageType.Success, Resources.Messages.SmsWasSent);
|
||||
}
|
||||
|
@ -323,19 +333,6 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
|
||||
#region Helpers
|
||||
|
||||
private bool SendPasswordResetSms(Guid token, string mobilePhone)
|
||||
{
|
||||
var response = _smsAuthService.SendRequestMessage(mobilePhone);
|
||||
|
||||
if (string.IsNullOrEmpty(response))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
WspContext.Services.Organizations.SetAccessTokenResponse(token, response);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private UserProfile GetUserProfileModel(int itemId, int accountId)
|
||||
{
|
||||
var user = WspContext.Services.Organizations.GetUserGeneralSettingsWithExtraData(itemId, accountId);
|
||||
|
|
|
@ -5178,7 +5178,6 @@
|
|||
<data name="Quota.VPSForPC.StartShutdownAllowed" xml:space="preserve">
|
||||
<value>Allow user to Start, Turn off VPS</value>
|
||||
</data>
|
||||
|
||||
<data name="ResourceGroup.VPS2012" xml:space="preserve">
|
||||
<value>Virtual Private Servers 2012</value>
|
||||
</data>
|
||||
|
@ -5245,7 +5244,6 @@
|
|||
<data name="Quota.VPS2012.StartShutdownAllowed" xml:space="preserve">
|
||||
<value>Allow user to Start, Turn off VPS</value>
|
||||
</data>
|
||||
|
||||
<data name="Error.CreateCheckPointError" xml:space="preserve">
|
||||
<value>Error creating CheckPoint</value>
|
||||
</data>
|
||||
|
@ -5831,7 +5829,7 @@
|
|||
<data name="ERROR.REMOTE_DESKTOP_SERVICES_VIEW_SESSION" xml:space="preserve">
|
||||
<value>View session error</value>
|
||||
</data>
|
||||
<data name="ERROR.REMOTE_DESKTOP_SERVICES_CONTROL_SESSION" xml:space="preserve">
|
||||
<data name="ERROR.REMOTE_DESKTOP_SERVICES_CONTROL_SESSION" xml:space="preserve">
|
||||
<value>Control session error</value>
|
||||
</data>
|
||||
<data name="ERROR.REMOTE_DESKTOP_SERVICES_USER_SESSIONS" xml:space="preserve">
|
||||
|
@ -5852,4 +5850,7 @@
|
|||
<data name="Error.UNABLETOLOADPASSWORDSETTINGS" xml:space="preserve">
|
||||
<value>Unable to load password settings</value>
|
||||
</data>
|
||||
<data name="Error.SEND_USER_PASSWORD_RESET_SMS" xml:space="preserve">
|
||||
<value>Sms was not sent.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -141,6 +141,12 @@
|
|||
<data name="lblNoChangesTextBody.Text" xml:space="preserve">
|
||||
<value>No Changes Text Body:</value>
|
||||
</data>
|
||||
<data name="lblPasswordResetLinkSmsBody.Text" xml:space="preserve">
|
||||
<value>Password Reset Link Sms Body:</value>
|
||||
</data>
|
||||
<data name="lblPasswordResetPincodeSmsBody.Text" xml:space="preserve">
|
||||
<value>Password Reset Link Pincode Body:</value>
|
||||
</data>
|
||||
<data name="lblPriority.Text" xml:space="preserve">
|
||||
<value>Priority:</value>
|
||||
</data>
|
||||
|
|
|
@ -123,10 +123,22 @@
|
|||
<data name="locEmailAddress.Text" xml:space="preserve">
|
||||
<value>Email:</value>
|
||||
</data>
|
||||
<data name="locMobile.Text" xml:space="preserve">
|
||||
<value>Mobile</value>
|
||||
</data>
|
||||
<data name="locReason.Text" xml:space="preserve">
|
||||
<value>Reason:</value>
|
||||
</data>
|
||||
<data name="locSendTo.Text" xml:space="preserve">
|
||||
<value>Send to:</value>
|
||||
</data>
|
||||
<data name="locTitle.Text" xml:space="preserve">
|
||||
<value>Reset Password</value>
|
||||
</data>
|
||||
<data name="rbtnEmail.Text" xml:space="preserve">
|
||||
<value>Email</value>
|
||||
</data>
|
||||
<data name="rbtnMobile.Text" xml:space="preserve">
|
||||
<value>Mobile</value>
|
||||
</data>
|
||||
</root>
|
|
@ -4,42 +4,69 @@
|
|||
|
||||
|
||||
<div id="ExchangeContainer">
|
||||
<div class="Module">
|
||||
<div class="Left">
|
||||
</div>
|
||||
<div class="Content">
|
||||
<div class="Center">
|
||||
<div class="Title">
|
||||
<asp:Image ID="Image1" SkinID="OrganizationUser48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Reset Password"></asp:Localize>
|
||||
-
|
||||
<div class="Module">
|
||||
<div class="Left">
|
||||
</div>
|
||||
<div class="Content">
|
||||
<div class="Center">
|
||||
<div class="Title">
|
||||
<asp:Image ID="Image1" SkinID="OrganizationUser48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Reset Password"></asp:Localize>
|
||||
-
|
||||
<asp:Literal ID="litDisplayName" runat="server" Text="John Smith" />
|
||||
</div>
|
||||
|
||||
<div class="FormBody">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="FormLabel150" valign="top"><asp:Localize ID="locEmailAddress" runat="server" meta:resourcekey="locEmailAddress" ></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="txtEmailAddress" CssClass="TextBox200"/>
|
||||
<asp:RequiredFieldValidator ID="valEmailAddress" runat="server" ErrorMessage="*" ControlToValidate="txtEmailAddress" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
|
||||
<asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="ResetUserPassword" ControlToValidate="txtEmailAddress" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel150"><asp:Localize ID="locReason" runat="server" meta:resourcekey="locReason" Text="Reason:"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox ID="txtReason" runat="server" CssClass="TextBox200" Rows="4" TextMode="MultiLine"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="valReason" runat="server" ErrorMessage="*" ControlToValidate="txtReason" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="FormFooterClean">
|
||||
<asp:Button id="btnResetPassoword" runat="server" Text="Send Password Reset Email" CssClass="Button1" meta:resourcekey="btnResetPassoword" ValidationGroup="ResetUserPassword" OnClick="btnResetPassoword_Click"></asp:Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="FormBody">
|
||||
<asp:UpdatePanel ID="PasswrodResetUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||
<ContentTemplate>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="FormLabel150">
|
||||
<asp:Localize ID="locSendTo" runat="server" meta:resourcekey="locSendTo" Text="Send to:"></asp:Localize></td>
|
||||
<td class="FormRBtnL">
|
||||
<asp:RadioButton ID="rbtnEmail" runat="server" meta:resourcekey="rbtnEmail" Text="Email" GroupName="SendToGroup" AutoPostBack="true" Checked="true" OnCheckedChanged="SendToGroupCheckedChanged" />
|
||||
<asp:RadioButton ID="rbtnMobile" runat="server" meta:resourcekey="rbtnMobile" Text="Mobile" GroupName="SendToGroup" AutoPostBack="true" OnCheckedChanged="SendToGroupCheckedChanged" />
|
||||
<br />
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="EmailRow" runat="server">
|
||||
<td class="FormLabel150" valign="top">
|
||||
<asp:Localize ID="locEmailAddress" runat="server" meta:resourcekey="locEmailAddress"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="txtEmailAddress" CssClass="TextBox200" />
|
||||
<asp:RequiredFieldValidator ID="valEmailAddress" runat="server" ErrorMessage="*" ControlToValidate="txtEmailAddress" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
|
||||
<asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="ResetUserPassword" ControlToValidate="txtEmailAddress" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="MobileRow" runat="server" visible="False">
|
||||
<td class="FormLabel150" valign="top">
|
||||
<asp:Localize ID="locMobile" runat="server" meta:resourcekey="locMobile"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="txtMobile" CssClass="TextBox200" />
|
||||
<asp:RequiredFieldValidator ID="valMobile" runat="server" ErrorMessage="*" ControlToValidate="txtMobile" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
|
||||
<asp:RegularExpressionValidator ID="regexMobileValid" runat="server" ValidationExpression="^\+?\d+$" ValidationGroup="ResetUserPassword" ControlToValidate="txtMobile" ErrorMessage="Invalid Mobile Format"></asp:RegularExpressionValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="FormLabel150">
|
||||
<asp:Localize ID="locReason" runat="server" meta:resourcekey="locReason" Text="Reason:"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox ID="txtReason" runat="server" CssClass="TextBox200" Rows="4" TextMode="MultiLine"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="valReason" runat="server" ErrorMessage="*" ControlToValidate="txtReason" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="FormFooterClean">
|
||||
<asp:Button ID="btnResetPassoword" runat="server" Text="Send Password Reset Email" CssClass="Button1" meta:resourcekey="btnResetPassoword" ValidationGroup="ResetUserPassword" OnClick="btnResetPassoword_Click"></asp:Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -26,6 +26,8 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
litDisplayName.Text = PortalAntiXSS.Encode(user.DisplayName);
|
||||
|
||||
txtEmailAddress.Text = user.PrimaryEmailAddress;
|
||||
|
||||
txtMobile.Text = user.MobilePhone;
|
||||
}
|
||||
|
||||
protected void btnResetPassoword_Click(object sender, EventArgs e)
|
||||
|
@ -35,11 +37,31 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
return;
|
||||
}
|
||||
|
||||
ES.Services.Organizations.SendResetUserPasswordEmail(PanelRequest.ItemID,PanelRequest.AccountID, txtReason.Text, txtEmailAddress.Text);
|
||||
if (rbtnEmail.Checked)
|
||||
{
|
||||
ES.Services.Organizations.SendResetUserPasswordEmail(PanelRequest.ItemID,PanelRequest.AccountID, txtReason.Text, txtEmailAddress.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = ES.Services.Organizations.SendResetUserPasswordLinkSms(PanelRequest.ItemID, PanelRequest.AccountID, txtReason.Text, txtMobile.Text);
|
||||
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
ShowErrorMessage("SEND_USER_PASSWORD_RESET_SMS");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(),
|
||||
(PanelRequest.Context == "Mailbox") ? "mailboxes" : "users",
|
||||
"SpaceID=" + PanelSecurity.PackageId));
|
||||
}
|
||||
|
||||
protected void SendToGroupCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
EmailRow.Visible = rbtnEmail.Checked;
|
||||
MobileRow.Visible = !rbtnEmail.Checked;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,6 +39,51 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal litDisplayName;
|
||||
|
||||
/// <summary>
|
||||
/// PasswrodResetUpdatePanel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel PasswrodResetUpdatePanel;
|
||||
|
||||
/// <summary>
|
||||
/// locSendTo 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.Localize locSendTo;
|
||||
|
||||
/// <summary>
|
||||
/// rbtnEmail 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.RadioButton rbtnEmail;
|
||||
|
||||
/// <summary>
|
||||
/// rbtnMobile 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.RadioButton rbtnMobile;
|
||||
|
||||
/// <summary>
|
||||
/// EmailRow control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlTableRow EmailRow;
|
||||
|
||||
/// <summary>
|
||||
/// locEmailAddress control.
|
||||
/// </summary>
|
||||
|
@ -75,6 +120,51 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RegularExpressionValidator regexEmailValid;
|
||||
|
||||
/// <summary>
|
||||
/// MobileRow control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlTableRow MobileRow;
|
||||
|
||||
/// <summary>
|
||||
/// locMobile 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.Localize locMobile;
|
||||
|
||||
/// <summary>
|
||||
/// txtMobile 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.TextBox txtMobile;
|
||||
|
||||
/// <summary>
|
||||
/// valMobile 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 valMobile;
|
||||
|
||||
/// <summary>
|
||||
/// regexMobileValid 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.RegularExpressionValidator regexMobileValid;
|
||||
|
||||
/// <summary>
|
||||
/// locReason control.
|
||||
/// </summary>
|
||||
|
|
|
@ -41,5 +41,20 @@
|
|||
<td class="Normal" colspan="2">
|
||||
<asp:TextBox ID="txtTextBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="SubHead" colspan="2"><br /><br /><asp:Label ID="lblPasswordResetLinkSmsBody" runat="server" meta:resourcekey="lblPasswordResetLinkSmsBody" Text="Password Reset Link Sms Body:"></asp:Label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="Normal" colspan="2">
|
||||
<asp:TextBox ID="txtBodyPasswordResetLinkSmsBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
|
||||
</tr>
|
||||
tr>
|
||||
<td class="SubHead" colspan="2"><br /><br /><asp:Label ID="lblPasswordResetPincodeSmsBody" runat="server" meta:resourcekey="lblPasswordResetPincodeSmsBody" Text="Password Reset Link Pincode Body:"></asp:Label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="Normal" colspan="2">
|
||||
<asp:TextBox ID="txtPasswordResetPincodeSmsBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
|
@ -18,6 +18,9 @@ namespace WebsitePanel.Portal
|
|||
txtHtmlBody.Text = settings["HtmlBody"];
|
||||
txtTextBody.Text = settings["TextBody"];
|
||||
txtLogoUrl.Text = settings["LogoUrl"];
|
||||
|
||||
txtBodyPasswordResetLinkSmsBody.Text = settings["PasswordResetLinkSmsBody"];
|
||||
txtPasswordResetPincodeSmsBody.Text = settings["PasswordResetPincodeSmsBody"];
|
||||
}
|
||||
|
||||
public void SaveSettings(UserSettings settings)
|
||||
|
@ -28,6 +31,9 @@ namespace WebsitePanel.Portal
|
|||
settings["HtmlBody"] = txtHtmlBody.Text;
|
||||
settings["TextBody"] = txtTextBody.Text;
|
||||
settings["LogoUrl"] = txtLogoUrl.Text;
|
||||
|
||||
settings["PasswordResetLinkSmsBody"]= txtBodyPasswordResetLinkSmsBody.Text;
|
||||
settings["PasswordResetPincodeSmsBody"] =txtPasswordResetPincodeSmsBody.Text;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -119,5 +119,41 @@ namespace WebsitePanel.Portal {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtTextBody;
|
||||
|
||||
/// <summary>
|
||||
/// lblPasswordResetLinkSmsBody 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.Label lblPasswordResetLinkSmsBody;
|
||||
|
||||
/// <summary>
|
||||
/// txtBodyPasswordResetLinkSmsBody 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.TextBox txtBodyPasswordResetLinkSmsBody;
|
||||
|
||||
/// <summary>
|
||||
/// lblPasswordResetPincodeSmsBody 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.Label lblPasswordResetPincodeSmsBody;
|
||||
|
||||
/// <summary>
|
||||
/// txtPasswordResetPincodeSmsBody 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.TextBox txtPasswordResetPincodeSmsBody;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<repositories>
|
||||
<repository path="..\WebsitePanel.EnterpriseServer.Code\packages.config" />
|
||||
<repository path="..\WebsitePanel.WebDav.Core\packages.config" />
|
||||
<repository path="..\WebsitePanel.WebDavPortal\packages.config" />
|
||||
<repository path="..\WebsitePanel.WebPortal\packages.config" />
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<Target Name="RestorePackages">
|
||||
<Exec Command="$(TrunkFolder)\Sources\.nuget\NuGet.exe restore $(TrunkFolder)\Sources\WebsitePanel.EnterpriseServer.sln" />
|
||||
<Exec Command="$(TrunkFolder)\Sources\.nuget\NuGet.exe restore $(TrunkFolder)\Sources\WebsitePanel.WebPortal.sln" />
|
||||
</Target>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue