regardless of whether or not they are a member. If you disable it, users
will only be able to share their resources with groups they are members
of.">false</configboolean>
+ <configboolean name="hidden" required="false" desc="If you enable this
+ option, the shares that a user has access to will NOT be displayed
+ automatically, but only if the user subscribed to
+ them.">false</configboolean>
<configheader>Share Caching</configheader>
<configdescription>Enabling share caching improves performance because the
share backend will only be queried once per session. But it also increases
v4.0-cvs
--------
+[jan] Add option to not automatically show all available shares.
[jan] Add option to disallow world permissions for user shares.
[mms] Allow Mozilla DNS prefetching to be turned off when displaying untrusted
content (Ticket #8836).
$next_step = $data->cleanup();
}
+$import_calendars = $export_calendars = array();
+if (Horde_Auth::getAuth()) {
+ $calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT);
+ foreach ($calendars as $id => $calendar) {
+ if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
+ $import_calendars[$id] = $calendar;
+ }
+}
+$calendars = Kronolith::listCalendars(false, Horde_Perms::READ);
+foreach ($calendars as $id => $calendar) {
+ if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
+ $export_calendars[$id] = $calendar;
+}
+
$title = _("Import/Export Calendar");
require KRONOLITH_TEMPLATES . '/common-header.inc';
require KRONOLITH_TEMPLATES . '/menu.inc';
$calendars = Kronolith::listCalendars(false, Horde_Perms::READ);
$owners = array();
foreach ($calendars as $calendar) {
+ if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
$owners[$calendar->get('owner')] = true;
}
$default_share = Horde_Util::getFormData('default_share');
if (!is_null($default_share)) {
$sharelist = Kronolith::listCalendars();
- if ((is_array($sharelist)) > 0 &&
- isset($sharelist[$default_share])) {
+ if (isset($sharelist[$default_share]) &&
+ ($sharelist[$default_share]->get('owner') == Horde_Auth::getAuth() ||
+ in_array($default_share, $GLOBALS['display_calendars']))) {
$GLOBALS['prefs']->setValue('default_share', $default_share);
return true;
}
protected function _prefsFbCalsSelect()
{
$fb_calsSelected = Horde_Util::getFormData('fb_cals');
- $fb_cals = Kronolith::listCalendars();
$fb_calsFiltered = array();
if (isset($fb_calsSelected) && is_array($fb_calsSelected)) {
'default' => '__all'));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
+ if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($cal->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
$params['calendar']['values'][$id] = $cal->get('name');
}
'default' => 0));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
+ if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($cal->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
$params['calendar']['values'][$id] = $cal->get('name');
}
'default' => 0));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
+ if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($cal->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
$params['calendar']['values'][$id] = $cal->get('name');
}
'default' => 0));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
+ if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($cal->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
$params['calendar']['values'][$id] = $cal->get('name');
}
*/
public static function includeJSVars()
{
- global $browser, $conf, $prefs, $registry;
+ global $prefs, $registry;
$kronolith_webroot = $registry->get('webroot');
$horde_webroot = $registry->get('webroot', 'horde');
- $has_tasks = $GLOBALS['registry']->hasInterface('tasks');
+ $has_tasks = $registry->hasInterface('tasks');
$app_urls = array();
if (isset($GLOBALS['conf']['menu']['apps']) &&
is_array($GLOBALS['conf']['menu']['apps'])) {
foreach ($GLOBALS['conf']['menu']['apps'] as $app) {
- $app_urls[$app] = (string) Horde::url($GLOBALS['registry']->getInitialPage($app), true);
+ $app_urls[$app] = (string) Horde::url($registry->getInitialPage($app), true);
}
}
'app_urls' => $app_urls,
'name' => $registry->get('name'),
'has_tasks' => $has_tasks,
- 'is_ie6' => ($browser->isBrowser('msie') && ($browser->getMajor() < 7)),
+ 'is_ie6' => ($GLOBALS['browser']->isBrowser('msie') && ($GLOBALS['browser']->getMajor() < 7)),
'login_view' => $prefs->getValue('defaultview'),
'default_calendar' => 'internal|' . self::getDefaultCalendar(Horde_Perms::EDIT),
'week_start' => (int)$prefs->getValue('week_start_monday'),
);
if ($has_tasks) {
- $code['conf']['tasks'] = $GLOBALS['registry']->tasks->ajaxDefaults();
+ $code['conf']['tasks'] = $registry->tasks->ajaxDefaults();
}
// Calendars
foreach (array(true, false) as $my) {
foreach ($GLOBALS['all_calendars'] as $id => $calendar) {
+ if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
$owner = Horde_Auth::getAuth() &&
$calendar->get('owner') == Horde_Auth::getAuth();
if (($my && $owner) || (!$my && !$owner)) {
if (!$has_tasks) {
continue;
}
- foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW) as $id => $tasklist) {
+ foreach ($registry->tasks->listTasklists($my, Horde_Perms::SHOW) as $id => $tasklist) {
+ if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array('tasks/' . $id, $GLOBALS['display_external_calendars'])) {
+ continue;
+ }
$owner = Horde_Auth::getAuth() &&
$tasklist->get('owner') == Horde_Auth::getAuth();
if (($my && $owner) || (!$my && !$owner)) {
if ($api == 'tasks') {
continue;
}
+ if (!empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($api . '/' . $id, $GLOBALS['display_external_calendars'])) {
+ continue;
+ }
$calendar = $api . '/' . $id;
$code['conf']['calendars']['external'][$calendar] = array(
'name' => $name,
'fg' => '#000',
'bg' => '#ddd',
- 'api' => $GLOBALS['registry']->get('name', $GLOBALS['registry']->hasInterface($api)),
+ 'api' => $registry->get('name', $registry->hasInterface($api)),
'show' => in_array($calendar, $GLOBALS['display_external_calendars']));
}
}
if ($this->event->creator == Horde_Auth::getAuth()) {
$perms |= Kronolith::PERMS_DELEGATE;
}
- $calendars = Kronolith::listCalendars(false, $perms);
+ $all_calendars = Kronolith::listCalendars(false, $perms);
+ $calendars = array();
+ foreach ($all_calendars as $id => $calendar) {
+ if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
+ $calendars[$id] = $calendar;
+ }
$buttons = array();
if (!$this->event->hasPermission(Horde_Perms::EDIT) &&
$cancelurl = Horde::applicationUrl('month.php', true)->add('month', $month);
}
+$all_calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT | Kronolith::PERMS_DELEGATE);
+$calendars = array();
+foreach ($all_calendars as $id => $calendar) {
+ if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
+ $calendars[$id] = $calendar;
+}
+
$title = _("Add a new event");
-$calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT | Kronolith::PERMS_DELEGATE);
Horde::addScriptFile('new.js', 'kronolith');
Horde::addScriptFile('popup.js', 'horde');
require KRONOLITH_TEMPLATES . '/common-header.inc';
if ($cal->get('owner') && $cal->get('owner') == $current_user) {
$calendars[_("My Calendars:")]['|' . $id] = $cal->get('name');
} else {
+ if (!empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($cal->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
$calendars[_("Shared Calendars:")]['|' . $id] = $cal->get('name');
}
}
foreach ($GLOBALS['all_external_calendars'] as $api => $categories) {
$app = $GLOBALS['registry']->get('name', $GLOBALS['registry']->hasInterface($api));
foreach ($categories as $id => $name) {
+ if (!empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($api . '/' . $id, $GLOBALS['display_external_calendars'])) {
+ continue;
+ }
$calendars[$app . ':']['Horde|external_' . $api . '/' . $id] = $name;
}
}
<option value="<?php echo Horde_Data::EXPORT_ICALENDAR ?>">iCalendar</option>
</select><br /><br />
- <?php if (count($calendars = Kronolith::listCalendars(false, Horde_Perms::READ)) > 1): ?>
+ <?php if (count($export_calendars) > 1): ?>
<?php echo Horde::label('exportCal', _("Select the calendar(s) to export from")) ?><br />
<select id="exportCal" name="exportCal[]" multiple="multiple">
- <?php foreach ($calendars as $id => $cal) {
+ <?php foreach ($export_calendars as $id => $cal) {
printf('<option value="%s">%s</option>', htmlspecialchars($id), htmlspecialchars($cal->get('name'))) . "\n";
} ?>
</select><br /><br />
<option value="icalendar"><?php echo _("vCalendar/iCalendar") ?></option>
</select><br />
- <?php if (!$prefs->isLocked('default_share') && count($calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT)) > 1): ?>
+ <?php if (!$prefs->isLocked('default_share') && count($import_calendars ) > 1): ?>
<?php echo Horde::label('importCal', _("Select the calendar to import to:")) ?><br />
<select id="importCal" name="importCal">
- <?php foreach ($calendars as $id => $cal) {
+ <?php foreach ($import_calendars as $id => $cal) {
printf('<option value="%s">%s</option>', htmlspecialchars($id), htmlspecialchars($cal->get('name'))) . "\n";
} ?>
</select><br /><br />
if ($cal->get('owner') && $cal->get('owner') == $current_user) {
$my_calendars[$id] = $cal;
} else {
+ if (!empty($conf['share']['hidden']) &&
+ !in_array($cal->getName(), $display_calendars)) {
+ continue;
+ }
$shared_calendars[$id] = $cal;
}
}
+$externals = array();
+foreach ($all_external_calendars as $api => $categories) {
+ if (count($categories)) {
+ $app = $registry->get('name', $registry->hasInterface($api));
+ $externals[$app] = array();
+ foreach ($categories as $id => $name) {
+ if (!empty($conf['share']['hidden']) &&
+ !in_array($api . '/' . $id, $display_external_calendars)) {
+ continue;
+ }
+ $externals[$app][$api . '/' . $id] = $name;
+ }
+ }
+}
+
$tagger = Kronolith::getTagger();
?>
<div id="pageControls">
</ul>
<?php endif; ?>
-<?php if (count($GLOBALS['all_external_calendars'])): ?>
+<?php if (count($externals)): ?>
<h4><?php echo _("External Events:") ?></h4>
<ul id="externalcalendars">
-<?php foreach ($GLOBALS['all_external_calendars'] as $api => $categories): ?>
+ <?php foreach ($externals as $app => $categories): ?>
<?php if (count($categories)): ?>
- <li class="category"><?php echo htmlspecialchars($GLOBALS['registry']->get('name', $GLOBALS['registry']->hasInterface($api))) ?></li>
- <?php foreach ($categories as $id => $name): ?>
- <li><label><input type="checkbox" class="checkbox" name="display_cal[]" value="external_<?php echo htmlspecialchars($api . '/' . $id) ?>"<?php echo (in_array($api . '/' . $id, $GLOBALS['display_external_calendars']) ? ' checked="checked"' : '') . ' /> ' . htmlspecialchars($name) ?></label></li>
- <?php endforeach; ?>
+ <li class="category"><?php echo htmlspecialchars($app) ?></li>
+ <?php foreach ($categories as $id => $name): ?>
+ <li><label><input type="checkbox" class="checkbox" name="display_cal[]" value="external_<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_external_calendars) ? ' checked="checked"' : '') . ' /> ' . htmlspecialchars($name) ?></label></li>
+ <?php endforeach; ?>
<?php endif; ?>
-<?php endforeach; ?>
+ <?php endforeach; ?>
</ul>
<?php endif; ?>
-<?php if (count($GLOBALS['all_remote_calendars'])): ?>
+<?php if (count($all_remote_calendars)): ?>
<h4><?php echo _("Remote Calendars:") ?></h4>
<ul id="remotecalendars">
-<?php foreach ($GLOBALS['all_remote_calendars'] as $id => $cal): ?>
+<?php foreach ($all_remote_calendars as $id => $cal): ?>
<li<?php echo Kronolith::getCSSColors($cal) ?>><label><input type="checkbox" class="checkbox" name="display_cal[]" value="remote_<?php echo htmlspecialchars($cal['url']) ?>"<?php echo (in_array($cal['url'], $display_remote_calendars) ? ' checked="checked"' : '') . ' /> ' . htmlspecialchars($cal['name']) ?></label> <?php echo $info_img ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
-<?php if (!empty($GLOBALS['conf']['holidays']['enable'])): ?>
+<?php if (!empty($conf['holidays']['enable'])): ?>
<h4><?php echo _("Holidays:") ?></h4>
<ul id="holidays">
-<?php foreach ($GLOBALS['all_holidays'] as $holiday): ?>
+<?php foreach ($all_holidays as $holiday): ?>
<li<?php echo Kronolith::getCSSColors($holiday) ?>><label><input type="checkbox" class="checkbox" name="display_cal[]" value="holiday_<?php echo htmlspecialchars($holiday['id']) ?>"<?php echo (in_array($holiday['id'], $display_holidays) ? ' checked="checked"' : '') . ' /> ' . htmlspecialchars($holiday['title']) ?></label></li>
<?php endforeach; ?>
</ul>
<?php
if (!$prefs->isLocked('default_share')):
- $sharelist = Kronolith::listCalendars();
+ $all_shares = Kronolith::listCalendars();
+ $sharelist = array();
+ foreach ($all_shares as $id => $share) {
+ if ($share->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($share->getName(), $GLOBALS['display_calendars'])) {
+ continue;
+ }
+ $sharelist[$id] = $share;
+ }
if (($default_share = $prefs->getValue('default_share')) == null ||
!isset($sharelist[$default_share])) {
$default_share = Horde_Auth::getAuth();
<?php echo Horde::label('default_share', _("Your default calendar")) ?><br />
<select id="default_share" name="default_share">
- <?php foreach ($sharelist as $id => $share): ?>
+ <?php foreach ($sharelist as $id => $share): ?>
<option value="<?php echo htmlspecialchars($id) ?>"<?php if ($id == $default_share) echo ' selected="selected"' ?>><?php echo htmlspecialchars($share->get('name')) ?></option>
- <?php endforeach; ?>
+ <?php endforeach; ?>
</select>
<?php endif; ?>
$next_step = $data->cleanup();
}
+$import_tasklists = $export_tasklists = array();
+if (Horde_Auth::getAuth()) {
+ $tasklists = Nag::listTasklists(false, Horde_Perms::EDIT);
+ foreach ($tasklists as $id => $tasklist) {
+ if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
+ continue;
+ }
+ $import_tasklists[$id] = $tasklist;
+ }
+}
+$tasklists = Nag::listTasklists(false, Horde_Perms::READ);
+foreach ($tasklists as $id => $tasklist) {
+ if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
+ continue;
+ }
+ $export_tasklists[$id] = $tasklist;
+}
+
$title = _("Import/Export Tasks");
require NAG_TEMPLATES . '/common-header.inc';
require NAG_TEMPLATES . '/menu.inc';
$parts = explode('/', $path);
if (empty($path)) {
- //
- // This request is for a list of all users who have tasklists visible
- // to the requesting user.
- //
+ // This request is for a list of all users who have tasklists
+ // visible to the requesting user.
$tasklists = Nag::listTasklists(false, Horde_Perms::READ);
$owners = array();
foreach ($tasklists as $tasklist) {
+ if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
+ continue;
+ }
$owners[$tasklist->get('owner') ? $tasklist->get('owner') : '-system-'] = true;
}
$default_tasklist = Horde_Util::getFormData('default_tasklist');
if (!is_null($default_tasklist)) {
$tasklists = Nag::listTasklists();
- if (is_array($tasklists) &&
- isset($tasklists[$default_tasklist])) {
+ if (isset($tasklists[$default_tasklist]) &&
+ ($tasklists[$default_tasklist]->get('owner') == Horde_Auth::getAuth() ||
+ in_array($default_tasklist, $GLOBALS['display_tasklists']))) {
$GLOBALS['prefs']->setValue('default_tasklist', $default_tasklist);
return true;
}
$tasklists = array();
foreach (Nag::listTasklists() as $id => $tasklist) {
+ if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
+ continue;
+ }
$tasklists[$id] = $tasklist->get('name');
}
'url' => $add));
foreach (Nag::listTasklists() as $name => $tasklist) {
+ if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
+ continue;
+ }
$tree->addNode($parent . $name . '__new',
$parent . '__new',
sprintf(_("in %s"), $tasklist->get('name')),
$tasklists = Nag::listTasklists(false, Horde_Perms::EDIT);
$tasklist_enums = array();
foreach ($tasklists as $tl_id => $tl) {
+ if ($tl->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($tl->getName(), $GLOBALS['display_tasklists'])) {
+ continue;
+ }
$tasklist_enums[$tl_id] = $tl->get('name');
}
$tasklist = $vars->get('tasklist_id');
if (empty($tasklist)) {
- reset($tasklists);
- $tasklist = key($tasklists);
+ reset($tasklist_enums);
+ $tasklist = key($tasklist_enums);
}
$tasks = Nag::listTasks(null, null, null, array($tasklist), Nag::VIEW_FUTURE_INCOMPLETE);
$task_enums = array('' => _("No parent task"));
$this->addVariable(_("Name"), 'name', 'text', true);
if (!$GLOBALS['prefs']->isLocked('default_tasklist') &&
- count($tasklists) > 1) {
+ count($tasklist_enums) > 1) {
$v = &$this->addVariable(_("Task List"), 'tasklist_id', 'enum', true, false, false, array($tasklist_enums));
$v->setAction(Horde_Form_Action::factory('reload'));
}
</select>
</p>
- <?php if (count($tasklists = Nag::listTasklists(false, Horde_Perms::READ)) > 1): ?>
+ <?php if (count($export_tasklists) > 1): ?>
<p>
<?php echo Horde::label('exportList', _("Select the task list(s) to export from:")) ?><br />
<select id="exportList" name="exportList[]" multiple="multiple">
- <?php foreach ($tasklists as $id => $tasklist) {
+ <?php foreach ($export_tasklists as $id => $tasklist) {
printf('<option value="%s">%s</option>', htmlspecialchars($id), htmlspecialchars($tasklist->get('name'))) . "\n";
} ?>
</select>
</select>
</p>
-<?php if (!$prefs->isLocked('default_tasklist') && count($tasklists = Nag::listTasklists(false, Horde_Perms::EDIT)) > 1): ?>
+<?php if (!$prefs->isLocked('default_tasklist') && count($import_tasklists) > 1): ?>
<p>
<?php echo Horde::label('tasklist_target', _("Which tasklist should the tasks be added to?")) ?><br />
<select id="tasklist_target" name="tasklist_target">
<?php
$default = Nag::getDefaultTasklist(Horde_Perms::EDIT);
- foreach ($tasklists as $id => $tasklist) {
+ foreach ($import_tasklists as $id => $tasklist) {
$sel = ($id == $default) ? ' selected="selected"' : '';
printf('<option value="%s"%s>%s</option>',
htmlspecialchars($id), $sel, htmlspecialchars($tasklist->get('name'))) . "\n";
if ($tl->get('owner') && $tl->get('owner') == $current_user) {
$my_tasklists[$id] = $tl;
} else {
+ if (!empty($conf['share']['hidden']) &&
+ !in_array($tl->getName(), $display_tasklists)) {
+ continue;
+ }
$shared_tasklists[$id] = $tl;
}
}
<?php
if (!$prefs->isLocked('default_tasklist')):
- $tasklists = Nag::listTasklists();
+ $all_tasklists = Nag::listTasklists();
+ $tasklists = array();
+ foreach ($all_tasklists as $id => $tasklist) {
+ if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ !empty($GLOBALS['conf']['share']['hidden']) &&
+ !in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
+ continue;
+ }
+ $tasklists[$id] = $tasklist;
+ }
if (($default_tasklist = $prefs->getValue('default_tasklist')) == null ||
!isset($tasklists[$default_tasklist])) {
$default_tasklist = Horde_Auth::getAuth();