BEST /BaliEnterpriseSystems/BaliEnterpriseSystems/UserPreferences.aspx.cs

Language C# Lines 47
MD5 Hash 563fecc3749ee2f3a73a99e1a29f00f4
Repository https://github.com/sirivedula/BEST.git View Raw File
 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
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace BaliEnterpriseSystems
{
    public partial class UserPreferences : System.Web.UI.Page
    {
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session["CurrentUser"] == null)
            {
                Response.Redirect("Logout.aspx");
            }

            if (Request.Form.Count > 0)
            {
                string newPassword = Request.Form["newpassword"];
                var cUser = Utils.User;

                cUser.BestUser.password = Utils.GetMD5Hash(newPassword);
                cUser.BestUser.initialPassword = false;
                cUser.BestUser.passwordExpiration = DateTime.Today.AddDays(365);

                if (!cUser.BestUser.CurrentRow.Save())
                {
                    this.ChangePasswordMessage.Text = "<div class=\"err\">There was a problem changing your password.  Please try again.</div>";
                }
                else
                {
                    Response.Redirect("BestWelcome.aspx");
                }
            }

        }
    }
}
Back to Top