2022-06-28 01:50:20 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Settings::PrivacyController < ApplicationController
|
|
|
|
before_action :authenticate_user!
|
|
|
|
|
|
|
|
def edit; end
|
|
|
|
|
|
|
|
def update
|
2022-11-06 15:00:28 +01:00
|
|
|
user_attributes = params.require(:user).permit(:privacy_lock_inbox,
|
|
|
|
:privacy_allow_anonymous_questions,
|
2022-06-28 01:50:20 +02:00
|
|
|
:privacy_allow_public_timeline,
|
|
|
|
:privacy_allow_stranger_answers,
|
2022-11-13 14:26:03 +01:00
|
|
|
:privacy_show_in_search,
|
2022-11-16 22:32:40 +01:00
|
|
|
:privacy_require_user,
|
2022-11-18 23:23:01 +01:00
|
|
|
:privacy_noindex,
|
2022-11-15 21:34:45 +01:00
|
|
|
:privacy_hide_social_graph)
|
2022-06-28 01:50:20 +02:00
|
|
|
if current_user.update(user_attributes)
|
|
|
|
flash[:success] = t(".success")
|
|
|
|
else
|
|
|
|
flash[:error] = t(".error")
|
|
|
|
end
|
2023-10-20 02:21:52 +02:00
|
|
|
render :edit
|
2022-06-28 01:50:20 +02:00
|
|
|
end
|
|
|
|
end
|