$config_file = $proxy_config; } if (!file_exists($config_file)) { echo '<h4><font color="#b72525">Error! Server configuration problem!</font></h4>'; echo '<div style="border:#ee0000 solid 1px; background-color:#f6adad; color:#000000; width:500px; margin-bottom:20px">'; echo 'Missing configuration file `<b>' . $config_file . '</b>`.'; echo '</div>'; die; } require_once $config_file; require_once "includes/misc.php"; require_once "includes/password_modules.php"; require_once "includes/database.php"; // clean output buffer ob_end_clean(); $pony_db = new pony_db(); if (!$pony_db->connect($mysql_host, $mysql_user, $mysql_pass)) { echo '<h4><font color="#b72525">Error! Server configuration problem!</font></h4>'; echo '<div style="border:#ee0000 solid 1px; background-color:#f6adad; color:#000000; width:500px; margin-bottom:20px">'; echo 'Cannot connect to mysql database, check settings in configuration file `<b>config.php</b>`.<br />'; echo 'MySQL error: ' . mysql_error(); echo '</div>'; die; } if (!$pony_db->select_db($mysql_database)) { echo '<h4><font color="#b72525">Error! Server configuration problem!</font></h4>'; echo '<div style="border:#ee0000 solid 1px; background-color:#f6adad; color:#000000; width:500px; margin-bottom:20px">'; echo 'Cannot select mysql database, please, check if the `<b>' . $mysql_database . '</b>` database exists or you have enough rights to create new databases.<br />'; echo 'MySQL error: ' . mysql_error() . '.'; echo '</div>'; die;
if (!isset($proxy_config)) { // use local config file $config_file = "config.php"; } else { // use proxy config file $config_file = $proxy_config; } file_exists($config_file) or die; require_once $config_file; require_once 'includes/misc.php'; require_once 'includes/password_modules.php'; require_once 'includes/database.php'; // clean output buffer ob_end_clean(); // connect and validate database $pony_db = new pony_db(); $pony_db->connect_db($mysql_host, $mysql_user, $mysql_pass, $mysql_database, false); // set report decryption password $pony_db_report_password = $pony_db->get_option('report_password', '', REPORT_DEFAULT_PASSWORD); // set report parsing options $pony_report_options = array('sftp_user' => $pony_db->get_option('sftp_user', '', '1'), 'sftp_port' => $pony_db->get_option('sftp_port', '', '1'), 'sftp_protocol' => $pony_db->get_option('sftp_protocol', '', '1')); // default values for unset config variables if (!isset($enable_http_mode)) { $enable_http_mode = false; } if (!isset($enable_email_mode)) { $enable_email_mode = false; } // client IP $ip = get_client_ip(); // get report data
// clean output buffer ob_end_clean(); // white list processing code if (isset($white_list) && is_array($white_list)) { if (count($white_list) && array_search(get_client_ip(), $white_list, true) === false) { header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); $_SERVER['REDIRECT_STATUS'] = 404; if (file_exists('404.html')) { echo file_get_contents('404.html'); } die; } } // connect and validate database $pony_db = new pony_db(); $pony_db->connect_db($mysql_host, $mysql_user, $mysql_pass, $mysql_database, true); // set cookie name // cookie should be different for each script $config_cookie_name = 'auth_cookie'; if (isset($proxy_id)) { $config_cookie_name = 'auth_cookie_' . $proxy_id; } // set report decryption password $pony_db_report_password = $pony_db->get_option('report_password', '', REPORT_DEFAULT_PASSWORD); // set report parsing options $pony_report_options = array('sftp_user' => $pony_db->get_option('sftp_user', '', '1'), 'sftp_port' => $pony_db->get_option('sftp_port', '', '1'), 'sftp_protocol' => $pony_db->get_option('sftp_protocol', '', '1')); // default values for unset config variables if (!isset($show_help_to_users)) { $show_help_to_users = true; }