if ($User->type['Moderator'] && isset($_REQUEST['viewOrderLogGame']) && isset($_REQUEST['viewOrderLogCountryID'])) { $gameID = (int) $_REQUEST['viewOrderLogGame']; $countryID = (int) $_REQUEST['viewOrderLogCountryID']; require_once l_r('objects/game.php'); $Variant = libVariant::loadFromGameID($gameID); $Game = $Variant->Game($gameID); if (!($data = file_get_contents(libCache::dirID(Config::orderlogDirectory(), $gameID, true) . '/' . $countryID . '.txt'))) { trigger_error(l_t("Couldn't open file %s.txt", $log)); } header('Content-type:text/plain'); print $data; die; } if ($User->type['Admin'] && isset($_REQUEST['viewErrorLog'])) { $log = (int) $_REQUEST['viewErrorLog']; if (!($data = file_get_contents(Config::errorlogDirectory() . '/' . $log . '.txt'))) { trigger_error(l_t("Couldn't open file %s.txt", $log)); } header('Content-type:text/plain'); print $data; die; } if ($User->type['Admin'] && isset($_REQUEST['systemTask'])) { if ($Misc->Maintenance == 0) { $Misc->Maintenance = 1; $Misc->write(); libHTML::notice(l_t('Wait'), l_t("Make sure you're in maintenance-mode and no-one " . "else is using the system before running a system-task!") . "<br /> " . l_t("Maintenance mode has been set, please wait 3 mins to make sure all " . "other users are done, then click " . "<a href='admincp.php?systemTask=%s'>here</a> to " . "run the system-task safely.", $_REQUEST['systemTask']) . "<br /><br /> " . l_t("Once it has run successfully, maintenance-mode can be disabled.")); } else { ini_set('memory_limit', "32M"); // 8M is the default ini_set('max_execution_time', '120');
public static function directory() { static $dir; if (isset($dir)) { return $dir; } if (!libError::isLoggingEnabled()) { return false; } $dir = Config::errorlogDirectory(); if (!is_dir($dir)) { mkdir($dir); } if (!is_file($dir . '/index.html')) { touch($dir . '/index.html'); } if (!is_writable($dir)) { libHTML::error("Error log directory not ready; does not exist, or no protective index file"); } return $dir; }