foreach ($_POST as $k => $v) { $_POST[$k] = stripslashes($v); } foreach ($_GET as $k => $v) { $_GET[$k] = stripslashes($v); } } /*---End Login---*/ if (isset($_GET['down'])) { do_down($_GET['down']); } if (isset($_GET['pack'])) { $dir = do_show($_GET['pack']); $zip = new eanver($dir); $out = $zip->out; do_download($out, "eanver.tar.gz"); } if (isset($_GET['unzip'])) { css_main(); start_unzip($_GET['unzip'], $_GET['unzip'], $_GET['todir']); exit; } define('root_dir', str_replace('\\', '/', dirname(myaddress)) . '/'); define('run_win', substr(PHP_OS, 0, 3) == "WIN"); define('my_shell', str_path(root_dir . $_SERVER['SCRIPT_NAME'])); $eanver = isset($_GET['eanver']) ? $_GET['eanver'] : ""; $doing = isset($_POST['doing']) ? $_POST['doing'] : ""; $path = isset($_GET['path']) ? $_GET['path'] : root_dir; $name = isset($_POST['name']) ? $_POST['name'] : ""; $img = isset($_GET['img']) ? $_GET['img'] : ""; $p = isset($_GET['p']) ? $_GET['p'] : "";
function get_wu_output_files($wu_id, $auth_str) { $wu = BoincWorkunit::lookup_id($wu_id); if (!$wu) { die("no workunit {$wu_id}"); } $batch = BoincBatch::lookup_id($wu->batch); if (!$batch) { die("no batch {$wu->batch}"); } $user = BoincUser::lookup_id($batch->user_id); if (!$user) { die("no user {$batch->user_id}"); } $x = md5($user->authenticator . $wu_id); echo "user authenticator= {$user->authenticator}, wu_id={$wu_id}<br/>"; if ($x != $auth_str) { die("bad auth str: x={$x}, auth_str={$auth_str}"); } $zip_basename = tempnam("/tmp", "boinc_wu_" . $wu->name . "_"); $zip_filename = $zip_basename . ".zip"; $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); $upload_dir = parse_config(get_config(), "<upload_dir>"); if (!$wu->canonical_resultid) { die("no canonical result for wu {$wu->name}"); } $result = BoincResult::lookup_id($wu->canonical_resultid); $names = get_outfile_names($result); foreach ($names as $name) { $path = dir_hier_path($name, $upload_dir, $fanout); if (is_file($path)) { system("nice -9 zip -jq {$zip_basename} {$path}"); } } do_download($zip_filename); unlink($zip_filename); unlink($zip_basename); }
function download_file($user) { $name = get_str('name'); $dir = sandbox_dir($user); list($err, $size, $md5) = sandbox_parse_link_file("{$dir}/{$name}"); if ($err) { error_page("can't parse link file"); } $p = sandbox_physical_path($user, $md5); if (!is_file($p)) { error_page("{$p} does not exist!"); } do_download($p, $name); }
do_mkdir(); break; case 'showrename': do_showrename(); break; case 'rename': do_rename(); break; case 'showmove': do_showmove(); break; case 'move': do_move(); break; case 'download': do_download(); break; case 'showdelete': do_showdelete(); break; case 'delete': do_delete(); break; default: // no matching $action in input fatal_error(sprintf(_("Invalid action: '%s'"), html_safe($action))); break; } function do_showdir() { global $curr_relpath, $hce_curr_displaypath, $home_dirname;