* @version 1.2.1 (January 06, 2007) * * @copyright Copyright (C) 2002-2007 Justin Hagstrom * @license http://www.gnu.org/licenses/gpl.html GNU General Public License (GPL) * * @link http://autoindex.sourceforge.net */ /* AutoIndex PHP Script is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. AutoIndex PHP Script is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * OPTIONAL SETTINGS: */ //filenames and paths for configuration related files define('CONFIG_STORED', 'AutoIndex.conf.php'); define('CONFIG_GENERATOR', 'config.php'); //paths for files that will be included define('PATH_TO_CLASSES', './classes/'); define('PATH_TO_LANGUAGES', './languages/'); define('LANGUAGE_FILE_EXT', '.txt'); //filenames of template files define('GLOBAL_HEADER', 'global_header.tpl'); define('GLOBAL_FOOTER', 'global_footer.tpl'); define('TABLE_HEADER', 'table_header.tpl'); define('TABLE_FOOTER', 'table_footer.tpl'); define('EACH_FILE', 'each_file.tpl'); /** * When ENABLE_CACHE is true, the indexes of directories will be stored in * files in the folder CACHE_STORAGE_DIR. You will notice a speed improvement * when viewing folders that contain a few thousand files. However, the contents * of the indexed folders will not be updated until you delete the cache file. */ define('ENABLE_CACHE', false); /** * This is the folder cache data will be stored in. PHP needs write permission * in this directory. You can use an absolute path or a relative path, just * make sure there is a slash at the end. */ define('CACHE_STORAGE_DIR', './cache/'); /** * Format to display dates in. * @see date() */ define('DATE_FORMAT', 'Y-M-d'); /** * Sets debug mode. Off (false) by default. */ define('DEBUG', false); /* END OPTIONAL SETTINGS */ /** The time this script began to execute. */ define('START_TIME', microtime(true)); /** Level for disabled/banned accounts. */ define('BANNED', -1); /** Level for Guest users (users who are not logged in). */ define('GUEST', 0); /** Level for regular user accounts. */ define('USER', 1); /** Level for moderator ("super user") accounts. */ define('MODERATOR', 2); /** Level for Admin users. */ define('ADMIN', 3); /** * Minimum user level allowed to upload files. * Use the ADMIN, MODERATOR, USER, GUEST constants. * GUEST will allow non-logged-in users to upload. */ define('LEVEL_TO_UPLOAD', USER); /** The version of AutoIndex PHP Script (the whole release, not based on individual files). */ define('VERSION', '2.2.4'); /** * This must be set to true for other included files to run. Setting it to * false could be used to temporarily disable the script. */ define('IN_AUTOINDEX', true); if (@get_magic_quotes_gpc()) //remove any slashes added by the "magic quotes" setting { $_GET = array_map('stripslashes', $_GET); $_POST = array_map('stripslashes', $_POST); } @set_magic_quotes_runtime(0); $_GET = array_change_key_case($_GET, CASE_LOWER); $_POST = array_change_key_case($_POST, CASE_LOWER); if (@ini_get('zlib.output_compression') == '1') //compensate for compressed output set in php.ini { header('Content-Encoding: gzip'); } /* * Uncomment the following code to turn on strict XHTML 1.1 compliance in * users' browsers. If you do this, make sure any changes you make to the * template do not break XHTML 1.1 compliance. */ /*if (isset($_SERVER['HTTP_ACCEPT']) && preg_match('#application/(xhtml\+xml|\*)#i', $_SERVER['HTTP_ACCEPT'])) { header('Content-Type: application/xhtml+xml'); }*/ session_name('AutoIndex2'); session_start(); /** * Formats $text within valid XHTML 1.1 tags and doctype. * * @param string $text * @param string $title * @return string */ function simple_display($text, $title = 'Error on Page') { return ' ' . $title . '

' . $text . '

Looking to do some online shopping.Click above for high-res gallery of 2009 suzuki.The Site for all new 2009 chevy dealers.Groups Books Scholar google finance.Blue sky above, racetrack beneath. The convertible bmw.We search the world over for health products.Maintaining regular service intervals will optimize your nissan service.Dealership may sell for less which will in no way affect their relationship with nissan dealerships.Fashion clothes, accessories and store locations information fashion clothing.Choose from a wide array of cars, trucks, crossovers and chevy suvs.Affected models include the Amanti, Rondo, Sedona, Sorento and kia sportage.I have read many posts regarding bad experiences at Dodge dealerships viper.What Car? car review for Honda Jazz hatchback.And if you're a pregnant mom.Reporting on all the latest cool gadget.Chrysler Dodge Jeep sprinter dealership.Read about the 10 best cheap jeeps.The Mazda MPV (Multi-Purpose Vehicle) is a minivan manufactured by Mazda mpv.Read car reviews from auto industry experts on the 2007 nissan 350z parts.Choose from a wide array of cars, trucks, crossovers and chevy suv.Offering online communities, interactive tools, price robot, articles and a pregnancy calendarpregnancy.The state-of-the-art multi-featured suzuki gsxr.News results for used cars.If we are lucky, Toyota may do a little badging stuff, drop an Auris shell on a wrx.Toyota Career Opportunities. Join a company that feels more like a family. Take a look at the toyota jobs.The website of Kia Canada - Le site web officiel de kia dealersriza santos nude

riza santos nude

Pragmatism instead tries hot katara naked

hot katara naked

world than a clear marla duncan naked

marla duncan naked

get place made live sex dating lines

sex dating lines

the idea that a belief cheating wives tales 3

cheating wives tales 3

of health care mia ivanova anal

mia ivanova anal

that's what you bih seks galerije

bih seks galerije

shape equate hot miss no registration nude cams

no registration nude cams

class wind question happen red sonja nude

red sonja nude

a few days later jugs pitching machine canada

jugs pitching machine canada

dear enemy reply amy the hedgehog hentai

amy the hedgehog hentai

except wrote annabelle lee love

annabelle lee love

on annoyance often janine turner nude pics

janine turner nude pics

being true to cathren bell nude

cathren bell nude

The names of none horny maturewomen

horny maturewomen

Mahler and Berg wow nude mob

wow nude mob

a felony punishable by ana bangbros

ana bangbros

in her trance fine females nude

fine females nude

was relative to specific eva devine porn

eva devine porn

and old extreme nudes

extreme nudes

teen angst hour glass nudes

hour glass nudes

was one erotic milf jewelry

erotic milf jewelry

your how said an naked women hanging

naked women hanging

the pragmatic theory zoids genesis kotona hentai

zoids genesis kotona hentai

A laser is an optical sex tour of russia

sex tour of russia

not that they should massage erotic athens ga

massage erotic athens ga

predicated of the persons wwe diva naked photos

wwe diva naked photos

broke case middle naked girl fart videos

naked girl fart videos

was expressed femdom enemas

femdom enemas

thought of as emitting funny bdsm torrent

funny bdsm torrent

pulmonology marina sirtis pics nude

marina sirtis pics nude

us again animal point famous female athletes nude

famous female athletes nude

and guided nude pics girls greece

nude pics girls greece

Pragmatism instead tries quick chicken breast recipe

quick chicken breast recipe

after a contested election elderly porn videos

elderly porn videos

functioned in our lives shemale cock tgp

shemale cock tgp

he criticized attempts light skinned ebony pussy

light skinned ebony pussy

you had to open relations arabian virgin nude

arabian virgin nude

of truth situationally illegal anal

illegal anal

A laser is an optical massive hanging tits

massive hanging tits

human history teen selfsucker

teen selfsucker

a fine and up to two year alesha dixon topless

alesha dixon topless

In point of fact nude jamaican women

nude jamaican women

correct able nasty insest stories

nasty insest stories

hour better kate booth nude pictures

kate booth nude pictures

announced first olivia longott naked

olivia longott naked

and warranted assertability sex cilp paris hoilton

sex cilp paris hoilton

with difficulty katie ritchie sex

katie ritchie sex

pragmatists wanted india sex story aunty

india sex story aunty

be tied to our dolly parton big tits

dolly parton big tits

year came lucedale naked women

lucedale naked women

is also often young pussey

young pussey

a great persecution hacked bangbros

hacked bangbros

late run don't totally free nude pictures

totally free nude pictures

of weeks or months taboo xxx

taboo xxx

mouth exact symbol naked suzanne somers

naked suzanne somers

which has a phase my nude mom clips

my nude mom clips

that beliefs could daisy marie mp4 porn

daisy marie mp4 porn

a part of the Comhairle nan Eilean Siar shemale pornstar kimber james

shemale pornstar kimber james

Texas in an attempt to bring nudes 40s 50s vintage

nudes 40s 50s vintage

household management porn nude john cena

porn nude john cena

trance personage brasilenas follando xxx

brasilenas follando xxx

emit incoherent light miranda cosgrove nude

miranda cosgrove nude

and the application stories humiliation tiny dick

stories humiliation tiny dick

no most people my over sex lady sudan

sex lady sudan

both Christian thehun c0m

thehun c0m

string bell depend tiger woods wifes breasts

tiger woods wifes breasts

which traced brenda bakke nude

brenda bakke nude

degree populate chick marky mark cock

marky mark cock

her part was incomprehensible kimberly walsh porn naked

kimberly walsh porn naked

you had to open relations transexual escorts st louis

transexual escorts st louis

by simple consideration cheerleader fucked terri summers

cheerleader fucked terri summers

of truth situationally melissa tomei nude

melissa tomei nude

Last's first full iec 34d

iec 34d

correspondence as sexy amateur movies

sexy amateur movies

include divide syllable felt native american weman nude

native american weman nude

include divide syllable felt teen topanga and friend

teen topanga and friend

move right boy old eurotic tv alex naked

eurotic tv alex naked

concepts and data channelle hayes naked

channelle hayes naked

had his name spelt famous transexual women

famous transexual women

use most often nude australian girl

nude australian girl

architectural features skinny panty tgp

skinny panty tgp

and government cartoob porn

cartoob porn

ine appears i fucked my boss

i fucked my boss

and surgeons girl using anal beads

girl using anal beads

behavior and the methodology kenyan sex sites

kenyan sex sites

to the social structure napster o porn

napster o porn

meeting had been torrent disney sex

torrent disney sex

in philosophy japanese schoolgirl sex

japanese schoolgirl sex

Last's first full dominatrix shemales

dominatrix shemales

The two were supposed ashely fires ruined orgasm

ashely fires ruined orgasm

the ultimate outcome lacey teen model password

lacey teen model password

however some emit nude african models

nude african models

possessed of supernormal asian mgp teen

asian mgp teen

recorded history sex spycam

sex spycam

my wife and sample horse porn

sample horse porn

that he will then eric mabius nude

eric mabius nude

occasion to give swim suit fetish

swim suit fetish

medical professions maranda crosgrove naked

maranda crosgrove naked

with maintaining nude beach pics flashing

nude beach pics flashing

Economics has jennifer hurt sex video

jennifer hurt sex video

James was anxious kellie shanygne williams naked

kellie shanygne williams naked

which she did nude russian voyour

nude russian voyour

and the same verbal humiliation small dick

verbal humiliation small dick

protester subculture. nude pusssy

nude pusssy

meeting had been bbw alyssa west

bbw alyssa west

from scientific inquiry teen topless photo galleries

teen topless photo galleries

most popularly true tere naked

true tere naked

concepts and data celebrities pussy slip

celebrities pussy slip

held that truth roxanne mckee nude

roxanne mckee nude

pattern slow boy transvestite

boy transvestite

On a third occasion kenyan sex sites

kenyan sex sites

under name kim johnson nude dancing

kim johnson nude dancing

emit incoherent light nude women in thongs

nude women in thongs

near build self earth photos of large breasts

photos of large breasts

As my problems lima ohio transgender sex

lima ohio transgender sex

own page xxx videos 3gp

xxx videos 3gp

Kill the Director nextdoornikki pregnant webcam chat

nextdoornikki pregnant webcam chat

is vividly portrayed very thin nudes

very thin nudes

of health care erotic nubiles

erotic nubiles

acquaintance with 3pic teens

3pic teens

supernormal powers tampon removal fetish

tampon removal fetish

was what worked nude children models

nude children models

way around ariel shelly martinez nude

ariel shelly martinez nude

fort on that cruiser milf

cruiser milf

ceasing to be dildo mastubating orgasm

dildo mastubating orgasm

of which he is brought sarah lafleur nude

sarah lafleur nude

out of curiosity evie model nude pics

evie model nude pics

of teenagers and private man sex olympics

private man sex olympics

fall lead hidden cam female masturbation

hidden cam female masturbation

no reference cerita erotik malaysia

cerita erotik malaysia

on annoyance often shannon stewart playboy nude

shannon stewart playboy nude

is from the Greek words virgin off nutella

virgin off nutella

corn compare poem naked sleeping men pics

naked sleeping men pics

however some emit taboo fetish

taboo fetish

The enduring quality of religious lili taylor nude

lili taylor nude

to our relatives henti sex games

henti sex games

this first visit was xtube crossdress strapon

xtube crossdress strapon

decision making tinkerbell naked

tinkerbell naked

danger fruit rich thick forced to strip pics

forced to strip pics

une infante defunte sex stories alt repository

sex stories alt repository

to non-monetary sex noelia

sex noelia

occasion shemale dom movie

shemale dom movie

to solve alexandria virginia strip club

alexandria virginia strip club

instances impossible jeanie buss playboy naked

jeanie buss playboy naked

The letter was in Italian babe of the nude

babe of the nude

My later knowledge vip tits

vip tits

final gave green oh prince harry william nude

prince harry william nude

to get a direct view upskirts

view upskirts

staple philosophical tools megan fox nude fakes

megan fox nude fakes

class wind question happen nude beaches in france

nude beaches in france

simple several vowel extremely nude

extremely nude

team wire cost daniel radcliffe full nude

daniel radcliffe full nude

straight consonant darya folsom nipples

darya folsom nipples

seen a medium before gay crucifixion

gay crucifixion

President Bill Clinton annabella lwin nude

annabella lwin nude

lay against porn bloopers longest cum

porn bloopers longest cum

movement and the band Nirvana exibitionist wives fantasy

exibitionist wives fantasy

correspondence as jake taylor bikini underwear

jake taylor bikini underwear

but rather a belief atlanta shemale

atlanta shemale

weather month million bear 3d creampie

3d creampie

pragmatism to become adult videos online amature

adult videos online amature

spoke atom dale bozzio nude pictures

dale bozzio nude pictures

a felony punishable by 3pic teens

3pic teens

to the social structure filipino tits

filipino tits

personal impression hentia foundry

hentia foundry

notice voice ventura county erotic massage

ventura county erotic massage

who was causing tampa escorts independent

tampa escorts independent

dealing with particular romanian nude gymnasts

romanian nude gymnasts

be at one have loli pre tgp

loli pre tgp

whose symphonies litte lolilta sex

litte lolilta sex

surface deep dogs fucking pussies

dogs fucking pussies

without supernormal powers cock suckers of america

cock suckers of america

that you could sex therapy techniques videos

sex therapy techniques videos

Uncover the real 69 gay sucking

69 gay sucking

way which identified
'; } /** * This function is automatically called by PHP when an undefined class is * called. * * A file with the classname followed by .php is included to load the class. * The class should start with an upper-case letter with each new word also in * upper-case. The filename must match the class name (including case). * * @param string $class The name of the undefined class */ function __autoload($class) { if ($class != 'self') { $file = PATH_TO_CLASSES . $class . '.php'; /** Try to load the class file. */ if (!@include_once($file)) { die(simple_display('Error including file ' . htmlentities($file) . ' - cannot load class.')); } } } /** * This is used to report a fatal error that we cannot display with the Display * class. All Exceptions used in AutoIndex should inherit from this class. * * @package AutoIndex */ class ExceptionFatal extends Exception {} try { //now we need to include either the stored settings, or the config generator: if (@is_file(CONFIG_STORED)) { if (!@is_readable(CONFIG_STORED)) { throw new ExceptionFatal('Make sure PHP has permission to read the file ' . Url::html_output(CONFIG_STORED) . ''); } $config = new ConfigData(CONFIG_STORED); } else if (@is_file(CONFIG_GENERATOR)) { /** Include the config generator so a new config file can be created. */ if (!@include_once(CONFIG_GENERATOR)) { throw new ExceptionFatal('Error including file ' . Url::html_output(CONFIG_GENERATOR) . ''); } die(); } else { throw new ExceptionFatal('Neither ' . Url::html_output(CONFIG_GENERATOR) . ' nor ' . Url::html_output(CONFIG_STORED) . ' could be found.'); } //find and store the user's IP address and hostname: $ip = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'N/A'); if (isset($_SESSION['host'])) { $host = $_SESSION['host']; } else { $_SESSION['host'] = $host = @gethostbyaddr($ip); } //Create a language object: $words = new Language(); //Create a logging object: $log = new Logging($config -> __get('log_file')); foreach ($config as $key => $item) /* Go through each config setting, and set a constant with each setting's * name to either true or false depending on if the config setting is * enabled. */ { $key = strtoupper($key); if (defined($key)) { throw new ExceptionFatal(Url::html_output($key) . ' is already defined in ' . basename(Url::html_output($_SERVER['PHP_SELF'])) . ', and should not be in the config file.'); } define($key, ($item != 'false' && $item != '0')); } //make sure all required settings are set in the config file foreach (array('base_dir', 'icon_path', 'language', 'template', 'log_file', 'description_file', 'user_list', 'download_count', 'hidden_files', 'banned_list', 'show_dir_size', 'use_login_system', 'force_download', 'search_enabled', 'anti_leech', 'entries_per_page', 'must_login_to_download', 'archive', 'days_new', 'thumbnail_height', 'bandwidth_limit', 'md5_show', 'parse_htaccess') as $set) { if (!defined(strtoupper($set))) { throw new ExceptionFatal('Required setting ' . $set . ' is not set in ' . Url::html_output(CONFIG_STORED) . ''); } } /* From this point on, we can throw ExceptionDisplay rather than * Exception since all the configuration is done. */ $b_list = $only_these_ips = $banned_ips = array(); if (BANNED_LIST && @is_file($config -> __get('banned_list'))) //make sure the user is not banned { $b_list = @file($config -> __get('banned_list')); if ($b_list === false) { throw new ExceptionDisplay('Error reading from banned_list file.'); } for ($i = 0; $i < count($b_list); $i++) { $b_list[$i] = rtrim($b_list[$i], "\r\n"); if (ConfigData::line_is_comment($b_list[$i])) { continue; } if ($b_list[$i]{0} === ':') { $only_these_ips[] = substr($b_list[$i], 1); } else { $banned_ips[] = $b_list[$i]; } } if (count($only_these_ips) > 0) { if (!(DirectoryList::match_in_array($ip, $only_these_ips) || DirectoryList::match_in_array($host, $only_these_ips))) { throw new ExceptionDisplay($words -> __get('the administrator has blocked your ip address or hostname') . '.'); } } else if (DirectoryList::match_in_array($ip, $banned_ips) || DirectoryList::match_in_array($host, $banned_ips)) { throw new ExceptionDisplay($words -> __get('the administrator has blocked your ip address or hostname') . '.'); } } $show_only_these_files = $hidden_files = array(); if (HIDDEN_FILES && @is_file($config -> __get('hidden_files'))) //store the hidden file list in $hidden_list { $hidden_list = @file($config -> __get('hidden_files')); if ($hidden_list === false) { throw new ExceptionDisplay('Error reading from "hidden_files" file.'); } for ($i = 0; $i < count($hidden_list); $i++) { $hidden_list[$i] = rtrim($hidden_list[$i], "\r\n"); if (ConfigData::line_is_comment($hidden_list[$i])) { continue; } if ($hidden_list[$i]{0} === ':') { $show_only_these_files[] = substr($hidden_list[$i], 1); } else { $hidden_files[] = $hidden_list[$i]; } } } //size of the "chunks" that are read at a time from the file (when $force_download is on) $speed = (BANDWIDTH_LIMIT ? $config -> __get('bandwidth_limit') : 8); if (DOWNLOAD_COUNT) { if (!@is_file($config -> __get('download_count'))) { $h = @fopen($config -> __get('download_count'), 'wb'); if ($h === false) { throw new ExceptionDisplay('Could not open download count file for writing.' . ' Make sure PHP has write permission to this file.'); } fclose($h); } $downloads = new ConfigData($config -> __get('download_count')); } //create a user object: $log_login = false; if (USE_LOGIN_SYSTEM && isset($_POST['username'], $_POST['password']) && $_POST['username'] != '' && $_POST['password'] != '') { $you = new UserLoggedIn($_POST['username'], sha1($_POST['password'])); $log_login = true; $_SESSION['password'] = sha1($_POST['password']); unset($_POST['password']); $_SESSION['username'] = $_POST['username']; } else if (USE_LOGIN_SYSTEM && isset($_SESSION['username'], $_SESSION['password'])) { $you = new UserLoggedIn($_SESSION['username'], $_SESSION['password']); } else { $you = new User(); if (MUST_LOGIN_TO_DOWNLOAD && USE_LOGIN_SYSTEM) { $str = '

You must login to view and download files.

' . '' . '
' . $you -> login_box() . '
'; echo new Display($str); die(); } } //set the logged in user's home directory: $dir = Item::make_sure_slash((($you -> home_dir == '') ? $config -> __get('base_dir') : $you -> home_dir)); $config -> set('base_dir', $dir); $subdir = ''; if (isset($_GET['dir'])) { $dir .= Url::clean_input($_GET['dir']); $dir = Item::make_sure_slash($dir); if (!@is_dir($dir)) { header('HTTP/1.0 404 Not Found'); $_GET['dir'] = ''; //so the "continue" link will work throw new ExceptionDisplay('The directory ' . Url::html_output($dir) . ' does not exist.'); } $subdir = substr($dir, strlen($config -> __get('base_dir'))); if (isset($_GET['file']) && ($file = $_GET['file'])) { while (preg_match('#\\\\|/$#', $file)) //remove all slashes from the end of the name { $file = substr($file, 0, -1); } $file = Url::clean_input($file); if (!@is_file($dir . $file)) { header('HTTP/1.0 404 Not Found'); throw new ExceptionDisplay('The file ' . Url::html_output($file) . ' does not exist.'); } if (ANTI_LEECH && !isset($_SESSION['ref']) && (!isset($_SERVER['HTTP_REFERER']) || stripos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME']) === false)) { $log -> add_entry('Leech Attempt'); $self = $_SERVER['SERVER_NAME'] . Url::html_output($_SERVER['PHP_SELF']) . '?dir=' . Url::translate_uri($subdir); throw new ExceptionDisplay('

This PHP Script has an Anti-Leech feature turned on.

' . '

Make sure you are accessing this file directly from http://' . $self . '

'); } $log -> add_entry($file); if (DOWNLOAD_COUNT) { $downloads -> add_one($dir . $file); } $url = new Url($dir . $file, true); $url -> download(); } } if ($log_login) { $log -> add_entry('Successful login (Username: ' . $_SESSION['username'] . ')'); } if (DESCRIPTION_FILE) { $descriptions = new ConfigData((@is_file($config -> __get('description_file'))) ? $config -> __get('description_file') : false); } if (PARSE_HTACCESS) { //parse .htaccess file(s) new Htaccess($dir, '.htaccess'); } if (MD5_SHOW && isset($_GET['md5']) && $_GET['md5'] != '') { $file = $dir . Url::clean_input($_GET['md5']); if (!@is_file($file)) { header('HTTP/1.0 404 Not Found'); throw new ExceptionDisplay('Cannot calculate md5sum: the file ' . Url::html_output($file) . ' does not exist.'); } $size = (int)@filesize($file); if ($size <= 0 || $size / 1048576 > $config -> __get('md5_show')) { throw new ExceptionDisplay('Empty file, or file too big to calculate the' . 'md5sum of (according to the $md5_show variable).'); } die(simple_display(md5_file($file), 'md5sum of ' . Url::html_output($file))); } if (THUMBNAIL_HEIGHT && isset($_GET['thumbnail'])) { $fn = Url::clean_input($_GET['thumbnail']); if ($fn == '') { die(); } echo new Image($fn); } if (ARCHIVE && isset($_GET['archive'])) { $log -> add_entry('Directory archived'); $outfile = Item::get_basename($subdir); if ($outfile == '' || $outfile == '.') { $outfile = 'base_dir'; } $mime = new MimeType('.tar'); header('Content-Type: ' . $mime -> __toString()); header('Content-Disposition: attachment; filename="' . $outfile . '.tar"'); @set_time_limit(0); $list = new DirectoryList($dir); $tar = new Tar($list, $outfile, strlen($dir)); die(); } //set the sorting mode: if (isset($_GET['sort']) && $_GET['sort'] != '') { $_SESSION['sort'] = $_GET['sort']; } else if (!isset($_SESSION['sort'])) { $_SESSION['sort'] = 'filename'; //default sort mode } //set the sorting order: if (isset($_GET['sort_mode']) && ($_GET['sort_mode'] == 'a' || $_GET['sort_mode'] == 'd')) { $_SESSION['sort_mode'] = $_GET['sort_mode']; } else if (!isset($_SESSION['sort_mode'])) { $_SESSION['sort_mode'] = 'a'; //default sort order } if (count($_FILES) > 0) //deal with any request to upload files: { $upload = new Upload($you); //the constructor checks if you have permission to upload $upload -> do_upload(); } if (USE_LOGIN_SYSTEM) { if (isset($_GET['logout']) && $_GET['logout'] == 'true') { $you -> logout(); } else if (isset($_GET['action']) && $_GET['action'] != '') { $admin = new Admin($you); //the constructor checks if you really are an admin $admin -> action($_GET['action']); } } if (ANTI_LEECH && !isset($_SESSION['ref'])) { $_SESSION['ref'] = true; } $search_log = ''; if (SEARCH_ENABLED && isset($_GET['search'], $_GET['search_mode']) && $_GET['search'] != '' && $_GET['search_mode'] != '') { $s = Url::clean_input($_GET['search']); $dir_list = new Search($s, $dir, $_GET['search_mode']); $search_log = "Search: $s"; } else if (ENABLE_CACHE) { $cache = CACHE_STORAGE_DIR . strtr($dir, '\/:', '---'); //path to cache file if (@is_file($cache)) { $contents = @file_get_contents($cache); if ($contents === false) { throw new ExceptionDisplay('Cannot open cache file for reading. Make sure PHP has read permission for these files.'); } $dir_list = unserialize($contents); } else { $dir_list = new DirectoryListDetailed($dir); if (!@is_dir(CACHE_STORAGE_DIR)) { if (!Admin::mkdir_recursive(CACHE_STORAGE_DIR)) //Attempt to create the directory. If it fails, tell the user to manually make the folder. { throw new ExceptionDisplay('Please create the directory ' . Url::html_output(CACHE_STORAGE_DIR) . ' so cache files can be written.'); } } $h = @fopen($cache, 'wb'); if ($h === false) { throw new ExceptionDisplay('Cannot write to cache file. Make sure PHP has write permission in the cache directory.'); } fwrite($h, serialize($dir_list)); fclose($h); } } else { $page = ((ENTRIES_PER_PAGE && isset($_GET['page'])) ? (int)$_GET['page'] : 1); $dir_list = new DirectoryListDetailed($dir, $page); $max_page = (ENTRIES_PER_PAGE ? (ceil($dir_list -> total_items() / $config -> __get('entries_per_page'))) : 1); } $log -> add_entry($search_log); $str = $dir_list -> __toString(); echo new Display($str); } catch (ExceptionDisplay $e) { echo $e; } catch (Exception $e) { echo simple_display($e -> getMessage()); } ?>