]> git.openstreetmap.org Git - rails.git/commitdiff
Fix exception when a suspended user tries to login
authorTom Hughes <tom@compton.nu>
Mon, 23 Jan 2012 14:31:06 +0000 (14:31 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 23 Jan 2012 14:31:06 +0000 (14:31 +0000)
app/controllers/user_controller.rb
config/locales/en.yml

index 89f35a8996e6cea3c9b20808259ae16b76e8d0b2..8c63f8b757845b517e82321e794aaed209e37538 100644 (file)
@@ -512,8 +512,7 @@ private
     elsif user = User.authenticate(:username => username, :password => password, :pending => true)
       failed_login t('user.login.account not active', :reconfirm => url_for(:action => 'confirm_resend', :display_name => user.display_name))
     elsif User.authenticate(:username => username, :password => password, :suspended => true)
     elsif user = User.authenticate(:username => username, :password => password, :pending => true)
       failed_login t('user.login.account not active', :reconfirm => url_for(:action => 'confirm_resend', :display_name => user.display_name))
     elsif User.authenticate(:username => username, :password => password, :suspended => true)
-      webmaster = link_to t('user.login.webmaster'), "mailto:webmaster@openstreetmap.org"
-      failed_login t('user.login.account suspended', :webmaster => webmaster)
+      failed_login t('user.login.account is suspended', :webmaster => "mailto:webmaster@openstreetmap.org")
     else
       failed_login t('user.login.auth failure')
     end
     else
       failed_login t('user.login.auth failure')
     end
@@ -546,8 +545,7 @@ private
             when "active", "confirmed" then
               successful_login(user)
             when "suspended" then
             when "active", "confirmed" then
               successful_login(user)
             when "suspended" then
-              webmaster = link_to t('user.login.webmaster'), "mailto:webmaster@openstreetmap.org"
-              failed_login t('user.login.account suspended', :webmaster => webmaster)
+              failed_login t('user.login.account is suspended', :webmaster => "mailto:webmaster@openstreetmap.org")
             else
               failed_login t('user.login.auth failure')
           end
             else
               failed_login t('user.login.auth failure')
           end
index bd467cb7b9a3b2f138040278a484cdc38c4c277d..1ab8ef90d8232adf8bc2a6ec6e9fe9c4d12ce4de 100644 (file)
@@ -1552,8 +1552,7 @@ en:
       to make changes: To make changes to the OpenStreetMap data, you must have an account.
       create account minute: Create an account. It only takes a minute.
       account not active: "Sorry, your account is not active yet.<br />Please use the link in the account confirmation email to activate your account, or <a href=\"%{reconfirm}\">request a new confirmation email</a>."
       to make changes: To make changes to the OpenStreetMap data, you must have an account.
       create account minute: Create an account. It only takes a minute.
       account not active: "Sorry, your account is not active yet.<br />Please use the link in the account confirmation email to activate your account, or <a href=\"%{reconfirm}\">request a new confirmation email</a>."
-      account suspended: Sorry, your account has been suspended due to suspicious activity.<br />Please contact the %{webmaster} if you wish to discuss this.
-      webmaster: webmaster
+      account is suspended: Sorry, your account has been suspended due to suspicious activity.<br />Please contact the <a href="%{webmaster}">webmaster</a> if you wish to discuss this.
       auth failure: "Sorry, could not log in with those details."
       notice: "<a href=\"http://www.osmfoundation.org/wiki/License/We_Are_Changing_The_License\">Find out more about OpenStreetMap's upcoming license change</a> (<a href=\"http://wiki.openstreetmap.org/wiki/ODbL/We_Are_Changing_The_License\">translations</a>) (<a href=\"http://wiki.openstreetmap.org/wiki/Talk:ODbL/Upcoming\">discussion</a>)"
       notice_terms: "OpenStreetMap is moving to a new licence on 1st April 2012. It's just as open as our current one, but the legal bits are much better suited to our map database. We'd love to keep your contributions in OpenStreetMap, but we can only do so if you agree to let us distribute them under the new licence. Otherwise, we'll have to remove them from the database.<br /><br />Please log in, then take a few seconds to review and accept the new terms. Thank you!"
       auth failure: "Sorry, could not log in with those details."
       notice: "<a href=\"http://www.osmfoundation.org/wiki/License/We_Are_Changing_The_License\">Find out more about OpenStreetMap's upcoming license change</a> (<a href=\"http://wiki.openstreetmap.org/wiki/ODbL/We_Are_Changing_The_License\">translations</a>) (<a href=\"http://wiki.openstreetmap.org/wiki/Talk:ODbL/Upcoming\">discussion</a>)"
       notice_terms: "OpenStreetMap is moving to a new licence on 1st April 2012. It's just as open as our current one, but the legal bits are much better suited to our map database. We'd love to keep your contributions in OpenStreetMap, but we can only do so if you agree to let us distribute them under the new licence. Otherwise, we'll have to remove them from the database.<br /><br />Please log in, then take a few seconds to review and accept the new terms. Thank you!"