From 6b84d3f8fc328f1b073d1fbb9ff58851f925384c Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Fri, 10 Jun 2005 08:51:02 +0000 Subject: [PATCH] propper groups --- include/functions_config.inc.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index dcdaa99..3633b0f 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -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')"); -- 2.39.5