diff --git a/CREDITS b/CREDITS
index d8d9bb67..a1dd165b 100644
--- a/CREDITS
+++ b/CREDITS
@@ -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
+Andrew McMillan
+Andrew Ruthven
+Aurelien Requiem
+Christian Kier
+Christoph Anton Mitterer
+Cyril Giraud
+Daniel Aleksandersen
+DAViCal Administrator
+Dávid Takács
+Emmanuel Seyman
+fbiete@gmail.com
+Felix Möller
+Florian Schlichting
+Francois Marier
+Francois Perichon
+Frank Steinberg
+Henri Sivonen
+Ján Máté
+Jason Alavaliant
+Jens Zahner
+Jeppe Bob Dyrby
+Jeroen van Disseldorp
+Jim Fenton
+Jim Hague
+lebarjack
+Leho Kraav
+Masahiro Mikami
+Matthias Althaus
+Matthias Beyer
+Matthias Mohr
+Maxime Delorme
+Michael Trausch
+Milan Medlik
+Patrick Näf Moser
+Paul Willoughby
+Peter Schaefer-Hutter
+Philipp Matthias Hahn
+Raphael Hertzog
+Rob Ostensen
+Vincent Van Houtte
+Wolfgang Herget
diff --git a/Makefile b/Makefile
index 56002fc7..21952e67 100755
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/dba/better_perms.sql b/dba/better_perms.sql
index 0fe1837d..35c1e4b1 100644
--- a/dba/better_perms.sql
+++ b/dba/better_perms.sql
@@ -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;
diff --git a/dba/caldav_functions.sql b/dba/caldav_functions.sql
index 5be1fc1e..9733a007 100644
--- a/dba/caldav_functions.sql
+++ b/dba/caldav_functions.sql
@@ -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;
diff --git a/dba/davical.sql b/dba/davical.sql
index 347ebc34..e1f28097 100644
--- a/dba/davical.sql
+++ b/dba/davical.sql
@@ -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();
diff --git a/dba/patches/1.1.12.sql b/dba/patches/1.1.12.sql
index b50a6da1..dde540d4 100644
--- a/dba/patches/1.1.12.sql
+++ b/dba/patches/1.1.12.sql
@@ -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();
diff --git a/dba/patches/1.1.12a.sql b/dba/patches/1.1.12a.sql
index 525da349..5c364afe 100644
--- a/dba/patches/1.1.12a.sql
+++ b/dba/patches/1.1.12a.sql
@@ -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();
diff --git a/dba/patches/1.2.1.sql b/dba/patches/1.2.1.sql
index 197a6457..0b530c4b 100644
--- a/dba/patches/1.2.1.sql
+++ b/dba/patches/1.2.1.sql
@@ -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();
diff --git a/dba/patches/1.2.10a.sql b/dba/patches/1.2.10a.sql
index 02d5f25d..d75fd020 100644
--- a/dba/patches/1.2.10a.sql
+++ b/dba/patches/1.2.10a.sql
@@ -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
diff --git a/dba/patches/1.2.1a.sql b/dba/patches/1.2.1a.sql
index 648cb7c3..c7f3b90a 100644
--- a/dba/patches/1.2.1a.sql
+++ b/dba/patches/1.2.1a.sql
@@ -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();
diff --git a/dba/patches/1.2.1b.sql b/dba/patches/1.2.1b.sql
index f4e006da..7d346c44 100644
--- a/dba/patches/1.2.1b.sql
+++ b/dba/patches/1.2.1b.sql
@@ -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();
diff --git a/dba/patches/1.2.6.sql b/dba/patches/1.2.6.sql
index 7fb6e532..6672b0f0 100644
--- a/dba/patches/1.2.6.sql
+++ b/dba/patches/1.2.6.sql
@@ -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']);
diff --git a/dba/patches/1.2.7.sql b/dba/patches/1.2.7.sql
index 1b5147d2..d0c6ba88 100644
--- a/dba/patches/1.2.7.sql
+++ b/dba/patches/1.2.7.sql
@@ -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;
diff --git a/dba/rrule_functions-8.1.sql b/dba/rrule_functions-8.1.sql
index 0175c8c6..b5108f2c 100644
--- a/dba/rrule_functions-8.1.sql
+++ b/dba/rrule_functions-8.1.sql
@@ -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;
diff --git a/dba/rrule_functions.sql b/dba/rrule_functions.sql
index 1ea896d4..11691034 100644
--- a/dba/rrule_functions.sql
+++ b/dba/rrule_functions.sql
@@ -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;
diff --git a/debian/changelog b/debian/changelog
index 55a56149..4e49e857 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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 didn’t contain any useful information.
- -- Andrew McMillan 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 Sun, 14 Sep 2014 15:29:54 +0200
davical (1.1.1-1) unstable; urgency=high
diff --git a/debian/compat b/debian/compat
index 7ed6ff82..ec635144 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+9
diff --git a/debian/control b/debian/control
index f5ab02cd..351b6415 100644
--- a/debian/control
+++ b/debian/control
@@ -1,18 +1,28 @@
Source: davical
Section: web
Priority: extra
-Maintainer: Andrew McMillan
-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
+Uploaders: Andrew McMillan ,
+ Florian Schlichting
+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.
-
diff --git a/debian/copyright b/debian/copyright
index 5e9e0932..b7f165fa 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,47 +1,105 @@
-This package was debianized by Andrew McMillan
+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
+ 2006 - 2008, Catalyst IT Ltd
+ 2008 - 2013, Morphoss Ltd
+ 2007 - 2014, Davical contributors (see CREDITS for details)
+License: GPL-2+
-Upstream Author: Andrew McMillan
+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
+ 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
+ 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
+ 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
+ 2014, Florian Schlichting
+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
- Copyright 2001-2002 Chuck Hagenbuch
- Copyright 2001-2002 Jan Schneider
- Copyright 2002-2003 Bharat Mediratta
- Copyright 2006-2008 Andrew McMillan
+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'.
diff --git a/debian/davical-doc.doc-base.api b/debian/davical-doc.doc-base.api
new file mode 100644
index 00000000..9063dbea
--- /dev/null
+++ b/debian/davical-doc.doc-base.api
@@ -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
diff --git a/debian/davical-doc.doc-base.website b/debian/davical-doc.doc-base.website
new file mode 100644
index 00000000..87c619df
--- /dev/null
+++ b/debian/davical-doc.doc-base.website
@@ -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
diff --git a/debian/davical-doc.links b/debian/davical-doc.links
new file mode 100644
index 00000000..6dc6ef07
--- /dev/null
+++ b/debian/davical-doc.links
@@ -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
diff --git a/debian/rules b/debian/rules
index 1f6d0525..f940aa7f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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- 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
diff --git a/debian/source/format b/debian/source/format
index 89ae9db8..163aaf8d 100644
--- a/debian/source/format
+++ b/debian/source/format
@@ -1 +1 @@
-3.0 (native)
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 00000000..1b500d77
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+https://gitlab.com/davical-project/davical/tags \/davical-project\/davical\/repository\/archive.tar.gz\?ref=r([\d.]*)
diff --git a/docs/website/images/flattr-badge-large.png b/docs/website/images/flattr-badge-large.png
deleted file mode 100644
index c03a4fa3..00000000
Binary files a/docs/website/images/flattr-badge-large.png and /dev/null differ
diff --git a/docs/website/images/paypal_donate_button.png b/docs/website/images/paypal_donate_button.png
deleted file mode 100644
index c0e367a2..00000000
Binary files a/docs/website/images/paypal_donate_button.png and /dev/null differ
diff --git a/docs/website/inc/page-footer.php b/docs/website/inc/page-footer.php
index 7c764d02..3a1db181 100644
--- a/docs/website/inc/page-footer.php
+++ b/docs/website/inc/page-footer.php
@@ -11,11 +11,7 @@ echo $tags_to_be_closed;
XHTML | CSS
-Copyright 2007-2011 | Andrew McMillan
-
-
-
-
+Copyright 2007-2014 | Andrew McMillan
diff --git a/docs/website/index.php b/docs/website/index.php
index 6c6e0d0e..6122a2dc 100644
--- a/docs/website/index.php
+++ b/docs/website/index.php
@@ -3,8 +3,9 @@
include("inc/page-header.php");
?>
About DAViCal
-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.
+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.
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.
-Getting DAViCal and Installing DAViCal
-You can download DAViCal from http://debian.mcmillan.net.nz/
-Start looking on the DAViCal Installation Page for more places to download, and
+
Getting and Installing DAViCal
+Start by looking on the DAViCal
+ Installation Page for instructions on places to download, and
detailed instructions as to what to do when you have it.
There is a lot of information on the wiki about DAViCal configuration settings but in most cases the configuration
will need very few of these settings.
@@ -71,15 +72,6 @@ CalDAV server:
writing and reviewing patches
designing future functionality
thinking of more interesting ways to contribute to DAViCal!
-you could also something or
-
-
-since paid work is my biggest distraction from free software.
Can you think of more?
diff --git a/docs/website/installation.php b/docs/website/installation.php
index 353d672e..6c199551 100644
--- a/docs/website/installation.php
+++ b/docs/website/installation.php
@@ -5,73 +5,41 @@
Before Starting
Debian Users
-Ideally you will be running a recent Debian (or Ubuntu) release and will
-be able to add:
-
-deb http://debian.mcmillan.net.nz/debian lenny awm
-
-to your /etc/apt/sources.list. Once you have done that you
-can use apt-get or synaptic or some other equivalent package
-manager to fetch and install DAViCal and all the dependencies.
-
-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:
-
-
-sudo apt-key advanced --keyserver pgp.net.nz --recv-keys F6E0FA5CF0307507BB23A512EAFCFEBF8FEB8EBF
-
-
-Skip to the "Database Setup" part if you have done that already.
-
+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.
Other Linux Users
-Please write something up about your experiences in the Wiki, adding distribution specific
-notes to pages somewhere under here:
- http://wiki.davical.org/w/Installation_Stuff
+The DAViCal wiki 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.
-RPM Packages of DAViCal
-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!
+In many cases, you will need to download the latest versions of
+the DAViCal and awl packages from
+the repository on
+GitLab. More details on this are on
+the Downloading
+ page on the wiki.
-SuSE Linux
-On SuSE Linux you may need to look in /var/lib/pgsql/data/ for the pg_hba.conf file.
-
-Gentoo
-Davical and the awl library ebuilds are available on the sunrise overlay.
-You'll have to add this overlay to your system:
-
-emerge layman
-layman -f -a sunrise
-echo "source /usr/portage/local/layman/make.conf" >> /etc/make.conf
-
-
-From there, you can keep the overlay in sync with the command:
-layman -s sunrise
-
-Davical can now be installed with a normal:
-emerge davical
-
-Slackware, BSD and the rest
-
-You will need to download the latest versions of the DAViCal and awl packages
-from the sourceforge download page for DAViCal.
-You will need to untar these. Preferably you will untar them from within the "/usr/share" 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).
-
-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.
+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.
Non-Linux Users
-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.
-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.
+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.
+
+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.
We're available to answer questions, anyway :-)
Pre-requisites
@@ -94,7 +62,7 @@ if you want to increase the security or scalability of your
installation.
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
diff --git a/inc/caldav-PUT-functions.php b/inc/caldav-PUT-functions.php
index e30ee372..bd5d55cc 100644
--- a/inc/caldav-PUT-functions.php
+++ b/inc/caldav-PUT-functions.php
@@ -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
diff --git a/inc/caldav-PUT-vcard.php b/inc/caldav-PUT-vcard.php
index 8bb7dafe..0da06bc3 100644
--- a/inc/caldav-PUT-vcard.php
+++ b/inc/caldav-PUT-vcard.php
@@ -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 ) {
diff --git a/inc/caldav-REPORT-calquery.php b/inc/caldav-REPORT-calquery.php
index 365b8905..63c77f97 100644
--- a/inc/caldav-REPORT-calquery.php
+++ b/inc/caldav-REPORT-calquery.php
@@ -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;
}
diff --git a/inc/caldav-REPORT-cardquery.php b/inc/caldav-REPORT-cardquery.php
index fdc82149..07b4e6b3 100644
--- a/inc/caldav-REPORT-cardquery.php
+++ b/inc/caldav-REPORT-cardquery.php
@@ -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 );
\ No newline at end of file
diff --git a/inc/drivers_imap_pam.php b/inc/drivers_imap_pam.php
index f3260657..cac06f1e 100644
--- a/inc/drivers_imap_pam.php
+++ b/inc/drivers_imap_pam.php
@@ -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
));
diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php
index 8e5cb452..52e37762 100644
--- a/inc/drivers_ldap.php
+++ b/inc/drivers_ldap.php
@@ -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);
diff --git a/inc/external-fetch.php b/inc/external-fetch.php
index 6417feb5..1c2937a2 100644
--- a/inc/external-fetch.php
+++ b/inc/external-fetch.php
@@ -22,9 +22,9 @@ function create_external ( $path,$is_calendar,$is_addressbook )
if ($is_calendar) $resourcetypes .= '';
$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;
}