+ @user.email_valid = true
+ @user.save!
+ token.destroy
+ flash[:notice] = t 'user.confirm.success'
+ session[:user] = @user.id
+ redirect_to :action => 'account', :display_name => @user.display_name
+ else
+ @notice = t 'user.confirm.failure'
+ end
+ end
+ end
+
+ def confirm_email
+ if params[:confirm_action]
+ token = UserToken.find_by_token(params[:confirm_string])
+ if token and token.user.new_email?
+ @user = token.user
+ @user.email = @user.new_email
+ @user.new_email = nil
+ @user.active = true
+ @user.email_valid = true