Update saving Users. Don't allow restrictions on admin user. Fix CSP violations.

This commit is contained in:
Isaac Connor
2020-06-23 22:19:04 -04:00
parent 93b0552ed7
commit e778ea0918

View File

@@ -12,16 +12,22 @@ function validateForm( form, newUser ) {
} else if ( newUser ) {
errors[errors.length] = "You must supply a password";
}
var monitorIds = new Array();
for ( var i = 0; i < form.elements['monitorIds'].options.length; i++ ) {
if ( form.elements['monitorIds'].options[i].selected ) {
monitorIds[monitorIds.length] = form.elements['monitorIds'].options[i].value;
}
}
form.elements['newUser[MonitorIds]'].value = monitorIds.join( ',' );
if ( errors.length ) {
alert( errors.join( "\n" ) );
return ( false );
alert(errors.join("\n"));
return false;
}
return ( true );
return true;
}
function initPage() {
$j('#contentForm').submit(function(event) {
if ( validateForm(this) ) {
$j('#contentButtons').hide();
return true;
} else {
return false;
};
});
} // end function initPage
window.addEventListener('DOMContentLoaded', initPage);