Commit 564f846a authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.1.4 Logging now working for all User & Group Management functions

parent 970727b0
Pipeline #23428 failed with stages
in 2 seconds
......@@ -6,7 +6,7 @@ if [[ ${CI_COMMIT_REF_NAME} == 'master' ]]; then
else
BRANCH="-${CI_COMMIT_REF_NAME}"
fi
VERSION_NUMBER='1.1.3'
VERSION_NUMBER='1.1.4'
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum -y install nodejs npm ruby-devel gcc make rpm-build rubygems
......
......@@ -259,7 +259,7 @@ function createWindow() {
var menu = Menu.buildFromTemplate(menuTemplate);
Menu.setApplicationMenu(menu); //Sets the template as the app menu
//mainWindow.openDevTools() //Opens dev tools on start
mainWindow.openDevTools() //Opens dev tools on start
}
function addWin(file, title, width, height) {
......@@ -310,7 +310,7 @@ function addWin(file, title, width, height) {
})
addWindow.setMenu(null)
//addWindow.openDevTools()
addWindow.openDevTools()
}
}
......
......@@ -32,7 +32,6 @@ function addUser() {
name = ipcRenderer.sendSync('prompt', 'start')
if(name == null) {
ipcRenderer.send('log', 'ORNL Toolbox: Add User canceled', 'info')
alert('Operation canceled')
return
}
ipcRenderer.send('log', `ORNL Toolbox: Manual name entered for ${uid}`, 'info')
......@@ -62,7 +61,6 @@ function addUser() {
return
} else if(error.includes('Request dismissed')) {
ipcRenderer.send('log', 'ORNL Toolbox: Add User request canceled', 'info')
alert('Operation canceled')
return
}
console.error(error)
......
......@@ -39,7 +39,6 @@ function removeUser() {
return
} else if(error.includes('Request dismissed')) {
ipcRenderer.send('log', 'ORNL Toolbox: Remove User request canceled', 'info')
alert('Operation canceled')
return
}
console.error(error)
......
const ipcRenderer = require('electron').ipcRenderer
function sudoManagement() { //Save checkbox setting for the selected user
if(!execSync) var execSync = require('child_process').execSync
ipcRenderer.send('log', 'ORNL Toolbox: Submitted request to apply Sudo Management setting', 'info')
//Grab the user
var dropdown = document.getElementById('sudoManagementUserSelect')
var user = dropdown.options[dropdown.selectedIndex].text
if(user == "User") { //User didn't choose from the dropdown menu
ipcRenderer.send('log', 'ORNL Toolbox: No user selected - request aborted', 'info')
alert('No user selected')
return
} else {
......@@ -14,11 +18,12 @@ function sudoManagement() { //Save checkbox setting for the selected user
if(admin == true) {
//Add or keep for sudo group
execSync(`pkexec gpasswd -a ${user} sudo`, () => {})
output = execSync(`pkexec gpasswd -a ${user} sudo`, () => {})
} else {
//Remove or keep absent for sudo group
execSync(`pkexec gpasswd -d ${user} sudo`, () => {})
output = execSync(`pkexec gpasswd -d ${user} sudo`, () => {})
}
ipcRenderer.send('log', 'ORNL Toolbox: Sudo Management setting applied', 'info')
}
}
......@@ -37,6 +42,7 @@ function sudoManagementLoad() { //Loading the users
optionValue++
}
document.getElementById('sudoManagementUserSelect').innerHTML = dropdownString;
ipcRenderer.send('log', `ORNL Toolbox: List of users loaded`, 'info')
}
//Checking if user is sudo and checking the box if so
......@@ -55,4 +61,5 @@ function sudoManagementCheckIfSudo() {
} else {
document.getElementById('sudoManagementCheckbox').checked = false
}
ipcRenderer.send('log', `ORNL Toolbox: Retrieved current sudo setting for ${user}`, 'info')
}
......@@ -46,7 +46,6 @@ function syncPasswords(all) {
if(stderr) {
if(stderr.includes("Request dismissed")) {
ipcRenderer.send('log', 'ORNL Toolbox: Sync Passwords request canceled', 'info')
alert('Operation canceled')
return
}
alert(`${stderr}`)
......@@ -54,7 +53,7 @@ function syncPasswords(all) {
alert(`${stdout}`)
}
ipcRenderer.send('log', 'ORNL Toolbox: Password sync completed', 'info')
});
})
}
} else { //User pressed "Sync All"
......@@ -62,7 +61,6 @@ function syncPasswords(all) {
exec('pkexec wspasswd -a 2>&1 | grep -P \"Account .{3} :\"', (error, stdout, stderr) => {
if(stdout == "") { //Assuming request dismissed due to grep finding nothing
ipcRenderer.send('log', 'ORNL Toolbox: Sync Passwords request canceled', 'info')
alert('Operation canceled')
return
} else {
alert(`${stdout}`) //Need to test for a large number of system users
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment