]> git.mjollnir.org Git - s9y.git/commitdiff
propper groups
authorgarvinhicking <garvinhicking>
Fri, 10 Jun 2005 08:51:02 +0000 (08:51 +0000)
committergarvinhicking <garvinhicking>
Fri, 10 Jun 2005 08:51:02 +0000 (08:51 +0000)
include/functions_config.inc.php

index dcdaa99fc98883568716f233dd7bf0fe785419a8..3633b0f01fa962be056f3ae3a502423b4959582f 100644 (file)
@@ -913,14 +913,13 @@ function serendipity_addDefaultGroup($name, $level) {
     serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}groupconfig (id, property, value) VALUES ($gid, 'userlevel', '" . (int)$level . "')");
 
     $authors = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}authors WHERE userlevel = " . (int)$level);
-    if (!is_array($authors)) {
-        return;
-    }
-    
-    foreach($authors AS $author) {
-        serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}authorgroups (authorid, groupid) VALUES ('{$author['authorid']}', '$gid')");
-    }
     
+    if (is_array($authors)) {
+        foreach($authors AS $author) {
+            serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}authorgroups (authorid, groupid) VALUES ('{$author['authorid']}', '$gid')");
+        }
+    }    
+
     foreach($perms AS $permName => $permArray) {
         if (in_array($level, $permArray)) {
             serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}groupconfig (id, property, value) VALUES ($gid, '" . serendipity_db_escape_string($permName) . "', 'true')");