From 2d7785d0417ab162696db830fd66f8c730acbaed Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Thu, 2 Oct 2014 16:14:25 +0200 Subject: Disable JSOM APIs, remove all access to nen-existing table. --- web/lib/api/v4/josm.rb | 24 ++---------------------- web/lib/api/v4/key.rb | 23 ++--------------------- web/lib/api/v4/tag.rb | 20 ++------------------ web/lib/ui/keys.rb | 1 - web/lib/ui/tags.rb | 1 - 5 files changed, 6 insertions(+), 63 deletions(-) (limited to 'web/lib') diff --git a/web/lib/api/v4/josm.rb b/web/lib/api/v4/josm.rb index e72e484..30cda00 100644 --- a/web/lib/api/v4/josm.rb +++ b/web/lib/api/v4/josm.rb @@ -42,28 +42,8 @@ class Taginfo < Sinatra::Base :example => { :style => 'standard', :page => 1, :rp => 10 }, :ui => '/reports/josm_styles' }) do - style = params[:style] - - total = @db.count('josm_style_rules'). -# condition('style = ?', style). - condition_if("k LIKE ? ESCAPE '@' OR v LIKE ? ESCAPE '@'", like_contains(params[:query]), like_contains(params[:query])). - get_first_value().to_i - - res = @db.select('SELECT * FROM josm_style_rules'). -# condition('style = ?', style). - condition_if("k LIKE ? ESCAPE '@' OR v LIKE ? ESCAPE '@'", like_contains(params[:query]), like_contains(params[:query])). - order_by(@ap.sortname, @ap.sortorder) { |o| - o.key :k - o.key :v - o.key :b - o.value :v - o.value :b - o.value :k - o.b - }. - paging(@ap). - execute() - + total = 0 + res = [] return get_josm_style_rules_result(total, res); end diff --git a/web/lib/api/v4/key.rb b/web/lib/api/v4/key.rb index 813af1d..9deb394 100644 --- a/web/lib/api/v4/key.rb +++ b/web/lib/api/v4/key.rb @@ -127,27 +127,8 @@ class Taginfo < Sinatra::Base :example => { :style => 'standard', :key => 'highway', :page => 1, :rp => 10 }, :ui => '/keys/highway#josm' }) do - style = params[:style] - key = params[:key] - - total = @db.count('josm_style_rules'). -# condition('style = ?', style). - condition('k = ?', key). - condition_if("v LIKE ? ESCAPE '@'", like_contains(params[:query])). - get_first_value().to_i - - res = @db.select('SELECT * FROM josm_style_rules'). -# condition('style = ?', style). - condition('k = ?', key). - condition_if("v LIKE ? ESCAPE '@'", like_contains(params[:query])). - order_by(@ap.sortname, @ap.sortorder) { |o| - o.value :v - o.value :b - o.b - }. - paging(@ap). - execute() - + total = 0 + res = [] return get_josm_style_rules_result(total, res); end diff --git a/web/lib/api/v4/tag.rb b/web/lib/api/v4/tag.rb index 8e3a98b..5dabef5 100644 --- a/web/lib/api/v4/tag.rb +++ b/web/lib/api/v4/tag.rb @@ -147,24 +147,8 @@ class Taginfo < Sinatra::Base :example => { :style => 'standard', :key => 'highway', :value => 'residential', :page => 1, :rp => 10 }, :ui => '/tags/highway=residential#josm' }) do - style = params[:style] - key = params[:key] - value = params[:value] - - total = @db.count('josm_style_rules'). -# condition('style = ?', style). - condition('k = ?', key). - condition('v = ?', value). - get_first_value().to_i - - res = @db.select('SELECT * FROM josm_style_rules'). -# condition('style = ?', style). - condition('k = ?', key). - condition('v = ?', value). - order_by([:k, :v], 'ASC'). - paging(@ap). - execute() - + total = 0 + res = [] return get_josm_style_rules_result(total, res); end diff --git a/web/lib/ui/keys.rb b/web/lib/ui/keys.rb index ec5210c..ae5318d 100644 --- a/web/lib/ui/keys.rb +++ b/web/lib/ui/keys.rb @@ -45,7 +45,6 @@ class Taginfo < Sinatra::Base @prevalent_values << { 'value' => '(other)', 'count' => @count_all_values - sum } end - @josm_count = @db.count('josm_style_rules').condition('k = ?', @key).get_first_i @wiki_count = @db.count('wiki.wikipages').condition('key=? AND value IS NULL', @key).get_first_i @user_count = @db.select('SELECT users_all FROM db.keys').condition('key=?', @key).get_first_i diff --git a/web/lib/ui/tags.rb b/web/lib/ui/tags.rb index 4632f1d..54744ee 100644 --- a/web/lib/ui/tags.rb +++ b/web/lib/ui/tags.rb @@ -30,7 +30,6 @@ class Taginfo < Sinatra::Base @sel[@filter_type] = ' selected="selected"' @filter_xapi = { 'all' => '*', nil => '*', 'nodes' => 'node', 'ways' => 'way', 'relations' => 'relation' }[@filter_type]; - @josm_count = @db.count('josm_style_rules').condition('k=? AND v=?', @key, @value).get_first_i @wiki_count = @db.count('wiki.wikipages').condition('key=? AND value=?', @key, @value).get_first_i if @wiki_count == 0 @wiki_count_key = @db.count('wiki.wikipages').condition('key=? AND value IS NULL', @key).get_first_i -- cgit v1.2.3