diff --git a/.gitignore b/.gitignore
index 6066d8fb..0064ddf1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,13 @@
caldav.session
rscds.session
+davical.session
build
rscds.bfproject
+davical.bfproject
locale
built-docs
+built-po
.settings
*~
+testing/dumps
+testing/regression.conf
diff --git a/INSTALL b/INSTALL
index fb764883..a60ee6b4 100644
--- a/INSTALL
+++ b/INSTALL
@@ -50,15 +50,15 @@ I'm available to answer questions, anyway :-)
Pre-requisites
==============
-RSCDS depends on a number of things. Firstly, it depends
+DAViCal depends on a number of things. Firstly, it depends
on Andrew's Web Libraries (AWL) which is a set of useful
PHP functions and objects written by Andrew McMillan over
a number of years.
The following other software is also needed:
Apache: 1.3.x or 2.x.x
- PHP: 4.3 or greater, including PHP5
- PostgreSQL: 7.4 or greater
+ PHP: 5.0 or greater
+ PostgreSQL: 8.1 or greater
The PostgreSQL database may be installed on a server other
than the web server, and that kind of situation is recommended
@@ -102,22 +102,24 @@ Apache VHost Configuration
Your Apache instance needs to be configured for Virtual Hosts. If
this is not already the case you may want to read some documentation
about that, and you most likely will want to ensure that any existing
-site becomes the **default** virtual host, with RSCDS only being a
+site becomes the **default** virtual host, with DAViCal only being a
single virtual host.
I use a Virtual Host stanza like this:
#
-# Virtual Host def for Debian packaged RSCDS
+# Virtual Host def for Debian packaged DAViCal
DocumentRoot /usr/share/rscds/htdocs
DirectoryIndex index.php index.html
- ServerName rscds.example.net
+ ServerName davical.example.net
ServerAlias calendar.example.net
Alias /images/ /usr/share/rscds/htdocs/images/
php_value include_path /usr/share/rscds/inc:/usr/share/awl/inc
php_value magic_quotes_gpc 0
- php_value register_globals 1
+ php_value register_globals 0
+ php_value error_reporting "E_ALL & ~E_NOTICE"
+ php_value default_charset "utf-8"
Replace 123.4.56.78 with your own IP address, of course (you can
@@ -135,25 +137,24 @@ installed from a package.
Once your VHost is installed an working correctly, you should be
able to browse to that address and see a page telling you that
-you need to configure RSCDS.
+you need to configure DAViCal.
-RSCDS Configuration
-===================
+DAViCal Configuration
+=====================
-The RSCDS configuration generally resides in /etc/rscds/-conf.php
+The DAViCal configuration generally resides in /etc/davical/-conf.php
and is a regular PHP file which sets (or overrides) some specific variables.
domainname = "calendar.example.net";
-// $c->sysabbr = 'rscds';
+// $c->sysabbr = 'davical';
// $c->admin_email = 'admin@example.net';
-// $c->system_name = "Really Simple CalDAV Store";
+// $c->system_name = "DAViCal CalDAV Server";
// $c->collections_always_exist = false;
- $c->pg_connect[] = 'dbname=caldav port=5433 user=general';
- $c->pg_connect[] = 'dbname=caldav port=5432 user=general';
+ $c->pg_connect[] = 'dbname=davical port=5432 user=general';
?>
@@ -180,7 +181,7 @@ If all is going well you should now be able to browse to the admin
pages and log in as 'admin' (the password is the bit after the '**'
in the 'password' field of the 'usr' table so:
-psql rscds -c 'select username, password from usr;'
+psql davical -c 'select username, password from usr;'
should show you a list. Note that once you change a password it
won't be readable in this way - only the initial configuration
diff --git a/Makefile b/Makefile
index 24f02d21..15e58fdf 100755
--- a/Makefile
+++ b/Makefile
@@ -4,12 +4,16 @@
package=rscds
version=$(shell cat VERSION)
-all: inc/always.php built-docs
+all: inc/always.php built-docs built-po
built-docs: docs/api/phpdoc.ini htdocs/*.php inc/*.php
- phpdoc -c docs/api/phpdoc.ini
+ phpdoc -c docs/api/phpdoc.ini || echo "WARNING: failed to build docs"
touch built-docs
+built-po: inc/always.php scripts/po/rebuild-translations.sh scripts/po/extract.pl
+ scripts/po/rebuild-translations.sh
+ touch built-po
+
#
# Insert the current version number into always.php
#
@@ -28,7 +32,7 @@ release: built-docs
rm $(package)-$(version)
clean:
- rm -f built-docs
+ rm -f built-docs built-po
-find docs/api/* ! -name "phpdoc.ini" ! -name ".gitignore" -delete
-find . -name "*~" -delete
diff --git a/README b/README
index 556d882b..6593db96 100644
--- a/README
+++ b/README
@@ -1 +1,9 @@
-Really Simple CalDAV Store by Andrew McMillan.
+DAViCal CalDAV Server by Andrew McMillan.
+
+For documentation you are best advised to visit the sourceforge pages
+or to start searching from http://davical.org/ and see where you end
+up.
+
+Good luck!
+
+Andrew McMillan
\ No newline at end of file
diff --git a/TODO b/TODO
index 2b7655ea..0209dd55 100644
--- a/TODO
+++ b/TODO
@@ -1,10 +1,12 @@
Desirable
- - accept the free/busy information as a PUT
+ - accept the free/busy information as a POST
- more translations of the administration interface
- translations of the website.
- - the ability to see a basic list of event data in the admin interface
+ - the ability to see a better list of event data in the admin interface
- allow a specific CalDAV access permission to delegate free/busy viewability.
+ - rename everything to "DAViCal"
Important
- - allow for some sort of modular authentication methods
- -
+ - Fix the relationships code so relationships are controlled by the person
+ affected (or the admin).
+ - Implement draft-desruisseaux-caldav-sched specifications.
diff --git a/VERSION b/VERSION
index ac39a106..2003b639 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.9.0
+0.9.2
diff --git a/config/debug-config.php b/config/debug-config.php
index 1307c7c0..2c13d791 100644
--- a/config/debug-config.php
+++ b/config/debug-config.php
@@ -6,7 +6,7 @@
*/
/**
-* if this is set then any e-mail that would normally be sent by RSCDS will be
+* if this is set then any e-mail that would normally be sent by DAViCal will be
* sent to this e-mail address for debugging.
*/
//$c->debug_email
@@ -29,21 +29,23 @@
// $c->dbg['querystring'] = 1;
// $c->dbg['icalendar'] = 1;
// $c->dbg['ics'] = 1;
-// $c->dbg['Login'] = 1;
+// $c->dbg['login'] = 1;
// $c->dbg['options'] = 1;
// $c->dbg['get'] = 1;
// $c->dbg['put'] = 1;
// $c->dbg['propfind'] = 1;
+// $c->dbg['proppatch'] = 1;
// $c->dbg['report'] = 1;
+// $c->dbg['principal'] = 1;
// $c->dbg['user'] = 1;
// $c->dbg['vevent'] = 1;
// $c->dbg['rrule'] = 1;
/**
-* default is 'rscds' used to prefix debugging messages but will only need to change
-* if you are running multiple RSCDS servers logging into the same place.
+* default is 'davical' used to prefix debugging messages but will only need to change
+* if you are running multiple DAViCal servers logging into the same place.
*/
-// $c->sysabbr
+// $c->sysabbr = 'davical';
/**
* As yet we only support quite a limited range of options. When we see clients looking
@@ -55,4 +57,3 @@
*/
// $c->override_allowed_methods = "PROPPATCH, OPTIONS, GET, HEAD, PUT, DELETE, PROPFIND, MKCOL, MKCALENDAR, LOCK, UNLOCK, REPORT"
-?>
\ No newline at end of file
diff --git a/config/example-config.php b/config/example-config.php
index 66334922..4b076568 100644
--- a/config/example-config.php
+++ b/config/example-config.php
@@ -10,14 +10,14 @@
*****************************/
/**
-* Ex : $c->pg_connect[] = 'dbname=rscds port=5432 user=general'
+* Ex : $c->pg_connect[] = 'dbname=davical port=5432 user=general'
* The application will attempt to
* connect to the database, successively applying connection parameters from
* the array in $c->pg_connect.
* used in the web interface but also the caldav Server
*/
-$c->pg_connect[] = "dbname=rscds user=general";
-// $c->pg_connect[] = "dbname=rscds user=general port=5433 host=somehost password=mypass";
+$c->pg_connect[] = "dbname=davical user=general";
+// $c->pg_connect[] = "dbname=davical user=general port=5433 host=somehost password=mypass";
/****************************
@@ -66,7 +66,7 @@ $c->admin_email ='calendar-admin@example.com';
*
The "enable_row_linking" option controls whether javascript is used
* to make the entire row clickable in browse lists in the administration
* pages. Since this doesn't work in Konqueror you may want to set this
-* to false if you expect people to be using Konqueror with the RSCDS
+* to false if you expect people to be using Konqueror with the DAViCal
* administration pages.
*/
// $c->enable_row_linking = true;
@@ -149,19 +149,20 @@ $c->admin_email ='calendar-admin@example.com';
/********************************/
/******* Other AWL hook *********/
/********************************/
-//require_once('AuthPlugins.php');
+// require_once('auth-functions.php');
// $c->authenticate_hook = array(
-// 'call' => 'auth_other_awl',
+// 'call' => 'AuthExternalAwl',
// 'config' => array(
- /** A PgSQL database connection string for the database containing user records */
-// 'connection' => 'dbname=wrms host=otherhose port=5433 user=general',
- /** Which columns should be fetched from the database */
-// 'columns' => "user_no, active, email_ok, joined, last_update AS updated, last_used, username, password, fullname, email"
+// // A PgSQL database connection string for the database containing user records
+// 'connection' => 'dbname=wrms host=otherhost port=5433 user=general',
+// // Which columns should be fetched from the database
+// 'columns' => "user_no, active, email_ok, joined, last_update AS updated, last_used, username, password, fullname, email",
+// // a WHERE clause to limit the records returned.
+// 'where' => "active AND org_code=7"
// )
// );
-
/********************************/
/*********** LDAP hook **********/
/********************************/
@@ -169,8 +170,12 @@ $c->admin_email ='calendar-admin@example.com';
//$c->authenticate_hook['config'] = array(
// 'host' => 'www.tennaxia.net', //host name of your LDAP Server
// 'port' => '389', //port
+
+ /* For the initial bind to be anonymous leave bindDN and passDN
+ commented out */
// 'bindDN'=> 'cn=manager,cn=internal,dc=tennaxia,dc=net', //DN to bind to this server enabling to perform request
// 'passDN'=> 'xxxxxxxx', //Password of the previous bindDN to bind to this server enabling to perform request
+
// 'protocolVersion' => '3', //Version of LDAP protocol to use
// 'baseDNUsers'=> 'dc=tennaxia,dc=net', //where to look at valid user
// 'filterUsers' => 'objectClass=kolabInetOrgPerson', //filter which must validate a user according to RFC4515, i.e. surrounded by brackets
@@ -193,6 +198,16 @@ $c->admin_email ='calendar-admin@example.com';
//include('drivers_ldap.php');
+/**
+* Authentication against PAM using the Squid helper script.
+*/
+//$c->authenticate_hook = array(
+// 'call' => 'SQUID_PAM_check',
+// 'config' => array( 'script' => '/usr/bin/pam_auth', 'email_base' => 'example.com' );
+// );
+//include('drivers_squid_pam.php');
+
+
/**
* The default locale will be "en_NZ";
* If you are in a non-English locale, you can set the default_locale
@@ -225,6 +240,3 @@ $c->admin_email ='calendar-admin@example.com';
* of a VEVENT. The local (server) time zone will be used as a default.
*/
// $c->local_tzid;
-
-
-?>
\ No newline at end of file
diff --git a/config/other-config.php b/config/other-config.php
index e58b7e84..1cc92414 100644
--- a/config/other-config.php
+++ b/config/other-config.php
@@ -84,4 +84,3 @@
// $c->schema_patch
// $c->schema_version
-?>
\ No newline at end of file
diff --git a/rscds.webprj b/davical.webprj
similarity index 95%
rename from rscds.webprj
rename to davical.webprj
index 7b259807..2eec6308 100644
--- a/rscds.webprj
+++ b/davical.webprj
@@ -23,13 +23,11 @@
-
-
@@ -236,6 +234,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dba/create-database.sh b/dba/create-database.sh
index 96a9b82b..a944cac6 100755
--- a/dba/create-database.sh
+++ b/dba/create-database.sh
@@ -8,20 +8,65 @@ ADMINPW="${2}"
DBADIR="`dirname \"$0\"`"
+testawldir() {
+ [ -f "${1}/dba/awl-tables.sql" ]
+}
+
+#
+# Attempt to locate the AWL directory
+AWLDIR="${DBADIR}/../../awl"
+if ! testawldir "${AWLDIR}"; then
+ AWLDIR="/usr/share/awl"
+ if ! testawldir "${AWLDIR}"; then
+ AWLDIR="/usr/local/share/awl"
+ if ! testawldir "${AWLDIR}"; then
+ echo "Unable to find AWL libraries"
+ exit 1
+ fi
+ fi
+fi
+
+export AWL_DBAUSER=davical_dba
+export AWL_APPUSER=davical_app
+
+# Get the major version for PostgreSQL
+export DBVERSION="`psql -qAt template1 -c "SELECT version();" | cut -f2 -d' ' | cut -f1-2 -d'.'`"
+
+db_users() {
+ psql -qAt template1 -c "SELECT usename FROM pg_user;";
+}
+
+create_db_user() {
+ if ! db_users | grep "^${1}$" >/dev/null ; then
+ createuser --no-superuser --no-createdb --no-createrole "${1}"
+ fi
+}
+
+create_plpgsql_language() {
+ if ! psql -qAt template1 -c "SELECT lanname FROM pg_language;" | grep "^plpgsql$" >/dev/null; then
+ createlang plpgsql "${DBNAME}"
+ fi
+}
+
+create_db_user "${AWL_DBAUSER}"
+create_db_user "${AWL_APPUSER}"
+
# FIXME: Need to check that the database was actually created.
-if ! createdb -E UTF8 "${DBNAME}" -T template0 ; then
+if ! createdb --encoding UTF8 "${DBNAME}" --template template0 --owner "${AWL_DBAUSER}"; then
echo "Unable to create database"
exit 1
fi
-#
-# This will fail if the language already exists, but it should not
-# because we created from template0.
-createlang plpgsql "${DBNAME}"
+create_plpgsql_language
#
-# FIXME: filter non-error output
-psql -q -f "${DBADIR}/rscds.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )"
+# Load the AWL base tables and schema management tables
+psql -q -f "${AWLDIR}/dba/awl-tables.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )"
+psql -q -f "${AWLDIR}/dba/schema-management.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )"
+
+#
+# Load the DAViCal tables
+psql -q -f "${DBADIR}/davical.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )"
psql -q -f "${DBADIR}/caldav_functions.sql" "${DBNAME}"
@@ -39,7 +84,7 @@ fi
if [ "$ADMINPW" = "" ] ; then
# OK. They didn't supply one, and pwgen didn't work, so we hack something
# together from /dev/random ...
- ADMINPW="`dd if=/dev/urandom bs=512 count=1 2>/dev/null | tr -c -d "a-zA-HJ-NP-Y0-9" | cut -c2-9`"
+ ADMINPW="`dd if=/dev/urandom bs=512 count=1 2>/dev/null | tr -c -d "a-km-zA-HJ-NP-Y0-9" | cut -c2-9`"
fi
if [ "$ADMINPW" = "" ] ; then
diff --git a/dba/rscds.sql b/dba/davical.sql
similarity index 93%
rename from dba/rscds.sql
rename to dba/davical.sql
index 2e76a617..b8dc8a0a 100644
--- a/dba/rscds.sql
+++ b/dba/davical.sql
@@ -1,13 +1,9 @@
-- Really Simple CalDAV Store - Database Schema
--
--- Use the usr, group and schema management stufffrom libawl-php
-\i /usr/share/awl/dba/awl-tables.sql
-\i /usr/share/awl/dba/schema-management.sql
-
-- The main event. Where we store the things the calendar throws at us.
CREATE TABLE caldav_data (
- user_no INT references usr(user_no),
+ user_no INT references usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE,
dav_name TEXT,
dav_etag TEXT,
created TIMESTAMP WITH TIME ZONE,
@@ -69,7 +65,7 @@ GRANT SELECT,INSERT,UPDATE,DELETE ON calendar_item TO general;
-- Something that can look like a filesystem hierarchy where we store stuff
CREATE TABLE collection (
- user_no INT references usr(user_no),
+ user_no INT references usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE,
parent_container TEXT,
dav_name TEXT,
dav_etag TEXT,
@@ -77,6 +73,7 @@ CREATE TABLE collection (
is_calendar BOOLEAN,
created TIMESTAMP WITH TIME ZONE,
modified TIMESTAMP WITH TIME ZONE,
+ public_events_only BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY ( user_no, dav_name )
);
@@ -141,4 +138,4 @@ CREATE TABLE freebusy_ticket (
GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE freebusy_ticket TO general;
-SELECT new_db_revision(1,1,9, 'September' );
+SELECT new_db_revision(1,1,11, 'November' );
diff --git a/dba/patches/1.1.10.sql b/dba/patches/1.1.10.sql
new file mode 100644
index 00000000..2a059cb6
--- /dev/null
+++ b/dba/patches/1.1.10.sql
@@ -0,0 +1,20 @@
+
+-- Sort out accessing calendar entries.
+
+BEGIN;
+SELECT check_db_revision(1,1,9);
+
+-- Make sure that class is set to something, by default PUBLIC.
+-- According to RFC2445, 4.8.1.3.
+UPDATE calendar_item SET class = 'PUBLIC' WHERE class IS NULL;
+
+-- Allow forcing all events in a calendar to be public
+ALTER TABLE collection ADD COLUMN public_events_only BOOLEAN;
+UPDATE collection SET public_events_only = FALSE;
+ALTER TABLE collection ALTER public_events_only SET NOT NULL;
+ALTER TABLE collection ALTER public_events_only SET DEFAULT FALSE;
+
+SELECT new_db_revision(1,1,10, 'October' );
+COMMIT;
+ROLLBACK;
+
diff --git a/dba/patches/1.1.11.sql b/dba/patches/1.1.11.sql
new file mode 100644
index 00000000..1a6ad905
--- /dev/null
+++ b/dba/patches/1.1.11.sql
@@ -0,0 +1,16 @@
+
+-- Sort out accessing calendar entries.
+
+BEGIN;
+SELECT check_db_revision(1,1,10);
+
+ALTER TABLE caldav_data DROP CONSTRAINT "$1";
+ALTER TABLE caldav_data ADD CONSTRAINT "$1" FOREIGN KEY (user_no) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE;
+
+ALTER TABLE collection DROP CONSTRAINT "$1";
+ALTER TABLE collection ADD CONSTRAINT "$1" FOREIGN KEY (user_no) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE;
+
+SELECT new_db_revision(1,1,11, 'November' );
+COMMIT;
+ROLLBACK;
+
diff --git a/dba/patches/1.1.11a.sql b/dba/patches/1.1.11a.sql
new file mode 100644
index 00000000..2f22a7d7
--- /dev/null
+++ b/dba/patches/1.1.11a.sql
@@ -0,0 +1,17 @@
+
+-- Sort out accessing calendar entries.
+-- This alternative patch file is the same in/out revision as 1.1.11 but it works with newer databases (8.x)
+
+BEGIN;
+SELECT check_db_revision(1,1,10);
+
+ALTER TABLE caldav_data DROP CONSTRAINT "caldav_data_user_no_fkey";
+ALTER TABLE caldav_data ADD CONSTRAINT "caldav_data_user_no_fkey" FOREIGN KEY (user_no) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE;
+
+ALTER TABLE collection DROP CONSTRAINT "collection_user_no_fkey";
+ALTER TABLE collection ADD CONSTRAINT "collection_user_no_fkey" FOREIGN KEY (user_no) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE;
+
+SELECT new_db_revision(1,1,11, 'November' );
+COMMIT;
+ROLLBACK;
+
diff --git a/dba/patches/1.1.12.sql b/dba/patches/1.1.12.sql
new file mode 100644
index 00000000..b50a6da1
--- /dev/null
+++ b/dba/patches/1.1.12.sql
@@ -0,0 +1,70 @@
+
+-- Add a numeric foreign key link between caldav_data and calendar_item to
+-- provide more efficient linking when the db has been initialised with a
+-- non POSIX collation.
+
+
+BEGIN;
+SELECT check_db_revision(1,1,11);
+
+-- Add a column to the collection table to allow us to mark collections
+-- as publicly readable
+ALTER TABLE collection ADD COLUMN publicly_readable BOOLEAN DEFAULT FALSE;
+
+-- Add a numeric dav_id to link the caldav_data and calendar_item tables
+ALTER TABLE caldav_data ADD COLUMN dav_id INT8;
+ALTER TABLE calendar_item ADD COLUMN dav_id INT8;
+CREATE SEQUENCE caldav_data_dav_id_seq;
+GRANT SELECT,UPDATE ON caldav_data_dav_id_seq TO general;
+
+CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS '
+ DECLARE
+ BEGIN
+
+ IF TG_OP = ''DELETE'' THEN
+ -- Just let the ON DELETE CASCADE handle this case
+ RETURN OLD;
+ END IF;
+
+ IF NEW.dav_id IS NULL THEN
+ NEW.dav_id = nextval(''caldav_data_dav_id_seq'');
+ END IF;
+
+ IF TG_OP = ''UPDATE'' THEN
+ IF OLD.dav_id = NEW.dav_id THEN
+ -- Nothing to do
+ RETURN NEW;
+ END IF;
+ END IF;
+
+ IF TG_RELNAME = ''caldav_data'' THEN
+ UPDATE calendar_item SET dav_id = NEW.dav_id WHERE user_no = NEW.user_no AND dav_name = NEW.dav_name;
+ ELSE
+ UPDATE caldav_data SET dav_id = NEW.dav_id WHERE user_no = NEW.user_no AND dav_name = NEW.dav_name;
+ END IF;
+
+ RETURN NEW;
+
+ END
+' LANGUAGE 'plpgsql';
+
+CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
+ FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();
+
+CREATE TRIGGER calendar_item_sync_dav_id AFTER INSERT OR UPDATE ON calendar_item
+ FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();
+
+-- Now, using the trigger, magically assign dav_id to all rows in caldav_data and calendar_item
+UPDATE caldav_data SET dav_id = dav_id;
+
+ALTER TABLE caldav_data ALTER COLUMN dav_id SET DEFAULT nextval('caldav_data_dav_id_seq');
+ALTER TABLE caldav_data ALTER COLUMN dav_id SET NOT NULL;
+ALTER TABLE caldav_data ADD CONSTRAINT caldav_data_dav_id_key UNIQUE (dav_id);
+
+ALTER TABLE calendar_item ADD CONSTRAINT calendar_item_dav_id_key UNIQUE (dav_id);
+
+SELECT new_db_revision(1,1,12, 'December' );
+
+COMMIT;
+ROLLBACK;
+
diff --git a/dba/update-rscds-database b/dba/update-rscds-database
index ee192ca6..d00cf691 100755
--- a/dba/update-rscds-database
+++ b/dba/update-rscds-database
@@ -46,18 +46,32 @@ my $current_revision = get_current_revision();
printf( "The database is currently at revision %d.%d.%d.\n", $current_revision->{'schema_major'}, $current_revision->{'schema_minor'}, $current_revision->{'schema_patch'} );
opendir( PATCHDIR, $patchdir ) or die "Can't open patch directory $patchdir";
-my @patches = grep { /^([0-9]+)\.([0-9]+)\.([0-9]+)\.sql$/ } readdir(PATCHDIR);
+my @patches = grep { /^([0-9]+)\.([0-9]+)\.([0-9]+)([a-z]?)\.sql$/ } readdir(PATCHDIR);
closedir(PATCHDIR);
-@patches = sort { compare_revisions(revision_hash($a),revision_hash($b)); } @patches;
+@patches = sort { compare_revisions(revision_hash($a),revision_hash($b), 1); } @patches;
my $applied = 0;
+my $last_results = ''; # Will hold the last SQL result from applying a patch
for ( my $i=0; $i <= $#patches; $i++ ) {
printf( "Looking at patches[%d] (%s)\n", $i, $patches[$i]) if ( $debug );
if ( compare_revisions(revision_hash($patches[$i]),$current_revision) > 0 ) {
- print "Applying patch $patches[$i]\n";
- last unless( apply_patch( $patches[$i] ) );
+ print "Applying patch $patches[$i] ... ";
+ if ( !apply_patch( $patches[$i] ) ) {
+ # Skip to the end unless the next patch is an alternate for the same version.
+ if ( defined($patches[$i+1]) && compare_revisions(revision_hash($patches[$i]),revision_hash($patches[$i+1])) == 0 ) {
+ print "failed. Attempting next alternative.\n";
+ $applied--;
+ }
+ else {
+ print "failed!\n$last_results ==> No further patches will be attempted!\n";
+ last;
+ }
+ }
+ else {
+ print "succeeded.\n";
+ }
$applied++;
}
else {
@@ -91,17 +105,20 @@ exit 0;
# which is of the form "1.2.3" or we have three parameters.
############################################################
sub revision_hash {
- my $rev = +{};
+ my $rev = +{ 'schema_major', => 0, 'schema_minor' => 0, 'schema_patch' => 0, 'alternative' => '0' };
my $first = shift;
- if ( $first =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)([^0-9]|$)/ ) {
+ return $rev unless ( defined($first) );
+ if ( $first =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)([a-z]?)([^0-9]|$)/ ) {
$rev->{'schema_major'} = $1;
$rev->{'schema_minor'} = $2;
$rev->{'schema_patch'} = $3;
+ $rev->{'alternative'} = $4;
}
else {
$rev->{'schema_major'} = $first;
$rev->{'schema_minor'} = shift;
$rev->{'schema_patch'} = shift;
+ $rev->{'alternative'} = '0';
}
return $rev;
}
@@ -113,6 +130,7 @@ sub revision_hash {
sub compare_revisions {
my $a = shift;
my $b = shift;
+ my $test_alt = shift;
return -1 if ( $a->{'schema_major'} < $b->{'schema_major'} );
return 1 if ( $a->{'schema_major'} > $b->{'schema_major'} );
@@ -123,6 +141,11 @@ sub compare_revisions {
return -1 if ( $a->{'schema_patch'} < $b->{'schema_patch'} );
return 1 if ( $a->{'schema_patch'} > $b->{'schema_patch'} );
+ if ( defined($test_alt) ) {
+ return -1 if ( $a->{'alternative'} lt $b->{'alternative'} );
+ return 1 if ( $a->{'alternative'} gt $b->{'alternative'} );
+ }
+
return 0;
}
@@ -165,7 +188,7 @@ sub apply_patch {
$current_revision = get_current_revision();
if ( compare_revisions($current_revision,revision_hash($patch)) != 0 ) {
- printf( "Failed to apply revision %s to the database!\n", $patch );
+ printf( "Failed to apply revision %s to the database!\n", $patch ) if ( $debug );
return 0;
}
return 1; # Success
@@ -188,11 +211,10 @@ sub apply_sql_file {
$ENV{'PGPASS'} = $dbpass if ( $dbpass ne "" );
my $command = join ' ', @psql_opts;
- my $results = `$command 2>&1 1>/dev/null`;
+ $last_results = `$command 2>&1 1>/dev/null`;
- $results =~ s/^.*WARNING: there is no transaction in progress\s$//m;
-
- print $results;
+ $last_results =~ s/^.*WARNING: there is no transaction in progress\s$//m;
+ $last_results =~ s/^.*NOTICE: //m;
}
diff --git a/debian/changelog b/debian/changelog
index 639afdb4..f55f08ed 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,30 @@
+rscds (0.9.2) unstable; urgency=low
+
+ * Add support for principal-url and calendar-home-set properties.
+ * All events should be PUBLIC unless CLASS specifies otherwise.
+ * Calendars can now be set such that all events are PUBLIC.
+ * Add support for automatically added relationships.
+ * Make some use of the improvements to the iCalendar class.
+ * Working with iCal 3.0 from Mac OS 10.5.
+ * Refactoring of driver code for LDAP and external AWL DB.
+
+ -- Andrew McMillan Sun, 04 Nov 2007 23:31:10 +1300
+
+rscds (0.9.1) unstable; urgency=low
+
+ * Reduce debug logging noise when debugging is iff
+ * When class is NULL we should consider it to be PUBLIC.
+ * Clean up some uninitialised variable warnings.
+ * Refactoring caldav-PUT to allow calling from a different code path.
+ * State how to make LDAP use an anonymous bind initially.
+ * Include any VTODO in GET for a collection.
+ * Minor permissions changes.
+ * Fix VTODO handling by time-range queries.
+ * Various fixes to LDAP authentication.
+ * Fix permissions for RW access.
+
+ -- Andrew McMillan Thu, 25 Oct 2007 16:30:06 +1300
+
rscds (0.9.0) unstable; urgency=low
* Changes preparatory to renaming to DAViCal
diff --git a/docs/website/clients.php b/docs/website/clients.php
index fcda89b3..44c1af00 100644
--- a/docs/website/clients.php
+++ b/docs/website/clients.php
@@ -43,6 +43,7 @@
sort($clients);
foreach( $clients AS $k => $v ) {
if ( $v == "Interoperability" ) continue;
+ if ( $v == "Other" ) continue;
$style = (strcmp($client_page,$v) == 0 ? ' class="selected"' : '' );
printf( '
', $style, $style );
+
include("inc/page-middle.php");
include("clients/".$details[$client_page]);
diff --git a/docs/website/clients/Evolution-details.php b/docs/website/clients/Evolution-details.php
index 9381a94f..39691d1f 100644
--- a/docs/website/clients/Evolution-details.php
+++ b/docs/website/clients/Evolution-details.php
@@ -5,7 +5,7 @@ was little in the way of a repository available to test against until recently.<
Select "File" then "New" then "Calendar" from the menus.
-
Choose a type of "CalDAV", enter a name, and a URL such as caldav://server.domain.name/caldav.php/username/home/, enter your user name for RSCDS and click "OK".
+
Choose a type of "CalDAV", enter a name, and a URL such as caldav://server.domain.name/caldav.php/username/home/, enter your user name for DAViCal and click "OK".
You should now be prompted for a password for that username. Enter the password and your calendar should now show.
@@ -15,11 +15,11 @@ restart. If you still have problems try doing that, but killing evolution-data-
Sometimes Evolution writes error messages into the cache file, so if you have ongoing problems you may want to
take a look inside that.
-
There are some quirks with Evolution's handling of CalDAV too, so perhaps take a look at the following
-bugs:
+
There are some quirks with Evolution's handling of CalDAV too, prior to 2.12.0, so perhaps take a look at the following
+bugs (fixed in 2.12.0):
If you intend to have users accessing the Really Simple CalDAV Store with more than one client
+
If you intend to have users accessing the DAViCal CalDAV Server with more than one client
then you should attempt to structure the URLs which they use to access the system in the way
that Mulberry does it.
Basically, Mulberry breaks the URL into three parts:
diff --git a/docs/website/clients/iCal-details.php b/docs/website/clients/iCal-details.php
new file mode 100644
index 00000000..e6290d6a
--- /dev/null
+++ b/docs/website/clients/iCal-details.php
@@ -0,0 +1,23 @@
+
iCal
+
iCal, from version 3.0 (released with OS 10.5) is generally well-behaved
+ and will discover your own calendars when configured. It will not allow you to manipulate other calendars on
+ the same server, however, unless you use different credentials to access them.
+
+
+
Open the "Preferences" dialog.
+
Choose the "Accounts" tab
+
Click on the "+" and a new panel will appear.
+
Enter a "Description" for the account.
+
The "Username" and "Password" are the relevant ones for your CalDAV server.
+
Open the "Server Options" area and set your account URL to point to http://host.../caldav.php/username/.
+
Click "Add" to confirm the new account
+
Your own calendars will be automatically discovered.
+
If you don't already have a calendar for your own user, go to the calendar view and long-click on the "+" will display a menu letting you create a new one.
+
+
+
Caveats
+
DAViCal does not support the draft scheduling extensions to CalDAV, so you will not see the full functionality
+ of iCal.
+
iCal does not let you browse the calendar hierarchy to find other calendars you could view, so you will not
+ see the full functionality of DAViCal either.
+
diff --git a/docs/website/clients/iCal-dialog.png b/docs/website/clients/iCal-dialog.png
new file mode 100644
index 00000000..c77ba8cf
Binary files /dev/null and b/docs/website/clients/iCal-dialog.png differ
diff --git a/docs/website/clients/iCal-icon.png b/docs/website/clients/iCal-icon.png
new file mode 100644
index 00000000..acb18df0
Binary files /dev/null and b/docs/website/clients/iCal-icon.png differ
diff --git a/docs/website/clients/iCal-screenshot.png b/docs/website/clients/iCal-screenshot.png
new file mode 100644
index 00000000..f0c96d4a
Binary files /dev/null and b/docs/website/clients/iCal-screenshot.png differ
diff --git a/docs/website/inc/page-footer.php b/docs/website/inc/page-footer.php
index c06b77c5..20d95992 100644
--- a/docs/website/inc/page-footer.php
+++ b/docs/website/inc/page-footer.php
@@ -11,7 +11,7 @@ echo $tags_to_be_closed;
XHTML | CSS
-Copyright 2006 | Andrew McMillan
+Copyright 2007 | Andrew McMillan
diff --git a/docs/website/index.php b/docs/website/index.php
index 0a3e45d9..c4c6e1cc 100644
--- a/docs/website/index.php
+++ b/docs/website/index.php
@@ -40,9 +40,9 @@ few releases as we come to understand the particular problems people experience.
In general DAViCal should not need significant maintenance to keep it operating.
Administrative functionality will be kept as simple as possible, within the target of supporting
organisations of up to several hundred staff.
-
This is called a Store rather than a Server because the server-side smarts are intended to be
-minimised to support CalDAV only in a manner sufficient to inter-operate with clients, and with the focus primarily
-on the storage of calendar resources.
+
The server-side smarts in DAViCal are intended to be fairly minimal in order to support CalDAV
+ only in a manner sufficient to inter-operate with clients, and with the focus primarily
+ on the storage of calendar resources.
Web-based Administration
General administration of the system should be through a web-based application.
@@ -51,7 +51,7 @@ maintainable through a web-based client, although the server should support the
works using the CalDAV protocol.
Credits
-
The Really Simple CalDAV Store was conceived and written by Andrew McMillan.
+
DAViCal CalDAV Server was conceived and written by Andrew McMillan.
Translations of the administration interface have been done by:
Lorena Paoletti (Spanish)
@@ -62,7 +62,8 @@ works using the CalDAV protocol.
Other contributors:
-
Maxime Delorme (CSS for Administration Pages)
+
Maxime Delorme (CSS, LDAP, SyncML, French translations)
+
Andrew Ruthven (Various enhancements)
Your Name Here!
diff --git a/docs/website/installation.php b/docs/website/installation.php
index 39534283..fc19500d 100644
--- a/docs/website/installation.php
+++ b/docs/website/installation.php
@@ -164,8 +164,11 @@ database on a different server, you should read the
PostgreSQL documentation on pg_hba.conf
for the version you are using.
-
Apache Configuration
+
Once you have changed the pg_hba.conf file you will need to
+reload or restart the PostgreSQL process for the change to come
+into effect.
+
Apache Configuration
Relative to an existing DocumentRoot
You can create a symlink from an existing web root directory to the
@@ -204,6 +207,7 @@ single virtual host.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value error_reporting "E_ALL & ~E_NOTICE"
+ php_value default_charset "utf-8"
</VirtualHost>
diff --git a/htdocs/caldav.php b/htdocs/caldav.php
index ccecb73f..5a82cd0a 100644
--- a/htdocs/caldav.php
+++ b/htdocs/caldav.php
@@ -2,7 +2,7 @@
/**
* CalDAV Server - main program
*
-* @package rscds
+* @package davical
* @subpackage caldav
* @author Andrew McMillan
* @copyright Catalyst .Net Ltd
@@ -14,6 +14,18 @@ require_once("HTTPAuthSession.php");
$session = new HTTPAuthSession();
dbg_log_array( "headers", '_SERVER', $_SERVER, true );
+/**
+* From reading the "Scheduling Extensions to CalDAV" draft I don't think that we will
+* be doing 'calendar-schedule' any time soon. The current spec is at:
+* http://www.ietf.org/internet-drafts/draft-desruisseaux-caldav-sched-03.txt
+*
+* access-control is rfc3744, so we will say we do it, but I doubt if we do it
+* in all (or even much of) it's glory really.
+*/
+$dav = "1, 2, access-control, calendar-access";
+header( "DAV: $dav");
+// header( "DAV: 1, 2, access-control, calendar-access, calendar-schedule");
+
require_once("CalDAVRequest.php");
$request = new CalDAVRequest();
@@ -41,4 +53,3 @@ switch ( $request->method ) {
$request->DoResponse( 500, translate("The application program does not understand that request.") );
-?>
\ No newline at end of file
diff --git a/htdocs/css/browse.css b/htdocs/css/browse.css
index feeb1377..c0874b3f 100644
--- a/htdocs/css/browse.css
+++ b/htdocs/css/browse.css
@@ -1,4 +1,4 @@
-/* CSS for browse pages in RSCDS */
+/* CSS for browse pages in DAViCal */
tr.header th, td {
padding: 1px 4px;
diff --git a/htdocs/help.php b/htdocs/help.php
index 1adba1f3..c7aa4d52 100644
--- a/htdocs/help.php
+++ b/htdocs/help.php
@@ -5,13 +5,14 @@ $session->LoginRequired();
require_once("interactive-page.php");
-$c->page_title = "Really Simple CalDAV Store - Configuration Help";
+$c->page_title = "DAViCal CalDAV Server - Configuration Help";
include("page-header.php");
?>
Help
-
For initial help you should visit the RSCDS Home Page. If you can't
-find the answers there, then you should post your problem in the RSCDS forums on Sourceforge itself.
+
For initial help you should visit the DAViCal Home Page. If you can't
+find the answers there, visit the #davical IRC channel on irc.oftc.net, send a question to the mailing list or
+post your problem in the DAViCal forums on Sourceforge itself.
LoginRequired();
-require_once("interactive-page.php");
+include("interactive-page.php");
include("page-header.php");
echo <<Where a set of users link to a group, which then links to other users/resources, the access restrictions will apply as the lesser of their link to that group, or the link from the group. They will have no access to each other's calendars.
-