summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/user_preference.rb2
-rw-r--r--app/views/settings/_users.html.erb2
-rw-r--r--config/settings.yml2
-rw-r--r--test/unit/user_preference_test.rb7
4 files changed, 12 insertions, 1 deletions
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index 4c36e5ef7..91261e1c7 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -52,7 +52,7 @@ class UserPreference < ActiveRecord::Base
self.time_zone = Setting.default_users_time_zone
end
unless attributes && attributes.key?(:no_self_notified)
- self.no_self_notified = true
+ self.no_self_notified = Setting.default_users_no_self_notified
end
end
self.others ||= {}
diff --git a/app/views/settings/_users.html.erb b/app/views/settings/_users.html.erb
index 11c2aadac..2ae55b1a3 100644
--- a/app/views/settings/_users.html.erb
+++ b/app/views/settings/_users.html.erb
@@ -19,6 +19,8 @@
<p><%= setting_select(:default_notification_option, User.valid_notification_options.collect {|o| [l(o.last), o.first.to_s]}) %></p>
+ <p><%= setting_check_box :default_users_no_self_notified, :label => :label_user_mail_no_self_notified %></p>
+
<p><%= setting_select :default_users_time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :label => :field_time_zone, :blank => :label_none %></p>
</fieldset>
diff --git a/config/settings.yml b/config/settings.yml
index 5c11d1f57..83685a04a 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -277,6 +277,8 @@ sequential_project_identifiers:
default: 0
default_users_hide_mail:
default: 1
+default_users_no_self_notified:
+ default: 1
default_users_time_zone:
default: ""
# encodings used to convert files content to UTF-8
diff --git a/test/unit/user_preference_test.rb b/test/unit/user_preference_test.rb
index a95d7a9f7..08c00a84e 100644
--- a/test/unit/user_preference_test.rb
+++ b/test/unit/user_preference_test.rb
@@ -50,6 +50,13 @@ class UserPreferenceTest < ActiveSupport::TestCase
assert_equal true, preference.no_self_notified
end
+ def test_no_self_notified_should_default_to_setting
+ with_settings :default_users_no_self_notified => '0' do
+ preference = UserPreference.new
+ assert_equal false, preference.no_self_notified
+ end
+ end
+
def test_create
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
user.login = "newuser"