password reset link changed in setup letter

This commit is contained in:
vfedosevich 2015-04-28 06:24:39 -07:00
parent f0812f7b2d
commit afae6c4a6d
7 changed files with 44 additions and 29 deletions

View file

@ -11,6 +11,12 @@
//
// 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 {
using System.Xml.Serialization;
using System.Web.Services;
@ -19,10 +25,6 @@ namespace WebsitePanel.EnterpriseServer {
using System;
using System.Diagnostics;
using System.Data;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers;
/// <remarks/>
@ -4311,24 +4313,26 @@ namespace WebsitePanel.EnterpriseServer {
/// <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)]
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[] {
itemId,
accountId,
pmm,
emailMode,
signup});
signup,
passwordResetUrl});
return ((string)(results[0]));
}
/// <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[] {
itemId,
accountId,
pmm,
emailMode,
signup}, callback, asyncState);
signup,
passwordResetUrl}, callback, asyncState);
}
/// <remarks/>
@ -4338,12 +4342,12 @@ namespace WebsitePanel.EnterpriseServer {
}
/// <remarks/>
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) {
this.GetMailboxSetupInstructionsAsync(itemId, accountId, pmm, emailMode, signup, null);
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl) {
this.GetMailboxSetupInstructionsAsync(itemId, accountId, pmm, emailMode, signup, passwordResetUrl, null);
}
/// <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)) {
this.GetMailboxSetupInstructionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxSetupInstructionsOperationCompleted);
}
@ -4352,7 +4356,8 @@ namespace WebsitePanel.EnterpriseServer {
accountId,
pmm,
emailMode,
signup}, this.GetMailboxSetupInstructionsOperationCompleted, userState);
signup,
passwordResetUrl}, this.GetMailboxSetupInstructionsOperationCompleted, userState);
}
private void OnGetMailboxSetupInstructionsOperationCompleted(object arg) {

View file

@ -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
if (IsDemoMode)
@ -2589,12 +2589,11 @@ namespace WebsitePanel.EnterpriseServer
if (String.IsNullOrEmpty(body))
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/>");
}
private static string EvaluateMailboxTemplate(int itemId, int accountId,
bool pmm, bool emailMode, bool signup, string template)
private static string EvaluateMailboxTemplate(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string template, string passwordResetUrl)
{
Hashtable items = new Hashtable();
@ -2618,7 +2617,8 @@ namespace WebsitePanel.EnterpriseServer
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))
{
items["PswResetUrl"] = passwordResetUrl;
@ -2696,8 +2696,8 @@ namespace WebsitePanel.EnterpriseServer
if (to == null)
to = user.Email;
subject = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, subject);
body = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, body);
subject = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, subject, string.Empty);
body = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, body, string.Empty);
// send message
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);

View file

@ -1858,18 +1858,23 @@ namespace WebsitePanel.EnterpriseServer
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();
tokenGuid = new Guid();
if (settings == null || !settings.GetValueOrDefault(SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false) ||!settings.Contains("WebdavPortalUrl"))
if (settings == null || !settings.GetValueOrDefault(SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false) || !settings.Contains("WebdavPortalUrl"))
{
tokenGuid = new Guid();
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 token = CreateAccessToken(itemId, accountId, AccessTokenTypes.PasswrodReset);

View file

@ -315,9 +315,9 @@ namespace WebsitePanel.EnterpriseServer
}
[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]

View file

@ -51,7 +51,7 @@ namespace WebsitePanel.Portal.ExchangeServer
{
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))
{
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = true;

View file

@ -47,7 +47,12 @@ namespace WebsitePanel.Portal.ExchangeServer
// load content
litContent.Text = ES.Services.ExchangeServer.GetMailboxSetupInstructions(
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
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);

View file

@ -70,7 +70,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
if (!hideItems) tabsList.Add(CreateTab("mailbox_mailflow", "Tab.Mailflow"));
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))
tabsList.Add(CreateTab("mailbox_setup", "Tab.Setup"));