function send_file($name) { OB_END_CLEAN(); $path = $name; //"../temp/".$name; if (!IS_FILE($path) or CONNECTION_STATUS() != 0) { return FALSE; } HEADER("Cache-Control: no-store, no-cache, must-revalidate"); HEADER("Cache-Control: post-check=0, pre-check=0", FALSE); HEADER("Pragma: no-cache"); HEADER("Expires: " . GMDATE("D, d M Y H:i:s", MKTIME(DATE("H") + 2, DATE("i"), DATE("s"), DATE("m"), DATE("d"), DATE("Y"))) . " GMT"); HEADER("Last-Modified: " . GMDATE("D, d M Y H:i:s") . " GMT"); HEADER("Content-Type: application/octet-stream"); HEADER("Content-Length: " . (string) FILESIZE($path)); HEADER("Content-Disposition: inline; filename={$name}"); HEADER("Content-Transfer-Encoding: binary\n"); if ($file = FOPEN($path, 'rb')) { while (!FEOF($file) and CONNECTION_STATUS() == 0) { print FREAD($file, 1024 * 8); FLUSH(); } FCLOSE($file); } return CONNECTION_STATUS() == 0 and !CONNECTION_ABORTED(); }
function restoreDBFromBackup() { makeRed("Restore Database? WARNING: This will drop all tables and restore data to last backup!"); echo "(Y/N): "; $data = FOPEN("php://stdin", "rb"); $input = ''; while (1 == 1) { $chunk = FREAD($data, 1); if ($chunk == "\n" || $chunk == "\r") { break; } $input .= $chunk; } FCLOSE($data); if (strtolower(@$input) == 'y') { echo "Getting Credentials from application.ini...\n"; $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); $bootstrap = $application->getBootstrap(); $options = $bootstrap->getOptions(); $db = $options['resources']['db']['params']; echo "Database Restoring. Please be patient, this could take a while..."; sleep(1); echo "."; sleep(1); echo "."; sleep(1); echo "."; echo "\n"; exec("mysql -u " . $db['username'] . " -p" . $db['password'] . " " . $db['dbname'] . " < " . APPLICATION_PATH . "/../data/dbbackup.sql", $output); makeGreen("DONE!"); echo "\n\n"; } else { echo "Operation Cancelled.\n"; } }
<br/>SmallAvatar: <img src='$player->avatar'/> <br/>MediumAvatar: <img src='$player->avatarmedium'/> <br/>LargeAvatar: <img src='$player->avatarfull'/>"; echo "<br/>SmallAvatar: <img src='$player->avatar'/>"; */ $steam64 = $player->steamid; $steamID = GetSteamNorm($steam64); //Get players ingame name $_SESSION['id'] = $steam64; $_SESSION['sid'] = $steamID; $_SESSION['name'] = $player->personaname; $_SESSION['mAvatar'] = $player->avatarmedium; $_SESSION['steamAPI'] = $_STEAMAPI; if (empty($admin)) { $str = "<?php \$admin = '{$steam64}';?>"; $fp = FOPEN("admin.php", "w"); FWRITE($fp, $str); FCLOSE($fp); echo "<p> Successfully made {$friendlyName} an admin!</p>"; header("Location: {$curdirectory}/logout.php"); } if ($steam64 == $admin) { $_SESSION['admin'] = True; } else { $_SESSION['admin'] = False; } } header("Location: {$curdirectory}/install.php"); } } } catch (ErrorException $e) {
function HTMLE_IMG_INLINE($src) { if ($src == '') { $srcfile = file_get_contents('rax-blank.jpg', true); $src = base64_encode($srcfile); } $pic = 'xx' . rand(10000, 99999); $F = FOPEN($GLOBALS['AG']['dirs']['root'] . '/' . $pic, 'w'); fputs($F, base64_decode($src)); fclose($F); return '<span><image src="' . $pic . '"></span>'; //return // '<span><object style="float:left;"' // .' type="image/jpeg" data="data:;base64,'.$src.'">' // .'</object></span>'; //.' type="image/jpeg" data="data:;base64,'.$src.'">' }
} if (empty($prices)) { $prices = array("1", "2", "3"); } if (empty($ranks)) { $ranks = array("iron", "bronze", "gold"); } if (empty($commands)) { $commands = array("ulx adduserid", "ulx adduserid", "ulx adduserid"); } if (empty($messageRankFail)) { $messageRankFail = ' Thank you for your purchase $name Your rank information ------------------------- Paid: \\$fee SteamID: \\$steamid Rank: \\$rank ------------------------- There has been an issue when adding your SteamID to the correct usergroup. Please contact the server admin to resolve this issue.'; } if (empty($messageSuccess)) { $messageSuccess = 'Thank you for your purchase $name Your rank information ------------------------- Paid: \\$fee SteamID: \\$steamid Rank: \\$rank ------------------------- Your rank will be available immediately'; } if (empty($messageIPNFail)) {