From ea458981e3e921c8e780b8560ed7c55045e5cf45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20H=C3=A4ggqvist?= Date: Fri, 13 Mar 2009 02:38:44 +0100 Subject: [PATCH] Do some logging. More may be needed. --- private/themesite.class.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/private/themesite.class.php b/private/themesite.class.php index 963c333..55c1d74 100644 --- a/private/themesite.class.php +++ b/private/themesite.class.php @@ -70,6 +70,7 @@ class themesite { * Run checkwps on all our themes */ public function checkallthemes() { + $this->log("Running checkwps"); $sql = "SELECT RowID, * FROM themes"; $themes = $this->db->query($sql); $return = array(); @@ -175,6 +176,13 @@ class themesite { } public function changestatus($themeid, $newstatus, $oldstatus, $reason) { + $status_text = array('1' => 'Approved', '0' => 'hidden', '-1' => 'deleted'); + $this->log(sprintf("Changing status of theme %d from %s to %s", + $themeid, + $status_text[$oldstatus], + $status_text[$newstatus] + ); + if ($newstatus == -1) { $theme = $this->db->query(sprintf("SELECT shortname, mainlcd FROM themes WHERE RowID='%d'", db::quote($themeid)))->next(); $sql = sprintf("DELETE FROM themes WHERE RowID='%d'", @@ -210,6 +218,8 @@ class themesite { } public function addtarget($shortname, $fullname, $mainlcd, $pic, $depth, $remotelcd = false) { + $this->log(sprintf("Add new target %s", $fullname)); + $sql = sprintf("INSERT INTO targets (shortname, fullname, mainlcd, pic, depth, remotelcd) VALUES @@ -329,7 +339,9 @@ END; ); $result = $this->db->query($sql); $id = $result->insertid(); - $check = $this->checkwps(sprintf("%s/%s/%s", config::datadir, $mainlcd, $zipfile['name']), $mainlcd, $remotelcd, true); + $check = $this->checkwps(sprintf("%s/%s/%s", config::datadir, $mainlcd, $zipfile['name']), $mainlcd, $remotelcd); + /* xxx: store these results */ + $this->log(sprintf("Added theme %d (email: %s)", $id, $email)); return $id; } -- 2.11.4.GIT