-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.aspx.cs
43 lines (36 loc) · 1.09 KB
/
login.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AccountStoreCore;
namespace AccountStore
{
public partial class login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//// get querystring, check for invalid logins....
//string qs = Request.QueryString["valid"].ToString();
//if (qs == "false")
//{
// // inform user that login was invalid
//}
}
protected void btnLogin_Click(object sender, EventArgs e)
{
cUser user = new cUser();
// check the users login info, if it is valid, return a cUser object representing that user - otherwise null is returned
user = cUser.Verify(txtEmail.Text, "a");
// if user isn't null, we have a validated user and can proceed to the main page...
if (user != null)
{
Session.Add("objUser", user);
Session.Add("Email", user.Email);
Response.Redirect("index.aspx");
}
Response.Redirect("login.aspx?valid=false");
}
}
}