summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-11-15 17:03:51 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-11-15 17:03:51 -0500
commitdf16cb8ace67d26244098af2073a89f34c3847a6 (patch)
tree1029791422f5c79d0c76d739690750319e434f4c
parent0da284dec075c8fb1fa9c78289e336132f348882 (diff)
downloadthemesite-df16cb8ace67d26244098af2073a89f34c3847a6.tar.gz
themesite-df16cb8ace67d26244098af2073a89f34c3847a6.zip
When deleting themes, also clean up the secondary tables.
-rw-r--r--private/themesite.class.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/private/themesite.class.php b/private/themesite.class.php
index 8acfaf5..cf9f144 100644
--- a/private/themesite.class.php
+++ b/private/themesite.class.php
@@ -449,10 +449,16 @@ class themesite {
$args = array(':id' => $themeid);
$theme = $this->db->query($sql, $args)->next();
- if ($newstatus == -1) {
+ if ($newstatus == -1) {
+ $sql = 'DELETE FROM zipcontents WHERE themeid=:id';
+ $args = array(':id' => $themeid);
+ $this->db->query($sql, $args);
+ $sql = 'DELETE FROM checkwps WHERE themeid=:id';
+ $args = array(':id' => $themeid);
+ $this->db->query($sql, $args);
$sql = 'DELETE FROM themes WHERE themeid=:id';
$args = array(':id' => $themeid);
-
+
/* Delete the files */
foreach(array($this->themedir_public, $this->themedir_private) as $root) {
$dir = sprintf('%s/%s/%s',
@@ -474,7 +480,7 @@ class themesite {
':reason' => $reason,
':id' => $themeid
);
-
+
$public = sprintf('%s/%s/%s/%s', $this->themedir_public, $theme['mainlcd'], $theme['shortname'], $theme['zipfile']);
$private = sprintf('%s/%s/%s/%s', $this->themedir_private, $theme['mainlcd'], $theme['shortname'], $theme['zipfile']);
if ($oldstatus == 0 && $newstatus >= 1) {