automatically approve invited users on forum where moderators must approve (keep in mind only moderators can invite)

speed up specs a touch
allow invite controller to accept an email in absence of user (cleans up API)
This commit is contained in:
Sam
2013-07-11 11:21:39 +10:00
parent 7792b7da48
commit 1aef6de4b0
5 changed files with 42 additions and 24 deletions

View File

@@ -59,9 +59,9 @@ module CurrentUser
@current_user.update_ip_address!(request.remote_ip)
end
# possible we have an api call, impersonate
# possible we have an api call, impersonate
unless @current_user
if api_key = request["api_key"]
if api_key = request["api_key"]
if api_username = request["api_username"]
if SiteSetting.api_key_valid?(api_key)
@current_user = User.where(username_lower: api_username.downcase).first