mirror of
https://github.com/haiwen/ccnet-server.git
synced 2025-09-03 13:54:37 +00:00
Don't import special creator 'system admin' to a group.
This commit is contained in:
@@ -274,12 +274,14 @@ create_group_common (CcnetGroupManager *mgr,
|
|||||||
if (group_id < 0)
|
if (group_id < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
g_string_printf (sql, "INSERT INTO GroupUser (group_id, user_name, is_staff) VALUES (?, ?, ?)");
|
if (g_strcmp0(user_name, "system admin") != 0) {
|
||||||
|
g_string_printf (sql, "INSERT INTO GroupUser (group_id, user_name, is_staff) VALUES (?, ?, ?)");
|
||||||
|
|
||||||
if (ccnet_db_trans_query (trans, sql->str, 3,
|
if (ccnet_db_trans_query (trans, sql->str, 3,
|
||||||
"int", group_id, "string", user_name_l,
|
"int", group_id, "string", user_name_l,
|
||||||
"int", 1) < 0)
|
"int", 1) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
if (parent_group_id == -1) {
|
if (parent_group_id == -1) {
|
||||||
g_string_printf (sql, "INSERT INTO GroupStructure (group_id, path) VALUES (?,'%d')", group_id);
|
g_string_printf (sql, "INSERT INTO GroupStructure (group_id, path) VALUES (?,'%d')", group_id);
|
||||||
|
Reference in New Issue
Block a user