Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Configurable Volume for Notifications #6087 #7517

Merged
merged 14 commits into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implementing the administration setting for the frequency of notifica…
…tions about changing user's password. #2995
  • Loading branch information
lindoelio committed Jul 21, 2017
commit e309670706a5e6a11315e2839a71e9897893e2ca
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
.env
.externalToolBuilders
.idea
.vscode
.loadpath
.map
.metadata
Expand Down
5 changes: 5 additions & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@
"Accounts_PasswordReset": "Password Reset",
"Accounts_OAuth_Proxy_host": "Proxy Host",
"Accounts_OAuth_Proxy_services": "Proxy Services",
"Accounts_ReceivePasswordChangeLog": "Receive password change log by email",
"Accounts_ReceivePasswordChangeLog_Dismiss": "Disabled",
"Accounts_ReceivePasswordChangeLog_Immediately": "Immediately with each change",
"Accounts_ReceivePasswordChangeLog_Daily": "Daily summary",
"Accounts_ReceivePasswordChangeLog_Weekly": "Weekly summary",
"Accounts_Registration_AuthenticationServices_Default_Roles": "Default Roles for Authentication Services",
"Accounts_Registration_AuthenticationServices_Default_Roles_Description": "Default roles (comma-separated) users will be given when registering through authentication services",
"Accounts_Registration_AuthenticationServices_Enabled": "Registration with Authentication Services",
Expand Down
5 changes: 5 additions & 0 deletions packages/rocketchat-i18n/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
"Accounts_OAuth_Wordpress_id": "WordPress ID",
"Accounts_OAuth_Wordpress_secret": "WordPress Secret",
"Accounts_PasswordReset": "Resetar senha",
"Accounts_ReceivePasswordChangeLog": "Receber log das alterações de senha por e-mail",
"Accounts_ReceivePasswordChangeLog_Dismiss": "Desativado",
"Accounts_ReceivePasswordChangeLog_Immediately": "Imediatamente a cada alteração",
"Accounts_ReceivePasswordChangeLog_Daily": "Resumo diário",
"Accounts_ReceivePasswordChangeLog_Weekly": "Resumo semanal",
"Accounts_Registration_AuthenticationServices_Enabled": "Registro com os Serviços de Autenticação",
"Accounts_RegistrationForm": "Formulário de Registro",
"Accounts_RegistrationForm_Disabled": "Desativado",
Expand Down
5 changes: 5 additions & 0 deletions packages/rocketchat-i18n/i18n/pt.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
"Accounts_PasswordReset": "Resetar senha",
"Accounts_OAuth_Proxy_host": "Host de Proxy",
"Accounts_OAuth_Proxy_services": "Serviços de Proxy",
"Accounts_ReceivePasswordChangeLog": "Receber log das alterações de senha por e-mail",
"Accounts_ReceivePasswordChangeLog_Dismiss": "Desativado",
"Accounts_ReceivePasswordChangeLog_Immediately": "Imediatamente a cada alteração",
"Accounts_ReceivePasswordChangeLog_Daily": "Resumo diário",
"Accounts_ReceivePasswordChangeLog_Weekly": "Resumo semanal",
"Accounts_Registration_AuthenticationServices_Enabled": "Registro com os Serviços de Autenticação",
"Accounts_RegistrationForm": "Formulário de Registro",
"Accounts_RegistrationForm_Disabled": "Desativado",
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-lib/server/functions/saveUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ RocketChat.saveUser = function(userId, userData) {
}

if (userData.password && userData.password.trim() && RocketChat.authz.hasPermission(userId, 'edit-other-user-password')) {
// TODO #2995
Accounts.setPassword(userData._id, userData.password.trim());
}

Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ class ModelUsers extends RocketChat.models._Base {
requirePasswordChangeReason
}
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, do not introduce unnecessary changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Fixed!

// TODO #2995
return this.update(_id, update);
}

Expand Down
20 changes: 20 additions & 0 deletions packages/rocketchat-lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ RocketChat.settings.addGroup('Accounts', function() {
type: 'boolean',
'public': true
});
// TODO: Implementing #2995
this.add('Accounts_ReceivePasswordChangeLog', '', {
type: 'select',
'public': true,
values: [
{
key: '',
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Dismiss'
}, {
key: 'immediately',
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Immediately'
}, {
key: 'daily',
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Daily'
}, {
key: 'weekly',
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Weekly'
}
]
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, do not introduce unnecessary changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Fixed!

this.section('Registration', function() {
this.add('Accounts_DefaultUsernamePrefixSuggestion', 'user', {
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-ui-account/client/accountProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Template.accountProfile.onCreated(function() {
typedPassword
};
if (_.trim($('#password').val()) && RocketChat.settings.get('Accounts_AllowPasswordChange')) {
// TODO #2995
data.newPassword = $('#password').val();
}
if (_.trim($('#realname').val())) {
Expand Down
4 changes: 3 additions & 1 deletion server/methods/saveUserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ Meteor.methods({
Meteor.call('setEmail', settings.email);
}

// Should be the last chack to prevent error when trying to check password for users without password
// Should be the last check to prevent error when trying to check password for users without password
if ((settings.newPassword) && RocketChat.settings.get('Accounts_AllowPasswordChange') === true) {
if (!checkPassword(user, settings.typedPassword)) {
throw new Meteor.Error('error-invalid-password', 'Invalid password', {
method: 'saveUserProfile'
});
}

// TODO: #2995

Accounts.setPassword(Meteor.userId(), settings.newPassword, {
logout: false
});
Expand Down