diff --git a/apps/aqhome-cgi/modules/common/mmodules.c b/apps/aqhome-cgi/modules/common/mmodules.c index a0b4630..e8d87fc 100644 --- a/apps/aqhome-cgi/modules/common/mmodules.c +++ b/apps/aqhome-cgi/modules/common/mmodules.c @@ -72,7 +72,7 @@ static uint32_t _readPermissionsFromForm(GWEN_DB_NODE *dbPost, const AQH_PERMDEF * ------------------------------------------------------------------------------------------------ */ -AQH_MODSERVICE_HANDLER_ENTRY _requestTable[]={ +static AQH_MODSERVICE_HANDLER_ENTRY _requestTable[]={ {"index.html", AQCGI_REQUEST_METHOD_GET, AQH_MODADMMODULES_PERMS_MODULESREAD, _handleRqIndex}, {"editmodule.html", AQCGI_REQUEST_METHOD_GET, AQH_MODADMMODULES_PERMS_MODULESWRITE, _handleRqEditModGet}, {"editmodule.html", AQCGI_REQUEST_METHOD_POST, AQH_MODADMMODULES_PERMS_MODULESWRITE, _handleRqEditModPost}, @@ -334,16 +334,6 @@ void _handleRqAddRoleGet(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session, _writePermissionsToForm(permDefList, guestPerms, dbuf); GBAS(dbuf, "\n"); -#if 0 - GBAS(dbuf, ""); - _writePermissionsToForm(permDefList, 0, dbuf); - GBAS(dbuf, "\n"); - - GBAS(dbuf, ""); - _writePermissionsToForm(permDefList, 0, dbuf); - GBAS(dbuf, "\n"); -#endif - GBAS(dbuf, "\n"); GBAA(dbuf, "\n", sModName?sModName:""); GBAS(dbuf, "\n"); @@ -373,10 +363,6 @@ void _handleRqAddRolePost(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session const char *sName; const char *sDescr; uint32_t perms; -#if 0 - uint32_t explAddPerms; - uint32_t explDelPerms; -#endif AQH_PERMDEF_LIST *permDefList; AQH_ROLE_LIST *roleList; int rv; @@ -449,10 +435,6 @@ void _handleRqEditRoleGet(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session const char *sName; const char *sDescr; uint32_t perms; -#if 0 - uint32_t explAddPerms; - uint32_t explDelPerms; -#endif AQH_MODULE *currentMod; const AQH_PERMDEF_LIST *permDefList; const AQH_ROLE_LIST *roleList; @@ -469,40 +451,20 @@ void _handleRqEditRoleGet(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session sName=role?AQH_Role_GetName(role):NULL; sDescr=role?AQH_Role_GetDescr(role):NULL; perms=role?AQH_Role_GetPerms(role):0; -#if 0 - explAddPerms=role?AQH_Role_GetExplAddPerms(role):0; - explDelPerms=role?AQH_Role_GetExplDelPerms(role):0; -#endif if (role) { GBAA(dbuf, "

Edit Role for Module %s

\n", sModName?sModName:""); GBAA(dbuf, "
\n" "\n" - "\n" - "" - "" - "\n" - "" - "" - "" - "\n", + "\n" + "\n", sName, sDescr?sDescr:""); GBAS(dbuf, "\n"); -#if 0 - GBAS(dbuf, "\n"); - - GBAS(dbuf, "\n"); -#endif - GBAS(dbuf, "
"); _writePermissionsToForm(permDefList, perms, dbuf); GBAS(dbuf, "
"); - _writePermissionsToForm(permDefList, explAddPerms, dbuf); - GBAS(dbuf, "
"); - _writePermissionsToForm(permDefList, explDelPerms, dbuf); - GBAS(dbuf, "
\n"); GBAA(dbuf, "\n", sModName?sModName:""); @@ -528,10 +490,6 @@ void _handleRqEditRolePost(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *sessio const char *sName; const char *sDescr; uint32_t perms; -#if 0 - uint32_t explAddPerms; - uint32_t explDelPerms; -#endif AQH_PERMDEF_LIST *permDefList; AQH_ROLE_LIST *roleList; AQH_ROLE *role; @@ -693,23 +651,14 @@ void _writeEditModForm(const AQH_MODULE *currentMod, const char *sModName, GWEN_ GBAA(dbuf, "\n" "\n" - "" - "" - "" - "\n" - "" - "" - "" - "\n", + "\n" + "\n", sName?sName:"", sDescr?sDescr:""); if (permDefList) { - GBAA(dbuf, - "" - "\n" - "\n" ""); + GBAA(dbuf, ""); } GBAS(dbuf, "
"); + GBAA(dbuf, "
"); _writePermissionsToForm(permDefList, AQH_Module_GetGuestPerms(currentMod), dbuf); - GBAA(dbuf, "
\n"); @@ -723,10 +672,7 @@ void _writeEditModForm(const AQH_MODULE *currentMod, const char *sModName, GWEN_ _writeRoleListToForm(roleList, sModName, permDefList, dbuf); else GBAS(dbuf, "

none

"); - GBAA(dbuf, - "" - "Add Role\n", - sModName?sModName:""); + GBAA(dbuf, "Add Role\n", sModName?sModName:""); } @@ -740,9 +686,7 @@ void _writeRoleListToForm(const AQH_ROLE_LIST *roleList, GBAS(dbuf, "\n" - "" - "\n" - "\n" + "\n\n" "\n"); role=AQH_Role_List_First(roleList); while(role) { @@ -766,23 +710,15 @@ void _writeRoleListToForm(const AQH_ROLE_LIST *roleList, GBAA(dbuf, "", s?s:""); /* actions */ GBAA(dbuf, ""); - GBAS(dbuf, "\n"); + role=AQH_Role_List_Next(role); } - GBAS(dbuf, - "\n" - "
IdNamePermissionsDescriptionActions
IdNamePermissionsDescriptionActions
%s"); - GBAA(dbuf, - "" - "", - sModName?sModName:"", id); - GBAA(dbuf, - "" - "", - sModName?sModName:"", id); + GBAA(dbuf, "", sModName?sModName:"", id); + GBAA(dbuf, "", sModName?sModName:"", id); GBAA(dbuf, "
\n"); + GBAS(dbuf, "\n\n"); }