From b4b04844fe21d8b89438f643f539a1993997299f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 24 Sep 2011 21:15:44 +0000 Subject: [PATCH] added two more match-type values from CardDAV:text-match --- phpgwapi/inc/class.groupdav_principals.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpgwapi/inc/class.groupdav_principals.inc.php b/phpgwapi/inc/class.groupdav_principals.inc.php index d4b780022c..d171946c75 100644 --- a/phpgwapi/inc/class.groupdav_principals.inc.php +++ b/phpgwapi/inc/class.groupdav_principals.inc.php @@ -310,6 +310,8 @@ class groupdav_principals extends groupdav_handler /** * Match using $match_type * + * It's not defined in WebDAV ACL, but CardDAV:text-match seems similar + * * @param string $value value to test * @param string $match criteria/sub-string * @param string $match_type='contains' or 'starts-with' @@ -318,9 +320,15 @@ class groupdav_principals extends groupdav_handler { switch($match_type) { + case 'equals': + return $value === $match; + case 'starts-with': return stripos($value, $match) === 0; + case 'ends-with': + return stripos($value, $match) === strlen($value) - strlen($match); + case 'contains': default: return stripos($value, $match) !== false;