Hallo alle zusammen!
Weis einer von euch was ich da falsch mache?
Vielleicht kann mir einer von euch weiterhelfen
Weis einer von euch was ich da falsch mache?
Code:
Fatal error: Cannot instantiate non-existent class: config_data in /usr/export/www/vhosts/funnetwork/hosting/index.php on line 83
Vielleicht kann mir einer von euch weiterhelfen
PHP:
<?php
/* OPTIONAL SETTINGS */
$stored_config = 'AutoIndex.conf.php';
$config_generator = 'config.php';
$path_to_classes = './classes/';
/* END OPTIONAL SETTINGS */
function get_microtime()
{
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
$start_time = get_microtime();
session_start();
define('IN_AUTOINDEX', true);
define('VERSION', '2.0.0 beta 4');
define('GUEST', 0);
define('USER', 1);
define('ADMIN', 2);
function __autoload($class)
{
global $path_to_classes;
$file = "$path_to_classes$class.php";
if (!@include_once($file))
{
die("Error including file <i>$file</i>.");
}
}
if (get_magic_quotes_gpc())
//remove any slashes added by the "magic quotes" setting
{
foreach ($_GET as $key => $element)
{
$_GET[$key] = stripslashes($element);
}
foreach ($_POST as $key => $element)
{
$_POST[$key] = stripslashes($element);
}
}
if (ini_get('zlib.output_compression') == '1')
//compensate for compressed output set in php.ini
{
header('Content-Encoding: gzip');
}
//now we need to include either the stored settings, or the config generator
if (is_file($stored_config))
{
$config = new config_data($stored_config);
}
else if (is_file($config_generator))
{
if (!@include($config_generator))
{
new message_die("Error including file <i>$config_generator</i>");
}
die();
}
else
{
new message_die("Neither <i>$config_generator</i> nor <i>$stored_config</i> could be found.");
}
function client_ip()
{
if (isset($_SERVER['HTTP_CLIENT_IP']))
{
return $_SERVER['HTTP_CLIENT_IP'];
}
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
if (isset($_SERVER['REMOTE_ADDR']))
{
return $_SERVER['REMOTE_ADDR'];
}
return 'N/A';
}
//find the user's IP address and hostname
if (!isset($_SESSION['ip'], $_SESSION['host']))
{
$_SESSION['ip'] = client_ip();
$_SESSION['host'] = @gethostbyaddr($_SESSION['ip'])
or $_SESSION['host'] = 'N/A';
}
$ip = $_SESSION['ip'];
$host = $_SESSION['host'];
$words = new config_data($config -> __get('path_to_languages')
. $config -> __get('language') . '.txt');
$log = new logging($config -> __get('log_file'));
foreach ($config as $key => $item)
{
$$key = ($item != 'false' && $item != '0');
}
if ($banned_list && is_file($config -> __get('banned_list')))
{
$b_list = @file($config -> __get('banned_list')) or $b_list = array();
if ($b_list === false)
{
new message_die('Error reading from banned_list file.');
}
for ($i=0; $i<count($b_list); $i++)
{
$b_list[$i] = rtrim($b_list[$i]);
}
if (directory_list::match_in_array($ip, $b_list) || directory_list::match_in_array($host, $b_list))
{
new message_die('Sorry, the administrator has blocked your IP address or hostname.');
}
}
if ($hidden_files && is_file($config -> __get('hidden_files')))
{
$hidden_list = @file($config -> __get('hidden_files')) or $hidden_list = array();
if ($hidden_list === false)
{
new message_die('Error reading from hidden_list file.');
}
for ($i=0; $i<count($hidden_list); $i++)
{
$hidden_list[$i] = rtrim($hidden_list[$i]);
}
}
else
{
$hidden_list = array();
}
$speed = ($bandwidth_limit ? $config -> __get('bandwidth_limit') : 4);
if ($download_count)
{
if (!is_file($config -> __get('download_count')))
{
$h = @fopen($config -> __get('download_count'), 'wb');
if ($h === false)
{
new message_die('Could not open download count file for writing.');
}
fclose($h);
}
$downloads = new config_data($config -> __get('download_count'));
}
if ($use_login_system && isset($_POST['username'], $_POST['password'])
&& $_POST['username'] != '' && $_POST['password'] != '')
{
$you = new logged_in_user($_POST['username'], sha1($_POST['password']));
$log -> add_entry('Successful login (Username: ' . $_POST['username'] . ')');
$_SESSION['password'] = sha1($_POST['password']);
unset($_POST['password']);
$_SESSION['username'] = $_POST['username'];
}
else if ($use_login_system && isset($_SESSION['username'], $_SESSION['password']))
{
$you = new logged_in_user($_SESSION['username'], $_SESSION['password']);
}
else
{
$you = new user();
if ($use_login_system && $must_login_to_download)
{
echo new display('<p>You must login to view and download files.</p>'
.'<p><table border="0" cellpadding="8" cellspacing="0">'
.'<tr class="paragraph"><td class="default_td">'
. $you -> login_box() . '</td></tr></table></p>');
die();
}
}
if ($you -> home_dir != '')
{
$config -> set('base_dir', $you -> home_dir);
}
$dir = $config -> __get('base_dir');
if (isset($_GET['dir']))
{
$dir .= url::clean_input($_GET['dir']);
$dir = item::make_sure_slash($dir);
if (!is_dir($dir))
{
$_GET['dir'] = '';
new message_die('The directory <i>' . htmlentities($dir) . '</i> does not exist.');
}
if (isset($_GET['file']) && $_GET['file'] != '')
{
$file = url::clean_input($_GET['file']);
if (!is_file($dir.$file))
{
new message_die('File does not exist.');
}
if ($anti_leech && !isset($_SESSION['ref']) && (!isset($_SERVER['HTTP_REFERER']) || stripos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME']) === false))
{
$log -> add_entry('Leech Attempt');
new message_die('<h2>This PHP Script has an Anti-Leech feature turned on.</h2>'.
' <p>Make sure you are accessing this file directly from <a class="default_a" href="http://'
. $_SERVER['SERVER_NAME'].'">'.$_SERVER['SERVER_NAME'].'</a></p>');
}
$log -> add_entry($file);
if (isset($downloads))
{
$downloads -> add_one($dir.$file);
}
$url = new url($dir.$file);
$url -> download();
}
}
$subdir = substr($dir, strlen($config -> __get('base_dir')));
if ($md5_show && isset($_GET['md5']) && $_GET['md5'] != '')
{
$file = $dir . url::clean_input($_GET['md5']);
if (!is_file($file))
{
new message_die('Error: file does not exist.');
}
$size = filesize($file);
if ($size <= 0 || $size / 1048576 > $config -> __get('md5_show'))
{
new message_die('Empty file, or file too big to find the md5sum of (according to the $md5_show variable).');
}
die(md5_file($file));
}
if ($thumbnail_height && isset($_GET['thumbnail']) && $_GET['thumbnail'] != '')
{
$fn = url::clean_input($_GET['thumbnail']);
new image($fn);
}
if ($archive && isset($_GET['archive']))
{
$list = new directory_list($dir);
$log -> add_entry('Directory archived');
$outfile = basename($subdir);
if ($outfile == '' || $outfile == '.')
{
$outfile = 'base_dir';
}
header('Content-Type: octet/stream');
header('Content-Disposition: attachment; filename="'
. $outfile . '.tar"');
set_time_limit(0);
$tar = new tar($list -> get_file_list(), $outfile, strlen($dir));
die();
}
if ($description_file && is_file($config -> __get('description_file')))
{
$descriptions = new config_data($config -> __get('description_file'));
}
if (isset($_GET['sort']))
{
$_SESSION['sort'] = $_GET['sort'];
}
else if (!isset($_SESSION['sort']))
{
$_SESSION['sort'] = 'filename';
}
if (isset($_GET['sort_mode']))
{
$_SESSION['sort_mode'] = $_GET['sort_mode'];
}
else if (!isset($_SESSION['sort_mode']))
{
$_SESSION['sort_mode'] = 'a';
}
if (count($_FILES) > 0)
{
$upload = new upload($you);
$upload -> do_upload();
}
if (isset($_GET['logout']) && $_GET['logout'] == 'true')
{
$you -> logout();
}
if ($use_login_system && isset($_GET['action']))
{
$admin = new admin($you);
$admin -> action($_GET['action']);
}
$_SESSION['ref'] = true;
if ($search_enabled && isset($_GET['search'], $_GET['search_mode'])
&& $_GET['search'] != '' && $_GET['search_mode'] != '')
{
$s = url::clean_input($_GET['search']);
$dir_list = new search($s, $dir, $_GET['search_mode']);
$log -> add_entry("Search: $s");
}
else
{
$dir_list = new directory_list_detailed($dir);
$log -> add_entry();
}
echo new display($dir_list -> __toString());
?>