]> git.mjollnir.org Git - s9y.git/commitdiff
fix groups when no_create is turned on for a user
authorgarvinhicking <garvinhicking>
Mon, 27 Jun 2005 17:18:44 +0000 (17:18 +0000)
committergarvinhicking <garvinhicking>
Mon, 27 Jun 2005 17:18:44 +0000 (17:18 +0000)
plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php

index 6f0a09c0ed5d2aec3d1c967759126ffed3ba6023..e0a7aab8fa62d344f8d294d30010ecf010e33763 100644 (file)
@@ -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