function updateDownload($param) { global $gbl, $sgbl, $login, $ghtml; $gen = $login->getObject('general')->generalmisc_b; ignore_user_abort(false); log_log("download", "ignored user abort"); $this->download_f = true; $this->get(); $ret = $this->serverfile_data; while (@ob_end_clean()) { } if ($this->isLocalhost('__readserver') || $gen->isOn('masterdownload')) { header("Content-Disposition: attachment; filename={$this->base}"); header('Content-Type: application/octet-stream'); header("Content-Transfer-Encoding: binary"); header("Content-Length: {$this->size}"); printFromFileServ($this->__readserver, $ret); flush(); exit; } else { $url = getFQDNforServer($this->__readserver); $ret['realname'] = $this->base; $ob = new Remote(); $ob->filepass = $ret; $var = base64_encode(serialize($ob)); $url = "http://{$url}:{$sgbl->__var_prog_port}/htmllib/lbin/filedownload.php?frm_info={$var}"; header("Location: {$url}"); //$ghtml->print_redirect($url); exit; } }
function updateBackup($param) { $ret = $this->backMeUpThere(); $fname = $this->getBackupFileNameForObject('out-' . time()); while (@ob_end_clean()) { } header('Content-Type: application/octet-stream'); header("Content-Disposition: attachment; filename={$fname}"); printFromFileServ($this->syncserver, $ret); flush(); exit; }
<?php chdir("../../"); include_once "htmllib/lib/displayinclude.php"; $info = unserialize(base64_decode($ghtml->frm_info)); if (!$info) { print "No info"; exit; } $filepass = $info->filepass; /* $ip = $_SERVER['REMOTE_ADDR']; if ($res['ip'] !== $ip) { print("You are trying to access this file from a different Ip, than the one you accessed the master with, which is prohibited <br> Possibly an attempt to hack. \n"); exit; } */ $size = $filepass['size']; while (@ob_end_clean()) { } header("Content-Disposition: attachment; filename={$filepass['realname']}"); header('Content-Type: application/octet-stream'); header("Content-Length: {$size}"); printFromFileServ('localhost', $filepass);