This file is indexed.

/etc/horde/kronolith/prefs.php is in php-horde-kronolith 4.2.13-1ubuntu1.

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
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<?php
/**
 * See horde/config/prefs.php for documentation on the structure of this file.
 *
 * IMPORTANT: DO NOT EDIT THIS FILE! DO NOT COPY prefs.php TO prefs.local.php!
 * Local overrides ONLY MUST be placed in prefs.local.php or prefs.d/.
 * If the 'vhosts' setting has been enabled in Horde's configuration, you can
 * use prefs-servername.php.
 */

$prefGroups['view'] = array(
    'column' => _("Display Preferences"),
    'label' => _("User Interface"),
    'desc' => _("Select confirmation preferences, how to display the different views and choose default view."),
    'members' => array(
        'dynamic_view', 'confirm_delete', 'defaultview', 'max_events',
        'time_between_days', 'week_start_monday', 'day_hour_start',
        'day_hour_end', 'day_hour_force', 'slots_per_hour', 'show_icons',
        'show_time', 'show_location', 'show_fb_legend',
        'show_shared_side_by_side'
    ),
);

$prefGroups['share'] = array(
    'column' => _("Calendars"),
    'label' => _("Default Calendar"),
    'desc' => _("Choose your default calendar."),
    'members' => array('default_share'),
);

$prefGroups['sync'] = array(
    'column' => _("Calendars"),
    'label' => _("Synchronization Preferences"),
    'desc' => _("Choose the calendars to use for synchronization with external devices."),
    'members' => array('sync_calendars', 'activesync_no_multiplex', 'activesync_identity'),
);

$prefGroups['event_options'] = array(
    'column' => _("Events"),
    'label' => _("Event Defaults"),
    'desc' => _("Set default values for new events."),
    'members' => array('default_alarm_management')
);

$prefGroups['logintasks'] = array(
    'column' => _("Events"),
    'label' => _("Login Tasks"),
    'desc' => sprintf(_("Customize tasks to run upon logon to %s."), $GLOBALS['registry']->get('name')),
    'members' => array(
        'purge_events', 'purge_events_interval', 'purge_events_keep'
    )
);

$prefGroups['notification'] = array(
    'column' => _("Events"),
    'label' => _("Notifications"),
    'desc' => _("Choose how you want to be notified about event changes, event alarms and upcoming events."),
    'members' => array(
        'event_notification', 'event_notification_exclude_self',
        'daily_agenda', 'event_reminder', 'event_alarms_select'
    )
);

$prefGroups['freebusy'] = array(
    'column' => _("Calendars"),
    'label' => _("Free/Busy Information"),
    'desc' => _("Set your Free/Busy calendars and your own and other users' Free/Busy preferences."),
    'members' => array('fb_url', 'fb_cals', 'freebusy_days'),
);

$prefGroups['addressbooks'] = array(
    'column' => _("Other Preferences"),
    'label' => _("Address Books"),
    'desc' => _("Select address book sources for adding and searching for addresses."),
    'members' => array('display_contact', 'sourceselect'),
    'suppress' => function() {
        return !$GLOBALS['registry']->hasMethod('contacts/sources');
    }
);

// Show dynamic view?
$_prefs['dynamic_view'] = array(
   'value' => 1,
   'type' => 'checkbox',
   'desc' => _("Show the dynamic view by default, if the browser supports it?")
);

// confirm deletion of events which don't recur?
$_prefs['confirm_delete'] = array(
    'value' => 1,
    'type' => 'checkbox',
    'desc' => _("Confirm deletion of events?")
);

// default view
$_prefs['defaultview'] = array(
    'value' => 'month',
    'type' => 'enum',
    'enum' => array(
        'day' => _("Day"),
        'week' => _("Week"),
        'workweek' => _("Work Week"),
        'month' => _("Month")
    ),
    'desc' => _("Select the view to display on startup:")
);

$_prefs['max_events'] = array(
    'value' => 3,
    'type' => 'number',
    'zero' => true,
    'desc' => _("How many events should be displayed per day in the month view? Set to 0 to always show all events."),
);

// Display the timeslots between each day column, in week view.
$_prefs['time_between_days'] = array(
    'value' => 0,
    'type' => 'checkbox',
    'desc' => _("Show time of day between each day in week views?") . ' (<em>' . _("Basic view only") . '</em>'
);

// what day does the week start with
$_prefs['week_start_monday'] = array(
    'value' => '0',
    'type' => 'enum',
    'desc' => _("Select the first weekday:"),
    'enum' => array(
        '0' => _("Sunday"),
        '1' => _("Monday")
    )
);

// start of the time range in day/week views:
// Time array is dynamically built when prefs screen is displayed
$_prefs['day_hour_start'] = array(
    'value' => 16,
    'type' => 'enum',
    'enum' => array(),
    'desc' => _("What time should day and week views start, when there are no earlier events?") . ' (<em>' . _("Basic view only") . '</em>',
    'on_init' => function($ui) {
        $enum = array();
        $fmt = $GLOBALS['prefs']->getValue('twentyFour')
            ? 'G:i'
            : 'g:ia';
        for ($i = 0; $i <= 48; ++$i) {
            $enum[$i] = date($fmt, mktime(0, $i * 30, 0));
        }
        $ui->prefs['day_hour_start']['enum'] = $enum;
    }
);

// end of the time range in day/week views:
// Time array is dynamically built when prefs screen is displayed
$_prefs['day_hour_end'] = array(
    'value' => 48,
    'type' => 'enum',
    'enum' => array(),
    'desc' => _("What time should day and week views end, when there are no later events?") . ' (<em>' . _("Basic view only") . '</em>',
    'on_init' => function($ui) {
        $enum = array();
        $fmt = $GLOBALS['prefs']->getValue('twentyFour')
            ? 'G:i'
            : 'g:ia';
        for ($i = 0; $i <= 48; ++$i) {
            $enum[$i] = date($fmt, mktime(0, $i * 30, 0));
        }
        $ui->prefs['day_hour_end']['enum'] = $enum;
    }
);

// enforce hour slots?
$_prefs['day_hour_force'] = array(
    'value' => 0,
    'type' => 'checkbox',
    'desc' => _("Restrict day and week views to these time slots, even if there <strong>are</strong> earlier or later events?"),
);

// number of slots in each hour:
$_prefs['slots_per_hour'] = array(
    'value' => 1,
    'type' => 'enum',
    'desc' => _("How long should the time slots on the day and week views be?") . ' (<em>' . _("Basic view only") . '</em>',
    'enum' => array(
        4 => _("15 minutes"),
        3 => _("20 minutes"),
        2 => _("30 minutes"),
        1 => _("1 hour")
    ),
);

// show delete/alarm icons in the calendar view?
$_prefs['show_icons'] = array(
    'value' => 1,
    'type' => 'checkbox',
    'desc' => _("Show delete, alarm, and recurrence icons in calendar views?") . ' (<em>' . _("Basic view only") . '</em>',
);

// show event start/end times in the calendar and/or print views?
$_prefs['show_time'] = array(
    'value' => 'a:1:{i:0;s:5:"print";}',
    'type' => 'multienum',
    'enum' => array(
        'screen' => _("Month, Week, and Day Views"),
        'print' => _("Print Views")
     ),
    'desc' => _("Choose the views to show event start and end times in:"),
);

// show event location in the calendar and/or print views?
$_prefs['show_location'] = array(
    'value' => 'a:1:{i:0;s:5:"print";}',
    'type' => 'multienum',
    'enum' => array(
        'screen' => _("Month, Week, and Day Views"),
        'print' => _("Print Views")
     ),
    'desc' => _("Choose the views to show event locations in:") . ' (<em>' . _("Basic view only") . '</em>',
);

// show Free/Busy legend?
// a value of 0 = no, 1 = yes
$_prefs['show_fb_legend'] = array(
    'value' => 1,
    'type' => 'checkbox',
    'desc' => _("Show Free/Busy legend?") . ' (<em>' . _("Basic view only") . '</em>',
);

// collapsed or side by side view
$_prefs['show_shared_side_by_side'] = array(
    'value' => 0,
    'type' => 'checkbox',
    'desc' => _("Show shared calendars side-by-side?") . ' (<em>' . _("Basic view only") . '</em>',
);

// default calendar
// Set locked to true if you don't want users to have multiple calendars.
$_prefs['default_share'] = array(
    'value' => '',
    'type' => 'enum',
    'enum' => array(),
    'desc' => _("Your default calendar:"),
    'on_init' => function($ui) {
        $enum = array();
        foreach (Kronolith::listInternalCalendars(false, Horde_Perms::EDIT) as $id => $calendar) {
            $enum[$id] = Kronolith::getLabel($calendar);
        }
        $ui->prefs['default_share']['enum'] = $enum;
    },
    'on_change' => function() {
        $GLOBALS['injector']->getInstance('Kronolith_Factory_Calendars')
            ->create()
            ->setDefaultShare($GLOBALS['prefs']->getValue('default_share'));
        $sync = @unserialize($GLOBALS['prefs']->getValue('sync_calendars'));
        $haveDefault = false;
        $default = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
        foreach ($sync as $cid) {
            if ($cid == $default) {
                $haveDefault = true;
                break;
            }
        }
        if (!$haveDefault) {
            $sync[] = $default;
            $GLOBALS['prefs']->setValue('sync_calendars', serialize($sync));
        }
    }
);
// Calendars use for synchronization
$_prefs['sync_calendars'] = array(
    'value' => 'a:0:{}',
    'type' => 'multienum',
    'enum' => array(),
    'desc' => _("Select the calendars that, in addition to the default, should be used for synchronization with external devices:"),
    'on_init' => function($ui) {
        $enum = array();
        $sync = @unserialize($GLOBALS['prefs']->getValue('sync_calendars'));
        if (empty($sync)) {
            $GLOBALS['prefs']->setValue('sync_calendars', serialize(array(Kronolith::getDefaultCalendar())));
        }
        foreach (Kronolith::listInternalCalendars(!$GLOBALS['prefs']->getValue('activesync_no_multiplex'), Horde_Perms::EDIT) as $key => $cal) {
            if ($cal->getName() != Kronolith::getDefaultCalendar(Horde_Perms::EDIT)) {
                $enum[$key] = Kronolith::getLabel($cal);
            }
        }
        $ui->prefs['sync_calendars']['enum'] = $enum;
    },
    'on_change' => function() {
        $sync = @unserialize($GLOBALS['prefs']->getValue('sync_calendars'));
        $haveDefault = false;
        $default = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
        foreach ($sync as $cid) {
            if ($cid == $default) {
                $haveDefault = true;
                break;
            }
        }
        if (!$haveDefault) {
            $sync[] = $default;
            $GLOBALS['prefs']->setValue('sync_calendars', serialize($sync));
        }
        if ($GLOBALS['conf']['activesync']['enabled'] && !$GLOBALS['prefs']->getValue('activesync_no_multiplex')) {
            try {
                $sm = $GLOBALS['injector']->getInstance('Horde_ActiveSyncState');
                $sm->setLogger($GLOBALS['injector']->getInstance('Horde_Log_Logger'));
                $devices = $sm->listDevices($GLOBALS['registry']->getAuth());
                foreach ($devices as $device) {
                    $sm->removeState(array(
                        'devId' =>$device['device_id'],
                        'id' => Horde_Core_ActiveSync_Driver::APPOINTMENTS_FOLDER_UID,
                        'user' => $GLOBALS['registry']->getAuth()
                    ));
                }
                $GLOBALS['notification']->push(_("All state removed for your ActiveSync devices. They will resynchronize next time they connect to the server."));
            } catch (Horde_ActiveSync_Exception $e) {
                $GLOBALS['notification']->push(_("There was an error communicating with the ActiveSync server: %s"), $e->getMessage(), 'horde.error');
            }
        }
    }
);

// @todo We default to using multiplex since that is the current behavior
// For Kronolith 5 we should default to separate.
$_prefs['activesync_no_multiplex'] = array(
    'type' => 'checkbox',
    'desc' => _("Support separate calendars?"),
    'value' => 0);

// Which drivers are we supposed to use to examine holidays?
$_prefs['holiday_drivers'] = array(
    'value' => 'a:0:{}'
);

// store the calendars to diplay
$_prefs['display_cals'] = array(
    'value' => 'a:0:{}'
);

$_prefs['display_resource_cals'] = array(
    'value' => 'a:0:{}'
);

// default alarm
$_prefs['default_alarm'] = array(
    'value' => ''
);

$_prefs['default_alarm_management'] = array(
    'type' => 'special',
    'handler' => 'Kronolith_Prefs_Special_DefaultAlarm',
    'requires_nolock' => array('default_alarm')
);

// remote calendars
$_prefs['remote_cals'] = array(
    'value' => 'a:0:{}'
);

// store the remote calendars to display
$_prefs['display_remote_cals'] = array(
    'value' => 'a:0:{}'
);

// store the external calendars to display
$_prefs['display_external_cals'] = array(
    'value' => 'a:0:{}'
);

// new event notifications
$_prefs['event_notification'] = array(
    'value' => '',
    'type' => 'enum',
    'enum' => array(
        '' => _("No"),
        'owner' => _("On my calendars only"),
        'show' => _("On all shown calendars"),
        'read' => _("On all calendars I have explicitly read access to")
    ),
    'desc' => _("Choose if you want to be notified of new, edited, and deleted events by email:")
);

// daily agenda
$_prefs['daily_agenda'] = array(
    'value' => '',
    'type' => 'enum',
    'enum' => array(
        '' => _("No"),
        'owner' => _("On my calendars only"),
        'show' => _("On all shown calendars"),
        'read' => _("On all calendars I have read access to")
    ),
    'desc' => _("Choose if you want to receive daily agenda email reminders:")
);

$_prefs['event_notification_exclude_self'] = array(
    'value' => 0,
    'type' => 'checkbox',
    'desc' => _("Don't send me a notification if I've added, changed or deleted the event?")
);

// reminder notifications
$_prefs['event_reminder'] = array(
    'value' => 'owner',
    'type' => 'enum',
    'enum' => array(
        '' => _("No"),
        'owner' => _("On my calendars only"),
        'show' => _("On all shown calendars"),
        'read' => _("On all calendars I have read access to")
    ),
    'desc' => _("Choose if you want to receive reminders for events with alarms:")
);

// alarm methods
$_prefs['event_alarms_select'] = array(
    'type' => 'special',
    'handler' => 'Kronolith_Prefs_Special_EventAlarms',
    'suppress' => function() {
        return empty($GLOBALS['conf']['alarms']['driver']);
    }
);

$_prefs['event_alarms'] = array(
    'value' => 'a:1:{s:6:"notify";a:0:{}}'
);

// number of days to generate Free/Busy information for:
$_prefs['freebusy_days'] = array(
    'value' => 30,
    'type' => 'number',
    'desc' => _("How many days of Free/Busy information should be generated?")
);

// By default, display all contacts in the address book when loading
// the contacts screen.  If your default address book is large and
// slow to display, you may want to disable and lock this preference.
$_prefs['display_contact'] = array(
    'value' => 1,
    'type' => 'checkbox',
    'desc' => _("List all contacts when loading the contacts screen? (if disabled, you will only see contacts that you search for explicitly)"),
);

// address book selection widget
$_prefs['sourceselect'] = array(
    'type' => 'special',
    'handler' => 'Kronolith_Prefs_Special_Sourceselect',
    'requires_nolock' => array('search_sources')
);

// Address book(s) to use when expanding addresses
// Refer to turba/config/sources.php for possible source values
//
// You can provide default values this way:
//   'value' => json_encode(array('source_one', 'source_two'))
$_prefs['search_sources'] = array(
    'value' => ''
);

// Field(s) to use when expanding addresses
// Refer to turba/config/sources.php for possible source and field values
//
// If you want to provide a default value, this field depends on the
// search_sources preference. For example:
//   'value' => json_encode(array(
//       'source_one' => array('field_one', 'field_two'),
//       'source_two' => array('field_three')
//   ))
// will search the fields 'field_one' and 'field_two' in source_one and
// 'field_three' in source_two.
$_prefs['search_fields'] = array(
    'value' => ''
);

$_prefs['fb_url'] = array(
    'value' => '<strong>' . _("My Free/Busy URL") . '</strong><div class="fburl"><div>' . _("Copy this URL for use wherever you need your Free/Busy URL:") . '</div><div class="fixed">' . Horde::url('fb.php', true, array('append_session' => -1))->add('u', $GLOBALS['registry']->getAuth()) . '</div></div>',
    'type' => 'rawhtml'
);

// Calendars to include in generating Free/Busy URLs.
$_prefs['fb_cals'] = array(
    'value' => 'a:0:{}',
    'type' => 'multienum',
    'enum' => array(),
    'desc' => _("Choose the calendars to include in the above Free/Busy URL:"),
    'on_init' => function($ui) {
        $enum = array();
        foreach (Kronolith::listCalendars() as $fb_cal => $cal) {
            if ($cal->display()) {
                $enum[htmlspecialchars($fb_cal)] = htmlspecialchars($cal->name());
            }
        }
        $ui->prefs['fb_cals']['enum'] = $enum;
    },
    'on_change' => function() {
        $GLOBALS['injector']->getInstance('Horde_Cache')
            ->expire('kronolith.fb.u.' . $GLOBALS['registry']->getAuth());
    }
);

// Login Tasks preferences

$_prefs['purge_events'] = array(
    'value' => 0,
    'type' => 'checkbox',
    'desc' => _("Purge old events from your calendar?"),
);

$_prefs['purge_events_interval'] = array(
    'value' => Horde_LoginTasks::MONTHLY,
    'type' => 'enum',
    'enum' => Horde_LoginTasks::getLabels(),
    'desc' => _("Purge old events how often:"),
);

$_prefs['purge_events_keep'] = array(
    'value' => 365,
    'type' => 'number',
    'desc' => _("Purge old events older than this amount of days."),
);

// End Login Tasks preferences

$_prefs['activesync_identity'] = array(
    'value' => 'horde',
    'type' => 'enum',
    'enum' => array_merge($GLOBALS['injector']
                ->getInstance('Horde_Core_Factory_Identity')
                ->create($GLOBALS['registry']->getAuth())->getAll('id'), array('horde' => _("Use Horde Default"))),
    'desc' => _("Choose the identity to use for ActiveSync. This determines the email address used as the ORGANIZER for events you create.")
);