forked from lovemachinej/Hackzone-tunisia-CTF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activate.php
executable file
·221 lines (205 loc) · 9.48 KB
/
activate.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?php
//Start session
session_start();
if (isset($_SESSION['SESS_USERNAME']))
{
header("location: index.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" href="favicon.png">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/comment.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/manager.js"></script>
<body style="background:#f2f2f2;">
<div class="container" >
<div class="row clearfix">
<div class="col-md-12 column">
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span><span class="icon-bar"></span>
<span class="icon-bar"></span><span class="icon-bar"></span></button>
<a class="navbar-brand" href="index.php"><span ><img src="img/logo-hack.png" alt="logo" height="25" width="25" class="profile-image img-circle"/>Hack-Zone</span></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li >
<a href="index.php"><span class="glyphicon glyphicon-home">Home</span></a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li >
<a href="scoreboard.php"><span class="glyphicon glyphicon-signal">Scoreboard</span></a>
</li> <li >
<a href="rules.php"><span class="glyphicon glyphicon-lock" >Rules</span></a>
</li>
<li >
<a href="contact.php"><span class="glyphicon glyphicon-comment">Contact</span></a>
</li>
<li >
<a href="sponsors.php"><span class="glyphicon glyphicon-shopping-cart">Sponsors</span></a>
</li>
<li >
<a href="media.php"><span class="glyphicon glyphicon-camera">Media</span></a>
</li>
<li margin-left:10px;>
<a id="modal-signup" href="#modal-container-signup" role="button" class="btn" data-toggle="modal">SIGN UP</a>
</li>
<li margin-right:20px;>
<a id="modal-login" href="#modal-container-login" role="button" class="btn" data-toggle="modal">LOGIN</a>
</li>
<li></li>
</ul>
</div>
</nav>
</div>
</div>
</div>
<br><br><br><br>
<?php
if (!isset($_SESSION['SESS_USERNAME']))
echo '<!--SIGNUP dialog-->
<div class="modal fade" id="modal-container-signup" role="dialog" aria-labelledby="signup" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="signupLabel">
Sign Up
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-8 col-sm-8 col-xs-12 login-box">
<form id="signup" action="signup_json.php" method="post" >
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" class="form-control" placeholder="Username" name="username" required autofocus />
</div>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input type="password" class="form-control" placeholder="Password" name="npassword" required />
</div>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input type="password" class="form-control" placeholder="Confirm Password" name="cpassword" required />
</div>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></span>
<input type="text" class="form-control" placeholder="Email" name="email" required />
</div>
<br>
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="g-recaptcha" data-sitekey="6LdEhgITAAAAAGigEVKR5jrozGcVwVr0gva8EzmT"></div>
</div>
</div><br>
<div class="col-xs-6 col-sm-6 col-md-6">
<button class="btn btn-labeled btn-success" id="signup-button">Sign Up</button>
</div>
</form>
<br><br><div id="div_signup_response" class="alert alert-info alert-dismissable" style="display: none;" >
<i id="signup_response" class="fa fa-coffee"></i>
</div><br>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Login dialog-->
<div class="modal fade" id="modal-container-login" role="dialog" aria-labelledby="login" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="loginLabel">
Login
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-8 col-sm-8 col-xs-12 login-box">
<form id="login" action="login_json.php" method="post" >
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" class="form-control" placeholder="Username" name="username" required autofocus />
</div>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input type="password" class="form-control" placeholder="Password" name="password" required />
</div>
<div class="checkbox">
<label>
<input type="checkbox" value="Remember">
Remember me
</label>
</div>
<a href="init.php" >Find Your Account?</a>
<br>
<div class="col-xs-6 col-sm-6 col-md-6">
<button class="btn btn-labeled btn-success" id="login-button">LogIn</button>
</div>
</form>
<br><br><div id="div_login_response" class="alert alert-info alert-dismissable" style="display: none;" >
<a class="panel-close close" data-dismiss="alert">×</a>
<i id="login_response" class="fa fa-coffee"></i>
</div><br>
</div>
</div>
</div>
</div>
</div>
</div>';
?>
<div class="row clearfix">
<div class="col-md-4 column">
</div>
<div class="col-md-4 column">
<?php
if($_SERVER['REQUEST_METHOD'] == 'GET')
if (isset($_GET['code'])) {
$code=$_GET['code'];
$code = strip_tags($code);
$code = htmlspecialchars($code);
echo '<h3>
Active Your Account
</h3>
<form id="activate" action="activate_json.php" method="get" >
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input type="text" value="'.$code.'" class="form-control" placeholder="code" name="code" required />
</div>
<br>
<div class="col-xs-6 col-sm-6 col-md-6">
<button id="activate_button" class="btn btn-labeled btn-success">Activate</button>
</div>
<br><br>
<div id="div_activate_response" class="alert alert-info alert-dismissable" style="display: none;">
<a class="panel-close close" data-dismiss="alert">×</a>
<i id="activate_response" class="fa fa-coffee"></i>
</div>
</form>';}
else header("location: index.php");
else header("location: index.php");
?>
</div>
<div class="col-md-4 column">
</div>
</div>
</div>
</body>
</html>