aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/settings_controller.rb
blob: 0b8688829f71fdcab21098a57976de2cbe884d79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class SettingsController < ApplicationController
  before_filter :authenticate!
  layout "index"

  def index
  end

  def update
    @account.update_settings!(notification: params[:notification] == "true",
                              private: params[:private] == "true")
    redirect_to action: "index"
  end

  def confirm_deactivation
  end

  def deactivate
    @account.deactivate!
    reset_session
  end

  private
  def authenticate!
    raise Aclog::Exceptions::LoginRequired unless session[:user_id]
    @account = session[:account]
  end
end