-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
167 lines (142 loc) · 5.29 KB
/
index.php
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
$template = 'login';
include 'includes/bootstrap.php';
/*
* IF logged in, go ahead and redirect to the dashboard, otherwise show the login form
*/
function page()
{
global $user;
?>
<header id="header-extra">
<!--
<div id="logo-group">
<span id="logo"> <img src="/images/logo.png" alt="Mango"> </span>
</div>
-->
<span id="extra-page-header-space"> <span class="hidden-mobile hiddex-xs">Need an account?</span> <a
href="/pages/user/requestAccess.php" class="btn btn-danger">Request Access</a> </span>
</header>
<div id="main" role="main">
<!-- MAIN CONTENT -->
<div id="content" class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-7 col-lg-8 hidden-xs hidden-sm">
<h1 class="txt-color-red login-header-big">Mango
<small>Newspaper Management Made Easy</small>
</h1>
<!--
<div class="hero">
<div class="pull-left login-desc-box-l">
<h4 class="paragraph-header">It's Okay to be Smart. Experience the simplicity of SmartAdmin,
everywhere you go!</h4>
</div>
<img src="/images/iphoneview.png" class="pull-right display-image" alt="" style="width:210px">
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<h5 class="about-heading">About SmartAdmin - Are you up to date?</h5>
<p>
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque
laudantium, totam rem aperiam, eaque ipsa.
</p>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<h5 class="about-heading">Not just your average template!</h5>
<p>
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta
nobis est eligendi voluptatem accusantium!
</p>
</div>
</div>
-->
</div>
<div class="col-xs-12 col-sm-12 col-md-5 col-lg-4">
<div class="well">
<?php userForm() ?>
</div>
</div>
</div>
</div>
</div>
<?php
}
function userForm()
{
global $session, $db;
$form = new Form();
?>
<form class="form-horizontal" role="form" method="post" action="/pages/user/authorizeUser.php">
<?php
$form->showErrors(true);
?>
<input type="hidden" name="csrf_token" size=38 value="<?php print $session->csrf_token ?>" />
<div class="form-group">
<label class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-8">
<input type="email" class="form-control" name="email" value="<?php print $_POST['email'] ?>" />
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Password</label>
<div class="col-md-8">
<input type="password" class="form-control" name="password" />
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
<input type="checkbox" name="remember"> Remember Me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">Login</button>
<a class="btn btn-link" href="/pages/user/forgot.php">Forgot Your
Password?</a>
</div>
</div>
</form>
<?php
$GLOBALS['scripts'][] = <<<BLOCK
$(function () {
// Validation
$("#login-form") . validate({
// Rules for form validation
rules : {
email : {
required :
true,
email : true
},
password : {
required :
true,
minlength : 3,
maxlength : 20
}
},
// Messages for form validation
messages : {
email : {
required :
'Please enter your email address',
email : 'Please enter a VALID email address'
},
password : {
required :
'Please enter your password'
}
},
// Do not change code below
errorPlacement : function (error, element) {
error . insertAfter(element . parent());
}
});
});
};
BLOCK;
}