debugLog("The 'git' binary was not found or could not be executed on your server, aborting deployment!", $config['debug']); outputLog($config, true); } debugLog("Git version detected: {$git_output}", $config['debug']); $application = isset($_GET['app']) ? $_GET['app'] : false; if ($application) { if (isset($config['sites'][$application])) { $config = array_merge(['debug' => $config['debug'], 'key' => $config['key'], 'user' => $config['user'], 'git_bin' => $config['git_bin'], 'is_github' => $config['is_github'], 'github_deploy_events' => $config['github_deploy_events'], 'is_bitbucket' => $config['is_bitbucket'], 'bitbucket_deploy_events' => $config['bitbucket_deploy_events'], 'ip_whitelist' => $config['ip_whitelist'], 'pre_commands' => $config['pre_commands'], 'deploy_commands' => $config['deploy_commands'], 'post_commands' => $config['post_commands']], $config['sites'][$application]); debugLog("Application specific configurtion detected and being used!", $config['debug']); } else { debugLog("The requested site/application ({$application}) configuration was not found!", $config['debug']); setStatusCode(HTTP_NOTFOUND); outputLog($config, true); } } checkIpAuth($config); checkKeyAuth($config); if ($config['is_github']) { debugLog("Repository flagged as GitHub hosted.", $config['debug']); if (!in_array(requestHeader('X-Github-Event'), $config['github_deploy_events'])) { debugLog("The GitHub hook event (" . requestHeader('X-Github-Event') . ") was not found in the github_deploy_events list, skipping the deployment!", $config['debug']); outputLog($config, true); } } if ($config['is_bitbucket']) { debugLog("Repository flagged as BitBucket hosted.", $config['debug']); if (!in_array(requestHeader('X-Event-Key'), $config['bitbucket_deploy_events'])) { debugLog("The BitBucket hook event (" . requestHeader('X-Event-Key') . ") was not found in the 'bitbucket_deploy_events' list, skipping the deployment!", $config['debug']); outputLog($config, true); } }
/* */ /****************************************************************************/ /*************************************************************** * Define that we are here in the BF2 Admin area, prevents direct linking of files ***************************************************************/ DEFINE('_BF2_ADMIN', 1); /*************************************************************** * Import Configurations and Security scripts ***************************************************************/ require 'includes/utils.php'; require 'includes/admin.security.php'; $cfg = new Config(); /*************************************************************** * Check to see if users IP is authorized to view the ASP ***************************************************************/ if (!checkIpAuth($cfg->get('admin_hosts'))) { die("<font color='red'>ERROR:</font> You are NOT Authorised to access this Page!"); } /*************************************************************** * Import database class ***************************************************************/ include 'includes/db/class.database.php'; $DB = new Database($cfg->get('db_host'), $cfg->get('db_port'), $cfg->get('db_user'), $cfg->get('db_pass'), $cfg->get('db_name')); /*************************************************************** * Check for login / logout requests ***************************************************************/ if ($_POST['action'] == 'login') { processLogin(); } elseif ($_POST['action'] == 'logout' || $_GET['action'] == 'logout') { processLogout(); }
if (file_exists(chkPath($cfg->get('stats_logs')) . "bad/EOF")) { } else { mkdir(chkPath($cfg->get('stats_logs')) . "bad/EOF", 0777); } if (file_exists(chkPath($cfg->get('stats_logs')) . "bad/NOTAUTH")) { } else { mkdir(chkPath($cfg->get('stats_logs')) . "bad/NOTAUTH", 0777); } if (file_exists(chkPath($cfg->get('stats_logs')) . "bad/GAMEMOD")) { } else { mkdir(chkPath($cfg->get('stats_logs')) . "bad/GAMEMOD", 0777); } // Check for Complete Snapshot data //print_r($data); // Check remote host is authorised (simple security check) if (!checkIpAuth($game_hosts)) { $errmsg = "Unauthorised Access Attempted! (IP: " . $_SERVER['REMOTE_ADDR'] . ")"; ErrorLog($errmsg, 0); $fn_src = chkPath($cfg->get('stats_logs')) . $stats_filename; if (!file_exists(chkPath($cfg->get('stats_logs')) . "bad/NOTAUTH/" . $ip_s)) { mkdir(chkPath($cfg->get('stats_logs')) . "bad/NOTAUTH/" . $ip_s, 0777); } $fn_dest = chkPath($cfg->get('stats_logs')) . "bad/NOTAUTH/" . $ip_s . "/" . $stats_filename; if (file_exists($fn_src)) { if (file_exists($fn_dest)) { $errmsg = "SNAPSHOT Data File Already Exists, Over-writing! ({$fn_src} -> {$fn_dest})"; ErrorLog($errmsg, 2); } copy($fn_src, $fn_dest); // Remove the original ONLY if it copies if (file_exists($fn_dest)) {
* 06/12/10 - Removed passengerAssists/driverAssists * * 06/12/10 - Removed cpNeutralizeAssists/cpNeutralizes * * 06/12/10 - Fixed Opponent/Victim kills * * 06/12/10 - Fixed missed wins/loss * ********************************************************/ //Disable Zlib Compression ini_set('zlib.output_compression', '0'); //Make Sure Script doesn't timeout even if the user disconnects! set_time_limit(0); ignore_user_abort(true); // Import configuration require 'includes/utils.php'; $cfg = new Config(); DEFINE("_ERR_RESPONSE", "E\nH\tresponse\nD\t<font color=\"red\">ERROR</font>: "); // Check remote host is authorised (simple security check) if (!checkIpAuth($cfg->get('game_hosts'))) { $errmsg = "Unauthorised Access Attempted! (IP: " . $_SERVER['REMOTE_ADDR'] . ")"; ErrorLog($errmsg, 0); die(_ERR_RESPONSE . $errmsg); } // Get URL POST data $rawdata = file_get_contents('php://input'); // Seperate data if ($rawdata) { $gooddata = explode('\\', $rawdata); } else { $errmsg = "SNAPSHOT Data NOT found!"; ErrorLog($errmsg, 1); die(_ERR_RESPONSE . $errmsg); } // Make key/value pairs