- replaced hardcoded www.openstreetmap.org with environment variable
- added preferences action to user - added column preferences to user table
This commit is contained in:
parent
1ecf13d846
commit
85d8a2d177
7 changed files with 22 additions and 6 deletions
|
@ -1,5 +1,7 @@
|
||||||
class UserController < ApplicationController
|
class UserController < ApplicationController
|
||||||
layout 'site'
|
layout 'site'
|
||||||
|
|
||||||
|
before_filter :authorize, :only => :preferences
|
||||||
|
|
||||||
def save
|
def save
|
||||||
@user = User.new(params[:user])
|
@user = User.new(params[:user])
|
||||||
|
@ -93,4 +95,16 @@ class UserController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def preferences
|
||||||
|
if request.get?
|
||||||
|
render_text @user.preferences
|
||||||
|
elsif request.post? or request.put?
|
||||||
|
@user.preferences = request.raw_post
|
||||||
|
@user.save!
|
||||||
|
render :nothing => true
|
||||||
|
else
|
||||||
|
render :status => 400, :nothing => true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@ class Notifier < ActionMailer::Base
|
||||||
@recipients = user.email
|
@recipients = user.email
|
||||||
@from = 'abuse@openstreetmap.org'
|
@from = 'abuse@openstreetmap.org'
|
||||||
@subject = '[OpenStreetMap] Confirm your email address'
|
@subject = '[OpenStreetMap] Confirm your email address'
|
||||||
@body['url'] = 'http://www.openstreetmap.org/user/confirm?confirm_string=' + user.token
|
@body['url'] = "http://#{SERVER_URL}/user/confirm?confirm_string=#{user.token}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def lost_password( user )
|
def lost_password( user )
|
||||||
@recipients = user.email
|
@recipients = user.email
|
||||||
@from = 'abuse@openstreetmap.org'
|
@from = 'abuse@openstreetmap.org'
|
||||||
@subject = '[OpenStreetMap] Password reset request'
|
@subject = '[OpenStreetMap] Password reset request'
|
||||||
@body['url'] = "http://www.openstreetmap.org/user/reset_password?email=#{user.email}&token=#{user.token}"
|
@body['url'] = "http://#{SERVER_URL}/user/reset_password?email=#{user.email}&token=#{user.token}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_password(user, pass)
|
def reset_password(user, pass)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Hi,
|
Hi,
|
||||||
|
|
||||||
Somone (hopefully you) would like to create an account over at
|
Somone (hopefully you) would like to create an account over at
|
||||||
www.openstreetmap.org
|
<%= SERVER_URL %>
|
||||||
|
|
||||||
If this is you, please click the link below to confirm that account.
|
If this is you, please click the link below to confirm that account.
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
function init(){
|
function init(){
|
||||||
|
|
||||||
OpenLayers.Util.onImageLoadError = function() {
|
OpenLayers.Util.onImageLoadError = function() {
|
||||||
this.src = "http://www.openstreetmap.org/javascript/img/404.png";
|
this.src = "http://<%= SERVER_URL %>/javascript/img/404.png";
|
||||||
}
|
}
|
||||||
map = new OpenLayers.Map( "map",
|
map = new OpenLayers.Map( "map",
|
||||||
{maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), maxResolution:156543, units:'meters', projection: "EPSG:41001"} );
|
{maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), maxResolution:156543, units:'meters', projection: "EPSG:41001"} );
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
<span class="rsssmall"><a href="<%= url_for :controller => 'trace', :action => 'georss' %>"><img src="http://www.openstreetmap.org/images/RSS.gif" border="0"></a></span> |
|
<span class="rsssmall"><a href="<%= url_for :controller => 'trace', :action => 'georss' %>"><img src="http://<%= SERVER_URL %>/images/RSS.gif" border="0"></a></span> |
|
||||||
<% if @user %>
|
<% if @user %>
|
||||||
<%= link_to 'See just your traces', {:controller => 'trace', :action => 'mine'} %>
|
<%= link_to 'See just your traces', {:controller => 'trace', :action => 'mine'} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -52,7 +52,8 @@ end
|
||||||
|
|
||||||
# Include your application configuration below
|
# Include your application configuration below
|
||||||
|
|
||||||
API_VERSION = '0.4'
|
API_VERSION = ENV['OSM_API_VERSION'] || '0.4'
|
||||||
|
SERVER_URL = ENV['OSM_SERVER_URL'] || 'www.openstreetmap.org'
|
||||||
|
|
||||||
ActionMailer::Base.server_settings = {
|
ActionMailer::Base.server_settings = {
|
||||||
:address => "localhost",
|
:address => "localhost",
|
||||||
|
|
|
@ -24,3 +24,4 @@ alter table gpx_file_tags drop column sequence_id;
|
||||||
create index gpx_file_tags_gpxid_idx on gpx_file_tags(gpx_id);
|
create index gpx_file_tags_gpxid_idx on gpx_file_tags(gpx_id);
|
||||||
alter table gpx_file_tags add id int(20) auto_increment not null, add primary key(id);
|
alter table gpx_file_tags add id int(20) auto_increment not null, add primary key(id);
|
||||||
|
|
||||||
|
alter table users add preferences text;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue