public function find_hash($hash, $dir)
 {
     $shell_command = "find \"{$dir}\" -! -name \\.\\*";
     $shell_result;
     exec($shell_command, $shell_result);
     foreach ($shell_result as $f) {
         if (Listing::hash_gen($f) == $hash) {
             $result = $f;
             break;
         }
     }
     # Work out the previous directory
     $dir_array = explode('/', $result);
     $previous_dir = "";
     for ($i = 0; $i < count($dir_array) - 1; $i++) {
         if ($dir_array[$i] != "") {
             $previous_dir .= "/" . $dir_array[$i];
         }
     }
     $previous_dir = Listing::hash_gen($previous_dir);
     return array('current_dir' => $result, 'previous_dir' => $previous_dir);
 }
include "includes/pitchfork-class-listing.php";
include "pitchfork-application-authenticate.php";
$search_results = new Listing();
$search_string = $_REQUEST['search'];
$search_exp = "\"*";
for ($i = 0; $i < strlen($search_string); $i++) {
    $search_exp .= "[" . strtoupper($search_string[$i]) . strtolower($search_string[$i]) . "]";
}
$search_exp .= "*\"";
$shell_command = "find " . escapeshellarg($Cfg_FolderLoc) . " -name " . $search_exp;
$shell_result;
exec($shell_command, $shell_result);
$results;
foreach ($shell_result as $f) {
    if ($f != $dir) {
        if (is_dir($f)) {
            $results['directories'][] = array('display' => end(explode('/', $f)), 'path' => $f, 'hash' => $search_results->hash_gen($f));
        } else {
            $results['files'][] = array('display' => end(explode('/', $f)), 'hash' => $search_results->hash_gen($f), 'path' => $f);
        }
    }
}
$search_index = new UserInterface();
$search_index->include_js("pitchfork-quicktime-playback.js");
$search_index->load_header();
$search_index->search_term = $search_string;
$search_index->load('search-results');
$search_index->append($search_results->print_structure($results));
$search_index->load_footer();
$search_index->return_UI();
# Part of Pitchfork.
# Include the UI processor...
include 'includes/pitchfork-class-interface.php';
include 'pitchfork-application-authenticate.php';
include 'configuration/pitchfork-configuration-user.php';
include 'includes/particletree-class-profile.php';
$Profiler = new Profile();
$index_UI = new UserInterface();
include 'includes/pitchfork-class-listing.php';
$recurse = true;
if ($_REQUEST['view'] != "full") {
    $recurse = false;
}
$list = new Listing();
if (!$_REQUEST['mask']) {
    $mask = $Cfg_FolderLoc;
    $index_UI->zip_hash = Listing::hash_gen($Cfg_FolderLoc);
    $index_UI->previous_href = "";
} else {
    $context = Listing::find_hash($_REQUEST['mask'], $Cfg_FolderLoc);
    $mask = $context['current_dir'];
    $index_UI->zip_hash = $_REQUEST['mask'];
}
if ($mask != $Cfg_FolderLoc) {
    $index_UI->previous_href = "pitchfork-application-index.php?mask=" . $context['previous_dir'];
} else {
    $index_UI->previous_href = "pitchfork-application-index.php";
}
# Set a title for this page (that will appear in the browser window title and on the page)
if ($hash == $Cfg_FolderLoc) {
    $index_UI->set_page_title("Index of all files");
} else {