1
0
mirror of https://github.com/haiwen/ccnet-server.git synced 2025-09-01 12:56:27 +00:00

Don't import special creator 'system admin' to a group.

This commit is contained in:
cuihaikuo
2018-04-19 18:19:38 +08:00
parent 9278154919
commit c095959cce

View File

@@ -274,12 +274,14 @@ create_group_common (CcnetGroupManager *mgr,
if (group_id < 0)
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,
"int", group_id, "string", user_name_l,
"int", 1) < 0)
goto error;
if (ccnet_db_trans_query (trans, sql->str, 3,
"int", group_id, "string", user_name_l,
"int", 1) < 0)
goto error;
}
if (parent_group_id == -1) {
g_string_printf (sql, "INSERT INTO GroupStructure (group_id, path) VALUES (?,'%d')", group_id);