-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfirm.php
More file actions
67 lines (51 loc) · 1.37 KB
/
confirm.php
File metadata and controls
67 lines (51 loc) · 1.37 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
<?php
/**
**************************
** FreeTSP Version: 1.0 **
**************************
** http://www.freetsp.info
** https://github.com/Krypto/FreeTSP
** Licence Info: GPL
** Copyright (C) 2010 FreeTSP v1.0
** A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
** Project Leaders: Krypto, Fireknight.
**/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'functions'.DIRECTORY_SEPARATOR.'function_main.php');
require_once(FUNC_DIR.'function_user.php');
require_once(FUNC_DIR.'function_vfunctions.php');
$id = 0 + $_GET["id"];
$md5 = $_GET["secret"];
if (!$id)
{
httperr();
}
db_connect();
$res = sql_query("SELECT passhash, editsecret, status
FROM users
WHERE id = $id") or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_assoc($res);
if (!$row)
{
httperr();
}
if ($row["status"] != "pending")
{
header("Refresh: 0; url=ok.php?type=confirmed");
exit();
}
$sec = hash_pad($row["editsecret"]);
if ($md5 != md5($sec))
{
httperr();
}
sql_query("UPDATE users
SET status = 'confirmed', editsecret = ''
WHERE id = $id
AND status ='pending'") or sqlerr(__FILE__, __LINE__);
if (!mysql_affected_rows())
{
httperr();
}
logincookie($id, $row["passhash"]);
header("Refresh: 0; url=ok.php?type=confirm");
?>