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; } }
$snimek = $_GET["photo"]; } $snimek = intval($snimek); $y = ''; if (isset($_GET['y'])) { $y = $_GET["y"]; } $cmnt = ''; if (isset($_GET["cmnt"])) { $cmnt = $_GET["cmnt"]; } $show_thumbs = ''; if (isset($_GET["show_thumbs"])) { $show_thumbs = $_GET["show_thumbs"]; } $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");
<?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();