]> git.openstreetmap.org Git - rails.git/commitdiff
Merge branch 'master' into terms
authorTom Hughes <tom@compton.nu>
Sun, 9 May 2010 16:16:43 +0000 (17:16 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 9 May 2010 16:16:43 +0000 (17:16 +0100)
README [deleted file]
README.mkdn [new file with mode: 0644]
app/controllers/user_controller.rb
config/wiki_pages.yml
script/misc/update-wiki-pages [changed mode: 0644->0755]
script/update-spam-blocks [new file with mode: 0755]

diff --git a/README b/README
deleted file mode 100644 (file)
index 70a9158..0000000
--- 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 (file)
index 0000000..24814ff
--- /dev/null
@@ -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
+
index 8fdb89b227c628c78807a87535d42c5f961edb6e..1bab42266e08bf3f47cb91db9afade9362c4cc81 100644 (file)
@@ -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
index 37973766b1fed9088ae5d9097ace55f299fd80d4..e4ecca94b00d50475abb59d45ea5c2ce634a3d74 100644 (file)
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index ffb1105..7cd40e5
@@ -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 (executable)
index 0000000..eaf7d9d
--- /dev/null
@@ -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