function access_check($login, $password, $realm) { if (!($_SERVER['PHP_AUTH_USER'] == "{$login}" && $_SERVER['PHP_AUTH_PW'] == "{$password}")) { header("WWW-authenticate: Basic Realm={$realm}"); Header("HTTP/1.0 401 Unauthorized"); $err = new C_www(); $err->header("Access Denied"); echo "<div class=\"error\">\n"; echo "<h1>Access Denied</h1>\n"; echo "<p>Sorry, this gallery is restricted</p>\n"; echo "<p><a href=\"index.php\">Return to index</a></p>\n"; echo "</div>\n"; $err->footer(); exit; } }
$page = new C_www(); //default colors if (!is_dir("{$gallery_dir}/{$galerie}/thumbs")) { $galerie = ""; } //read interesting stuff from info.txt if ($galerie) { readInfo("{$root}/{$gallery_dir}/{$galerie}/info.txt", $galerie); //check for restricted access if ($galerielogin[$galerie]) { access_check($galerielogin[$galerie], $galeriepw[$galerie], $galerie); } } $page->process_comment_form(); //START RENDERING $page->header("Photos"); require "inc/header.inc.php"; // folder > tree //print "<div class=\"navigation\"><a href=\"$ThisScript\">" . $scnamegallery . "</a>"; print "<div class=\"navigation\"><a href=\"./\">" . $scnamegallery . "</a>"; ############################# # Overall Gallery Index # ############################# if (!$galerie) { # finish off navigation bar print "</div>\n\n<!-- listing galleries-->\n\n"; # I've nuked date.txt to replace it with a more generic info.txt # It optionally supplies i18n name, camera model, author and date # TODO: imgconv script support while ($file = $adr->Read()) { // checking for inc is only really needed when gallery_dir == $root
<?php require_once "lib/lib.l10n.php"; require_once "inc/config.inc.php"; require_once "inc/www.class.inc.php"; require_once "inc/funkce.inc.php"; l10n::set("{$root}/l10n/" . $sclang . "/main.lang"); $page = new C_www(); if ($GLOBALS['have_sqlite']) { $page->header("Photo Statistics"); require "inc/header.inc.php"; //recent views print "<h2>Recently Viewed</h2>"; //recently commented print "<h2>Recently Commented</h2>"; //most viewed print "<h2>Most Viewed</h2>"; //most discussed print "<h2>Most Discussed</h2>"; } else { $page->error("No SQLite", "You need SQLite to use view statistics."); } $page->footer();