Skip to content

Commit

Permalink
Issue 50696 - Fix Allowed and Denied Ciphers lists - WebUI
Browse files Browse the repository at this point in the history
Description: When we add a cipher to an Allowed list we should
not be allowed to add the same cipher to a Denied list.
Also, show a warning when we do an action which requires a restart.

https://pagure.io/389-ds-base/issue/50696

Reviewed by: mreynolds (Thanks!)
  • Loading branch information
droideck committed Jun 23, 2020
1 parent a99cd7c commit 0f8605a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
10 changes: 6 additions & 4 deletions src/cockpit/389-console/src/lib/database/databaseConfig.jsx
Expand Up @@ -184,10 +184,6 @@ export class GlobalDatabaseConfig extends React.Component {
if (cmd.length > 6) {
log_cmd("save_db_config", "Applying config change", cmd);
let msg = "Successfully updated database configuration";
if (requireRestart) {
msg = ("Successfully updated database configuration. These " +
"changes require the server to be restarted to take effect");
}
cockpit
.spawn(cmd, {superuser: true, "err": "message"})
.done(content => {
Expand All @@ -197,6 +193,12 @@ export class GlobalDatabaseConfig extends React.Component {
"success",
msg
);
if (requireRestart) {
this.props.addNotification(
"warning",
`You must restart the Directory Server for these changes to take effect.`
);
}
})
.fail(err => {
let errMsg = JSON.parse(err);
Expand Down
10 changes: 6 additions & 4 deletions src/cockpit/389-console/src/lib/database/suffix.jsx
Expand Up @@ -726,10 +726,6 @@ export class Suffix extends React.Component {
if (cmd.length > 7) {
log_cmd("saveSuffixConfig", "Save suffix config", cmd);
let msg = "Successfully updated suffix configuration";
if (requireRestart) {
msg = ("Successfully updated suffix configuration. These " +
"changes require the server to be restarted to take effect");
}
cockpit
.spawn(cmd, {superuser: true, "err": "message"})
.done(content => {
Expand All @@ -739,6 +735,12 @@ export class Suffix extends React.Component {
"success",
msg
);
if (requireRestart) {
this.props.addNotification(
"warning",
`You must restart the Directory Server for these changes to take effect.`
);
}
})
.fail(err => {
let errMsg = JSON.parse(err);
Expand Down
8 changes: 6 additions & 2 deletions src/cockpit/389-console/src/lib/security/ciphers.jsx
Expand Up @@ -111,7 +111,11 @@ export class Ciphers extends React.Component {
.done(() => {
this.props.addNotification(
"success",
`Successfully set cipher preferences. You must restart the Directory Server for these changes to take effect.`
`Successfully set cipher preferences.`
);
this.props.addNotification(
"warning",
`You must restart the Directory Server for these changes to take effect.`
);
this.setState({
saving: false,
Expand Down Expand Up @@ -140,7 +144,7 @@ export class Ciphers extends React.Component {
}

handleCipherChange (type, values) {
let availableCiphers = this.props.supportedCiphers.slice(0); // Copy array
let availableCiphers = this.state.availableCiphers.slice(0); // Copy array
for (let i = 0; i < availableCiphers.length; i++) {
for (let ci = 0; ci < values.length; ci++) {
if (availableCiphers[i] === values[ci]) {
Expand Down
18 changes: 15 additions & 3 deletions src/cockpit/389-console/src/security.jsx
Expand Up @@ -412,7 +412,11 @@ export class Security extends React.Component {
.done(() => {
this.props.addNotification(
"success",
`Successfully enabled security. You must restart the server for this to take effect.`
`Successfully enabled security.`
);
this.props.addNotification(
"warning",
`You must restart the Directory Server for these changes to take effect.`
);
this.setState({
securityEnabled: true,
Expand Down Expand Up @@ -448,7 +452,11 @@ export class Security extends React.Component {
.done(() => {
this.props.addNotification(
"success",
`Successfully disabled security. You must restart the server for this to take effect.`
`Successfully disabled security.`
);
this.props.addNotification(
"warning",
`You must restart the Directory Server for these changes to take effect.`
);
this.setState({
securityEnabled: false,
Expand Down Expand Up @@ -540,7 +548,7 @@ export class Security extends React.Component {

if (cmd.length > 5) {
log_cmd("saveSecurityConfig", "Applying security config change", cmd);
let msg = "Successfully updated security configuration. You must restart the Directory Server for these changes to take effect.";
let msg = "Successfully updated security configuration.";

this.setState({
// Start the spinner
Expand All @@ -555,6 +563,10 @@ export class Security extends React.Component {
"success",
msg
);
this.props.addNotification(
"warning",
`You must restart the Directory Server for these changes to take effect.`
);
this.setState({
saving: false
});
Expand Down

0 comments on commit 0f8605a

Please sign in to comment.