bug fix in read.php, bump version in footer, NEW: bulk delete
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user