Add deletions to changelog

This commit is contained in:
“VeLiTi”
2024-04-25 09:50:09 +02:00
parent 10e18030bb
commit 665de3436f
8 changed files with 23 additions and 0 deletions

View File

@@ -178,6 +178,9 @@ elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('ac
elseif ($command == 'delete' && isAllowed('account',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM account WHERE rowID = ? '.$whereclause.'');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'accounts',$id,'Delete','Delete',$username);
} else
{
//do nothing

View File

@@ -85,6 +85,9 @@ elseif ($command == 'insert' && isAllowed('communication',$profile,$permission,'
elseif ($command == 'delete' && isAllowed('communication',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM communication WHERE rowID = ? '.$whereclause.'');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'communications',$id,'Delete','Delete',$username);
} else
{
//do nothing

View File

@@ -70,6 +70,9 @@ elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('co
elseif ($command == 'delete' && isAllowed('contract',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM contracts WHERE rowID = ? '.$whereclause.'');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'contracts',$id,'Delete','Delete',$username);
} else
{
//do nothing

View File

@@ -217,6 +217,8 @@ elseif ($command == 'delete' && (isAllowed('equipment_manage',$profile,$permissi
//delete history related to equipment
$stmt = $pdo->prepare('DELETE FROM history WHERE equipmentid = ?');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'equipment',$id,'Delete','Delete',$username);
} else
{
//do nothing

View File

@@ -80,6 +80,9 @@ elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('hi
elseif ($command == 'delete' && isAllowed('history',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM history WHERE rowID = ?');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'history',$id,'Delete','Delete',$username);
} else
{
//do nothing

View File

@@ -185,6 +185,9 @@ elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('pa
elseif ($command == 'delete' && isAllowed('partner',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM partner WHERE partnerID = ? '.$whereclause.'');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'partners',$id,'Delete','Delete',$username);
} else
{
//do nothing

View File

@@ -94,6 +94,9 @@ elseif ($command == 'insert' && isAllowed('products',$profile,$permission,'C') =
elseif ($command == 'delete' && isAllowed('products',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM products WHERE rowID = ? '.$whereclause.'');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'products',$id,'Delete','Delete',$username);
} else
{
//do nothing

View File

@@ -248,6 +248,9 @@ elseif ($command == 'delete' && isAllowed('user',$profile,$permission,'D') === 1
//delete equipment
$stmt = $pdo->prepare('DELETE FROM users WHERE id = ? '.$whereclause.'');
$stmt->execute([ $id ]);
//Add deletion to changelog
changelog($dbname,'users',$id,'Delete','Delete',$username);
} else
{
//do nothing