password reset link changed in setup letter
This commit is contained in:
parent
f0812f7b2d
commit
afae6c4a6d
7 changed files with 44 additions and 29 deletions
|
@ -11,6 +11,12 @@
|
||||||
//
|
//
|
||||||
// This source code was auto-generated by wsdl, Version=2.0.50727.3038.
|
// This source code was auto-generated by wsdl, Version=2.0.50727.3038.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
using WebsitePanel.Providers;
|
||||||
|
using WebsitePanel.Providers.Common;
|
||||||
|
using WebsitePanel.Providers.HostedSolution;
|
||||||
|
using WebsitePanel.Providers.ResultObjects;
|
||||||
|
|
||||||
namespace WebsitePanel.EnterpriseServer {
|
namespace WebsitePanel.EnterpriseServer {
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using System.Web.Services;
|
using System.Web.Services;
|
||||||
|
@ -19,10 +25,6 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using WebsitePanel.Providers.HostedSolution;
|
|
||||||
using WebsitePanel.Providers.Common;
|
|
||||||
using WebsitePanel.Providers.ResultObjects;
|
|
||||||
using WebsitePanel.Providers;
|
|
||||||
|
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -4311,24 +4313,26 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMailboxSetupInstructions", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMailboxSetupInstructions", 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 string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup) {
|
public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl) {
|
||||||
object[] results = this.Invoke("GetMailboxSetupInstructions", new object[] {
|
object[] results = this.Invoke("GetMailboxSetupInstructions", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
accountId,
|
accountId,
|
||||||
pmm,
|
pmm,
|
||||||
emailMode,
|
emailMode,
|
||||||
signup});
|
signup,
|
||||||
|
passwordResetUrl});
|
||||||
return ((string)(results[0]));
|
return ((string)(results[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginGetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginGetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("GetMailboxSetupInstructions", new object[] {
|
return this.BeginInvoke("GetMailboxSetupInstructions", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
accountId,
|
accountId,
|
||||||
pmm,
|
pmm,
|
||||||
emailMode,
|
emailMode,
|
||||||
signup}, callback, asyncState);
|
signup,
|
||||||
|
passwordResetUrl}, callback, asyncState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -4338,12 +4342,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) {
|
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl) {
|
||||||
this.GetMailboxSetupInstructionsAsync(itemId, accountId, pmm, emailMode, signup, null);
|
this.GetMailboxSetupInstructionsAsync(itemId, accountId, pmm, emailMode, signup, passwordResetUrl, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) {
|
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl, object userState) {
|
||||||
if ((this.GetMailboxSetupInstructionsOperationCompleted == null)) {
|
if ((this.GetMailboxSetupInstructionsOperationCompleted == null)) {
|
||||||
this.GetMailboxSetupInstructionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxSetupInstructionsOperationCompleted);
|
this.GetMailboxSetupInstructionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxSetupInstructionsOperationCompleted);
|
||||||
}
|
}
|
||||||
|
@ -4352,7 +4356,8 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
accountId,
|
accountId,
|
||||||
pmm,
|
pmm,
|
||||||
emailMode,
|
emailMode,
|
||||||
signup}, this.GetMailboxSetupInstructionsOperationCompleted, userState);
|
signup,
|
||||||
|
passwordResetUrl}, this.GetMailboxSetupInstructionsOperationCompleted, userState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGetMailboxSetupInstructionsOperationCompleted(object arg) {
|
private void OnGetMailboxSetupInstructionsOperationCompleted(object arg) {
|
||||||
|
|
|
@ -2564,7 +2564,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup)
|
public static string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl)
|
||||||
{
|
{
|
||||||
#region Demo Mode
|
#region Demo Mode
|
||||||
if (IsDemoMode)
|
if (IsDemoMode)
|
||||||
|
@ -2589,12 +2589,11 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (String.IsNullOrEmpty(body))
|
if (String.IsNullOrEmpty(body))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
string result = EvaluateMailboxTemplate(itemId, accountId, pmm, false, false, body);
|
string result = EvaluateMailboxTemplate(itemId, accountId, pmm, false, false, body, passwordResetUrl);
|
||||||
return user.HtmlMail ? result : result.Replace("\n", "<br/>");
|
return user.HtmlMail ? result : result.Replace("\n", "<br/>");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string EvaluateMailboxTemplate(int itemId, int accountId,
|
private static string EvaluateMailboxTemplate(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string template, string passwordResetUrl)
|
||||||
bool pmm, bool emailMode, bool signup, string template)
|
|
||||||
{
|
{
|
||||||
Hashtable items = new Hashtable();
|
Hashtable items = new Hashtable();
|
||||||
|
|
||||||
|
@ -2618,7 +2617,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
Guid token;
|
Guid token;
|
||||||
|
|
||||||
var passwordResetUrl = OrganizationController.GenerateUserPasswordResetLink(account.ItemId, account.AccountId,out token);
|
passwordResetUrl = OrganizationController.GenerateUserPasswordResetLink(account.ItemId, account.AccountId, out token, string.Empty, passwordResetUrl);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(passwordResetUrl))
|
if (!string.IsNullOrEmpty(passwordResetUrl))
|
||||||
{
|
{
|
||||||
items["PswResetUrl"] = passwordResetUrl;
|
items["PswResetUrl"] = passwordResetUrl;
|
||||||
|
@ -2696,8 +2696,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (to == null)
|
if (to == null)
|
||||||
to = user.Email;
|
to = user.Email;
|
||||||
|
|
||||||
subject = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, subject);
|
subject = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, subject, string.Empty);
|
||||||
body = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, body);
|
body = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, body, string.Empty);
|
||||||
|
|
||||||
// send message
|
// send message
|
||||||
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);
|
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);
|
||||||
|
|
|
@ -1858,18 +1858,23 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return SystemController.GetSystemSettingsInternal(SystemSettings.WEBDAV_PORTAL_SETTINGS, false);
|
return SystemController.GetSystemSettingsInternal(SystemSettings.WEBDAV_PORTAL_SETTINGS, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GenerateUserPasswordResetLink(int itemId, int accountId, out Guid tokenGuid, string pincode = null)
|
public static string GenerateUserPasswordResetLink(int itemId, int accountId, out Guid tokenGuid, string pincode = null, string resetUrl = null)
|
||||||
{
|
{
|
||||||
string passwordResetUrlFormat = string.IsNullOrEmpty(pincode) ? "account/password-reset/step-2" : "account/password-reset/step-final";
|
|
||||||
|
|
||||||
var settings = GetWebDavSystemSettings();
|
var settings = GetWebDavSystemSettings();
|
||||||
|
|
||||||
if (settings == null || !settings.GetValueOrDefault(SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false) ||!settings.Contains("WebdavPortalUrl"))
|
|
||||||
{
|
|
||||||
tokenGuid = new Guid();
|
tokenGuid = new Guid();
|
||||||
|
|
||||||
|
if (settings == null || !settings.GetValueOrDefault(SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false) || !settings.Contains("WebdavPortalUrl"))
|
||||||
|
{
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(resetUrl) == false)
|
||||||
|
{
|
||||||
|
return resetUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
string passwordResetUrlFormat = string.IsNullOrEmpty(pincode) ? "account/password-reset/step-2" : "account/password-reset/step-final";
|
||||||
|
|
||||||
var webdavPortalUrl = new Uri(settings["WebdavPortalUrl"]);
|
var webdavPortalUrl = new Uri(settings["WebdavPortalUrl"]);
|
||||||
|
|
||||||
var token = CreateAccessToken(itemId, accountId, AccessTokenTypes.PasswrodReset);
|
var token = CreateAccessToken(itemId, accountId, AccessTokenTypes.PasswrodReset);
|
||||||
|
|
|
@ -315,9 +315,9 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup)
|
public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl)
|
||||||
{
|
{
|
||||||
return ExchangeServerController.GetMailboxSetupInstructions(itemId, accountId, pmm, emailMode, signup);
|
return ExchangeServerController.GetMailboxSetupInstructions(itemId, accountId, pmm, emailMode, signup, passwordResetUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
{
|
{
|
||||||
BindPasswordSettings();
|
BindPasswordSettings();
|
||||||
|
|
||||||
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
|
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false, " ");
|
||||||
if (!string.IsNullOrEmpty(instructions))
|
if (!string.IsNullOrEmpty(instructions))
|
||||||
{
|
{
|
||||||
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = true;
|
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = true;
|
||||||
|
|
|
@ -47,7 +47,12 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
// load content
|
// load content
|
||||||
litContent.Text = ES.Services.ExchangeServer.GetMailboxSetupInstructions(
|
litContent.Text = ES.Services.ExchangeServer.GetMailboxSetupInstructions(
|
||||||
PanelRequest.ItemID, PanelRequest.AccountID,
|
PanelRequest.ItemID, PanelRequest.AccountID,
|
||||||
false, false, false);
|
false, false, false,
|
||||||
|
PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(),
|
||||||
|
"user_reset_password",
|
||||||
|
"SpaceID=" + PanelSecurity.PackageId,
|
||||||
|
"Context=Mailbox",
|
||||||
|
"AccountID=" + PanelRequest.AccountID).Trim('~'));
|
||||||
|
|
||||||
// bind user details
|
// bind user details
|
||||||
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);
|
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
||||||
if (!hideItems) tabsList.Add(CreateTab("mailbox_mailflow", "Tab.Mailflow"));
|
if (!hideItems) tabsList.Add(CreateTab("mailbox_mailflow", "Tab.Mailflow"));
|
||||||
if (!hideItems) tabsList.Add(CreateTab("mailbox_permissions", "Tab.Permissions"));
|
if (!hideItems) tabsList.Add(CreateTab("mailbox_permissions", "Tab.Permissions"));
|
||||||
|
|
||||||
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
|
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false, " ");
|
||||||
if (!string.IsNullOrEmpty(instructions))
|
if (!string.IsNullOrEmpty(instructions))
|
||||||
tabsList.Add(CreateTab("mailbox_setup", "Tab.Setup"));
|
tabsList.Add(CreateTab("mailbox_setup", "Tab.Setup"));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue