only create links for values if perms match.
This commit is contained in:
@@ -189,6 +189,9 @@ void _runIndex(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session, AQH_DATAC
|
|||||||
{
|
{
|
||||||
AQH_DEVICE_LIST *deviceList;
|
AQH_DEVICE_LIST *deviceList;
|
||||||
AQH_DEVICE *device;
|
AQH_DEVICE *device;
|
||||||
|
uint32_t perms;
|
||||||
|
|
||||||
|
perms=AQH_ModService_GetUserPerms(m);
|
||||||
|
|
||||||
deviceList=AQH_DataClient_GetDevices(dc, NULL);
|
deviceList=AQH_DataClient_GetDevices(dc, NULL);
|
||||||
if (deviceList==NULL) {
|
if (deviceList==NULL) {
|
||||||
@@ -225,9 +228,13 @@ void _runIndex(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session, AQH_DATAC
|
|||||||
GBAA(dbuf, "<tr>");
|
GBAA(dbuf, "<tr>");
|
||||||
/* name for system */
|
/* name for system */
|
||||||
s=AQH_Device_GetNameForSystem(device);
|
s=AQH_Device_GetNameForSystem(device);
|
||||||
GBAS(dbuf,"<td><a href=\"values.html?device=");
|
if (perms & AQH_MODDEVICES_PERMS_VALUEREAD) {
|
||||||
GWEN_Text_EscapeToBufferTolerant(s, dbuf);
|
GBAS(dbuf,"<td><a href=\"values.html?device=");
|
||||||
GBAA(dbuf,"\">%s</a></td>", s?s:"");
|
GWEN_Text_EscapeToBufferTolerant(s, dbuf);
|
||||||
|
GBAA(dbuf,"\">%s</a></td>", s?s:"");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GBAA(dbuf,"<td>%s</td>", s?s:"");
|
||||||
/* room */
|
/* room */
|
||||||
s=AQH_Device_GetRoomName(device);
|
s=AQH_Device_GetRoomName(device);
|
||||||
GBAA(dbuf, "<td>%s</td>", s?s:"");
|
GBAA(dbuf, "<td>%s</td>", s?s:"");
|
||||||
@@ -261,8 +268,6 @@ void _runIndex(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session, AQH_DATAC
|
|||||||
"</tbody>\n"
|
"</tbody>\n"
|
||||||
"</table>\n");
|
"</table>\n");
|
||||||
AQH_Device_List_free(deviceList);
|
AQH_Device_List_free(deviceList);
|
||||||
AQCGI_Request_SetResponseCode(rq, 200);
|
|
||||||
AQCGI_Request_SetResponseText(rq, "Ok");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user