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

@ -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);