Local repository update.
This commit is contained in:
Cyril Giraud 2014-09-22 22:18:37 +02:00
commit fcc322e65f
37 changed files with 619 additions and 454 deletions

45
CREDITS
View File

@ -18,4 +18,47 @@ And a big thank you to the translators:
Many other people have contributed bug reports, fixes and
in many small ways. These are acknowledged in the changelog
and version control history.
and version control history:
Aiko Barz <aiko@deepco.de>
Andrew McMillan <debian@mcmillan.net.nz>
Andrew Ruthven <andrew@etc.gen.nz>
Aurelien Requiem <aurelien@menfin.net>
Christian Kier <kier@isip.uni-luebeck.de>
Christoph Anton Mitterer <calestyo@scientia.net>
Cyril Giraud <cgiraud@free.fr>
Daniel Aleksandersen <code@daniel.priv.no>
DAViCal Administrator <davical@fry.dotcal.com>
Dávid Takács <david.takacs@cafeopen.eu>
Emmanuel Seyman <eseyman@edd.fr>
fbiete@gmail.com <fbiete@gmail.com>
Felix Möller <mail@felixmoeller.de>
Florian Schlichting <fsfs@debian.org>
Francois Marier <francois@debian.org>
Francois Perichon <francois.perichon@univ-lille2.fr>
Frank Steinberg <steinberg@ibr.cs.tu-bs.de>
Henri Sivonen <hsivonen@iki.fi>
Ján Máté <jan.mate@inf-it.com>
Jason Alavaliant <alavaliant@gmail.com>
Jens Zahner <jens.zahner@servicereisen.de>
Jeppe Bob Dyrby <jeppe.dyrby@gmail.com>
Jeroen van Disseldorp <jdizzl@xs4all.nl>
Jim Fenton <fenton@bluepopcorn.net>
Jim Hague <jim.hague@acm.org>
lebarjack <lebarjack@agenda.univ-lille2.fr>
Leho Kraav <leho@kraav.com>
Masahiro Mikami <ZBN15427@nifty.com>
Matthias Althaus <contact@althaus.it>
Matthias Beyer <matthias@ib-fb.de>
Matthias Mohr <Matthias@Mohrenclan.de>
Maxime Delorme <mdelorme@tennaxia.com>
Michael Trausch <mike@trausch.us>
Milan Medlik <milan@morphoss.com>
Patrick Näf Moser <patrick@moser-naef.ch>
Paul Willoughby <paulw@nationalfitness.com>
Peter Schaefer-Hutter <pschaefer@users.sourceforge.net>
Philipp Matthias Hahn <pmhahn@pmhahn.de>
Raphael Hertzog <debian@mcmillan.net.nz>
Rob Ostensen <caveman+davical@caveman.name>
Vincent Van Houtte <vvh@synergylaw.be>
Wolfgang Herget <wolfgang@r007.de>

View File

@ -55,8 +55,8 @@ snapshot: release
clean:
rm -f built-docs built-po
-find . -name "*~" -delete
-rm docs/translation.pdf
-rm davical.spec
rm -f docs/translation.pdf
rm -f davical.spec
.PHONY: clean-all
clean-all: clean

View File

@ -45,7 +45,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- This legacy conversion function will eventually be removed, once all logic
-- has been converted to use bitmaps, or to use the bits_to_priv() output.
@ -98,7 +98,7 @@ BEGIN
RETURN out_priv;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION get_permissions( INT, INT ) RETURNS TEXT AS $$
DECLARE
@ -151,12 +151,12 @@ BEGIN
RETURN '';
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION get_group_role_no() RETURNS INT AS $$
SELECT role_no FROM roles WHERE role_name = 'Group'
$$ LANGUAGE 'sql' IMMUTABLE;
$$ LANGUAGE sql IMMUTABLE;
CREATE or REPLACE FUNCTION has_legacy_privilege( INT, TEXT, INT ) RETURNS BOOLEAN AS $$
DECLARE
@ -205,7 +205,7 @@ BEGIN
RETURN FALSE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Given a verbose DAV: or CalDAV: privilege name return the bitmask
@ -242,7 +242,7 @@ BEGIN
ELSE 0 END)::BIT(24);
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- Given an array of verbose DAV: or CalDAV: privilege names return the bitmask
@ -269,7 +269,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- This legacy conversion function will eventually be removed, once all logic
@ -368,4 +368,4 @@ BEGIN
RETURN out_priv;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;

View File

@ -74,7 +74,7 @@ BEGIN
RETURN our_answer;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION calculate_later_timestamp( TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH TIME ZONE, TEXT ) RETURNS TIMESTAMP WITH TIME ZONE AS $$
@ -239,12 +239,12 @@ BEGIN
RETURN our_answer;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION usr_is_role( INT, TEXT ) RETURNS BOOLEAN AS $$
SELECT EXISTS( SELECT 1 FROM role_member JOIN roles USING(role_no) WHERE role_member.user_no=$1 AND roles.role_name=$2 )
$$ LANGUAGE 'sql' IMMUTABLE STRICT;
$$ LANGUAGE sql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION legacy_get_permissions( INT, INT ) RETURNS TEXT AS $$
DECLARE
@ -333,13 +333,13 @@ BEGIN
RETURN '';
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Function to convert a PostgreSQL date into UTC + the format used by iCalendar
CREATE or REPLACE FUNCTION to_ical_utc( TIMESTAMP WITH TIME ZONE ) RETURNS TEXT AS $$
SELECT to_char( $1 at time zone 'UTC', 'YYYYMMDD"T"HH24MISS"Z"' )
$$ LANGUAGE 'sql' IMMUTABLE STRICT;
$$ LANGUAGE sql IMMUTABLE STRICT;
-- Function to set an arbitrary DAV property
CREATE or REPLACE FUNCTION set_dav_property( TEXT, INTEGER, TEXT, TEXT ) RETURNS BOOLEAN AS $$
@ -365,7 +365,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' STRICT;
$$ LANGUAGE plpgsql STRICT;
-- List a user's relationships as a text string
CREATE or REPLACE FUNCTION relationship_list( INT8 ) RETURNS TEXT AS $$
@ -385,7 +385,7 @@ BEGIN
END LOOP;
RETURN rlist;
END;
$$ LANGUAGE 'plpgsql';
$$ LANGUAGE plpgsql;
DROP FUNCTION rename_davical_user( TEXT, TEXT );
DROP TRIGGER usr_modified ON usr CASCADE;
@ -518,7 +518,7 @@ CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS $$
RETURN NEW;
END
$$ LANGUAGE 'plpgsql';
$$ LANGUAGE plpgsql;
CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();
@ -573,7 +573,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- This legacy conversion function will eventually be removed, once all logic
-- has been converted to use bitmaps, or to use the bits_to_priv() output.
@ -626,7 +626,7 @@ BEGIN
RETURN out_priv;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION get_permissions( INT, INT ) RETURNS TEXT AS $$
DECLARE
@ -679,12 +679,12 @@ BEGIN
RETURN '';
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION get_group_role_no() RETURNS INT AS $$
SELECT role_no FROM roles WHERE role_name = 'Group'
$$ LANGUAGE 'sql' IMMUTABLE;
$$ LANGUAGE sql IMMUTABLE;
CREATE or REPLACE FUNCTION has_legacy_privilege( INT, TEXT, INT ) RETURNS BOOLEAN AS $$
DECLARE
@ -733,7 +733,7 @@ BEGIN
RETURN FALSE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Given a verbose DAV: or CalDAV: privilege name return the bitmask
@ -770,7 +770,7 @@ BEGIN
ELSE 0 END)::BIT(24);
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- Given an array of verbose DAV: or CalDAV: privilege names return the bitmask
@ -797,7 +797,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- NOTE: Round-trip through this and then back through privilege_to_bits
@ -892,7 +892,7 @@ BEGIN
RETURN out_priv;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- Expanded group memberships out to some depth
@ -902,7 +902,7 @@ CREATE or REPLACE FUNCTION expand_memberships( INT8, INT ) RETURNS SETOF INT8 AS
SELECT expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_memberships( group_id, $2 - 1) END AS g_id
FROM group_member WHERE member_id = $1) AS expanded
WHERE expanded.g_id IS NOT NULL;
$$ LANGUAGE 'sql' STABLE STRICT;
$$ LANGUAGE sql STABLE STRICT;
-- Expanded group members out to some depth
CREATE or REPLACE FUNCTION expand_members( INT8, INT ) RETURNS SETOF INT8 AS $$
@ -911,7 +911,7 @@ CREATE or REPLACE FUNCTION expand_members( INT8, INT ) RETURNS SETOF INT8 AS $$
SELECT expanded.m_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_members( member_id, $2 - 1) END AS m_id
FROM group_member WHERE group_id = $1) AS expanded
WHERE expanded.m_id IS NOT NULL;
$$ LANGUAGE 'sql' STABLE STRICT;
$$ LANGUAGE sql STABLE STRICT;
@ -949,7 +949,7 @@ BEGIN
RETURN out_conferred;
END;
$$ LANGUAGE 'plpgsql' STABLE STRICT;
$$ LANGUAGE plpgsql STABLE STRICT;
-- Privileges from accessor to grantor, by user_no
@ -972,7 +972,7 @@ BEGIN
RETURN out_conferred;
END;
$$ LANGUAGE 'plpgsql' STABLE STRICT;
$$ LANGUAGE plpgsql STABLE STRICT;
-- Privileges from accessor (by principal_id) to path
@ -1046,7 +1046,7 @@ BEGIN
RETURN out_conferred;
END;
$$ LANGUAGE 'plpgsql' STABLE STRICT;
$$ LANGUAGE plpgsql STABLE STRICT;
-- List a user's memberships as a text string
@ -1066,7 +1066,7 @@ BEGIN
END LOOP;
RETURN mlist;
END;
$$ LANGUAGE 'plpgsql' STRICT;
$$ LANGUAGE plpgsql STRICT;
-- List a user's members as a text string
@ -1086,7 +1086,7 @@ BEGIN
END LOOP;
RETURN mlist;
END;
$$ LANGUAGE 'plpgsql' STRICT;
$$ LANGUAGE plpgsql STRICT;
-- List the privileges as a text string
@ -1113,7 +1113,7 @@ BEGIN
END IF;
RETURN plist;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
DROP TRIGGER principal_modified ON principal CASCADE;
@ -1175,7 +1175,7 @@ CREATE or REPLACE FUNCTION p_has_proxy_access_to( INT8, INT ) RETURNS SETOF INT8
WHERE (default_privileges & 5::BIT(24)) != 0::BIT(24)
AND principal_id != $1
) subquery;
$$ LANGUAGE 'sql' STABLE STRICT;
$$ LANGUAGE sql STABLE STRICT;
-- A list of the principals who can proxy to this principal
@ -1185,7 +1185,7 @@ CREATE or REPLACE FUNCTION grants_proxy_access_from_p( INT8, INT ) RETURNS SETOF
WHERE by_collection IS NULL AND by_principal != $1
AND by_principal IN (SELECT expand_members(g2.to_principal,$2) FROM grants g2 WHERE g2.by_principal = $1)
;
$$ LANGUAGE 'sql' STABLE STRICT;
$$ LANGUAGE sql STABLE STRICT;
@ -1209,7 +1209,7 @@ BEGIN
VALUES( in_collection_id, in_status, tmp_int, in_dav_name);
RETURN TRUE;
END
$$ LANGUAGE 'plpgsql' VOLATILE STRICT;
$$ LANGUAGE plpgsql VOLATILE STRICT;
CREATE or REPLACE FUNCTION new_sync_token( INT8, INT8 ) RETURNS INT8 AS $$
@ -1254,7 +1254,7 @@ BEGIN
-- Returning the new token
RETURN new_token;
END
$$ LANGUAGE 'plpgsql' STRICT;
$$ LANGUAGE plpgsql STRICT;
DROP TRIGGER alarm_changed ON calendar_alarm CASCADE;

View File

@ -36,7 +36,7 @@ BEGIN
ELSE 0 END)::BIT(24);
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- Given an array of verbose DAV: or CalDAV: privilege names return the bitmask
CREATE or REPLACE FUNCTION privilege_to_bits( TEXT[] ) RETURNS BIT(24) AS $$
@ -62,7 +62,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- This sequence is used in a number of places so that any DAV resource will have a unique ID
@ -262,7 +262,7 @@ CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS $$
RETURN NEW;
END
$$ LANGUAGE 'plpgsql';
$$ LANGUAGE plpgsql;
CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();

View File

@ -46,7 +46,7 @@ CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS '
RETURN NEW;
END
' LANGUAGE 'plpgsql';
' LANGUAGE plpgsql;
CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();

View File

@ -48,7 +48,7 @@ CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS '
RETURN NEW;
END
' LANGUAGE 'plpgsql';
' LANGUAGE plpgsql;
CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();

View File

@ -42,7 +42,7 @@ CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS '
RETURN NEW;
END
' LANGUAGE 'plpgsql';
' LANGUAGE plpgsql;
-- CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
-- FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();

View File

@ -28,7 +28,7 @@ CREATE or REPLACE FUNCTION check_db_revision( INT, INT, INT ) RETURNS BOOLEAN AS
RAISE EXCEPTION ''Database has not been upgraded to %.%.%'', major, minor, patch;
RETURN FALSE;
END;
' LANGUAGE 'plpgsql';
' LANGUAGE plpgsql;
-- Just in case these constraints got added manually, so we won't fail

View File

@ -42,7 +42,7 @@ CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS '
RETURN NEW;
END
' LANGUAGE 'plpgsql';
' LANGUAGE plpgsql;
-- CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
-- FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();

View File

@ -42,7 +42,7 @@ CREATE or REPLACE FUNCTION sync_dav_id ( ) RETURNS TRIGGER AS '
RETURN NEW;
END
' LANGUAGE 'plpgsql';
' LANGUAGE plpgsql;
-- CREATE TRIGGER caldav_data_sync_dav_id AFTER INSERT OR UPDATE ON caldav_data
-- FOR EACH ROW EXECUTE PROCEDURE sync_dav_id();

View File

@ -50,7 +50,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- This legacy conversion function will eventually be removed, once all logic
-- has been converted to use bitmaps, or to use the bits_to_priv() output.
@ -103,7 +103,7 @@ BEGIN
RETURN out_priv;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION get_permissions( INT, INT ) RETURNS TEXT AS $$
DECLARE
@ -156,12 +156,12 @@ BEGIN
RETURN '';
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION get_group_role_no() RETURNS INT AS $$
SELECT role_no FROM roles WHERE role_name = 'Group'
$$ LANGUAGE 'sql' IMMUTABLE;
$$ LANGUAGE sql IMMUTABLE;
CREATE or REPLACE FUNCTION has_legacy_privilege( INT, TEXT, INT ) RETURNS BOOLEAN AS $$
DECLARE
@ -210,7 +210,7 @@ BEGIN
RETURN FALSE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Given a verbose DAV: or CalDAV: privilege name return the bitmask
@ -247,7 +247,7 @@ BEGIN
ELSE 0 END)::BIT(24);
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- Given an array of verbose DAV: or CalDAV: privilege names return the bitmask
@ -274,7 +274,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
-- This legacy conversion function will eventually be removed, once all logic
@ -372,7 +372,7 @@ BEGIN
RETURN out_priv;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
@ -491,7 +491,7 @@ BEGIN
RETURN out_bits;
END
$$
LANGUAGE 'plpgsql' IMMUTABLE STRICT;
LANGUAGE plpgsql IMMUTABLE STRICT;
ALTER TABLE relationship_type ADD COLUMN bit_confers BIT(24) DEFAULT privilege_to_bits(ARRAY['DAV::read','DAV::write']);

View File

@ -54,7 +54,7 @@ BEGIN
VALUES( in_collection_id, in_status, tmp_int, in_dav_name);
RETURN TRUE;
END
$$ LANGUAGE 'plpgsql' VOLATILE STRICT;
$$ LANGUAGE plpgsql VOLATILE STRICT;
CREATE or REPLACE FUNCTION new_sync_token( INT8, INT8 ) RETURNS INT8 AS $$
@ -76,4 +76,4 @@ BEGIN
INSERT INTO sync_tokens(collection_id, sync_token) VALUES( in_collection_id, tmp_int );
RETURN tmp_int;
END
$$ LANGUAGE 'plpgsql' STRICT;
$$ LANGUAGE plpgsql STRICT;

View File

@ -75,7 +75,7 @@ BEGIN
RETURN result;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Return a SETOF dates within the month of a particular date which match a string of BYDAY rule specifications
@ -170,7 +170,7 @@ BEGIN
RETURN;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
-- Return a SETOF dates within the month of a particular date which match a string of BYDAY rule specifications
@ -204,7 +204,7 @@ BEGIN
RETURN;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Return a SETOF dates within the week of a particular date which match a single BYDAY rule specification
@ -238,12 +238,12 @@ BEGIN
RETURN;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
CREATE or REPLACE FUNCTION event_has_exceptions( TEXT ) RETURNS BOOLEAN AS $$
SELECT $1 ~ E'\nRECURRENCE-ID(;TZID=[^:]+)?:[[:space:]]*[[:digit:]]{8}(T[[:digit:]]{6})?'
$$ LANGUAGE 'sql' IMMUTABLE STRICT;
$$ LANGUAGE sql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -261,7 +261,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -277,7 +277,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -293,7 +293,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -309,7 +309,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -356,7 +356,7 @@ BEGIN
END IF;
CLOSE curse;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -396,7 +396,7 @@ BEGIN
RETURN NEXT after;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -428,7 +428,7 @@ BEGIN
END LOOP;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -473,7 +473,7 @@ BEGIN
END LOOP;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -507,7 +507,7 @@ BEGIN
END IF;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -535,7 +535,7 @@ BEGIN
RETURN NEXT after;
END IF;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -632,7 +632,7 @@ BEGIN
END LOOP;
-- RETURN QUERY;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -651,7 +651,7 @@ BEGIN
RETURN NEXT rowvar.d;
END LOOP;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -701,9 +701,9 @@ BEGIN
RETURN FOUND;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
CREATE or REPLACE FUNCTION icalendar_interval_to_SQL( TEXT ) RETURNS interval AS $function$
SELECT CASE WHEN substring($1,1,1) = '-' THEN -1 ELSE 1 END * regexp_replace( regexp_replace($1, '[PT-]', '', 'g'), '([A-Z])', E'\\1 ', 'g')::interval;
$function$ LANGUAGE 'sql' IMMUTABLE STRICT;
$function$ LANGUAGE sql IMMUTABLE STRICT;

View File

@ -75,7 +75,7 @@ BEGIN
RETURN result;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Return a SETOF dates within the month of a particular date which match a string of BYDAY rule specifications
@ -161,7 +161,7 @@ BEGIN
RETURN;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
-- Return a SETOF dates within the month of a particular date which match a string of BYDAY rule specifications
@ -195,7 +195,7 @@ BEGIN
RETURN;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
-- Return a SETOF dates within the week of a particular date which match a single BYDAY rule specification
@ -229,12 +229,12 @@ BEGIN
RETURN;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
CREATE or REPLACE FUNCTION event_has_exceptions( TEXT ) RETURNS BOOLEAN AS $$
SELECT $1 ~ E'\nRECURRENCE-ID(;TZID=[^:]+)?:[[:space:]]*[[:digit:]]{8}(T[[:digit:]]{6})?'
$$ LANGUAGE 'sql' IMMUTABLE STRICT;
$$ LANGUAGE sql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -252,7 +252,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -268,7 +268,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -284,7 +284,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -300,7 +300,7 @@ BEGIN
END IF;
RETURN TRUE;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -340,7 +340,7 @@ BEGIN
END IF;
CLOSE curse;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
------------------------------------------------------------------------------------------------------
@ -380,7 +380,7 @@ BEGIN
RETURN NEXT after;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -410,7 +410,7 @@ BEGIN
RETURN QUERY SELECT d FROM rrule_bysetpos_filter(curse,rrule.bysetpos) d;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -453,7 +453,7 @@ BEGIN
RETURN QUERY SELECT d FROM rrule_bysetpos_filter(curse,rrule.bysetpos) d;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -483,7 +483,7 @@ BEGIN
END IF;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -510,7 +510,7 @@ BEGIN
RETURN NEXT after;
END IF;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -610,7 +610,7 @@ BEGIN
END LOOP;
-- RETURN QUERY;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -626,7 +626,7 @@ BEGIN
maxdate := current_date + '10 years'::interval;
RETURN QUERY SELECT d FROM rrule_event_instances_range( basedate, repeatrule, basedate, maxdate, 300 ) d;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
------------------------------------------------------------------------------------------------------
@ -676,7 +676,7 @@ BEGIN
RETURN FOUND;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE;
$$ LANGUAGE plpgsql IMMUTABLE;
-- Create a composite type for the parts of the RRULE.
@ -707,10 +707,10 @@ BEGIN
END LOOP;
END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
CREATE or REPLACE FUNCTION icalendar_interval_to_SQL( TEXT ) RETURNS interval AS $function$
SELECT CASE WHEN substring($1,1,1) = '-' THEN -1 ELSE 1 END * regexp_replace( regexp_replace($1, '[PT-]', '', 'g'), '([A-Z])', E'\\1 ', 'g')::interval;
$function$ LANGUAGE 'sql' IMMUTABLE STRICT;
$function$ LANGUAGE sql IMMUTABLE STRICT;

19
debian/changelog vendored
View File

@ -1,11 +1,26 @@
davical (1.1.2-1) unstable; urgency=low
davical (1.1.3~git20140914-1) unstable; urgency=low
[ Andrew McMillan ]
* New upstream release (closes: #656395, #702403, #703290, #703383, #703387)
* Updated the control file Vcs-* fields to the new addresses of the
canonical git upstream repository.
* Removed README.Debian which didnt contain any useful information.
-- Andrew McMillan <awm@debian.org> Wed, 01 May 2013 10:05:33 +1200
[ Florian Schlichting ]
* Takeover for the Davical Development Team (closes: #742498)
* Use short-form debian/rules and fix source format declaration
(closes: #730941)
* Clean up duplicate files (symlink identical files in api documentation)
* debian/control: update and sort dependencies, add php5, php5-cli
(closes: #717043), php5-curl to Recommends (closes: #656390)
* Add doc-base registration for api doc and website in davical-doc
* Bump dh compat to level 9
* Add a debian/watch file
* Switch d/copyright to copyright-format 1.0, amend CREDITS from git log
* Declare compliance with Debian Policy 3.9.5
* Upload to Debian (closes: #726577)
-- Florian Schlichting <fsfs@debian.org> Sun, 14 Sep 2014 15:29:54 +0200
davical (1.1.1-1) unstable; urgency=high

2
debian/compat vendored
View File

@ -1 +1 @@
5
9

33
debian/control vendored
View File

@ -1,18 +1,28 @@
Source: davical
Section: web
Priority: extra
Maintainer: Andrew McMillan <awm@debian.org>
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 7), libawl-php, gettext
Vcs-git: git://github.com/DAViCal/davical.git
Vcs-browser: https://github.com/DAViCal/davical
Homepage: http://davical.org/
Maintainer: Davical Development Team <davical-devel@lists.sourceforge.net>
Uploaders: Andrew McMillan <awm@debian.org>,
Florian Schlichting <fsfs@debian.org>
Standards-Version: 3.9.5
Build-Depends: debhelper (>= 9), libawl-php, gettext
Vcs-git: https://gitlab.com/davical-project/davical.git
Vcs-browser: https://gitlab.com/davical-project/davical
Homepage: http://www.davical.org/
Package: davical
Architecture: all
Depends: ${misc:Depends}, debconf (>= 1.0.32), php5-pgsql, postgresql-client (>= 8.1), libawl-php (>= 0.54-1~), libawl-php (<< 0.55), libdbd-pg-perl, libyaml-perl
Recommends: postgresql (>= 8.3)
Description: The DAViCal CalDAV & CardDAV Server
Depends: ${misc:Depends}, ${perl:Depends},
libawl-php (>= 0.54-1~), libawl-php (<< 0.55),
libdbd-pg-perl,
libyaml-perl,
php5,
php5-cli,
php5-pgsql,
postgresql-client
Recommends: php5-curl,
postgresql
Description: PHP CalDAV and CardDAV Server
The DAViCal CalDAV Server is designed to store CalDAV calendars and
CardDAV addressbooks, such as those from Evolution, Sunbird/Lightning,
Mulberry, iCal, iPhone or SOHO Organizer, in a central location,
@ -23,7 +33,7 @@ Package: davical-doc
Section: doc
Architecture: all
Depends: ${misc:Depends}
Description: The DAViCal CalDAV & CardDAV Server - technical documentation
Description: PHP CalDAV and CardDAV Server - technical documentation
The DAViCal CalDAV Server is designed to store CalDAV calendars and
CardDAV addressbooks, such as those from Evolution, Sunbird/Lightning,
Mulberry, iCal, iPhone or SOHO Organizer, in a central location,
@ -31,6 +41,5 @@ Description: The DAViCal CalDAV & CardDAV Server - technical documentation
basic administration interface.
.
This package contains detailed technical documentation for the
classes and methods in the DAViCal programs. Some user-centric
classes and methods in the DAViCal programs. Some user-centric
configuration documentation is also included.

132
debian/copyright vendored
View File

@ -1,47 +1,105 @@
This package was debianized by Andrew McMillan <andrew@mcmillan.net.nz>
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://gitlab.com/davical-project/davical
Upstream-Name: davical
Upstream-Contact: davical-devel@lists.sourceforge.net
It was downloaded from http://debian.mcmillan.net.nz/packages/davical/
Files: *
Copyright: 2006 - 2013, Andrew McMillan <andrew@mcmillan.net.nz>
2006 - 2008, Catalyst IT Ltd
2008 - 2013, Morphoss Ltd
2007 - 2014, Davical contributors (see CREDITS for details)
License: GPL-2+
Upstream Author: Andrew McMillan <andrew@mcmillan.net.nz>
Files: dba/caldav_functions.sql htdocs/public.php htdocs/tools.php
inc/pubsub.php inc/caldav-MKCOL.php inc/log_caldav_action.php
inc/caldav-ACL.php inc/caldav-PROPPATCH.php inc/RRule.php
inc/HTTPAuthSession.php inc/caldav-client.php inc/DAViCalSession.php
inc/caldav-REPORT.php inc/caldav-MOVE.php
Copyright: 2006 - 2013, Andrew McMillan <andrew@mcmillan.net.nz>
2006 - 2008, Catalyst IT Ltd
2008 - 2013, Morphoss Ltd
2007 - 2014, Davical contributors (see CREDITS for details)
License: GPL-2
Copyright: 2006-2011 Andrew McMillan
Files: htdocs/tz.php inc/CalDAVRequest.php inc/iSchedule-POST.php
inc/DAVResource.php inc/external-fetch.php inc/DAVTicket.php
inc/iSchedule.php inc/tz/* scripts/tz-update.php scripts/refresh-alarms.php
scripts/archive-old-events.php
Copyright: 2006 - 2013, Andrew McMillan <andrew@mcmillan.net.nz>
2006 - 2008, Catalyst IT Ltd
2008 - 2013, Morphoss Ltd
2007 - 2014, Davical contributors (see CREDITS for details)
License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Files: inc/caldav-client-v2.php
Copyright: 2006 - 2013, Andrew McMillan <andrew@mcmillan.net.nz>
2006 - 2008, Catalyst IT Ltd
2008 - 2013, Morphoss Ltd
2007 - 2014, Davical contributors (see CREDITS for details)
License: LGPL-3+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Files: inc/check_UTF8.php
Copyright: 1998, Netscape Communications Corporation
2003, Henri Sivonen, hsivonen@iki.fi
License: NPL-1.1_or_GPL-2+_or_LGPL-2.1+
The contents of this file are subject to the Netscape Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/NPL/
.
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
.
Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the NPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the NPL, the GPL or the LGPL.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
Files: debian/*
Copyright: 2006-2012, Andrew McMillan <awm@debian.org>
2014, Florian Schlichting <fsfs@debian.org>
License: GPL-2+
You are free to distribute this software under the terms of the GNU General
Public License. On Debian systems, the complete text of the GNU General
Public License can be found in /usr/share/common-licenses/GPL file.
License: GPL-2+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
.
On Debian systems, the complete text of version 2 of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
License: GPL-2
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
.
On Debian systems, the complete text of version 2 of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
License for Translation Building code
=====================================
The following files inherit their license separately:
scripts/po/extract.pl
scripts/po/rebuild-translations.sh
License: GPL-3+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at your option) any
later version.
.
On Debian systems, the complete text of version 3 of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-3'.
The process used for building the translations for DAViCal is based on
prior code originally from the Horde project and subsequently from the
Gallery project. It has also been somewhat further modified here.
The applicable Horde license is the LGPL, as identified here:
http://cvs.horde.org/co.php/horde/COPYING?r=2.1
Authors:
Copyright 2000-2002 Joris Braakman <jbraakman@yahoo.com>
Copyright 2001-2002 Chuck Hagenbuch <chuck@horde.org>
Copyright 2001-2002 Jan Schneider <jan@horde.org>
Copyright 2002-2003 Bharat Mediratta <bharat@menalto.co>
Copyright 2006-2008 Andrew McMillan <andrew@mcmillan.net.nz>
License: LGPL-3+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3, or (at your option)
any later version.
.
On Debian systems, the complete text of version 3 of the GNU Lesser
General Public License can be found in `/usr/share/common-licenses/LGPL-3'.

12
debian/davical-doc.doc-base.api vendored Normal file
View File

@ -0,0 +1,12 @@
Document: davical-api
Title: DAViCal API Documentation
Section: Programming/PHP
Abstract: Technical documentation for DAViCal
The DAViCal CalDAV & CardDAV Server is designed to store CalDAV calendars and
CardDAV addressbooks in a central location, providing shared calendars,
free/busy publication and a basic administration interface. This API
documentation details the classes and methods in die DAViCal programs.
Format: HTML
Index: /usr/share/doc/davical-doc/api/index.html
Files: /usr/share/doc/davical-doc/api/*.html /usr/share/doc/davical-doc/api/*/*.html /usr/share/doc/davical-doc/api/*/*/*.html

12
debian/davical-doc.doc-base.website vendored Normal file
View File

@ -0,0 +1,12 @@
Document: davical-website
Title: DAViCal Website
Section: Data Management
Abstract: The DAViCal Website
The DAViCal CalDAV & CardDAV Server can store calendars and addressbooks in a
central location, providing shared calendars, free/busy publication and a
basic administration interface. This offline copy of the website provides
configuration information for both the server and a diverse range of clients.
Format: HTML
Index: /usr/share/doc/davical-doc/website/index.php.gz
Files: /usr/share/doc/davical-doc/website/*.php /usr/share/doc/davical-doc/website/*.php.gz /usr/share/doc/davical-doc/website/*/*.php

4
debian/davical-doc.links vendored Normal file
View File

@ -0,0 +1,4 @@
usr/share/doc/davical-doc/api/media/images/Class_logo.png usr/share/doc/davical-doc/api/media/images/Interface_logo.png
usr/share/doc/davical-doc/api/media/images/StaticVariable.png usr/share/doc/davical-doc/api/media/images/Variable.png
usr/share/doc/davical-doc/api/media/images/PrivateClass_logo.png usr/share/doc/davical-doc/api/media/images/private_class_logo.png
usr/share/doc/davical-doc/api/media/images/Method.png usr/share/doc/davical-doc/api/media/images/StaticMethod.png

88
debian/rules vendored
View File

@ -1,90 +1,14 @@
#!/usr/bin/make -f
#
# rules for DAViCal
#
# This file allows you to build any of the binary packages independantly, via binary-<package> targets.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
# This has to be exported to make some magic below work.
export DH_OPTIONS
get-orig-source:
tar cJf ../davical_$(VERSION).orig.tar.xz --exclude-vcs --exclude=.gitattributes .
build: build-stamp
build-stamp:
dh_testdir
$(MAKE)
touch build-stamp
%:
dh $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp
$(MAKE) clean
-rm -f build
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
dh_install
# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common:
dh_testdir
dh_testroot
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
dh_installdocs --exclude=.gitignore
# dh_installexamples
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installcatalogs
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installman
# dh_installcron
# dh_installinfo
# dh_installwm
# dh_installudev
# dh_lintian
# dh_undocumented
# dh_strip
# dh_link
dh_compress --exclude=.js
dh_fixperms
rm debian/davical/usr/share/davical/htdocs/.htaccess || true
# dh_perl
# dh_python
# dh_makeshlibs
dh_installdeb
# dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build install
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build install
# Any other binary targets build just one binary package at a time.
binary-%: build install
make -f debian/rules binary-common DH_OPTIONS=-p$*
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary-common binary install

View File

@ -1 +1 @@
3.0 (native)
3.0 (quilt)

2
debian/watch vendored Normal file
View File

@ -0,0 +1,2 @@
version=3
https://gitlab.com/davical-project/davical/tags \/davical-project\/davical\/repository\/archive.tar.gz\?ref=r([\d.]*)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -11,11 +11,7 @@ echo $tags_to_be_closed;
<a href="http://validator.w3.org/check?uri=referer" class="flink">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" class="flink">CSS</a>
</p>
<p class="right">
Copyright 2007-2011 | Andrew McMillan
</p>
<p align="center">
<a href="http://andrew.mcmillan.net.nz/"><img src="http://sf-rscds.mcmillan.net.nz/clear-1.png" width="1" height="1" border="0" title="DAViCal CalDAV Server by Andrew McMillan" alt=" " /></a>
Copyright 2007-2014 | Andrew McMillan
</p>
</div>

View File

@ -3,8 +3,9 @@
include("inc/page-header.php");
?>
<h1>About DAViCal</h1>
<p>DAViCal is a server for calendar sharing. It is an implementation of the CalDAV protocol which is designed
for storing calendaring resources (in iCalendar format) on a remote shared server. </p>
<p>DAViCal is a server for calendar sharing. It is an implementation
of the CalDAV protocol which is designed for storing calendaring
resources (in iCalendar format) on a remote shared server. </p>
<p>An increasing number of calendar clients support
the maintenance of shared remote calendars through CalDAV, including Mozilla Calendar
(Sunbird/Lightning), Evolution, Mulberry, Chandler, and various other closed-source products
@ -30,9 +31,9 @@ and writing the same calendar entries over time, and scheduling of meetings with
versions of Linux, FreeBSD, Mac OSX and even Microsoft Windows. We definitely do not recommend using Windows
for this unless you are completely hobbled by silly internal IT policies and have to do so.</p>
<h2>Getting DAViCal and Installing DAViCal</h2>
<p>You can download DAViCal from <a href="http://debian.mcmillan.net.nz/">http://debian.mcmillan.net.nz/</a></p>
<p>Start looking on the <a href="installation.php">DAViCal Installation Page</a> for more places to download, and
<h2>Getting and Installing DAViCal</h2>
<p>Start by looking on the <a href="installation.php">DAViCal
Installation Page</a> for instructions on places to download, and
detailed instructions as to what to do when you have it.</p>
<p>There is a lot of information on the wiki about <a href="http://wiki.davical.org/w/Configuration">DAViCal configuration settings</a> but in most cases the configuration
will need very few of these settings.</p>
@ -71,15 +72,6 @@ CalDAV server:</p>
<li>writing and reviewing patches</li>
<li>designing future functionality</li>
<li>thinking of more interesting ways to contribute to DAViCal!</li>
<li>you could also <form style="display:inline;padding-top:1em;vertical-align:middle;" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBsdPslgSVqOy+tOKYZ4C9Z8eQ78sMnPjL5P6YlnIsRpU6YnaTcNeW4afVXPZ0z8W5ERKFVBbAoFgWkXeTVt/K/36GGgYAP1TgwPui4LCHavME2uEBD429fzaOC6uGyM5IPBD7+ZRXr+9GQuzbgbLwEpfocBYwmDXaoeLgDzzyu5TELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIvVHuEvLtKEaAgZhnaYIH1hNLXodqEmZbw3RtTZH6YC/8e/gZW96Il6EYYje/8GOSwfMu9LJCPnlqo2u6OLG5wDBI1IuLQoPcQx5QCaQtUq2ZZhKS8NkOxa2jKuzj9wu5HrtH9YY6jxqJ5RWAr9kJgV+8TIzhIHI/u3fwdV0LDydCrEMi21ispNspkXzE8qWMqgRQo271lqWLaIgkde2wJaNh/qCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTExMDExNzEwMTIxOFowIwYJKoZIhvcNAQkEMRYEFOMYMppRSee9AsXutXxlX3h/Fu8IMA0GCSqGSIb3DQEBAQUABIGAJlk9vVYtBPkDimgpfJTYOwO989NxKBdz0Nrx685m8yhKJsztYKAQ6VSrInnUTRTHmz7Qxd0lVze0iCjycUqteDMXRn+75cLFozDJYqjCzTeDuBMlsQzC0VeH0BTX/vMJqZ2wUBk9BdAxhdq1p3ISDxuExHCpbX0oHHzdOwsPfBg=-----END PKCS7-----
" />
<input type="image" src="images/paypal_donate_button.png" name="submit" alt="Donate to DAViCal via PayPal" />
</form> something or
<a href="http://flattr.com/thing/118849/DAViCal" target="_blank">
<img src="images/flattr-badge-large.png" style="padding-bottom:0.2em;vertical-align:middle;" alt="Flattr this" title="Flattr this" /></a>
since paid work is my biggest distraction from free software.</li>
</ul>
<p>Can you think of more?</p>

View File

@ -5,73 +5,41 @@
<h1>Before Starting</h1>
<h2>Debian Users</h2>
<p>Ideally you will be running a recent Debian (or Ubuntu) release and will
be able to add:</p>
<pre>
deb http://debian.mcmillan.net.nz/debian lenny awm
</pre>
<p>to your <code>/etc/apt/sources.list</code>. Once you have done that you
can use <code>apt-get</code> or <code>synaptic</code> or some other equivalent package
manager to fetch and install <code>DAViCal</code> and all the dependencies.</p>
<p>This repository is signed by Andrew McMillan's public key, which you can install so that
you don't get asked for confirmation all the time:</p>
<pre>
sudo apt-key advanced --keyserver pgp.net.nz --recv-keys F6E0FA5CF0307507BB23A512EAFCFEBF8FEB8EBF
</pre>
<p>Skip to the "Database Setup" part if you have done that already.</p>
<p>Recent Debian (and Ubuntu) releases have DAViCal 1.1.1 and AWL 0.53
(a library referenced by DAViCal) available in their repositories,
and you can use apt-get or similar tools to download and install
DAViCal. Once you have done that, you should be able to proceed to
the Database Setup section, below.</p>
<h2>Other Linux Users</h2>
<p>Please write something up about your experiences in the Wiki, adding distribution specific
notes to pages somewhere under here:
<a href="http://wiki.davical.org/w/Installation_Stuff">http://wiki.davical.org/w/Installation_Stuff</a></p>
<p>The <a href="http://wiki.davical.org">DAViCal wiki</a> contains
information on installation on other versions of Linux. Please feel
free to contribute your experiences, using the mailing list if you
don't have a wiki account.</p>
<h3>RPM Packages of DAViCal</h3>
<p>We have created RPM packages of DAViCal and libawl-php from the .deb packages
using "alien". These are reported to work fine, so use them and then proceed to the
Pre-requisites section below. If you would like to work with us to create native
RPM packages please get in touch!</p>
<p>In many cases, you will need to download the latest versions of
the <code>DAViCal</code> and <code>awl</code> packages from
the <a href="https://gitlab.com/groups/davical-project">repository on
GitLab</a>. More details on this are on
the <a href="http://davical.dhits.nl/index.php?title=Downloading">Downloading
page on the wiki</a>.</p>
<h3>SuSE Linux</h3>
<p>On SuSE Linux you may need to look in /var/lib/pgsql/data/ for the pg_hba.conf file.</p>
<h3>Gentoo</h3>
<p>Davical and the awl library ebuilds are available on the <a href="http://www.gentoo.org/proj/en/sunrise/">sunrise overlay</a>.
You'll have to add this overlay to your system:</p>
<pre>
emerge layman
layman -f -a sunrise
echo "source /usr/portage/local/layman/make.conf" &gt;&gt; /etc/make.conf
</pre>
<p>From there, you can keep the overlay in sync with the command:</p>
<pre>layman -s sunrise</pre>
<p>Davical can now be installed with a normal:</p>
<pre>emerge davical</pre>
<h3>Slackware, BSD and the rest</h3>
<p>You will need to download the latest versions of the <code>DAViCal</code> and <code>awl</code> packages
from the <a href="http://sourceforge.net/projects/davical/files/">sourceforge download page for DAViCal</a>.</p>
<p>You will need to untar these. Preferably you will untar them from within the "<code>/usr/share</code>" directory and everything
will be in it's expected location (well, except the docs, but it will at least be tidy and everything will be in one place).</p>
<p>We would like to hear from non-Debian users regarding things which might have been missed, or things you have
learned about the system, so please write about your installation experiences on the Wiki, or post a message
in the Sourceforge forums.</p>
<p>We would like to hear from non-Debian users regarding things which
might have been missed, or things you have learned about the system,
so please write about your installation experiences on the Wiki, or
post a message on the mailing list.</p>
<h2>Non-Linux Users</h2>
<p>We would really like to hear from you. As far as we can see there is no reason why this
can't all work on FreeBSD, Microsoft Windows, VMS, Mac OS or whatever else, as long as the
pre-requisites are able to be installed.</p>
<p>For Unix and unix-like operating systems the "Other Linux Users" instructions are likely
to be reasonably close to what you need. For other systems everything will need some
adjustment, and in particular some of the path name and shell expectations coded into
the database creation scripts are likely to need love.</p>
<p>We would really like to hear from you. As far as we can see there
is no reason why this can't all work on FreeBSD, Microsoft Windows,
VMS, Mac OS or whatever else, as long as the pre-requisites are able
to be installed.</p>
<p>For Unix and unix-like operating systems the "Other Linux Users"
instructions are likely to be reasonably close to what you need. For
other systems everything will need some adjustment, and in particular
some of the path name and shell expectations coded into the database
creation scripts are likely to need love.</p>
<p>We're available to answer questions, anyway :-)</p>
<h1>Pre-requisites</h1>
@ -94,7 +62,7 @@ if you want to increase the security or scalability of your
installation.</p>
<p>Since the CalDAV store takes over a significant amount of path
hierarchy, it can be easier in it's own virtual
hierarchy, it can be easier in its own virtual
host. If you want it to operate within the web root of some
other application there are instructions on the Wiki about doing this,
as well as other fancy tricks such as configuring URL rewriting in

View File

@ -28,7 +28,7 @@ $bad_events = null;
/**
* A regex which will match most reasonable timezones acceptable to PostgreSQL.
*/
$tz_regex = ':^(Africa|America|Antarctica|Arctic|Asia|Atlantic|Australia|Brazil|Canada|Chile|Etc|Europe|Indian|Mexico|Mideast|Pacific|US)/[a-z_]+$:i';
$GLOBALS['tz_regex'] = ':^(Africa|America|Antarctica|Arctic|Asia|Atlantic|Australia|Brazil|Canada|Chile|Etc|Europe|Indian|Mexico|Mideast|Pacific|US)/[a-z_]+$:i';
/**
* This function launches an error

View File

@ -134,7 +134,7 @@ $vcard->Write( $row->dav_id, $dest->Exists() );
$qry->QDo("SELECT write_sync_change( $collection_id, $response_code, :dav_name)", array(':dav_name' => $dest->bound_from() ) );
if ( isset($log_action) && $log_action && function_exists('log_caldav_action') ) {
if ( function_exists('log_caldav_action') ) {
log_caldav_action( $put_action_type, $uid, $user_no, $collection_id, $request->path );
}
else if ( isset($log_action) && $log_action ) {

View File

@ -88,11 +88,13 @@ function apply_filter( $filters, $item ) {
/**
* Process a filter fragment returning an SQL fragment
* Changed by GitHub user moosemark 2013-11-29 to allow multiple text-matches - SQL parameter now has numeric count appended.
*/
$need_post_filter = false;
$range_filter = null;
function SqlFilterFragment( $filter, $components, $property = null, $parameter = null ) {
global $need_post_filter, $range_filter, $target_collection;
$parameter_match_num = 0;
function SqlFilterFragment( $filter, $components, $property = null, $parameter = null) {
global $need_post_filter, $range_filter, $target_collection, $parameter_match_num;
$sql = "";
$params = array();
if ( !is_array($filter) ) {
@ -180,10 +182,13 @@ function SqlFilterFragment( $filter, $components, $property = null, $parameter =
$comparison = 'ILIKE';
break;
}
$params[':text_match'] = '%'.$search.'%';
$fragment = sprintf( 'AND (%s%s %s :text_match) ',
/* Append the match number to the SQL parameter, to allow multiple text match conditions within the same query */
$params[':text_match_'.$parameter_match_num] = '%'.$search.'%';
$fragment = sprintf( 'AND (%s%s %s :text_match_%s) ',
(isset($negate) && strtolower($negate) == "yes" ? $property.' IS NULL OR NOT ': ''),
$property, $comparison );
$property, $comparison, $parameter_match_num );
$parameter_match_num++;
dbg_error_log('calquery', ' text-match: %s', $fragment );
$sql .= $fragment;
break;
@ -233,6 +238,7 @@ function SqlFilterFragment( $filter, $components, $property = null, $parameter =
case 'COMPLETED': /** @todo this should be moved into the properties supported in SQL. */
default:
$need_post_filter = true;
unset($subproperty);
dbg_error_log("calquery", "Could not handle 'prop-filter' on %s in SQL", $propertyname );
continue;
}

View File

@ -47,13 +47,24 @@ if ( empty($properties) ) $properties['DAV::allprop'] = 1;
* There can only be *one* FILTER element.
*/
$qry_filters = $xmltree->GetPath('/urn:ietf:params:xml:ns:carddav:addressbook-query/urn:ietf:params:xml:ns:carddav:filter/*');
if ( count($qry_filters) != 1 ) {
/* $qry_filters = $qry_filters[0]; // There can only be one FILTER element
}
else { */
if ( count($qry_filters) == 0 ) {
$qry_filters = false;
}
$qry_limit = -1; // everything
$qry_filters_combination='OR';
if ( is_array($qry_filters) ) {
$filters_parent = $xmltree->GetPath('/urn:ietf:params:xml:ns:carddav:addressbook-query/urn:ietf:params:xml:ns:carddav:filter')[0];
// only anyof (OR) or allof (AND) allowed, if missing anyof is default (RFC6352 10.5)
if ( $filters_parent->GetAttribute("test") == 'allof' ) {
$qry_filters_combination='AND';
}
$limits = $xmltree->GetPath('/urn:ietf:params:xml:ns:carddav:addressbook-query/urn:ietf:params:xml:ns:carddav:limit/urn:ietf:params:xml:ns:carddav:nresults');
if ( count($limits) == 1) {
$qry_limit = intval($limits[0]->GetContent());
}
}
/**
* While we can construct our SQL to apply some filters in the query, other filters
@ -61,126 +72,174 @@ else { */
*
* @param array $filter An array of XMLElement which is the filter definition
* @param string $item The database row retrieved for this calendar item
* @param string $filter_type possible values AND or OR (for OR only one filter fragment must match)
*
* @return boolean True if the check succeeded, false otherwise.
*/
function apply_filter( $filters, $item ) {
function apply_filter( $filters, $item, $filter_type) {
global $session, $c, $request;
if ( count($filters) == 0 ) return true;
dbg_error_log("cardquery","Applying filter for item '%s'", $item->dav_name );
$vcard = new vComponent( $item->caldav_data );
return $vcard->TestFilter($filters);
if ( $filter_type === 'AND' ) {
return $vcard->TestFilter($filters);
} else {
foreach($filters AS $filter) {
$filter_fragment[0] = $filter;
if ( $vcard->TestFilter($filter_fragment) ) {
return true;
}
}
return false;
}
}
/**
* Process a filter fragment returning an SQL fragment
*/
$need_post_filter = false;
$post_filters = array();
$matchnum = 0;
function SqlFilterCardDAV( $filter, $components, $property = null, $parameter = null ) {
global $need_post_filter, $target_collection, $matchnum;
global $post_filters, $target_collection, $matchnum;
$sql = "";
$params = array();
if ( !is_array($filter) ) {
dbg_error_log( "cardquery", "Filter is of type '%s', but should be an array of XML Tags.", gettype($filter) );
}
foreach( $filter AS $k => $v ) {
$tag = $v->GetNSTag();
dbg_error_log("cardquery", "Processing $tag into SQL - %d, '%s', %d\n", count($components), $property, isset($parameter) );
$tag = $filter->GetNSTag();
dbg_error_log("cardquery", "Processing $tag into SQL - %d, '%s', %d\n", count($components), $property, isset($parameter) );
$not_defined = "";
switch( $tag ) {
case 'urn:ietf:params:xml:ns:carddav:text-match':
$search = $v->GetContent();
$negate = $v->GetAttribute("negate-condition");
$collation = $v->GetAttribute("collation");
switch( strtolower($collation) ) {
case 'i;octet':
$comparison = 'LIKE';
break;
case 'i;ascii-casemap':
case 'i;unicode-casemap':
default:
$comparison = 'ILIKE';
break;
$not_defined = "";
switch( $tag ) {
case 'urn:ietf:params:xml:ns:carddav:is-not-defined':
$sql .= $property . 'IS NULL';
break;
case 'urn:ietf:params:xml:ns:carddav:text-match':
if ( empty($property) ) {
return false;
}
$collation = $filter->GetAttribute("collation");
switch( strtolower($collation) ) {
case 'i;octet':
$comparison = 'LIKE';
break;
case 'i;ascii-casemap':
case 'i;unicode-casemap':
default:
$comparison = 'ILIKE';
break;
}
$search = $filter->GetContent();
$match = $filter->GetAttribute("match-type");
switch( strtolower($match) ) {
case 'equals':
break;
case 'starts-with':
$search = $search.'%';
break;
case 'ends-with':
$search = $search.'%';
break;
case 'contains':
default:
$search = '%'.$search.'%';
break;
}
$pname = ':text_match_'.$matchnum++;
$params[$pname] = $search;
$negate = $filter->GetAttribute("negate-condition");
$negate = ( (isset($negate) && strtolower($negate) ) == "yes" ) ? "NOT " : "";
dbg_error_log("cardquery", " text-match: (%s%s %s '%s') ", $negate, $property, $comparison, $search );
$sql .= sprintf( "(%s%s %s $pname)", $negate, $property, $comparison );
break;
case 'urn:ietf:params:xml:ns:carddav:prop-filter':
$propertyname = $filter->GetAttribute("name");
switch( $propertyname ) {
case 'VERSION':
case 'UID':
case 'NICKNAME':
case 'FN':
case 'NOTE':
case 'ORG':
case 'URL':
case 'FBURL':
case 'CALADRURI':
case 'CALURI':
$property = strtolower($propertyname);
break;
case 'N':
$property = 'name';
break;
default:
$post_filters[] = $filter;
dbg_error_log("cardquery", "Could not handle 'prop-filter' on %s in SQL", $propertyname );
return false;
}
$test_type = $filter->GetAttribute("test");
switch( $test_type ) {
case 'allOf':
$test_type = 'AND';
break;
case 'anyOf':
default:
$test_type = 'OR';
}
$subfilters = $filter->GetContent();
if (count($subfilters) <= 1) {
$success = SqlFilterCardDAV( $subfilters[0], $components, $property, $parameter );
if ( $success !== false ) {
$sql .= $success['sql'];
$params = array_merge( $params, $success['params'] );
}
$pname = ':text_match_'.$matchnum++;
$match_type = $v->GetAttribute("match-type");
switch( strtolower($match_type) ) {
case 'starts-with':
$params[$pname] = $search.'%';
break;
case 'ends-with':
$params[$pname] = '%'.$search;
break;
case 'equals':
$params[$pname] = $search;
case 'contains':
default:
$params[$pname] = '%'.$search.'%';
break;
} else {
$subfilter_added_counter=0;
foreach ($subfilters as $subfilter) {
$success = SqlFilterCardDAV( $subfilter, $components, $property, $parameter );
if ( $success === false ) continue; else {
if ($subfilter_added_counter <= 0) {
$sql .= '(' . $success['sql'];
} else {
$sql .= $test_type . ' ' . $success['sql'];
}
$params = array_merge( $params, $success['params'] );
$subfilter_added_counter++;
}
}
dbg_error_log("cardquery", " text-match: (%s%s %s '%s') ", (isset($negate) && strtolower($negate) == "yes" ? "NOT ": ""),
$property, $comparison, $params[$pname] );
$sql .= sprintf( "AND (%s%s %s $pname) ", (isset($negate) && strtolower($negate) == "yes" ? "NOT ": ""),
$property, $comparison );
break;
case 'urn:ietf:params:xml:ns:carddav:prop-filter':
$propertyname = $v->GetAttribute("name");
switch( $propertyname ) {
case 'VERSION':
case 'UID':
case 'NICKNAME':
case 'FN':
case 'NOTE':
case 'ORG':
case 'URL':
case 'FBURL':
case 'CALADRURI':
case 'CALURI':
$property = strtolower($propertyname);
break;
case 'N':
$property = 'name';
break;
default:
$need_post_filter = true;
dbg_error_log("cardquery", "Could not handle 'prop-filter' on %s in SQL", $propertyname );
continue;
if ($subfilter_added_counter > 0) {
$sql .= ')';
}
$subfilter = $v->GetContent();
$success = SqlFilterCardDAV( $subfilter, $components, $property, $parameter );
if ( $success === false ) continue; else {
$sql .= $success['sql'];
$params = array_merge( $params, $success['params'] );
}
break;
}
break;
case 'urn:ietf:params:xml:ns:carddav:param-filter':
$need_post_filter = true;
return false; /** Figure out how to handle PARAM-FILTER conditions in the SQL */
/*
$parameter = $v->GetAttribute("name");
$subfilter = $v->GetContent();
$success = SqlFilterCardDAV( $subfilter, $components, $property, $parameter );
if ( $success === false ) continue; else {
$sql .= $success['sql'];
$params = array_merge( $params, $success['params'] );
}
break;
*/
case 'urn:ietf:params:xml:ns:carddav:param-filter':
$post_filters[] = $filter;
return false; /** Figure out how to handle PARAM-FILTER conditions in the SQL */
/*
$parameter = $filter->GetAttribute("name");
$subfilter = $filter->GetContent();
$success = SqlFilterCardDAV( $subfilter, $components, $property, $parameter );
if ( $success === false ) continue; else {
$sql .= $success['sql'];
$params = array_merge( $params, $success['params'] );
}
break;
*/
default:
dbg_error_log("cardquery", "Could not handle unknown tag '%s' in calendar query report", $tag );
break;
}
default:
dbg_error_log("cardquery", "Could not handle unknown tag '%s' in calendar query report", $tag );
break;
}
dbg_error_log("cardquery", "Generated SQL was '%s'", $sql );
return array( 'sql' => $sql, 'params' => $params );
@ -213,23 +272,50 @@ $params = array();
$where = ' WHERE caldav_data.collection_id = ' . $target_collection->resource_id();
if ( is_array($qry_filters) ) {
dbg_log_array( 'cardquery', 'qry_filters', $qry_filters, true );
$components = array();
$filter_fragment = SqlFilterCardDAV( $qry_filters, $components );
if ( $filter_fragment !== false ) {
$where .= ' '.$filter_fragment['sql'];
$params = $filter_fragment['params'];
$appended_where_counter=0;
foreach ($qry_filters as $qry_filter) {
$components = array();
$filter_fragment = SqlFilterCardDAV( $qry_filter, $components );
if ( $filter_fragment !== false ) {
$filter_fragment_sql = $filter_fragment['sql'];
if ( empty($filter_fragment_sql) ) {
continue;
}
if ( $appended_where_counter == 0 ) {
$where .= ' AND (' . $filter_fragment_sql;
$params = $filter_fragment['params'];
} else {
$where .= ' ' . $qry_filters_combination . ' ' . $filter_fragment_sql;
$params = array_merge( $params, $filter_fragment['params'] );
}
$appended_where_counter++;
}
}
if ( $appended_where_counter > 0 ) {
$where .= ')';
}
}
else {
dbg_error_log( 'cardquery', 'No query filters' );
}
$need_post_filter = !empty($post_filters);
if ( $need_post_filter && ( $qry_filters_combination == 'OR' )) {
// we need a post_filter step, and it should be sufficient, that only one
// filter is enough to display the item => we can't prefilter values via SQL
$where = '';
$params = array();
$post_filters = $qry_filters;
}
$sql = 'SELECT * FROM caldav_data INNER JOIN addressbook_resource USING(dav_id)'. $where;
if ( isset($c->strict_result_ordering) && $c->strict_result_ordering ) $sql .= " ORDER BY dav_id";
$qry = new AwlQuery( $sql, $params );
if ( $qry->Exec("cardquery",__LINE__,__FILE__) && $qry->rows() > 0 ) {
while( $address_object = $qry->Fetch() ) {
if ( !$need_post_filter || apply_filter( $qry_filters, $address_object ) ) {
if ( !$need_post_filter || apply_filter( $post_filters, $address_object, $qry_filters_combination ) ) {
if ( $bound_from != $target_collection->dav_name() ) {
$address_object->dav_name = str_replace( $bound_from, $target_collection->dav_name(), $address_object->dav_name);
}
@ -239,9 +325,12 @@ if ( $qry->Exec("cardquery",__LINE__,__FILE__) && $qry->rows() > 0 ) {
$address_object->caldav_data = $vcard->Render();
}
$responses[] = component_to_xml( $properties, $address_object );
if ( ($qry_limit > 0) && ( count($responses) >= $qry_limit ) ) {
break;
}
}
}
}
$multistatus = new XMLElement( "multistatus", $responses, $reply->GetXmlNsArray() );
$request->XMLResponse( 207, $multistatus );
$request->XMLResponse( 207, $multistatus );

View File

@ -84,10 +84,19 @@ function IMAP_PAM_check($username, $password ){
$fullname = $username;
}
// ensure email domain is not doubled in email field
@list($tmp_user, $tmp_domain) = explode('@', $username);
if( empty($tmp_domain) ) {
$email_address = $username . "@" . $c->authenticate_hook['config']['email_base'];
}
else {
$email_address = $username;
}
$principal->Create( array(
'username' => $username,
'user_active' => true,
'email' => $username . "@" . $c->authenticate_hook['config']['email_base'],
'email' => $email_address,
'modified' => date('c'),
'fullname' => $fullname
));

View File

@ -48,6 +48,8 @@ class ldapDrivers
ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, $config['protocolVersion']);
if (isset($config['optReferrals']))
ldap_set_option($this->connect, LDAP_OPT_REFERRALS, $config['optReferrals']);
if (isset($config['networkTimeout']))
ldap_set_option($this->connect, LDAP_OPT_NETWORK_TIMEOUT, $config['networkTimeout']);
if ($port)
$this->connect=ldap_connect($host, $port);
@ -117,6 +119,7 @@ class ldapDrivers
global $c;
$query = $this->ldap_query_all;
$ret = array();
foreach($this->baseDNUsers as $baseDNUsers) {
$entry = $query($this->connect,$baseDNUsers,$this->filterUsers,$attributes);
@ -148,6 +151,7 @@ class ldapDrivers
global $c;
$query = $this->ldap_query_all;
$ret = array();
foreach($this->baseDNGroups as $baseDNGroups) {
$entry = $query($this->connect,$baseDNGroups,$this->filterGroups,$attributes);
@ -410,6 +414,16 @@ function LDAP_check($username, $password ){
}
function fix_unique_member($list) {
$fixed_list = array();
foreach ( $list as $member ){
list( $mem, $rest ) = explode(",", $member );
$member = str_replace( 'uid=', '', $mem );
array_unshift( $fixed_list, $member );
}
return $fixed_list;
}
/**
* sync LDAP Groups against the DB
*/
@ -500,6 +514,10 @@ function sync_LDAP_groups(){
Principal::cacheDelete('username', $group);
$c->messages[] = sprintf(i18n('- adding users %s to group : %s'),join(',',$ldap_groups_info[$group][$mapping['members']]),$group);
foreach ( $ldap_groups_info[$group][$mapping['members']] as $member ){
if ( $member_field == 'uniqueMember' ) {
list( $mem, $rest ) = explode(",", $member );
$member = str_replace( 'uid=', '', $mem );
}
$qry = new AwlQuery( "INSERT INTO group_member SELECT g.principal_id AS group_id,u.principal_id AS member_id FROM dav_principal g, dav_principal u WHERE g.username=:group AND u.username=:member;",array (':group'=>$group,':member'=>$member) );
$qry->Exec('sync_LDAP_groups',__LINE__,__FILE__);
Principal::cacheDelete('username', $member);
@ -512,6 +530,9 @@ function sync_LDAP_groups(){
foreach ( $groups_to_update as $group ){
$db_members = array_values ( $db_group_members[$group] );
$ldap_members = array_values ( $ldap_groups_info[$group][$member_field] );
if ( $member_field == 'uniqueMember' ) {
$ldap_members = fix_unique_member( $ldap_members );
}
$add_users = array_diff ( $ldap_members, $db_members );
if ( sizeof ( $add_users ) ){
$c->messages[] = sprintf(i18n('- adding %s to group : %s'),join(', ', $add_users ), $group);

View File

@ -22,9 +22,9 @@ function create_external ( $path,$is_calendar,$is_addressbook )
if ($is_calendar) $resourcetypes .= '<urn:ietf:params:xml:ns:caldav:calendar/>';
$qry = new AwlQuery();
if ( ! $qry->QDo( 'INSERT INTO collection ( user_no, parent_container, dav_name, dav_etag, dav_displayname,
is_calendar, is_addressbook, resourcetypes, created, modified )
is_calendar, is_addressbook, resourcetypes, created )
VALUES( :user_no, :parent_container, :dav_name, :dav_etag, :dav_displayname,
:is_calendar, :is_addressbook, :resourcetypes, current_timestamp, current_timestamp )',
:is_calendar, :is_addressbook, :resourcetypes, current_timestamp )',
array(
':user_no' => $request->user_no,
':parent_container' => '/.external/',
@ -55,43 +55,48 @@ function fetch_external ( $bind_id, $min_age = '1 hour' )
$sql .= ' ORDER BY modified DESC LIMIT 1';
$qry = new AwlQuery( $sql, $params );
if ( $qry->Exec('DAVResource') && $qry->rows() > 0 && $row = $qry->Fetch() ) {
$local_ts = new DateTime($row->modified);
$curl = curl_init ( $row->external_url );
curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt ( $curl, CURLOPT_HEADER, true );
curl_setopt ( $curl, CURLOPT_FILETIME, true );
curl_setopt ( $curl, CURLOPT_NOBODY, true );
curl_setopt ( $curl, CURLOPT_TIMEVALUE, $local_ts->format("U") );
curl_setopt ( $curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE );
dbg_error_log("external", "checking external resource for remote changes " . $row->external_url );
$ics = curl_exec ( $curl );
$info = curl_getinfo ( $curl );
if ( $info['http_code'] === 304 || isset($info['filetime']) && new DateTime("@" . $info['filetime']) <= $local_ts ) {
dbg_error_log("external", "external resource unchanged " . $info['filetime'] . ' < ' . $local_ts->getTimestamp() );
curl_close ( $curl );
// BUGlet: should track server-time instead of local-time
$qry = new AwlQuery( 'UPDATE collection SET modified=NOW() WHERE collection_id = :cid', array ( ':cid' => $row->collection_id ) );
$qry->Exec('DAVResource');
return true;
if ( $row->modified ) {
$local_ts = new DateTime($row->modified);
curl_setopt ( $curl, CURLOPT_HEADER, true );
curl_setopt ( $curl, CURLOPT_FILETIME, true );
curl_setopt ( $curl, CURLOPT_NOBODY, true );
curl_setopt ( $curl, CURLOPT_TIMEVALUE, $local_ts->format("U") );
curl_setopt ( $curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE );
dbg_error_log("external", "checking external resource for remote changes " . $row->external_url );
$ics = curl_exec ( $curl );
$info = curl_getinfo ( $curl );
if ( $info['http_code'] === 304 || (isset($info['filetime']) && $info['filetime'] != -1 && new DateTime("@" . $info['filetime']) <= $local_ts )) {
dbg_error_log("external", "external resource unchanged " . $info['filetime'] . ' < ' . $local_ts->getTimestamp() . ' (' . $info['http_code'] . ')');
curl_close ( $curl );
// BUGlet: should track server-time instead of local-time
$qry = new AwlQuery( 'UPDATE collection SET modified=NOW() WHERE collection_id = :cid', array ( ':cid' => $row->collection_id ) );
$qry->Exec('DAVResource');
return true;
}
dbg_error_log("external", "external resource changed, re importing" . $info['filetime'] );
}
else {
dbg_error_log("external", "fetching external resource for the first time " . $row->external_url );
}
dbg_error_log("external", "external resource changed, re importing" . $info['filetime'] );
curl_setopt ( $curl, CURLOPT_NOBODY, false );
curl_setopt ( $curl, CURLOPT_HEADER, false );
$ics = curl_exec ( $curl );
curl_close ( $curl );
if ( is_string ( $ics ) && strlen ( $ics ) > 20 ) {
// BUGlet: should track server-time instead of local-time
$qry = new AwlQuery( 'UPDATE collection SET modified=NOW(), dav_etag=:etag WHERE collection_id = :cid',
array ( ':cid' => $row->collection_id, ':etag' => md5($ics) ) );
$qry->Exec('DAVResource');
// BUGlet: should track server-time instead of local-time
$qry = new AwlQuery( 'UPDATE collection SET modified=NOW(), dav_etag=:etag WHERE collection_id = :cid',
array ( ':cid' => $row->collection_id, ':etag' => md5($ics) ) );
$qry->Exec('DAVResource');
require_once ( 'caldav-PUT-functions.php');
import_collection ( $ics , $row->user_no, $row->path, 'External Fetch' , false ) ;
return true;
}
}
else {
dbg_error_log("external", "external resource up to date or not found id(%s)", $bind_id );
}
}
else {
dbg_error_log("external", "external resource up to date or not found id(%s)", $bind_id );
}
return false;
}