/usr/bin/kronolith-import-icals is in php-horde-kronolith 4.2.13-1ubuntu1.
This file is owned by root:root, with mode 0o755.
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 | #!/usr/bin/php
<?php
/**
* This script imports iCalendar/vCalendar data into Kronolith calendars.
* The data is read from standard input, the calendar and user name passed as
* parameters.
*
* Copyright 2005-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>
*/
if (file_exists(__DIR__ . '/../../kronolith/lib/Application.php')) {
$baseDir = __DIR__ . '/../';
} else {
require_once 'PEAR/Config.php';
$baseDir = PEAR_Config::singleton()
->get('horde_dir', null, 'pear.horde.org') . '/kronolith/';
}
require_once $baseDir . 'lib/Application.php';
Horde_Registry::appInit('kronolith', array('cli' => true));
// Read command line parameters.
if (count($argv) != 3) {
$cli->message('Too many or too few parameters.', 'cli.error');
usage();
}
$cal = $argv[1];
$user = $argv[2];
// Read standard input.
$ical = $cli->readStdin();
if (empty($ical)) {
$cli->message('No import data provided.', 'cli.error');
usage();
}
// Set user.
$registry->setAuth($user, array());
// Import data.
try {
$result = $registry->call('calendar/import', array($ical, 'text/calendar', $cal));
} catch (Horde_Exception $e) {
$cli->fatal($e->toString());
}
$cli->message('Imported successfully ' . count($result) . ' events', 'cli.success');
function usage()
{
$GLOBALS['cli']->writeln('Usage: kronolith-import-icals calendar user');
exit;
}
|