Merge
This commit is contained in:
commit
c7798c5b9b
24 changed files with 314 additions and 91 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
@ -1994,7 +1999,8 @@ namespace WebsitePanel.EnterpriseServer
|
|||
AccountLockoutDuration = GetValueSafe(parts, 9, 0),
|
||||
ResetAccountLockoutCounterAfter = GetValueSafe(parts, 10, 0),
|
||||
LockoutSettingsEnabled = GetValueSafe(parts, 11, false),
|
||||
PasswordComplexityEnabled = GetValueSafe(parts, 11, true),
|
||||
PasswordComplexityEnabled = GetValueSafe(parts, 12, true),
|
||||
MaxPasswordAge = GetValueSafe(parts, 13, 42),
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue