header('Location: ' . WEBPATH . '/index.php'); exitZP(); } if (empty($image) && Gallery::imageObjectClass($album)) { $image = basename($album); $album = dirname($album); } $_404_data = array($album, $image, $obj = @$_zp_gallery_page, @$_index_theme, @$_zp_page); $_zp_gallery_page = '404.php'; if (isset($_index_theme)) { $_zp_script = SERVERPATH . "/" . THEMEFOLDER . '/' . internalToFilesystem($_index_theme) . '/404.php'; } else { $_zp_script = NULL; } if (class_exists('ipBlocker')) { ipBlocker::notFound(); } header('Content-Type: text/html; charset=' . LOCAL_CHARSET); header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); zp_apply_filter('theme_headers'); if ($_zp_script && file_exists($_zp_script)) { if (isset($custom) && $custom) { require_once $custom; } include $_zp_script; } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
} unset($cloneid); } if ($_zp_loggedin) { $locale = $_zp_current_admin_obj->getLanguage(); if (!empty($locale)) { // set his prefered language setupCurrentLocale($locale); } } } if (!$_zp_loggedin) { // Clear the ssl cookie zp_clearCookie("zenphoto_ssl"); if (class_exists('ipBlocker')) { ipBlocker::load(); } } // Handle a logout action. if (isset($_REQUEST['logout'])) { $location = Zenphoto_Authority::handleLogout(); zp_clearCookie("zenphoto_ssl"); if (empty($location)) { $redirect = '?fromlogout'; if (isset($_GET['p'])) { $redirect .= "&p=" . sanitize($_GET['p']); } if (isset($_GET['searchfields'])) { $redirect .= "&searchfields=" . sanitize($_GET['searchfields']); } if (isset($_GET['words'])) {
static function load($path) { $list = getSerializedArray(getOption('ipBlocker_list')); $allow = getOption('ipBlocker_type') == 'allow'; $gate = $allow; if (!empty($list)) { $ipa = explode('.', getUserIP()); $ip = sprintf('%03u.%03u.%03u.%03u', @$ipa[0], @$ipa[1], @$ipa[2], @$ipa[3]); foreach ($list as $range) { if ($ip >= $range['start'] && $ip <= $range['end']) { $gate = !$allow; break; } } } if ($gate) { header("HTTP/1.0 403 " . gettext("Forbidden")); header("Status: 403 " . gettext("Forbidden")); exitZP(); // terminate the script with no output } else { return $path; } } } if (extensionEnabled('ibBlocker') && ipBlocker::suspended()) { header("HTTP/1.0 403 " . gettext("Forbidden")); header("Status: 403 " . gettext("Forbidden")); exitZP(); // terminate the script with no output }