Flexion.Org
Bad grammar and typos for total strangers
Wiki › PHPi Calendar
Wiki Index All Recent Edit Bottom

PHP iCalendar

1.   Introduction
2.   Installing PHP iCalendar
2.1   Configuration
2.2   Calendar Publishing
2.3   Dirty "Fix" for publish.php
2.4   Disable Logging
3.   Calendar Client
4.   Holiday Calendars

Introduction

I have been meaning to setup a decent calendaring solution for home for ages. I am going to give PHP iCalendar a whirl.

Installing PHP iCalendar

 wget http://heanet.dl.sourceforge.net/sourceforge/phpicalendar/phpicalendar-2.24.tgz
 tar zxvf phpicalendar-2.24.tgz
 cp -R phpicalendar-2.24/phpicalendar/* /var/www/
 chown -R www-data:www-data /var/www/*
 chmod 775 /var/www/calendars

Configuration

 cp /var/www/config.inc-dist.php /var/www/config.inc.php

Set Timezone

Obviously setting the timezone to something specific to your location is advisable.

 vi /var/www/config.inc.php

Find...

 $timezone                       = ;

...and change it to...

 $timezone                       = 'Europe/London';

Disable Admin Access

Due to the way I access the calendars, I have found that I do not need to use the admin access PHP iCalendar provide, therefore I disable it.

 vi /var/www/config.inc.php

Find...

 $allow_admin                    = 'yes';

...and change it to...

 $allow_admin                    = 'no';

Calendar Publishing

Although Lighttpd has a WebDAV module, I decided to give the publish.php add-on supplied with PHP iCalendar a try.

Dirty "Fix" for publish.php

WARNING! - I have a bug/problem with my Lighty server, _SERVER['PATH_INFO'] is not available despite doing the appropriate things to get it working. Therefore I have added really dirty "fix" to publish.php.

Find...

 // include PHP iCalendar configuration variables
 include('../config.inc.php');

...and add this after...

 // Dirty "fix".
 if (! isset($_SERVER['PATH_INFO'])) {
         $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
 }

Here endth the dirty fix.

First turn on publishing in your PHP iCalendar connfig file

 vi /var/www/config.inc.php

Find...

 $phpicalendar_publishing = ;

...and change it to...

 $phpicalendar_publishing = '1';

Calendar Security

The 'calendars' directory should be configured to require authentication. This protects any private calendar data, and prevents unauthorized users from updating or deleting your calendar data.

I use Lighttpd HTTP authentication for this. So, add some user to my 'users.htdigest' file.

 lighty-digest.sh -u fred -p FredsPassword! -r Calendar -f ./users.htdigest

Now I need to update my 'lighttpd-custom.conf' file enable authentication.

 auth.require =  ( "/calendars" =>
                        (
                        # method must be either basic or digest
                        "method"  => "digest",
                        "realm"   => "Calendar",
                        "require" => "valid-user"
                        ),                
                )

Disable Logging

When Calendar publishing is all working correctly, you should disable logging which is enabled by default.

Edit 'publish.php', find...

 define( 'PHPICALENDAR_LOG_PUBLISHING', 1 );

...and replace it with...

 #define( 'PHPICALENDAR_LOG_PUBLISHING', 1 );

All done.

Calendar Client

I use the Lightning add-on for Thunderbird.

  • Create a new
    • Locate your calendar
      • On the Network
    • Format
      • iCalendar (ICS)
    • Location

Holiday Calendars

When everything was working I imported some public holiday dates from an existing .ics, found on the page below.

References

$Id: PHPiCalendar,v 1.11 2008/01/10 15:05:45 martin Exp $

Wiki Index All Recent Edit Top
 
Valid XHTML Valid CSS Hacker