/** * delete the downloadfile from a content * @param string $format * @param string $contentid * @return string xml/json */ private function contentdownloaddelete($format, $contentid) { $user = $this->checkpassword(true); $this->checktrafficlimit($user); $content = addslashes($contentid); // fetch data $con = new OCSContent(); if ($con->load($content) and $con->is_owned(OCSUser::id())) { $con->downloaddelete(); $txt = $this->generatexml($format, 'ok', 100, ''); } else { $txt = $this->generatexml($format, 'failed', 101, 'no permission to change content'); } echo $txt; }