-
Notifications
You must be signed in to change notification settings - Fork 0
/
RecoverAccount.aspx.cs
53 lines (45 loc) · 1.38 KB
/
RecoverAccount.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SS.Model;
using SS.Service;
using GenericServices;
using Spring.Context;
using log4net;
public partial class RecoverAccount : System.Web.UI.Page
{
private UserService _userService;
public UserService UserService
{
get
{
if (null == _userService)
{
IApplicationContext ctx = Spring.Context.Support.ContextRegistry.GetContext();
_userService = ctx["UserService"] as UserService;
}
return _userService;
}
set { _userService = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnReset_Click(object sender, EventArgs e)
{
string email = txtEmail.Text;
if (!String.IsNullOrEmpty(email))
{
User user = UserService.GetUser(email);
if (null != user && !user.IsDisabled)
{
string newPassword = UserService.NewPassword(user);
UserService.SendUserEmail(user, "Sterling Scholar password reset request", System.Web.HttpContext.Current.Server.MapPath("~/") + "/assets/PasswordResetTemplate.html");
}
}
Response.Redirect("Default.aspx");
}
}