diff --git a/src/lib/Qrcode/Qrcode-intchil.php b/src/lib/Qrcode/Qrcode-intchil.php index 9b0d62b..45285d0 100644 --- a/src/lib/Qrcode/Qrcode-intchil.php +++ b/src/lib/Qrcode/Qrcode-intchil.php @@ -207,9 +207,12 @@ class Qrcode { } public function getQrcode($id) { + require_once BASE_PATH . '/includes/security.php'; + $db = getDbInstance(); $db->where('id', $id); + qr_apply_owner_scope($db); $result = $db->getOne($this->table); if($result !== NULL) @@ -531,6 +534,7 @@ class Qrcode { if(!file_exists(SAVED_QRCODE_DIRECTORY.$data_to_db['filename'].'.'.$old_qrcode["format"]) || $data_to_db['filename'] == $input_data["old_filename"]){ $db->where('id', $input_data["id"]); + qr_apply_owner_scope($db); $stat = $db->update($this->table, $data_to_db); try{ @@ -563,6 +567,7 @@ class Qrcode { $qrcode = $this->getQrcode($id); $db->where('id', $id); + qr_apply_owner_scope($db); $status = $db->delete($this->table); if ($status) { diff --git a/src/lib/Qrcode/Qrcode.php b/src/lib/Qrcode/Qrcode.php index d49e447..6181e55 100644 --- a/src/lib/Qrcode/Qrcode.php +++ b/src/lib/Qrcode/Qrcode.php @@ -192,9 +192,12 @@ class Qrcode { } public function getQrcode($id) { + require_once BASE_PATH . '/includes/security.php'; + $db = getDbInstance(); $db->where('id', $id); + qr_apply_owner_scope($db); $result = $db->getOne($this->table); if($result !== NULL) @@ -376,6 +379,7 @@ class Qrcode { if(!file_exists(SAVED_QRCODE_DIRECTORY.$data_to_db['filename'].'.'.$old_qrcode["format"]) || $data_to_db['filename'] == $input_data["old_filename"]){ $db->where('id', $input_data["id"]); + qr_apply_owner_scope($db); $stat = $db->update($this->table, $data_to_db); try{ @@ -408,6 +412,7 @@ class Qrcode { $qrcode = $this->getQrcode($id); $db->where('id', $id); + qr_apply_owner_scope($db); $status = $db->delete($this->table); if ($status) {