aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/canonicalise-csv3
-rwxr-xr-xbin/convert.pl49
-rwxr-xr-xbin/convertL.pl62
-rwxr-xr-xbin/convertLB.pl51
-rw-r--r--conf/httpd.conf4
-rwxr-xr-xweb/index.cgi5
6 files changed, 6 insertions, 168 deletions
diff --git a/bin/canonicalise-csv b/bin/canonicalise-csv
index 6163b3741..17b952769 100755
--- a/bin/canonicalise-csv
+++ b/bin/canonicalise-csv
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: canonicalise-csv,v 1.2 2007-01-26 22:48:30 matthew Exp $
+# $Id: canonicalise-csv,v 1.3 2007-02-02 12:23:06 matthew Exp $
use strict;
require 5.8.0;
@@ -31,6 +31,7 @@ while (<FP>) {
s/\r?\n//g;
my ($name, $email) = split /,/;
$email ||= '';
+ $email =~ s/\xa0//g;
# Canonicalise
next if $name eq 'Londonderry'; # Dupe of Derry
diff --git a/bin/convert.pl b/bin/convert.pl
deleted file mode 100755
index a5e3d7a6b..000000000
--- a/bin/convert.pl
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/perl -w
-
-# convert.pl:
-# Out of date tile conversion
-#
-# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: convert.pl,v 1.1 2006-09-19 15:08:36 matthew Exp $
-
-use strict;
-
-my @squares = (
- '', '', '', '', 'HP', '', '',
- '', '', '', 'HT', 'HU', '', '',
- '', 'HW', 'HX', 'HY', 'HZ', '', '',
- 'NA', 'NB', 'NC', 'ND', '', '', '',
- 'NF', 'NG', 'NH', 'NJ', 'NK', '', '',
- 'NL', 'NM', 'NN', 'NO', '', '', '',
- '', 'NR', 'NS', 'NT', 'NU', '', '',
- '', 'NW', 'NX', 'NY', 'NZ', 'OV', '',
- '', '', 'SC', 'SD', 'SE', 'TA', '',
- '', '', 'SH', 'SJ', 'SK', 'TF', 'TG',
- '', 'SM', 'SN', 'SO', 'SP', 'TL', 'TM',
- '', 'SR', 'SS', 'ST', 'SU', 'TQ', 'TR',
- 'SV', 'SW', 'SX', 'SY', 'SZ', 'TV', '');
-
-my %squares;
-my $i = 0;
-foreach my $square (@squares) {
- $squares{$square} = $i if $square;
- $i++;
-}
-
-for (<*.png>) {
- /^(..)-(\d+)\.png$/ or die $!;
- my $square = $1;
- $square = $squares{$square};
- my $square_row = int($square/7);
- my $square_col = $square%7;
- my $part = $2;
- my $part_row = int($part/16);
- my $part_col = $part%16;
-
- my $out_col = $square_col*16+$part_col;
- my $out_row = $square_row*16+$part_row;
- print "$_ $square_row $square_col $part_row $part_col : $out_col x $out_row\n";
- system("cp $_ $out_col.$out_row.png");
-}
diff --git a/bin/convertL.pl b/bin/convertL.pl
deleted file mode 100755
index 429dc26d9..000000000
--- a/bin/convertL.pl
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/perl -w
-
-# convertL.pl:
-# Out of date tile conversion
-#
-# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-
-use strict;
-
-my @squares = (
- '', '', '', '', 'HP', '', '',
- '', '', '', 'HT', 'HU', '', '',
- '', 'HW', 'HX', 'HY', 'HZ', '', '',
- 'NA', 'NB', 'NC', 'ND', '', '', '',
- 'NF', 'NG', 'NH', 'NJ', 'NK', '', '',
- 'NL', 'NM', 'NN', 'NO', '', '', '',
- '', 'NR', 'NS', 'NT', 'NU', '', '',
- '', 'NW', 'NX', 'NY', 'NZ', 'OV', '',
- '', '', 'SC', 'SD', 'SE', 'TA', '',
- '', '', 'SH', 'SJ', 'SK', 'TF', 'TG',
- '', 'SM', 'SN', 'SO', 'SP', 'TL', 'TM',
- '', 'SR', 'SS', 'ST', 'SU', 'TQ', 'TR',
- 'SV', 'SW', 'SX', 'SY', 'SZ', 'TV', '');
-
-my %squares;
-my $i = 0;
-foreach my $square (@squares) {
- $squares{$square} = $i if $square;
- $i++;
-}
-
-print "Converting TIF to PNGs...\n";
-for (</home/tom/25k/BaseMap/*.TIF>) {
- /(S[Q-Z]\d+).TIF$/ or next;
- my $name = $1;
- unless (-e "$name-0.png") {
- print " $_\n";
- `convert $_ -crop 250x250 tl/$name.png`;
- }
-}
-print "Renaming PNGs...\n";
-for (<tl/*.png>) {
- /^tl\/(..)(\d+)-(\d+)\.png$/ or next;
- print " $_\n";
- my $square = $1;
- $square = $squares{$square};
- my $square_row = int($square/7);
- my $square_col = $square%7;
- my $parta = $2;
- my $parta_col = int($parta/10);
- my $parta_row = 9 - $parta%10;
- my $partb = $3;
- my $partb_row = int($partb/16);
- my $partb_col = $partb%16;
-
- my $out_col = ($square_col*10+$parta_col)*16+$partb_col;
- my $out_row = ($square_row*10+$parta_row)*16+$partb_row;
-# print "$_ $out_col x $out_row\n";
- system("mv $_ tl/$out_col.$out_row.png");
-}
-print "Done.\n";
diff --git a/bin/convertLB.pl b/bin/convertLB.pl
deleted file mode 100755
index 42a2401db..000000000
--- a/bin/convertLB.pl
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/perl -w
-
-# convertLB.pl:
-# Out of date tile conversion
-#
-# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: convertLB.pl,v 1.1 2006-09-19 15:08:36 matthew Exp $
-
-use strict;
-
-my @squares = (
- '', '', '', '', 'HP', '', '',
- '', '', '', 'HT', 'HU', '', '',
- '', 'HW', 'HX', 'HY', 'HZ', '', '',
- 'NA', 'NB', 'NC', 'ND', '', '', '',
- 'NF', 'NG', 'NH', 'NJ', 'NK', '', '',
- 'NL', 'NM', 'NN', 'NO', '', '', '',
- '', 'NR', 'NS', 'NT', 'NU', '', '',
- '', 'NW', 'NX', 'NY', 'NZ', 'OV', '',
- '', '', 'SC', 'SD', 'SE', 'TA', '',
- '', '', 'SH', 'SJ', 'SK', 'TF', 'TG',
- '', 'SM', 'SN', 'SO', 'SP', 'TL', 'TM',
- '', 'SR', 'SS', 'ST', 'SU', 'TQ', 'TR',
- 'SV', 'SW', 'SX', 'SY', 'SZ', 'TV', '');
-
-my %squares;
-my $i = 0;
-foreach my $square (@squares) {
- $squares{$square} = $i if $square;
- $i++;
-}
-
-for (<tl/*.png>) {
- /^tl\/(\d+)\.(\d+)\.png$/ or die;
- my $x = $1;
- my $y = $2;
- my $partb_col = $x%16;
- my $partb_row = $y%16;
- my $parta_col = int($x/16)%10;
- my $parta_row = 9 - int($y/16)%10;
- my $square_col = int(int($x/16)/10);
- my $square_row = int(int($y/16)/10);
-
- my $square = $squares[$square_row*7+$square_col];
- my $parta = 10*$parta_col+$parta_row;
- my $partb = $partb_col+$partb_row*16;
-# print "$_ : $square$parta-$partb.png\n";
- system("mv $_ tl/$square$parta-$partb.png");
-}
diff --git a/conf/httpd.conf b/conf/httpd.conf
index 242d7f5f0..b67f00206 100644
--- a/conf/httpd.conf
+++ b/conf/httpd.conf
@@ -20,7 +20,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org
#
-# $Id: httpd.conf,v 1.7 2007-01-26 01:05:35 matthew Exp $
+# $Id: httpd.conf,v 1.8 2007-02-02 12:23:07 matthew Exp $
DirectoryIndex index.cgi
@@ -46,7 +46,7 @@ RewriteRule /(.+) /$1.cgi [PT]
# Make a file down.html in the DocumentRoot bring down the whole site and
# display itself.
RewriteCond %{DOCUMENT_ROOT}/down.html -s
-RewriteRule /(.+).php /down.html [R]
+RewriteRule /(.+).cgi /down.html [R]
RewriteCond %{DOCUMENT_ROOT}/down.html !-s
RewriteRule /down.html / [R]
diff --git a/web/index.cgi b/web/index.cgi
index 06b589d9a..c0e634533 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.61 2007-01-30 17:56:33 matthew Exp $
+# $Id: index.cgi,v 1.62 2007-02-02 12:23:07 matthew Exp $
# TODO
# Nothing is done about the update checkboxes - not stored anywhere on anything!
@@ -53,8 +53,6 @@ BEGIN {
dbh()->do('insert into secret (secret) values (?)', {}, unpack('h*', mySociety::Util::random_bytes(32)));
}
dbh()->commit();
-
- mySociety::MaPit::configure();
}
# Main code for index.cgi
@@ -776,6 +774,7 @@ sub is_valid_council {
$councils = [ $councils ] unless ref($councils) eq 'ARRAY';
my @councils_no_email = (2288,2402,2390,2252,2351,2430,2375,2285,2377,2374,2330,2454,2284,2378,2294,2312,2419,2386,2363,2353,2296,2300,2291,2268,2512,2504,2495,2510,
2530,2516,2531,2545,2586,2554,2574,2580,2615,2596,2599,2601,2648,2652,2607,2582,14287,14317,14328,2225,2242,2222,2248,2246,2235,2224,2244,2236);
+
my $invalid_councils;
grep (vec($invalid_councils, $_, 1) = 1, @councils_no_email);