-
Notifications
You must be signed in to change notification settings - Fork 28
/
irc_idle.php
46 lines (44 loc) · 1.88 KB
/
irc_idle.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
<?php
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V4 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless,putyn. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
//irc idle thingy using php
$key = 'VGhlIE1vemlsbGEgZmFtaWx5IGFwcG';
$vars = array(
'ircidle' => '',
'username' => '',
'key' => '',
'do' => ''
);
foreach ($vars as $k => $v) $vars[$k] = isset($_GET[$k]) ? $_GET[$k] : '';
if ($key !== $vars['key'] || empty($vars['username'])) die('hmm something looks odd');
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'bittorrent.php');
dbconn();
switch ($vars['do']) {
case 'check':
$q = sql_query('SELECT id FROM users WHERE username = ' . sqlesc($vars['username']));
echo (mysqli_num_rows($q));
break;
case 'idle':
sql_query("UPDATE users SET onirc = " . sqlesc(!$vars['ircidle'] ? 'no' : 'yes') . " where username = " . sqlesc($vars['username']));
echo (mysqli_affected_rows($GLOBALS["___mysqli_ston"]));
break;
default:
die('hmm something looks odd again');
}
die;
?>