forked from Bigjoos/U-232-V3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirc_idle.php
executable file
·33 lines (31 loc) · 1.06 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
<?php
/**
* https://github.com/Bigjoos/
* Licence Info: GPL
* Copyright (C) 2010 U-232 v.3
* A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
* Project Leaders: Mindless, putyn.
**/
//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;
?>