function mgp_getUser($connection) { return mgp_command($connection, 'whoami'); }
require_once "classes/Login.php"; $login = new Login(); if ($login->isUserLoggedIn() == true) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Minecraft Game Panel</title> </head> <body> <pre> <?php $connection = new Net_SFTP($server_SSH_address); $connection->login($server_SSH_username, $server_SSH_password); $status = mgp_command($connection, 'zip -r /srv/games/minecraft/minecraft-files.zip /srv/games/minecraft/'); //$connection->put('/srv/games/minecraft/minecraft-files.zip', '/srv/www/htdocs/MGP/minecraft-files.zip', NET_SFTP_LOCAL_FILE); $file = '/srv/www/htdocs/MGP/minecraft_server.zip'; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file); exit;