From cc3c9dbd57c0c1c8fb8ab0a5fa6577c02b768667 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Sat, 18 Apr 2026 16:15:42 +0200 Subject: [PATCH] aqhome-cgi: fixed ids of created roles (now start with 1). --- apps/aqhome-cgi/modules/common/madmin.c | 2 +- apps/aqhome-cgi/modules/common/mmodules.c | 2 +- apps/aqhome-cgi/modules/common/musers.c | 9 ++++++--- apps/aqhome-cgi/modules/devices/mdevices_init.c | 2 +- apps/aqhome-cgi/service_file.c | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/aqhome-cgi/modules/common/madmin.c b/apps/aqhome-cgi/modules/common/madmin.c index 429ec24..b67f382 100644 --- a/apps/aqhome-cgi/modules/common/madmin.c +++ b/apps/aqhome-cgi/modules/common/madmin.c @@ -99,7 +99,7 @@ void _createPermDefList(AQH_MODULE *m) void _createRoleList(AQH_MODULE *m) { AQH_ROLE_LIST *roleList; - int id=0; + int id=1; roleList=AQH_Role_List_new(); AQH_ModService_AddRole(roleList, id++, "userAdmin", AQH_MODADM_PERMS_ADMINUSERS, "User administrator"); diff --git a/apps/aqhome-cgi/modules/common/mmodules.c b/apps/aqhome-cgi/modules/common/mmodules.c index 8458b9a..8d3eba5 100644 --- a/apps/aqhome-cgi/modules/common/mmodules.c +++ b/apps/aqhome-cgi/modules/common/mmodules.c @@ -140,7 +140,7 @@ void _createPermDefList(AQH_MODULE *m) void _createRoleList(AQH_MODULE *m) { AQH_ROLE_LIST *roleList; - int id=0; + int id=1; roleList=AQH_Role_List_new(); AQH_ModService_AddRole(roleList, id++, "admin", diff --git a/apps/aqhome-cgi/modules/common/musers.c b/apps/aqhome-cgi/modules/common/musers.c index 2c6dfe0..2514200 100644 --- a/apps/aqhome-cgi/modules/common/musers.c +++ b/apps/aqhome-cgi/modules/common/musers.c @@ -143,7 +143,7 @@ void _createPermDefList(AQH_MODULE *m) void _createRoleList(AQH_MODULE *m) { AQH_ROLE_LIST *roleList; - int id=0; + int id=1; roleList=AQH_Role_List_new(); AQH_ModService_AddRole(roleList, id++, "admin", @@ -587,9 +587,12 @@ void _readModRolesFromForm(GWEN_DB_NODE *dbPost, GBAS(tbuf, roleName); s=GWEN_DB_GetCharValue(dbPost, GWEN_Buffer_GetStart(tbuf), 0, NULL); + /*DBG_ERROR(NULL, "Role string %s = [%s]", GWEN_Buffer_GetStart(tbuf), s?s:"");*/ if (s && *s) { - if (nextRolePos