#!/usr/bin/perl use strict; use warnings; use lib $ENV{'DOCUMENT_ROOT'} . "/../lib/gal/lib"; use lib $ENV{'DOCUMENT_ROOT'} . "/../lib/perl"; use UCW::CGI; use UCW::CGI::ErrorHandler; use UCW::Gallery; use UCW::Gallery::Web::HighSlide; my $dir; UCW::CGI::parse_args({ dir => { var => \$dir, check => '^\w+(/([A-Za-z0-9][A-Za-z0-9.-]*))*$' }, }); my $path = $ENV{'DOCUMENT_ROOT'} . "/../lib/photos/$dir"; if ($dir ne "" && -f "$path/gallery.cf") { chdir $path or die; my $gal = UCW::Gallery->load_config(); UCW::Gallery::Web::HighSlide->run($gal); } else { print STDERR "Gallery not found: $path\n"; UCW::CGI::http_error("404 Gallery Not Found"); }