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.
<?php

# Pitchfork authentication page
# Include the UI Processor...
include 'includes/pitchfork-class-interface.php';
$auth_UI = new UserInterface();
$auth_UI->set_page_title("Login");
$auth_UI->load_header();
if ($_REQUEST['access'] == 'denied') {
    $auth_UI->special = $auth_UI->load('password-wrong', false);
} else {
    $auth_UI->special = $auth_UI->load('password-prompt', false);
}
$auth_UI->load('prompt-login');
$auth_UI->load_footer();
$auth_UI->return_UI();
# Part of Pitchfork.
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 {
    $index_UI->set_page_title("Index of " . end(explode('/', $mask)));
}
# Detect the browser and see if they can be trusted with the javascript
//if(strpos($browser,"MSIE 6.0")==true){}
//else {$index_UI -> include_js("pitchfork-quicktime-playback.js");}
# Include the page header that contains all the DOCTYPES / javascript / stylesheet
$index_UI->load_header();
$dir_result = $list->ls_dir($mask, $recurse);
if ($list->directory_empty) {
    $index_UI->load("directory-empty");
} else {
    $index_UI->load('index');
    $index_UI->append("<div id=\"browser-div\">");
    $index_UI->append($dir_result);
    $index_UI->append("</div>");
}
# This closes everything up and includes the navigation elements.
$index_UI->load_footer();
# Return the User interface...
$index_UI->return_UI();
//print_r($_SESSION);
# Part of Pitchfork.