-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.aspx.cs
36 lines (35 loc) · 1011 Bytes
/
admin.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
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Mail;
using System.ServiceModel.Security;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using com.KatomBook;
public partial class admin : System.Web.UI.Page
{
public bool logged;
public DataTable users;
protected void Page_Load(object sender, EventArgs e)
{
logged = true;
if (Session.Count < 2)
{
logged = false;
Response.Redirect("/Login.aspx", false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
else if(Session["isAdmin"].ToString() != "True")
{
logged = false;
Response.Redirect("/Login.aspx", false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
if(logged)
{
users = MyAdoHelper.ExecuteDataTable("SELECT * FROM `tblUsers` WHERE `fldIsAdmin` = 0 ;");
}
}
}