From: Tom Hughes Date: Sun, 9 May 2010 16:16:43 +0000 (+0100) Subject: Merge branch 'master' into terms X-Git-Tag: live~6337^2~6 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/61e51f88cc0242dadd3939cd0bbb5197a21cfb94?hp=303e5d3eb99284ab4fa41be85f831333f2154b0d Merge branch 'master' into terms --- diff --git a/README b/README deleted file mode 100644 index 70a915804..000000000 --- a/README +++ /dev/null @@ -1,5 +0,0 @@ -Documentation -============= - -Try `rake doc:app` and see /doc/ - diff --git a/README.mkdn b/README.mkdn new file mode 100644 index 000000000..24814ff2e --- /dev/null +++ b/README.mkdn @@ -0,0 +1,24 @@ +# Description + +This is the Rails port. The Ruby on Rails application that powers +http://www.openstreetmap.org. + +# Running it + +You can find documentation on how to setup and run the software on the +OpenStreetMap wiki: + +* http://wiki.openstreetmap.org/wiki/The_Rails_Port + +# Hacking it + +The canonnical Git repository for this software is hosted at +git.openstreetmap.org: + +* http://git.openstreetmap.org/?p=rails.git + +See commiting to the rails port on the wiki for getting your patches +integrated: + +* http://wiki.openstreetmap.org/wiki/Committing_to_the_rails_port + diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 8fdb89b22..1bab42266 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -148,7 +148,7 @@ class UserController < ApplicationController if params[:user] @user.pass_crypt = params[:user][:pass_crypt] @user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation] - @user.status = "active" + @user.status = "active" if @user.status == "pending" @user.email_valid = true if @user.save diff --git a/config/wiki_pages.yml b/config/wiki_pages.yml index 37973766b..e4ecca94b 100644 --- a/config/wiki_pages.yml +++ b/config/wiki_pages.yml @@ -10,6 +10,8 @@ cz: route=trolleybus: Cz:Tag:route=trolleybus da: key: + fee: Da:Key:fee + lit: Da:Key:lit maxheight: Da:Key:maxheight tag: highway=tertiary: Da:Tag:highway=tertiary @@ -591,6 +593,7 @@ en: leisure=sports_centre: Tag:leisure=sports centre leisure=track: Tag:leisure=track leisure=water_park: Tag:leisure=water park + man_made=compass_rose: Tag:man made=compass rose man_made=crane: Tag:man made=crane man_made=cutline: Tag:man made=cutline man_made=dyke: Tag:man made=dyke @@ -1036,6 +1039,7 @@ ja: crossing: Ja:Key:crossing cuisine: Ja:Key:cuisine cycleway: Ja:Key:cycleway + electrified: Ja:Key:electrified fixme: Ja:Key:fixme foot: Ja:Key:foot highway: Ja:Key:highway @@ -1052,6 +1056,7 @@ ja: operator: Ja:Key:operator phone: Ja:Key:phone power: Ja:Key:power + power_source: Ja:Key:power source railway: Ja:Key:railway ref: Ja:Key:ref route: Ja:Key:route @@ -1063,10 +1068,12 @@ ja: tracktype: Ja:Key:tracktype waterway: Ja:Key:waterway wheelchair: Ja:Key:wheelchair + wikipedia: Ja:Key:wikipedia wood: Ja:Key:wood tag: amenity=arts_centre: Ja:Tag:amenity=arts centre amenity=baby_hatch: Ja:Tag:amenity=baby hatch + amenity=bus_station: Ja:Tag:amenity=bus station amenity=cafe: Ja:Tag:amenity=cafe amenity=drinking_water: Ja:Tag:amenity=drinking water amenity=fast_food: Ja:Tag:amenity=fast food @@ -1078,6 +1085,7 @@ ja: amenity=toilets: Ja:Tag:amenity=toilets amenity=vending_machine: Ja:Tag:amenity=vending machine amenity=veterinary: Ja:Tag:amenity=veterinary + barrier=lift_gate: Ja:Tag:barrier=lift gate highway=crossing: Ja:Tag:highway=crossing highway=footway: Ja:Tag:highway=footway highway=pedestrian: Ja:Tag:highway=pedestrian @@ -1088,14 +1096,18 @@ ja: historic=archaeological_site: Ja:Tag:historic=archaeological site landuse=forest: Ja:Tag:landuse=forest landuse=wood: Ja:Tag:landuse=wood + leisure=dog_park: Ja:Tag:leisure=dog park leisure=ice_rink: Ja:Tag:leisure=ice rink man_made=lighthouse: Ja:Tag:man made=lighthouse natural=coastline: Ja:Tag:natural=coastline natural=wood: Ja:Tag:natural=wood + power=generator: Ja:Tag:power=generator railway=crossing: Ja:Tag:railway=crossing railway=level_crossing: Ja:Tag:railway=level crossing railway=rail: Ja:Tag:railway=rail + railway=station: Ja:Tag:railway=station shop=doityourself: Ja:Tag:shop=doityourself + shop=motorcycle: Ja:Tag:shop=motorcycle shop=outdoor: Ja:Tag:shop=outdoor tourism=hotel: Ja:Tag:tourism=hotel tourism=information: Ja:Tag:tourism=information diff --git a/script/misc/update-wiki-pages b/script/misc/update-wiki-pages old mode 100644 new mode 100755 index ffb11052e..7cd40e59e --- a/script/misc/update-wiki-pages +++ b/script/misc/update-wiki-pages @@ -42,7 +42,10 @@ Getopt::Long::Parser->new( # On --help help() if $help; -help() unless $ARGV[0]; +my $out_file = $ARGV[0]; +$out_file //= 'config/wiki_pages.yml'; + +help() unless -f $out_file; # Get a API interface my $mw = MediaWiki::API->new(); @@ -73,7 +76,7 @@ for my $lang ('', map { "${_}:" } qw[ Pt Fi De It HU Cz Fr RU Pl ]) { ok(1, "Got a total of $count{$_} ${_}s") for qw[ key value ]; # Dump to .yml file -open my $out, ">", $ARGV[0] or die "Can't open file '$ARGV[0]' supplied on the command line"; +open my $out, ">", $out_file or die "Can't open file '$out_file' supplied on the command line"; say $out "# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-wiki-pages"; say $out "# PROGRAM DO NOT MANUALLY EDIT IT"; say $out ""; diff --git a/script/update-spam-blocks b/script/update-spam-blocks new file mode 100755 index 000000000..eaf7d9dc3 --- /dev/null +++ b/script/update-spam-blocks @@ -0,0 +1,48 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../config/environment' +require 'generator' + +addresses = User.count( + :conditions => { + :status => ["suspended", "deleted"], + :creation_time => Time.now - 28.days .. Time.now + }, + :group => :creation_ip +) + +addresses.each do |address,count| + if count > 2 + acl = Acl.find(:first, :conditions => { + :address => address, + :netmask => "255.255.255.255" + }) + + unless acl + Acl.create( + :address => address, + :netmask => "255.255.255.255", + :k => "no_account", + :v => "auto_spam_block" + ) + + puts "Blocked #{address}" + end + end +end + +acls = Acl.find(:all, :conditions => { + :netmask => "255.255.255.255", + :k => "no_account_creation", + :v => "auto_spam_block" +}) + +acls.each do |acl| + unless addresses[acl.address] + acl.delete + + puts "Unblocked #{acl.address}" + end +end + +exit 0