-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvalidate.php
More file actions
53 lines (29 loc) · 1007 Bytes
/
validate.php
File metadata and controls
53 lines (29 loc) · 1007 Bytes
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
<?php
/**
* MASTER LOGIN SYSTEM
* @author Mihai Ionut Vilcu (ionutvmi@gmail.com)
* June 2013
*
*/
include 'inc/init.php';
$page->title = "Validate account";
if(isset($_GET['username']) && isset($_GET['key'])) {
if($u = $db->getRow("SELECT `userid` FROM `".MLS_PREFIX."users` WHERE `username` = ?s AND `validated` = ?s", $_GET['username'], $_GET['key'])) {
if($db->query("UPDATE `".MLS_PREFIX."users` SET `validated` = '1' WHERE `userid` = ?i", $u->userid)) {
$page->success = "Your account was successfully activated !";
$user = new User($db);
$_SESSION['user'] = $u->userid;
} else
$page->error = "Some error camed up !";
} else
$page->error = "Error ! Incorrect key !";
}
include 'header.php';
echo "<div class='container'>";
if(isset($page->error))
$options->fError($page->error);
else if(isset($page->success))
$options->success($page->success);
echo "<a class='btn btn-primary' href='$set->url'>Start exploring</a>
</div>";
include 'footer.php';