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