From 0443d0829ab7e2d30825fded2f172b74d26b5b3c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 19 Feb 2015 22:36:29 +0100 Subject: Add claiming of multipastes Signed-off-by: Florian Pritz --- application/models/mmultipaste.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'application/models/mmultipaste.php') diff --git a/application/models/mmultipaste.php b/application/models/mmultipaste.php index ed3b8e3a7..f80105ec9 100644 --- a/application/models/mmultipaste.php +++ b/application/models/mmultipaste.php @@ -88,6 +88,17 @@ class Mmultipaste extends CI_Model { return true; } + function adopt($id) + { + $userid = $this->muser->get_userid(); + + $this->db->set(array('user_id' => $userid )) + ->where('url_id', $id) + ->where('user_id', 0) + ->update('multipaste'); + return $this->db->affected_rows(); + } + public function get_tarball_path($id) { return $this->config->item("upload_path")."/special/multipaste-tarballs/".substr(md5($id), 0, 3)."/$id.tar.gz"; -- cgit v1.2.3-24-g4f1b