fixes #1651
This commit is contained in:
18
app/controllers/maintenance/user/email_changes_controller.rb
Normal file
18
app/controllers/maintenance/user/email_changes_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
module Maintenance
|
||||
module User
|
||||
class EmailChangesController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
email_change = UserEmailChange.new(CurrentUser.user, params[:email_change][:email], params[:email_change][:password])
|
||||
if email_change.process
|
||||
redirect_to(edit_user_path(CurrentUser.user.id), :notice => "Email was updated")
|
||||
else
|
||||
flash[:notice] = "Password was incorrect"
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user