Node.js based forum software built for the modern web
closes #4053
barisusakliac0903615684
diff --git a/src/user/create.js b/src/user/create.jsindex fe67b4a728..1d1543e863 100644--- a/src/user/create.js+++ b/src/user/create.js@@ -75,13 +75,6 @@ module.exports = function(User) {userData.uid = uid;db.setObject('user:' + uid, userData, next);},- function(next) {- if (parseInt(meta.config['sounds:default_enabled'], 10) === 1) {- return User.setSetting(userData.uid, 'notificationSounds', 1, next);- }-- next();- },function(next) {async.parallel([function(next) {diff --git a/src/user/settings.js b/src/user/settings.jsindex 6d9cf7d36a..f1c4081b50 100644--- a/src/user/settings.js+++ b/src/user/settings.js@@ -58,14 +58,14 @@ module.exports = function(User) {var defaultTopicsPerPage = parseInt(meta.config.topicsPerPage, 10) || 20;var defaultPostsPerPage = parseInt(meta.config.postsPerPage, 10) || 20;- settings.showemail = parseInt(settings.showemail, 10) === 1;- settings.showfullname = parseInt(settings.showfullname, 10) === 1;+ settings.showemail = parseInt(getSetting(settings, 'showemail', 0), 10) === 1;+ settings.showfullname = parseInt(getSetting(settings, 'showfullname', 0), 10) === 1;settings.openOutgoingLinksInNewTab = parseInt(getSetting(settings, 'openOutgoingLinksInNewTab', 0), 10) === 1;settings.dailyDigestFreq = getSetting(settings, 'dailyDigestFreq', 'off');settings.usePagination = parseInt(getSetting(settings, 'usePagination', 0), 10) === 1;settings.topicsPerPage = Math.min(settings.topicsPerPage ? parseInt(settings.topicsPerPage, 10) : defaultTopicsPerPage, defaultTopicsPerPage);settings.postsPerPage = Math.min(settings.postsPerPage ? parseInt(settings.postsPerPage, 10) : defaultPostsPerPage, defaultPostsPerPage);- settings.notificationSounds = parseInt(settings.notificationSounds, 10) === 1;+ settings.notificationSounds = parseInt(getSetting(settings, 'notificationSounds', 0), 10) === 1;settings.userLang = settings.userLang || meta.config.defaultLang || 'en_GB';settings.topicPostSort = getSetting(settings, 'topicPostSort', 'oldest_to_newest');settings.categoryTopicSort = getSetting(settings, 'categoryTopicSort', 'newest_to_oldest');@@ -73,7 +73,7 @@ module.exports = function(User) {settings.followTopicsOnReply = parseInt(getSetting(settings, 'followTopicsOnReply', 0), 10) === 1;settings.sendChatNotifications = parseInt(getSetting(settings, 'sendChatNotifications', 0), 10) === 1;settings.sendPostNotifications = parseInt(getSetting(settings, 'sendPostNotifications', 0), 10) === 1;- settings.restrictChat = parseInt(settings.restrictChat, 10) === 1;+ settings.restrictChat = parseInt(getSetting(settings, 'restrictChat', 0), 10) === 1;settings.topicSearchEnabled = parseInt(getSetting(settings, 'topicSearchEnabled', 0), 10) === 1;settings.bootswatchSkin = settings.bootswatchSkin || 'default';diff --git a/src/views/admin/settings/general.tpl b/src/views/admin/settings/general.tplindex a9ab0a96ff..147657195e 100644--- a/src/views/admin/settings/general.tpl+++ b/src/views/admin/settings/general.tpl@@ -64,26 +64,6 @@</div></div>--<div class="row">- <div class="col-sm-2 col-xs-12 settings-header">- Sounds- </div>- <div class="col-sm-10 col-xs-12">- <div class="form-group">- <div class="checkbox">- <label for="sounds:default_enabled" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">- <input type="checkbox" class="mdl-switch__input" id="sounds:default_enabled" data-field="sounds:default_enabled" name="sounds:default_enabled" />- <span class="mdl-switch__label">Force enabling of notification sounds for new users</span>- </label>- </div>- <p class="help-block">- Users can toggle this setting in their profile settings page.- </p>- </div>- </div>-</div>-<div class="row"><div class="col-sm-2 col-xs-12 settings-header">Favicondiff --git a/src/views/admin/settings/user.tpl b/src/views/admin/settings/user.tplindex 9852b133e2..cf5360d5fb 100644--- a/src/views/admin/settings/user.tpl+++ b/src/views/admin/settings/user.tpl@@ -174,6 +174,28 @@<div class="col-sm-2 col-xs-12 settings-header">Default User Settings</div><div class="col-sm-10 col-xs-12"><form>++ <div class="checkbox">+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">+ <input class="mdl-switch__input" type="checkbox" data-field="showemail">+ <span class="mdl-switch__label"><strong>[[user:show_email]]</strong></span>+ </label>+ </div>++ <div class="checkbox">+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">+ <input class="mdl-switch__input" type="checkbox" data-field="showfullname">+ <span class="mdl-switch__label"><strong>[[user:show_fullname]]</strong></span>+ </label>+ </div>++ <div class="checkbox">+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">+ <input class="mdl-switch__input" type="checkbox" data-field="restrictChat">+ <span class="mdl-switch__label"><strong>[[user:restrict_chats]]</strong></span>+ </label>+ </div>+<div class="checkbox"><label class="mdl-switch mdl-js-switch mdl-js-ripple-effect"><input class="mdl-switch__input" type="checkbox" data-field="openOutgoingLinksInNewTab">@@ -226,6 +248,13 @@</label></div>+ <div class="checkbox">+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">+ <input class="mdl-switch__input" type="checkbox" data-field="notificationSounds" />+ <span class="mdl-switch__label">[[user:notification_sounds]]</span>+ </label>+ </div>+</form></div></div>