From 696deaf9d00bcb8727c6ee4364cd9033ab325a7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Tue, 28 Feb 2012 12:42:25 +0000 Subject: [PATCH] - Remove garbage from the authz file listing - Different layout of the notification list page --- org.glite.lb.server/src/lb_html.c | 12 ++++++------ org.glite.lb.server/src/lb_proto.c | 3 +-- org.glite.lb.server/src/lb_text.c | 7 ++++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/org.glite.lb.server/src/lb_html.c b/org.glite.lb.server/src/lb_html.c index b56e4ab..7a32fb0 100644 --- a/org.glite.lb.server/src/lb_html.c +++ b/org.glite.lb.server/src/lb_html.c @@ -148,14 +148,14 @@ int edg_wll_UserNotifsToHTML(edg_wll_Context ctx UNUSED_VAR, char **notifids, ch } if (adm) { - asprintf(&mylink,"
%s just your registrations%s", + asprintf(&mylink,"%s just your registrations%s | ", option != HTTP_ADMIN_OPTION_MY ? "View" : "Viewing", option != HTTP_ADMIN_OPTION_MY ? "" : ""); - asprintf(&alllink,"
%s all registrations%s", + asprintf(&alllink,"%s all registrations%s | ", option != HTTP_ADMIN_OPTION_ALL ? "View" : "Viewing", option != HTTP_ADMIN_OPTION_ALL ? "" : ""); if (option == HTTP_ADMIN_OPTION_ALL) asprintf(&heading,"All notifications"); - asprintf(&foreignlink,"
%s registrations by other users%s", + asprintf(&foreignlink,"%s registrations by other users%s

", option != HTTP_ADMIN_OPTION_FOREIGN ? "View" : "Viewing", option != HTTP_ADMIN_OPTION_FOREIGN ? "" : ""); if (option == HTTP_ADMIN_OPTION_FOREIGN) asprintf(&heading,"Other users' notifications"); @@ -166,14 +166,14 @@ int edg_wll_UserNotifsToHTML(edg_wll_Context ctx UNUSED_VAR, char **notifids, ch asprintf(&ret, "\r\n\t\r\n"); asprintf(&ret, "\r\n\t\r\n" "

%s

\r\n" - "" "

%s%s%s" + "

" "\t\r\n", heading, - pomA, mylink ? mylink : "", alllink ? alllink : "", - foreignlink ? foreignlink : "" + foreignlink ? foreignlink : "", + pomA ? pomA : "No registrations found" ); free(pomA); free(mylink); diff --git a/org.glite.lb.server/src/lb_proto.c b/org.glite.lb.server/src/lb_proto.c index dab6849..1d22d4e 100644 --- a/org.glite.lb.server/src/lb_proto.c +++ b/org.glite.lb.server/src/lb_proto.c @@ -751,7 +751,7 @@ edg_wll_ErrorCode edg_wll_Proto(edg_wll_Context ctx, /* GET /[jobId]: Job Status */ else if (strcmp(requestMeat, "/RSS:") && strcmp(requestMeat, "/NOTIF") - && strcmp(requestMeat, "/NOTIF:") + && strncmp(requestMeat, "/NOTIF:", 7) && strcmp(requestMeat, "/favicon.ico") && extra_opt == HTTP_EXTRA_OPTION_NONE ) { @@ -925,7 +925,6 @@ edg_wll_ErrorCode edg_wll_Proto(edg_wll_Context ctx, } else if (extra_opt == HTTP_EXTRA_OPTION_CONFIGURATION) { // also browser-readable HTML version here? isadm = ctx->noAuth || edg_wll_amIroot(ctx->peerName, ctx->fqans,&ctx->authz_policy); - // Filo, tuto muzes pouzit k rozhodnuti, co vsechno se bude na konfiguracni strance ukazovat edg_wll_ConfigurationToText(ctx, isadm, &message); edg_wll_ServerStatisticsIncrement(ctx, SERVER_STATS_TEXT_VIEWS); diff --git a/org.glite.lb.server/src/lb_text.c b/org.glite.lb.server/src/lb_text.c index 8fc970c..800de5a 100644 --- a/org.glite.lb.server/src/lb_text.c +++ b/org.glite.lb.server/src/lb_text.c @@ -329,14 +329,15 @@ int edg_wll_ConfigurationToText(edg_wll_Context ctx, int admin, char **message){ int fd; if (ctx->authz_policy_file && (fd = open(ctx->authz_policy_file, O_RDONLY)) >= 0){ off_t size = lseek(fd, 0, SEEK_END) - lseek(fd, 0, SEEK_SET); - char *pft = (char*)malloc(size); + char *pft = (char*)calloc(sizeof(char), size); read(fd, pft, size); close(fd); pf = escape_text(pft); - +// Why not trio_asprintf(&pf, "%|Js", pft); + free(pft); } TRS("authz_policy_file", "%s\n", pf); - if (pf) free(pf); + free(pf); edg_wll_authz_policy ap = edg_wll_get_server_policy(); int i, j, k, l = 0; -- 1.8.2.3