Commit b1f89e7b authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.1.1 Remove User logging complete. Also added logging for when the app...

ver. 1.1.1 Remove User logging complete. Also added logging for when the app is closed, need to test this
parent 40d1bdad
Pipeline #23378 passed with stages
in 1 minute and 6 seconds
......@@ -46,7 +46,7 @@
</span>
</div>
<span title="Opens an application page for submitting feedback regarding ORNL Toolbox.">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Give Feedback', 500, 300)">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Feedback', 500, 300)">
<div class="feedbackImage">
<img src="../images/comment-white-oval-bubble-shape.png" alt="White Chat Bubble">
</div>
......@@ -54,7 +54,7 @@
</div>
</span>
<span title="Opens an application page for seeking help regarding your system.">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Email to Support', 500, 400)">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Help', 500, 400)">
<div class="helpImage">
<img src="../images/help-web-button-white.png" alt="Question Mark">
</div>
......
......@@ -6,7 +6,7 @@ if [[ ${CI_COMMIT_REF_NAME} == 'master' ]]; then
else
BRANCH="-${CI_COMMIT_REF_NAME}"
fi
VERSION_NUMBER='1.1.0'
VERSION_NUMBER='1.1.1'
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
......
......@@ -54,7 +54,7 @@
<div id="fileSystemManagementHiddenbuttons"></div>
</div>
<span title="Opens an application page for submitting feedback regarding ORNL Toolbox.">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Give Feedback', 500, 300)">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Feedback', 500, 300)">
<div class="feedbackImage">
<img src="../images/comment-white-oval-bubble-shape.png" alt="White Chat Bubble">
</div>
......@@ -62,7 +62,7 @@
</div>
</span>
<span title="Opens an application page for seeking help regarding your system.">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Email to Support', 500, 400)">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Help', 500, 400)">
<div class="helpImage">
<img src="../images/help-web-button-white.png" alt="Question Mark">
</div>
......
......@@ -55,7 +55,7 @@
</span>
</div>
<span title="Opens an application page for submitting feedback regarding ORNL Toolbox.">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Give Feedback', 500, 300)">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Feedback', 500, 300)">
<div class="feedbackImage">
<img src="../images/comment-white-oval-bubble-shape.png" alt="White Chat Bubble">
</div>
......@@ -63,7 +63,7 @@
</div>
</span>
<span title="Opens an application page for seeking help regarding your system.">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Email to Support', 500, 400)">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Help', 500, 400)">
<div class="helpImage">
<img src="../images/help-web-button-white.png" alt="Question Mark">
</div>
......
......@@ -378,6 +378,12 @@ ipcMain.on('log', (event, message, level) => {
})
ipcMain.on('close app', () => {
try {
execSync(`echo 'ORNLToolbox: Toolbox closed' | logger -p local0.info`)
} catch(error) {
console.error(error)
return
}
app.quit()
exit()
})
......
......@@ -55,7 +55,7 @@
<div id="ButtonSecurity" onclick="openSoftware(1)">0</div>
</span>
<span title="Opens an application page for submitting feedback regarding ORNL Toolbox.">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Give Feedback', 500, 300)">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Feedback', 500, 300)">
<div class="feedbackImage">
<img src="../images/comment-white-oval-bubble-shape.png" alt="White Chat Bubble">
</div>
......@@ -63,7 +63,7 @@
</div>
</span>
<span title="Opens an application page for seeking help regarding your system.">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Email to Support', 500, 400)">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Help', 500, 400)">
<div class="helpImage">
<img src="../images/help-web-button-white.png" alt="Question Mark">
</div>
......
......@@ -8,7 +8,7 @@ function addUser() {
ipcRenderer.send('log', 'ORNL Toolbox: Submitted Add User request', 'info')
if(uid.length != 3 || /^[a-z0-9]+$/.test(uid) == false) {
ipcRenderer.send('log', 'ORNL Toolbox: Invalid UID submitted for Add User', 'err')
ipcRenderer.send('log', `ORNL Toolbox: Invalid UID submitted for Add User - ${uid}`, 'err')
alert('Please enter a valid 3 character UID')
return
}
......@@ -27,12 +27,15 @@ function addUser() {
//Have user enter a name if the LDAP server can't be reached
//also if the specified user doesn't have the workstation resource
if(name == "" || name.includes('Can\'t contact LDAP server')) {
ipcRenderer.send('log', 'ORNL Toolbox: LDAP server unable to be reached or entered UID has no workstation resource', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened manual name entry for Add User', 'info')
ipcRenderer.send('log', `ORNL Toolbox: LDAP server unable to be reached or ${uid} has no workstation resource`, 'info')
ipcRenderer.send('log', `ORNL Toolbox: Opened manual name entry for ${uid}`, 'info')
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')
}
if(sudo == true) { //Check if the user wants the new user to have sudo
......@@ -43,9 +46,10 @@ function addUser() {
//"Ubuntu" not found in file
sudo = "-G wheel "
}
ipcRenderer.send('log', 'ORNL Toolbox: Assigned sudo privileges to entered UID', 'info')
ipcRenderer.send('log', `ORNL Toolbox: Sudo privileges set to be given to ${uid}`, 'info')
} else {
sudo = ""
ipcRenderer.send('log', `ORNL Toolbox: Sudo privileges set to not be given to ${uid}`, 'info')
}
try {
......@@ -53,7 +57,7 @@ function addUser() {
} catch(error) {
error = error.toString()
if(error.includes('already exists')) {
ipcRenderer.send('log', 'ORNL Toolbox: Entered UID already exists', 'err')
ipcRenderer.send('log', `ORNL Toolbox: ${uid} already exists as a user`, 'err')
alert('User already exists')
return
} else if(error.includes('Request dismissed')) {
......@@ -66,7 +70,7 @@ function addUser() {
return
}
ipcRenderer.send('log', 'ORNL Toolbox: Entered UID added as a user', 'info')
ipcRenderer.send('log', `ORNL Toolbox: ${uid} added as a user`, 'info')
alert('User added')
ipcRenderer.send('close minor window')
}
......@@ -7,18 +7,24 @@ function removeUser() {
var rhome = document.getElementById("removeUserCheckbox1").checked //Retrieve if user wants to remove the home directory
var confirm = document.getElementById("removeUserCheckbox2").checked //Retrieve if user is certain they wish to remove the user
ipcRenderer.send('log', 'ORNL Toolbox: Submitted Remove User request', 'info')
if(uid.length != 3 || /^[a-z0-9]+$/.test(uid) == false) { //Test for valid UID
ipcRenderer.send('log', `ORNL Toolbox: Invalid UID submitted for Remove User - ${uid}`, 'err')
alert('Please enter a valid 3 character UID')
return
}
if(rhome == true) { //Adding the remove home folder option if the user wanted
ipcRenderer.send('log', `ORNL Toolbox: Home folder of ${uid} set to be removed`, 'info')
rhome = "-r"
} else {
ipcRenderer.send('log', `ORNL Toolbox: Home folder of ${uid} set to be kept`, 'info')
rhome = ""
}
if(confirm == false) {
ipcRenderer.send('log', 'ORNL Toolbox: Confirmation box not checked - request aborted', 'err')
alert("Please confirm that you wish to remove this user")
return
}
......@@ -28,9 +34,11 @@ function removeUser() {
} catch(error) {
error = error.toString()
if(error.includes('does not exist')) {
ipcRenderer.send('log', `ORNL Toolbox: ${uid} does not exist as a user`, 'err')
alert('User does not exist')
return
} else if(error.includes('Request dismissed')) {
ipcRenderer.send('log', 'ORNL Toolbox: Remove User canceled', 'info')
alert('Operation canceled')
return
}
......@@ -39,6 +47,7 @@ function removeUser() {
return
}
ipcRenderer.send('log', `ORNL Toolbox: ${uid} removed as a user`, 'info')
alert('User removed')
ipcRenderer.send('close minor window')
}
......@@ -51,7 +51,7 @@
<div id="userManagementHiddenbuttons"></div>
</div>
<span title="Opens an application page for submitting feedback regarding ORNL Toolbox.">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Give Feedback', 500, 300)">
<div class="feedbackContainer" onclick="addWinMain('./feedback/feedback.html', 'Feedback', 500, 300)">
<div class="feedbackImage">
<img src="../images/comment-white-oval-bubble-shape.png" alt="White Chat Bubble">
</div>
......@@ -59,7 +59,7 @@
</div>
</span>
<span title="Opens an application page for seeking help regarding your system.">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Email to Support', 500, 400)">
<div class="helpContainer" onclick="addWinMain('./help/help.html', 'Help', 500, 400)">
<div class="helpImage">
<img src="../images/help-web-button-white.png" alt="Question Mark">
</div>
......
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