/usr/share/horde/trean/app/controllers/DeleteBookmark.php is in php-horde-trean 1.1.4-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <?php
class Trean_DeleteBookmark_Controller extends Horde_Controller_Base
{
public function processRequest(Horde_Controller_Request $request, Horde_Controller_Response $response)
{
$id = Horde_Util::getFormData('bookmark');
$gateway = $this->getInjector()->getInstance('Trean_Bookmarks');
$notification = $this->getInjector()->getInstance('Horde_Notification');
try {
$bookmark = $gateway->getBookmark($id);
$gateway->removeBookmark($bookmark);
$notification->push(_("Deleted bookmark: ") . $bookmark->title, 'horde.success');
$result = array('data' => 'deleted');
} catch (Horde_Exception $e) {
$notification->push(sprintf(_("There was a problem deleting the bookmark: %s"), $e->getMessage()), 'horde.error');
$result = array('error' => $e->getMessage());
}
if (Horde_Util::getFormData('format') == 'json') {
$response->setContentType('application/json');
$response->setBody(json_encode($result));
} else {
$response->setRedirectUrl(Horde_Util::getFormData('url', Horde::url('browse.php', true)));
}
}
}
|