aqhome-cgi: fixed ids of created roles (now start with 1).
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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:"<empty>");*/
|
||||
if (s && *s) {
|
||||
if (nextRolePos<AQH_ModulePerms_GetRoleArrayArraySize())
|
||||
AQH_ModulePerms_SetRoleArrayAt(modPerms, nextRolePos++, AQH_Role_GetId(role));
|
||||
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));
|
||||
}
|
||||
}
|
||||
GWEN_Buffer_Crop(tbuf, 0, pos);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,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++, "Reader",
|
||||
|
||||
@@ -170,7 +170,7 @@ int _saveUser(AQH_SERVICE *sv, AQH_USER *user)
|
||||
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);
|
||||
if (rv<0) {
|
||||
|
||||
Reference in New Issue
Block a user