diff options
author | Jochen Topf <jochen@topf.org> | 2014-10-02 16:14:25 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-10-02 16:14:25 +0200 |
commit | 2d7785d0417ab162696db830fd66f8c730acbaed (patch) | |
tree | cb3872313ce1407574b4bfe3e5d867bb980545c2 /web/lib | |
parent | c3075885dbc2413f8e711b8100c6e12f5374a6c6 (diff) | |
download | taginfo-2d7785d0417ab162696db830fd66f8c730acbaed.tar taginfo-2d7785d0417ab162696db830fd66f8c730acbaed.tar.gz |
Disable JSOM APIs, remove all access to nen-existing table.
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/api/v4/josm.rb | 24 | ||||
-rw-r--r-- | web/lib/api/v4/key.rb | 23 | ||||
-rw-r--r-- | web/lib/api/v4/tag.rb | 20 | ||||
-rw-r--r-- | web/lib/ui/keys.rb | 1 | ||||
-rw-r--r-- | web/lib/ui/tags.rb | 1 |
5 files changed, 6 insertions, 63 deletions
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 |