For checkouts or to view logs direct your SVN client to svn://svn.saintamh.org/code/mapedit/index.cgi

#!/usr/bin/perl -Tw
use warnings;
use strict;
$|++;

# file: index.cgi

# Herve Saint-Amand
# Edinburgh
# Wed Jun  9 14:32:50 2010

#------------------------------------------------------------------------------
# includes

# CPAN modules
use CGI;
use CGI::Carp qw/fatalsToBrowser/;

# external libs
use lib 'lib';
use Saintamh::Files qw/&read/;

# saintamh.org modules
use lib '/home/saintam1/www/inc/perl';
use login;

#------------------------------------------------------------------------------

my ($GMAP_KEY) = &read ('.gmap.secrets');
my ($domain) = &read ('.domain');
my ($title) = eval {
    &read ('.title');
}; if ($@) {
    $title = "Map Editor";
}

my $user = &login::current_user;
my $CAN_EDIT = ($user && $user->can_access_domain ($domain)) ? 1 : 0;

#------------------------------------------------------------------------------
# print out

my $html = &read ('_index.html');
$html =~ s/\$GMAP_KEY/$GMAP_KEY/g;
$html =~ s/\$CAN_EDIT/$CAN_EDIT/g;
$html =~ s/\$TITLE/$title/g;

print "Content-Type: text/html\n\n$html";

#------------------------------------------------------------------------------