get( "usergroup" );
if( ! $user_group ) {$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
if (! $is_logged) {$member_id['user_group'] = 5;}
if (! $user_group[$member_id['user_group']]['allow_files']) die ( "Access denied" );
$_SERVER['HTTP_REFERER'] = clean_url ( $_SERVER['HTTP_REFERER'] );
$_SERVER['HTTP_HOST'] = clean_url ( $_SERVER['HTTP_HOST'] );
if ($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) {
@header ( 'Location: ' . $config['http_home_url'] );
die ( "Access denied!!!
Please visit {$config['http_home_url']}" );
}
$id = intval ( $_REQUEST['id'] );
if ($_REQUEST['area'] == "static") $row = $db->super_query ( "SELECT name, onserver FROM " . PREFIX . "_static_files WHERE id ='$id'" );
else $row = $db->super_query ( "SELECT name, onserver FROM " . PREFIX . "_files WHERE id ='$id'" );
if (! $row) die ( "Access denied" );
$config['files_max_speed'] = intval ( $config['files_max_speed'] );
$file = new download ( FILE_DIR . $row['onserver'], $row['name'], $config['files_force'], $config['files_max_speed'] );
if ($_REQUEST['area'] == "static") {
if ($config['files_count'] == "yes" and ! $file->range)
$db->query ( "UPDATE " . PREFIX . "_static_files SET dcount=dcount+1 WHERE id ='$id'" );
} else {
if ($config['files_count'] == "yes" and ! $file->range)
$db->query ( "UPDATE " . PREFIX . "_files SET dcount=dcount+1 WHERE id ='$id'" );
}
$db->close ();
$file->download_file ();
?>