From: garvinhicking Date: Mon, 27 Jun 2005 17:18:44 +0000 (+0000) Subject: fix groups when no_create is turned on for a user X-Git-Tag: 0.9~382 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=207816f6e243c798525dd80e839865c976be56eb;p=s9y.git fix groups when no_create is turned on for a user --- diff --git a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php index 6f0a09c..e0a7aab 100644 --- a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php +++ b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php @@ -436,10 +436,12 @@ class serendipity_event_entryproperties extends serendipity_event if ($use_groups) { $mygroups = serendipity_checkPermission(null, null, true); $groupcond = array(); - foreach($mygroups AS $mygroup) { + foreach((array)$mygroups AS $mygroup) { $groupcond[] .= "ep_access_groups.value LIKE '%;$mygroup;%'"; } - $conds[] = " (ep_access_groups.property IS NULL OR ep_access.value = 'member' AND (" . implode(' OR ', $groupcond) . "))"; + if (count($groupcond) > 1) { + $conds[] = " (ep_access_groups.property IS NULL OR ep_access.value = 'member' AND (" . implode(' OR ', $groupcond) . "))"; + } } } else { $conds[] = " (ep_access.property IS NULL OR ep_access.value = 'public') "; @@ -549,4 +551,4 @@ class serendipity_event_entryproperties extends serendipity_event } /* vim: set sts=4 ts=4 expandtab : */ -?> +?> \ No newline at end of file