bug fix in read.php, bump version in footer, NEW: bulk delete

This commit is contained in:
giandonato.inverso@edempg.it
2024-04-18 20:33:20 +02:00
parent eba0ebbba7
commit 9f2d14abf8
9 changed files with 129 additions and 57 deletions
+3 -3
View File
@@ -89,9 +89,9 @@ class DynamicQrcode {
* Delete qr code
*
*/
public function deleteQrcode($id) {
public function deleteQrcode($id, $async = false) {
if($_SESSION['type'] === "super") {
$this->qrcode_instance->deleteQrcode($id);
$this->qrcode_instance->deleteQrcode($id, $async);
} else if ($_SESSION['type'] === "admin") {
$qrcode = $this->getQrcode($id);
@@ -103,7 +103,7 @@ class DynamicQrcode {
$user = $users->getUser($_SESSION['user_id']);
if($user["id"] === $qrcode["id_owner"])
$this->qrcode_instance->deleteQrcode($id);
$this->qrcode_instance->deleteQrcode($id, $async);
else
$this->failure("You cannot delete this qrcode because it's of another user");
}
+3 -2
View File
@@ -155,7 +155,7 @@ class Qrcode {
* Delete qr code
*
*/
public function deleteQrcode($id) {
public function deleteQrcode($id, $async = false) {
$db = getDbInstance();
$qrcode = $this->getQrcode($id);
@@ -171,7 +171,8 @@ class Qrcode {
}
if ($status)
$this->info('Qr code deleted successfully!');
if (!$async)
$this->info('Qr code deleted successfully!');
else
$this->failure('Unable to delete qr code');
}
+3 -3
View File
@@ -390,9 +390,9 @@ class StaticQrcode {
* Delete qr code
*
*/
public function deleteQrcode($id) {
public function deleteQrcode($id, $async = false) {
if($_SESSION['type'] === "super") {
$this->qrcode_instance->deleteQrcode($id);
$this->qrcode_instance->deleteQrcode($id, $async);
} else if ($_SESSION['type'] === "admin") {
$qrcode = $this->getQrcode($id);
@@ -404,7 +404,7 @@ class StaticQrcode {
$user = $users->getUser($_SESSION['user_id']);
if($user["id"] === $qrcode["id_owner"])
$this->qrcode_instance->deleteQrcode($id);
$this->qrcode_instance->deleteQrcode($id, $async);
else
$this->failure("You cannot delete this qrcode because it's of another user");
}