mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-24 14:32:25 -05:00
12d664a610
* move finding by username/email to User * make SiteSetting return a range of possible post title lengths * remove unnecessary conditions
18 lines
370 B
Ruby
18 lines
370 B
Ruby
class Admin::ImpersonateController < Admin::AdminController
|
|
|
|
def create
|
|
requires_parameters(:username_or_email)
|
|
|
|
user = User.find_by_username_or_email(params[:username_or_email]).first
|
|
|
|
raise Discourse::NotFound if user.blank?
|
|
|
|
guardian.ensure_can_impersonate!(user)
|
|
|
|
# Log on as the user
|
|
log_on_user(user)
|
|
|
|
render nothing: true
|
|
end
|
|
|
|
end
|