diff options
Diffstat (limited to 'application/models/mmultipaste.php')
-rw-r--r-- | application/models/mmultipaste.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/application/models/mmultipaste.php b/application/models/mmultipaste.php index 367e74787..29fc183b6 100644 --- a/application/models/mmultipaste.php +++ b/application/models/mmultipaste.php @@ -88,11 +88,20 @@ class Mmultipaste extends CI_Model { return true; } + public function get_tarball_path($id) + { + return $this->config->item("upload_path")."/special/multipaste-tarballs/".substr(md5($id), 0, 3)."/$id.tar.gz"; + } + public function delete_id($id) { $this->db->where('url_id', $id) ->delete('multipaste'); + $path = $this->get_tarball_path($id); + $f = new \service\storage($this->config->item("upload_path"), $path); + $f->unlink(); + if ($this->id_exists($id)) { return false; } |