-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
77 lines (72 loc) · 1.97 KB
/
admin.php
File metadata and controls
77 lines (72 loc) · 1.97 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
session_start();
if (isset($_SESSION['uwid']) && $_SESSION['uwid'] != "" && $_SESSION['logintype'] == 'admin')
{
header('location: ./controlpanel.php');
}
if (isset($_SESSION['uwid']) && $_SESSION['uwid'] != "" && $_SESSION['logintype'] == 'student')
{
header('location: ./index.php');
}
?>
<?php $page_title = 'Administrative Access'; ?>
<?php include 'siteconfig.php'; ?>
<?php echo $sDocType; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $sTitle . ' ~ ' . $page_title; ?></title>
<?php echo $sAdminCssFile.$sAllJs; ?>
<script type="text/javascript">
$(document).ready(function(){
$("#log_in").click(function(event){
event.preventDefault();
var mandatoryFieldIds = new Array ("email", "password");
if (CheckEmptyGroup(mandatoryFieldIds))
{
alert('You must fill up all mandatory fields.');
}
else
{
$.post('adminloginhandler.php?login=1',
{
email: $("#email").attr('value'),
password: $("#password").attr('value')
},
function(response){
if(response != "Success\n"){
$("div.message").html(response);
$("div.message").fadeIn("slow");
}
else
{
window.location = "./controlpanel.php";
}
})
}
})
})
</script>
</head>
<body>
<div class="content">
<?php include 'uwheader.php'; ?>
<p class="pagetitle"><?php echo $page_title; ?></p>
<form id="frm_login">
<fieldset class="loginform">
<legend>Log In</legend>
<p>
<label for="email">Email:</label><br/>
<input style="width: 250px" type="text" id="email" name="email"/>
</p>
<p>
<label for="password">Password:</label><br/>
<input style="width: 250px" type="password" id="password" name="password"/>
</p>
<input type="submit" id="log_in" class="btnlogin hugebutton btnmakeover" value="Log In"/>
</fieldset>
</form>
<a href="index.php">Regular users click here</a>
<div class="message errorMessage"></div>
</div>
</body>
</html>