Add sessions and log deleting

This commit is contained in:
2023-06-10 10:13:00 +02:00
parent 2e2a56a751
commit 5834a92a3f
2 changed files with 51 additions and 20 deletions

View File

@@ -48,7 +48,6 @@
$.post("api.php",
{
action: "deletecontent",
password: password,
id: name
}, function( data ) {
getcontents();
@@ -58,8 +57,7 @@
function getcontents(){
$.post("api.php",
{
action: "getcontent",
password: password
action: "getcontent"
}, function( data ) {
$("#contentlist").html(data);
@@ -82,13 +80,32 @@
$.post("api.php",
{
action: "delete",
password: password,
id: name
}, function( data ) {
getlinks();
});
}
function dellog(name){
$.post("api.php",
{
action: "deletelog",
id: name
}, function( data ) {
getlog();
});
}
function loadmgmt() {
getlinks();
getcontents();
getlog();
$("#pwdentry").fadeOut("fast", function(){
$("#indexmanagement").fadeIn("fast", function(){
});
});
}
function verifyPassword(){
password = $("#pwdbox").val();
$.post("api.php",
@@ -97,13 +114,7 @@
password: password
}, function( data ) {
if (data == "OK"){
getlinks();
getcontents();
getlog();
$("#pwdentry").fadeOut("slow", function(){
$("#indexmanagement").fadeIn("slow", function(){
});
});
loadmgmt();
}
});
}
@@ -111,8 +122,7 @@
function getlinks(){
$.post("api.php",
{
action: "get",
password: password
action: "get"
}, function( data ) {
$("#linkslist").html(data);
$("#addnickname").keyup(function(event) {
@@ -139,8 +149,7 @@
let id = $("#logid").val();
$.post("api.php",
{
action: "getlog",
password: password,
action: "getlog",
id: id
}, function( data ) {
$("#loglist").html(data);
@@ -152,6 +161,14 @@
$("#submitpwd").click(verifyPassword);
$("#logget").click(getlog);
$.post("api.php",
{
action: "hassession"
}, function( data ) {
if (data == "YES"){
loadmgmt();
}
});
$("#logid").keyup(function(event) {
if (event.keyCode === 13) {