-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.php
More file actions
31 lines (22 loc) · 826 Bytes
/
update.php
File metadata and controls
31 lines (22 loc) · 826 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
<?php
if ( ini_get( 'magic_quotes_gpc' ) ) {
// FUCKING MAGIC QUOTES FUCK FUCK FUCK FUCK
$_GET['d'] = stripslashes( $_GET['d'] );
}
define( 'STUZZPANEL', 'BESTPANEL' );
define( 'USERNAME', $_GET['u'] );
define( 'SKIP_AUTHENTICATION', 'grab-only' );
require_once 'database.php';
header( 'Cache-Control: private, max-age=0' );
header( 'Pragma: no-cache, must-revalidate' );
if ( $_GET['k'] != SERVER_KEY ) {
exit;
}
if ( $data = json_decode( $_GET['d'], true ) ) {
db_insert( 'mc_server_stats', array( 'username' => USERNAME, 'data' => serialize( $data ) ) );
// Don't run cleanup every single time.
if ( mt_rand( 0, 64 ) == 0 ) {
global $db;
$db->query( 'DELETE FROM `mc_server_stats` WHERE `username` = \'' . $db->escape_string( USERNAME ) . '\' AND `timestamp` < TIMESTAMPADD( HOUR, 48, NOW() ) )' );
}
}