36 lines
1005 B
C#
36 lines
1005 B
C#
using System.Configuration;
|
|
using System.Web;
|
|
using LeafWeb.Core.Entities;
|
|
using Umbraco.Core.Models;
|
|
|
|
namespace LeafWeb.WebCms.Services
|
|
{
|
|
public class UrlService
|
|
{
|
|
private readonly string _downloadUrl;
|
|
private readonly string _verifyEmailUrl;
|
|
|
|
public UrlService()
|
|
{
|
|
_downloadUrl =
|
|
ConfigurationManager.AppSettings["LeafWebUrl"]
|
|
+ ConfigurationManager.AppSettings["ResultsDownloadPath"];
|
|
|
|
_verifyEmailUrl =
|
|
ConfigurationManager.AppSettings["LeafWebUrl"]
|
|
+ ConfigurationManager.AppSettings["MemberVerifyPath"];
|
|
}
|
|
|
|
public string GetDownloadUrl(LeafInput leafInput)
|
|
{
|
|
return string.Format(_downloadUrl, leafInput.UniqueToken);
|
|
}
|
|
|
|
public string GetVerifyEmailURl(IMember member)
|
|
{
|
|
var memberEmail = member.Email;
|
|
var token = member.GetValue("VerificationToken") as string;
|
|
return string.Format(_verifyEmailUrl, HttpUtility.UrlEncode(memberEmail), token);
|
|
}
|
|
}
|
|
} |