removed unneeded code, make _requestTable private to source file.
This commit is contained in:
@@ -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, "</td></tr>\n");
|
||||
|
||||
#if 0
|
||||
GBAS(dbuf, "<tr><td><label>Explicitly add permissions:</label></td><td>");
|
||||
_writePermissionsToForm(permDefList, 0, dbuf);
|
||||
GBAS(dbuf, "</td></tr>\n");
|
||||
|
||||
GBAS(dbuf, "<tr><td><label>Explicitly sub permissions:</label></td><td>");
|
||||
_writePermissionsToForm(permDefList, 0, dbuf);
|
||||
GBAS(dbuf, "</td></tr>\n");
|
||||
#endif
|
||||
|
||||
GBAS(dbuf, "</table>\n");
|
||||
GBAA(dbuf, "<input type=\"hidden\" name=\"mod\" value=\"%s\">\n", sModName?sModName:"");
|
||||
GBAS(dbuf, "<input type=\"submit\" value=\"Add\">\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, "<h2>Edit Role for Module %s</h2>\n", sModName?sModName:"");
|
||||
GBAA(dbuf,
|
||||
"<form action=\"editrole.html\" method=\"post\">\n"
|
||||
"<table class=\"formtable\">\n"
|
||||
"<tr>\n"
|
||||
"<td><label for=\"name\">Name:</label></td>"
|
||||
"<td><input type=\"text\" name=\"name\" value=\"%s\"></td>"
|
||||
"</tr>\n"
|
||||
"<tr>"
|
||||
"<td><label for=\"descr\">Description:</label></td>"
|
||||
"<td><input type=\"text\" name=\"descr\" value=\"%s\"></td>"
|
||||
"</tr>\n",
|
||||
"<tr><td><label for=\"name\">Name:</label></td><td><input type=\"text\" name=\"name\" value=\"%s\"></td></tr>\n"
|
||||
"<tr><td><label for=\"descr\">Description:</label></td><td><input type=\"text\" name=\"descr\" value=\"%s\"></td></tr>\n",
|
||||
sName, sDescr?sDescr:"");
|
||||
|
||||
GBAS(dbuf, "<tr><td><label>Permissions:</label></td><td>");
|
||||
_writePermissionsToForm(permDefList, perms, dbuf);
|
||||
GBAS(dbuf, "</td></tr>\n");
|
||||
|
||||
#if 0
|
||||
GBAS(dbuf, "<tr><td><label>Explicitly add permissions:</label></td><td>");
|
||||
_writePermissionsToForm(permDefList, explAddPerms, dbuf);
|
||||
GBAS(dbuf, "</td></tr>\n");
|
||||
|
||||
GBAS(dbuf, "<tr><td><label>Explicitly sub permissions:</label></td><td>");
|
||||
_writePermissionsToForm(permDefList, explDelPerms, dbuf);
|
||||
GBAS(dbuf, "</td></tr>\n");
|
||||
#endif
|
||||
|
||||
GBAS(dbuf, "</table>\n");
|
||||
|
||||
GBAA(dbuf, "<input type=\"hidden\" name=\"mod\" value=\"%s\">\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,
|
||||
"<form action=\"editmodule.html\" method=\"post\">\n"
|
||||
"<table class=\"formtable\">\n"
|
||||
"<tr>"
|
||||
"<td><label for=\"name\">Name:</label></td>"
|
||||
"<td><input type=\"text\" name=\"name\" value=\"%s\"></td>"
|
||||
"</tr>\n"
|
||||
"<tr>"
|
||||
"<td><label for=\"descr\">Description:</label></td>"
|
||||
"<td><input type=\"text\" name=\"descr\" value=\"%s\"></td>"
|
||||
"</tr>\n",
|
||||
"<tr><td><label for=\"name\">Name:</label></td><td><input type=\"text\" name=\"name\" value=\"%s\"></td></tr>\n"
|
||||
"<tr><td><label for=\"descr\">Description:</label></td><td><input type=\"text\" name=\"descr\" value=\"%s\"></td></tr>\n",
|
||||
sName?sName:"", sDescr?sDescr:"");
|
||||
|
||||
if (permDefList) {
|
||||
GBAA(dbuf,
|
||||
"<tr>"
|
||||
"<td><label>Guest Permissions:</label></td>\n"
|
||||
"<td>");
|
||||
GBAA(dbuf, "<tr><td><label>Guest Permissions:</label></td>\n<td>");
|
||||
_writePermissionsToForm(permDefList, AQH_Module_GetGuestPerms(currentMod), dbuf);
|
||||
GBAA(dbuf, "</td>" "</tr>");
|
||||
GBAA(dbuf, "</td></tr>");
|
||||
}
|
||||
|
||||
GBAS(dbuf, "</table>\n");
|
||||
@@ -723,10 +672,7 @@ void _writeEditModForm(const AQH_MODULE *currentMod, const char *sModName, GWEN_
|
||||
_writeRoleListToForm(roleList, sModName, permDefList, dbuf);
|
||||
else
|
||||
GBAS(dbuf, "<p>none</p>");
|
||||
GBAA(dbuf,
|
||||
"<a href=\"addrole.html?mod=%s\">"
|
||||
"<img src=\"/pics/plus.png\">Add Role</a>\n",
|
||||
sModName?sModName:"");
|
||||
GBAA(dbuf, "<a href=\"addrole.html?mod=%s\"><img src=\"/pics/plus.png\">Add Role</a>\n", sModName?sModName:"");
|
||||
}
|
||||
|
||||
|
||||
@@ -740,9 +686,7 @@ void _writeRoleListToForm(const AQH_ROLE_LIST *roleList,
|
||||
|
||||
GBAS(dbuf,
|
||||
"<table class=\"datatable\">\n"
|
||||
"<thead>"
|
||||
"<tr><th>Id</th><th>Name</th><th>Permissions</th><th>Description</th><th>Actions</th></tr>\n"
|
||||
"</thead>\n"
|
||||
"<thead><tr><th>Id</th><th>Name</th><th>Permissions</th><th>Description</th><th>Actions</th></tr>\n</thead>\n"
|
||||
"<tbody>\n");
|
||||
role=AQH_Role_List_First(roleList);
|
||||
while(role) {
|
||||
@@ -766,23 +710,15 @@ void _writeRoleListToForm(const AQH_ROLE_LIST *roleList,
|
||||
GBAA(dbuf, "<td>%s</td>", s?s:"");
|
||||
/* actions */
|
||||
GBAA(dbuf, "<td>");
|
||||
GBAA(dbuf,
|
||||
"<a href=\"editrole.html?mod=%s&id=%d\">"
|
||||
"<img src=\"/pics/edit.png\"></a>",
|
||||
sModName?sModName:"", id);
|
||||
GBAA(dbuf,
|
||||
"<a href=\"delrole.html?mod=%s&id=%d\">"
|
||||
"<img src=\"/pics/minus.png\"></a>",
|
||||
sModName?sModName:"", id);
|
||||
GBAA(dbuf, "<a href=\"editrole.html?mod=%s&id=%d\"><img src=\"/pics/edit.png\"></a>", sModName?sModName:"", id);
|
||||
GBAA(dbuf, "<a href=\"delrole.html?mod=%s&id=%d\"><img src=\"/pics/minus.png\"></a>", sModName?sModName:"", id);
|
||||
GBAA(dbuf, "</td>");
|
||||
|
||||
GBAS(dbuf, "</tr>\n");
|
||||
|
||||
role=AQH_Role_List_Next(role);
|
||||
}
|
||||
|
||||
GBAS(dbuf,
|
||||
"</tbody>\n"
|
||||
"</table>\n");
|
||||
GBAS(dbuf, "</tbody>\n</table>\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user