- sandbox stuff

svn path=/trunk/boinc/; revision=24985
This commit is contained in:
David Anderson 2012-01-03 09:30:43 +00:00
parent d81fa10439
commit e05e872132
1 changed files with 25 additions and 0 deletions

View File

@ -60,4 +60,29 @@ function sandbox_physical_path($user, $md5) {
return dir_hier_path($f, "../../download", $fanout);
}
// return list of files in sandbox
//
function sandbox_file_names($user) {
$d = opendir(sandbox_dir($user));
$names = array();
while (($f = readdir($d)) !== false) {
if ($f == '.') continue;
if ($f == '..') continue;
$names[] = $f;
}
return $names;
}
// return a <select> for files in sandbox
//
function sandbox_file_select($user, $select_name) {
$x = "<select name=$select_name>\n";
$files = sandbox_file_names($user);
foreach ($files as $f) {
$x .= "<option value=\"$f\">$f</option>\n";
}
$x .= "</select>\n";
return $x;
}
?>