FIX: Better error message for resending activation. Don't limit staff.
This commit is contained in:
parent
010d847c2d
commit
46ca66771b
|
@ -288,10 +288,7 @@ const AdminUser = Discourse.User.extend({
|
||||||
data: { username: this.get('username') }
|
data: { username: this.get('username') }
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
bootbox.alert( I18n.t('admin.user.activation_email_sent') );
|
bootbox.alert( I18n.t('admin.user.activation_email_sent') );
|
||||||
}).catch(function(e) {
|
}).catch(popupAjaxError);
|
||||||
var error = I18n.t('admin.user.send_activation_email_failed', { error: "http: " + e.status + " - " + e.body });
|
|
||||||
bootbox.alert(error);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
anonymizeForbidden: Em.computed.not("can_be_anonymized"),
|
anonymizeForbidden: Em.computed.not("can_be_anonymized"),
|
||||||
|
|
|
@ -498,8 +498,10 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_activation_email
|
def send_activation_email
|
||||||
RateLimiter.new(nil, "activate-hr-#{request.remote_ip}", 30, 1.hour).performed!
|
if current_user.blank? || !current_user.staff?
|
||||||
RateLimiter.new(nil, "activate-min-#{request.remote_ip}", 6, 1.minute).performed!
|
RateLimiter.new(nil, "activate-hr-#{request.remote_ip}", 30, 1.hour).performed!
|
||||||
|
RateLimiter.new(nil, "activate-min-#{request.remote_ip}", 6, 1.minute).performed!
|
||||||
|
end
|
||||||
|
|
||||||
@user = User.find_by_username_or_email(params[:username].to_s)
|
@user = User.find_by_username_or_email(params[:username].to_s)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue