From cd63df3b26f1443ab399323a26c9996b45b0945a Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 7 Jan 2016 04:16:44 +0000 Subject: [PATCH] Merged r14974 and r14975 from trunk to 3.2-stable (#21447) git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15009 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user_preference.rb | 3 +++ app/views/settings/_authentication.html.erb | 8 ++++++++ config/locales/ar.yml | 1 + config/locales/az.yml | 1 + config/locales/bg.yml | 1 + config/locales/bs.yml | 1 + config/locales/ca.yml | 1 + config/locales/cs.yml | 1 + config/locales/da.yml | 1 + config/locales/de.yml | 1 + config/locales/el.yml | 1 + config/locales/en-GB.yml | 1 + config/locales/en.yml | 1 + config/locales/es-PA.yml | 1 + config/locales/es.yml | 1 + config/locales/et.yml | 1 + config/locales/eu.yml | 1 + config/locales/fa.yml | 1 + config/locales/fi.yml | 1 + config/locales/fr.yml | 1 + config/locales/gl.yml | 1 + config/locales/he.yml | 1 + config/locales/hr.yml | 1 + config/locales/hu.yml | 1 + config/locales/id.yml | 1 + config/locales/it.yml | 1 + config/locales/ja.yml | 1 + config/locales/ko.yml | 1 + config/locales/lt.yml | 1 + config/locales/lv.yml | 1 + config/locales/mk.yml | 1 + config/locales/mn.yml | 1 + config/locales/nl.yml | 1 + config/locales/no.yml | 1 + config/locales/pl.yml | 1 + config/locales/pt-BR.yml | 1 + config/locales/pt.yml | 1 + config/locales/ro.yml | 1 + config/locales/ru.yml | 1 + config/locales/sk.yml | 1 + config/locales/sl.yml | 1 + config/locales/sq.yml | 1 + config/locales/sr-YU.yml | 1 + config/locales/sr.yml | 1 + config/locales/sv.yml | 1 + config/locales/th.yml | 1 + config/locales/tr.yml | 1 + config/locales/uk.yml | 1 + config/locales/vi.yml | 1 + config/locales/zh-TW.yml | 1 + config/locales/zh.yml | 1 + config/settings.yml | 2 ++ test/unit/user_preference_test.rb | 7 +++++++ 53 files changed, 69 insertions(+) diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb index 80b3e6b9d..6e7876abb 100644 --- a/app/models/user_preference.rb +++ b/app/models/user_preference.rb @@ -25,6 +25,9 @@ class UserPreference < ActiveRecord::Base def initialize(attributes=nil, *args) super + if new_record? && !(attributes && attributes.key?(:hide_mail)) + self.hide_mail = Setting.default_users_hide_mail? + end self.others ||= {} end diff --git a/app/views/settings/_authentication.html.erb b/app/views/settings/_authentication.html.erb index f9c569cb8..35aa66425 100644 --- a/app/views/settings/_authentication.html.erb +++ b/app/views/settings/_authentication.html.erb @@ -36,5 +36,13 @@

<%= l(:text_session_expiration_settings) %>

+
+ <%= l(:label_default_values_for_new_users) %> + +
+

<%= setting_check_box :default_users_hide_mail, :label => :field_hide_mail %>

+
+
+ <%= submit_tag l(:button_save) %> <% end %> diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 894e299cd..8cd0a88de 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1181,3 +1181,4 @@ ar: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/az.yml b/config/locales/az.yml index e500bd546..9c41d4a79 100644 --- a/config/locales/az.yml +++ b/config/locales/az.yml @@ -1276,3 +1276,4 @@ az: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 591e338dc..18b6adaaf 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1172,3 +1172,4 @@ bg: description_date_from: Въведете начална дата description_date_to: Въведете крайна дата text_repository_identifier_info: 'Позволени са малки букви (a-z), цифри, тирета и _.
Промяна след създаването му не е възможна.' + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 9a50ef93d..ca4bd0721 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -1194,3 +1194,4 @@ bs: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 24370a80a..d6674a5e5 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1183,3 +1183,4 @@ ca: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/cs.yml b/config/locales/cs.yml index db55f2146..a888e89da 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1182,3 +1182,4 @@ cs: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/da.yml b/config/locales/da.yml index 11670eae6..e4543d0c8 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1198,3 +1198,4 @@ da: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/de.yml b/config/locales/de.yml index 0885f5ba8..56ed80627 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1190,3 +1190,4 @@ de: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/el.yml b/config/locales/el.yml index af9d8cf88..d2022735f 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -1181,3 +1181,4 @@ el: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 0756d9368..2d1e86a62 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1183,3 +1183,4 @@ en-GB: error_attachment_extension_not_allowed: Attachment extension %{extension} is not allowed setting_attachment_extensions_allowed: Allowed extensions setting_attachment_extensions_denied: Disallowed extensions + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/en.yml b/config/locales/en.yml index 24d5fe7c4..7d98034f6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -975,6 +975,7 @@ en: label_create_missing_values: Create missing values label_api: API label_field_format_enumeration: Key/value list + label_default_values_for_new_users: Default values for new users button_login: Login button_submit: Submit diff --git a/config/locales/es-PA.yml b/config/locales/es-PA.yml index bf3cbed82..d55482bfa 100644 --- a/config/locales/es-PA.yml +++ b/config/locales/es-PA.yml @@ -1215,3 +1215,4 @@ es-PA: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/es.yml b/config/locales/es.yml index fa9670afe..4e7499cbb 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1213,3 +1213,4 @@ es: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/et.yml b/config/locales/et.yml index 8a8852b12..87a94c512 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -1194,3 +1194,4 @@ et: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 42a8f998f..20e7222cd 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1182,3 +1182,4 @@ eu: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 7b5f0651c..3ffc47486 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -1182,3 +1182,4 @@ fa: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 201aaac06..5021546cf 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1202,3 +1202,4 @@ fi: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 4ec1d3368..43873caf3 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -993,6 +993,7 @@ fr: label_create_missing_values: Créer les valeurs manquantes label_api: API label_field_format_enumeration: Liste clé/valeur + label_default_values_for_new_users: Valeurs par défaut pour les nouveaux utilisateurs button_login: Connexion button_submit: Soumettre diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 5d83e7cab..381c2c9e7 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1189,3 +1189,4 @@ gl: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/he.yml b/config/locales/he.yml index 3485c0a57..cf5a1dd0e 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1186,3 +1186,4 @@ he: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/hr.yml b/config/locales/hr.yml index 8931e8af1..079ddfd8d 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -1180,3 +1180,4 @@ hr: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/hu.yml b/config/locales/hu.yml index ebed6d828..026d89fba 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1200,3 +1200,4 @@ setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/id.yml b/config/locales/id.yml index 573a3b9e9..01a9304dc 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -1185,3 +1185,4 @@ id: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/it.yml b/config/locales/it.yml index e0b377cad..0f9da368a 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1176,3 +1176,4 @@ it: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 2309a6e14..6713a85df 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1194,3 +1194,4 @@ ja: setting_attachment_extensions_denied: 禁止する拡張子 label_any_open_issues: 未完了のチケット label_no_open_issues: なし または完了したチケット + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/ko.yml b/config/locales/ko.yml index d2dda59d4..0097370a8 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1225,3 +1225,4 @@ ko: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 705f152a3..649835377 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -1240,3 +1240,4 @@ lt: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 373325be8..bcee88d6c 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1175,3 +1175,4 @@ lv: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/mk.yml b/config/locales/mk.yml index 012147336..6c7a2af08 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -1181,3 +1181,4 @@ mk: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/mn.yml b/config/locales/mn.yml index e365a5b96..c5a74e06f 100644 --- a/config/locales/mn.yml +++ b/config/locales/mn.yml @@ -1182,3 +1182,4 @@ mn: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/nl.yml b/config/locales/nl.yml index c4a588c90..9a2a17542 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1160,3 +1160,4 @@ nl: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/no.yml b/config/locales/no.yml index 2ebf5525b..35f2b8e91 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -1171,3 +1171,4 @@ setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 442e7f77c..50cd2f39c 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1196,3 +1196,4 @@ pl: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 1ad364886..8802ba324 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1200,3 +1200,4 @@ pt-BR: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 1dcaba5c1..da696f2b3 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -1183,3 +1183,4 @@ pt: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/ro.yml b/config/locales/ro.yml index b4bd79445..2e89625a1 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -1176,3 +1176,4 @@ ro: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 7a62d0efd..26c72a5da 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1284,3 +1284,4 @@ ru: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 9bf3dbf98..0508f1fe5 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1171,3 +1171,4 @@ sk: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/sl.yml b/config/locales/sl.yml index b8a43032f..56742220d 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1181,3 +1181,4 @@ sl: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 0520ac04d..fd2fdd33d 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1177,3 +1177,4 @@ sq: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/sr-YU.yml b/config/locales/sr-YU.yml index e8091cab5..3b30b09a8 100644 --- a/config/locales/sr-YU.yml +++ b/config/locales/sr-YU.yml @@ -1183,3 +1183,4 @@ sr-YU: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 6b1f0777d..89e5cfa96 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1182,3 +1182,4 @@ sr: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/sv.yml b/config/locales/sv.yml index e214a8d53..73be757c9 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1214,3 +1214,4 @@ sv: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/th.yml b/config/locales/th.yml index 4f2d00a67..122fcd4e1 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1178,3 +1178,4 @@ th: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 5a405a254..69a2255ce 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1190,3 +1190,4 @@ tr: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/uk.yml b/config/locales/uk.yml index d7f716bfc..077bfbad3 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1176,3 +1176,4 @@ uk: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 82b46ff07..632e44624 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1234,3 +1234,4 @@ vi: setting_attachment_extensions_denied: Disallowed extensions label_any_open_issues: any open issues label_no_open_issues: no open issues + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index a319470ea..efbd6378d 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1255,3 +1255,4 @@ description_date_from: 輸入起始日期 description_date_to: 輸入結束日期 text_repository_identifier_info: '僅允許使用小寫英文字母 (a-z), 阿拉伯數字, 虛線與底線。
一旦儲存之後, 代碼便無法再次被更改。' + label_default_values_for_new_users: Default values for new users diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 2e85dafa6..b162e536a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1176,3 +1176,4 @@ zh: setting_attachment_extensions_denied: 禁止上传的附件类型 label_any_open_issues: 任意进行中的问题 label_no_open_issues: 任意已关闭的问题 + label_default_values_for_new_users: Default values for new users diff --git a/config/settings.yml b/config/settings.yml index 7180dac3f..5031b68d3 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -217,6 +217,8 @@ sequential_project_identifiers: default: 0 # encodings used to convert repository files content to UTF-8 # multiple values accepted, comma separated +default_users_hide_mail: + default: 1 repositories_encodings: default: '' # encoding used to convert commit logs to UTF-8 diff --git a/test/unit/user_preference_test.rb b/test/unit/user_preference_test.rb index c76862408..bfdcd185a 100644 --- a/test/unit/user_preference_test.rb +++ b/test/unit/user_preference_test.rb @@ -25,6 +25,13 @@ class UserPreferenceTest < ActiveSupport::TestCase assert_equal true, preference.hide_mail end + def test_hide_mail_should_default_to_false_with_setting + with_settings :default_users_hide_mail => '0' do + preference = UserPreference.new + assert_equal false, preference.hide_mail + end + end + def test_create user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo") user.login = "newuser" -- 2.39.5