v1.18.x
barisusakli 9 years ago
parent ffc08facbd
commit ac09036156

@ -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) {

@ -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';

@ -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">
Favicon

@ -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>

Loading…
Cancel
Save