Skip to content

Commit

Permalink
Removed a config I wanted to add, but didn't make sense.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcgonag committed Mar 29, 2020
1 parent f94495c commit 1f56dae
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 45 deletions.
17 changes: 0 additions & 17 deletions client/Admin/adminAllowOtherUsers.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,6 @@
</div>
</div>
{{/if}}
{{#if $eq allowOwnNetwork false}}
<div class="row">
<div class="col s12 m8 l8">
Disallow Inter-client Communication
</div>
<div class="col s12 m4 l4">
<div class="switch">
<label>
No
<input type="checkbox" class="disallowCom" id="disallowCom" checked="{{#if $eq configInfo.disallowCom true}}checked{{/if}}" />
<span class="lever"></span>
Yes
</label>
</div>
</div>
</div>
{{/if}}
{{/if}}
</div>
</div>
Expand Down
8 changes: 0 additions & 8 deletions client/Admin/adminAllowOtherUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,4 @@ Template.adminAllowOtherUsers.events({
console.log("allow own: " + allowOwnNetwork);
Session.set("allowOwnNetwork", allowOwnNetwork);
},
'click #disallowCom' (event) {
Session.set("confirmationDialogTitle", "NOTICE");
Session.set("confirmationDialogContent", "Changing the Disallow Inter-Communication value after clients have been created with a specific value set, will not update the functionality of existing clients!");
Session.set("eventConfirmCallBackFunction", "");
Session.set("eventConfirmNecessaryId", "disallowCom");

$("#genModal").modal('open');
}
});
14 changes: 2 additions & 12 deletions client/Admin/adminConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Template.adminConfig.events({
let maxNoNets = $("#maxNetworks").val();
let logMore = $("#logMore").prop('checked');
let logLevel = $("#logLevel").val();
let disallowCom = $("#disallowCom").prop('checked');

if (allowOwnNetwork == null || allowOthers == false) {
allowOwnNetwork = false;
Expand All @@ -66,11 +65,7 @@ Template.adminConfig.events({
logLevel = "";
}

if (disallowCom == null || disallowCom == "") {
disallowCom = false;
}

Meteor.call("new.config", host, user, pass, server, portNo, allowOthers, maxNoInts, allowOwnNetwork, maxNoNets, logMore, logLevel, disallowCom, function(err, result) {
Meteor.call("new.config", host, user, pass, server, portNo, allowOthers, maxNoInts, allowOwnNetwork, maxNoNets, logMore, logLevel, function(err, result) {
if (err) {
console.log("Error adding email configuration: " + err);
showSnackbar("Error Adding Email Configuration!", "red");
Expand All @@ -94,7 +89,6 @@ Template.adminConfig.events({
let maxNoNets = $("#maxNetworks").val();
let logMore = $("#logMore").prop('checked');
let logLevel = $("#logLevel").val();
let disallowCom = $("#disallowCom").prop('checked');

if (allowOwnNetwork == null || allowOthers == false) {
allowOwnNetwork = false;
Expand All @@ -116,11 +110,7 @@ Template.adminConfig.events({
logLevel = "";
}

if (disallowCom == null || disallowCom == "") {
disallowCom = false;
}

Meteor.call("edit.config", host, user, pass, server, portNo, allowOthers, maxNoInts, allowOwnNetwork, maxNoNets, logMore, logLevel, disallowCom, function(err, result) {
Meteor.call("edit.config", host, user, pass, server, portNo, allowOthers, maxNoInts, allowOwnNetwork, maxNoNets, logMore, logLevel, function(err, result) {
if (err) {
console.log("Error editing email configuration: " + err);
showSnackbar("Error Editing Email Configuration!", "red");
Expand Down
9 changes: 2 additions & 7 deletions imports/api/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Configuration.allow({
});

Meteor.methods({
'new.config' (emailHost, emailUser, emailPassword, emailSmtpServer, emailSmtpPort, allowOthers, maxNumberInterfaces, allowOwnNetwork, maxNumberNetworks, logMore, logLevel, disallowCom) {
'new.config' (emailHost, emailUser, emailPassword, emailSmtpServer, emailSmtpPort, allowOthers, maxNumberInterfaces, allowOwnNetwork, maxNumberNetworks, logMore, logLevel) {
check(emailHost, String);
check(emailUser, String);
check(emailPassword, String);
Expand All @@ -24,7 +24,6 @@ Meteor.methods({
check(maxNumberNetworks, Number);
check(logMore, Boolean);
check(logLevel, String);
check(disallowCom, Boolean);

return Configuration.insert({
emailHost: emailHost,
Expand All @@ -38,11 +37,10 @@ Meteor.methods({
maxNumberNetworks: maxNumberNetworks,
logMore: logMore,
logLevel: logLevel,
disallowCom: disallowCom,
addedOn: new Date(),
});
},
'edit.config' (emailHost, emailUser, emailPassword, emailSmtpServer, emailSmtpPort, allowOthers, maxNumberInterfaces, allowOwnNetwork, maxNumberNetworks, logMore, logLevel, disallowCom) {
'edit.config' (emailHost, emailUser, emailPassword, emailSmtpServer, emailSmtpPort, allowOthers, maxNumberInterfaces, allowOwnNetwork, maxNumberNetworks, logMore, logLevel) {
check(emailHost, String);
check(emailUser, String);
check(emailPassword, String);
Expand All @@ -54,8 +52,6 @@ Meteor.methods({
check(maxNumberNetworks, Number);
check(logMore, Boolean);
check(logLevel, String);
check(disallowCom, Boolean);


if (!this.userId) {
throw new Meteor.Error('User is not allowed to setup admin values, make sure you are logged in.');
Expand All @@ -78,7 +74,6 @@ Meteor.methods({
maxNumberNetworks: maxNumberNetworks,
logMore: logMore,
logLevel: logLevel,
disallowCom: disallowCom,
addedOn: new Date(),
addedBy: Meteor.user().emails[0].address,
}
Expand Down
2 changes: 1 addition & 1 deletion server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Meteor.startup(() => {
let Configs = Configuration.findOne({});

if (typeof Configs == 'undefined') {
Meteor.call('new.config', "", "", "", "", "", false, 0, false, 0, false, "", false, function(err, result) {
Meteor.call('new.config', "", "", "", "", "", false, 0, false, 0, false, "", function(err, result) {
if (err) {
console.log("Error setting initial configuration: " + err);
} else {
Expand Down

0 comments on commit 1f56dae

Please sign in to comment.