/usr/share/horde/gollem/edit.php is in php-horde-gollem 3.0.7-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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | <?php
/**
* Gollem edit script.
*
* Copyright 2006-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Jan Schneider <jan@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/gpl GPL
* @package Gollem
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('gollem');
$vars = Horde_Variables::getDefaultVariables();
if ($vars->driver != Gollem::$backend['driver']) {
echo Horde::wrapInlineScript(array('window.close();'));
exit;
}
/* Run through action handlers. */
switch ($vars->actionID) {
case 'save_file':
try {
$injector
->getInstance('Gollem_Vfs')
->writeData($vars->dir, $vars->file, $vars->content);
$message = sprintf(_("%s successfully saved."), $vars->file);
} catch (Horde_Vfs_Exception $e) {
$message = sprintf(_("Access denied to %s"), $vars->file);
}
echo Horde::wrapInlineScript(array(
'alert(' . Horde_Serialize::serialize($message, Horde_Serialize::JSON) . ')'
));
break;
case 'edit_file':
try {
$data = $injector
->getInstance('Gollem_Vfs')
->read($vars->dir, $vars->file);
} catch (Horde_Vfs_Exception $e) {
echo Horde::wrapInlineScript(array(
'alert(' . Horde_Serialize::serialize(sprintf(_("Access denied to %s"), $vars->file), Horde_Serialize::JSON) . ')'
));
break;
}
$mime_type = Horde_Mime_Magic::extToMIME($vars->type);
if (strpos($mime_type, 'text/') !== 0) {
break;
}
if ($mime_type == 'text/html') {
$injector->getInstance('Horde_Editor')->initialize(array('id' => 'content'));
}
$view = $injector->createInstance('Horde_View');
$view->self_url = Horde::url('edit.php');
$view->forminput = Horde_Util::formInput();
$view->vars = $vars;
$view->data = $data;
$page_output->addScriptFile('edit.js');
$page_output->topbar = $page_output->sidebar = false;
$page_output->header(array(
'title' => $title
));
$notification->notify(array('listeners' => 'status'));
echo $view->render('edit');
$page_output->footer();
exit;
}
echo Horde::wrapInlineScript(array('window.close()'));
|