&1'; break; case 2: // bsd (snip from khr0n0s) $cmd .= ' 2>&1 &'; break; } @session_write_close(); $handle = popen($cmd, 'r' ); $buff= ""; while (!feof($handle)) $buff .= fgets($handle,30); $tmpl->setvar('buff', nl2br($buff)); pclose($handle); } // set vars if ((isset($_REQUEST['file'])) && ($_REQUEST['file'] != "")) { $file = tfb_getRequestVar('file'); $dir = tfb_getRequestVar('dir'); $file = str_replace($cfg["path"], '', $file); $dir = str_replace($cfg["path"], '', $dir); $targetFile = $cfg["path"].$file; // only valid dirs + entries with permission if (!((tfb_isValidPath($targetFile)) && (isValidEntry(basename($targetFile))) && (hasPermission($file, $cfg["user"], 'r')) && (hasPermission($dir, $cfg["user"], 'w')))) { AuditAction($cfg["constants"]["error"], "ILLEGAL UNCOMPRESS-ACCESS: ".$cfg["user"]." tried to uncompress ".$file); @error("Illegal access. Action has been logged.", "", ""); } // $tmpl->setvar('is_file', 1); $tmpl->setvar('url_file', str_replace('%2F', '/', urlencode($cfg["path"].$file))); $tmpl->setvar('url_dir', str_replace('%2F', '/', urlencode($cfg["path"].$dir))); $tmpl->setvar('type', tfb_getRequestVar('type')); } else { $tmpl->setvar('is_file', 0); } // tmplSetTitleBar('Uncompress File', false); tmplSetIidVars(); // parse template $tmpl->pparse(); ?>