aqhome-cgi: fixed ids of created roles (now start with 1).

This commit is contained in:
Martin Preuss
2026-04-18 16:15:42 +02:00
parent e5f9be1bff
commit cc3c9dbd57
5 changed files with 10 additions and 7 deletions

View File

@@ -99,7 +99,7 @@ void _createPermDefList(AQH_MODULE *m)
void _createRoleList(AQH_MODULE *m) void _createRoleList(AQH_MODULE *m)
{ {
AQH_ROLE_LIST *roleList; AQH_ROLE_LIST *roleList;
int id=0; int id=1;
roleList=AQH_Role_List_new(); roleList=AQH_Role_List_new();
AQH_ModService_AddRole(roleList, id++, "userAdmin", AQH_MODADM_PERMS_ADMINUSERS, "User administrator"); AQH_ModService_AddRole(roleList, id++, "userAdmin", AQH_MODADM_PERMS_ADMINUSERS, "User administrator");

View File

@@ -140,7 +140,7 @@ void _createPermDefList(AQH_MODULE *m)
void _createRoleList(AQH_MODULE *m) void _createRoleList(AQH_MODULE *m)
{ {
AQH_ROLE_LIST *roleList; AQH_ROLE_LIST *roleList;
int id=0; int id=1;
roleList=AQH_Role_List_new(); roleList=AQH_Role_List_new();
AQH_ModService_AddRole(roleList, id++, "admin", AQH_ModService_AddRole(roleList, id++, "admin",

View File

@@ -143,7 +143,7 @@ void _createPermDefList(AQH_MODULE *m)
void _createRoleList(AQH_MODULE *m) void _createRoleList(AQH_MODULE *m)
{ {
AQH_ROLE_LIST *roleList; AQH_ROLE_LIST *roleList;
int id=0; int id=1;
roleList=AQH_Role_List_new(); roleList=AQH_Role_List_new();
AQH_ModService_AddRole(roleList, id++, "admin", AQH_ModService_AddRole(roleList, id++, "admin",
@@ -587,10 +587,13 @@ void _readModRolesFromForm(GWEN_DB_NODE *dbPost,
GBAS(tbuf, roleName); GBAS(tbuf, roleName);
s=GWEN_DB_GetCharValue(dbPost, GWEN_Buffer_GetStart(tbuf), 0, NULL); s=GWEN_DB_GetCharValue(dbPost, GWEN_Buffer_GetStart(tbuf), 0, NULL);
/*DBG_ERROR(NULL, "Role string %s = [%s]", GWEN_Buffer_GetStart(tbuf), s?s:"<empty>");*/
if (s && *s) { if (s && *s) {
if (nextRolePos<AQH_ModulePerms_GetRoleArrayArraySize()) if (nextRolePos<AQH_ModulePerms_GetRoleArrayArraySize()) {
/*DBG_ERROR(NULL, "Setting role \"%s\" (%d)", roleName, AQH_Role_GetId(role));*/
AQH_ModulePerms_SetRoleArrayAt(modPerms, nextRolePos++, AQH_Role_GetId(role)); AQH_ModulePerms_SetRoleArrayAt(modPerms, nextRolePos++, AQH_Role_GetId(role));
} }
}
GWEN_Buffer_Crop(tbuf, 0, pos); GWEN_Buffer_Crop(tbuf, 0, pos);
} }

View File

@@ -98,7 +98,7 @@ void _createPermDefList(AQH_MODULE *m)
void _createRoleList(AQH_MODULE *m) void _createRoleList(AQH_MODULE *m)
{ {
AQH_ROLE_LIST *roleList; AQH_ROLE_LIST *roleList;
int id=0; int id=1;
roleList=AQH_Role_List_new(); roleList=AQH_Role_List_new();
AQH_ModService_AddRole(roleList, id++, "Reader", AQH_ModService_AddRole(roleList, id++, "Reader",

View File

@@ -170,7 +170,7 @@ int _saveUser(AQH_SERVICE *sv, AQH_USER *user)
return rv; return rv;
} }
//_logGroup(AQH_SERVICE_FILE_GROUP_USERS, s, db); /*_logGroup(AQH_SERVICE_FILE_GROUP_USERS, s, db);*/
rv=_saveGroupLocked(sv, AQH_SERVICE_FILE_GROUP_USERS, s, db); rv=_saveGroupLocked(sv, AQH_SERVICE_FILE_GROUP_USERS, s, db);
if (rv<0) { if (rv<0) {