- Remove garbage from the authz file listing
authorZdeněk Šustr <sustr4@cesnet.cz>
Tue, 28 Feb 2012 12:42:25 +0000 (12:42 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Tue, 28 Feb 2012 12:42:25 +0000 (12:42 +0000)
- Different layout of the notification list page

org.glite.lb.server/src/lb_html.c
org.glite.lb.server/src/lb_proto.c
org.glite.lb.server/src/lb_text.c

index b56e4ab..7a32fb0 100644 (file)
@@ -148,14 +148,14 @@ int edg_wll_UserNotifsToHTML(edg_wll_Context ctx UNUSED_VAR, char **notifids, ch
         }
 
        if (adm) {
-               asprintf(&mylink,"<BR>%s just your registrations%s",
+               asprintf(&mylink,"%s just your registrations%s | ",
                        option != HTTP_ADMIN_OPTION_MY ? "<A HREF=\"/NOTIF:\">View" : "<B>Viewing",
                        option != HTTP_ADMIN_OPTION_MY ? "</A>" : "</B>");
-               asprintf(&alllink,"<BR>%s all registrations%s",
+               asprintf(&alllink,"%s all registrations%s | ",
                        option != HTTP_ADMIN_OPTION_ALL ? "<A HREF=\"/NOTIF:?all\">View" : "<B>Viewing",
                        option != HTTP_ADMIN_OPTION_ALL ? "</A>" : "</B>");
                if (option == HTTP_ADMIN_OPTION_ALL) asprintf(&heading,"All notifications");
-               asprintf(&foreignlink,"<BR>%s registrations by other users%s",
+               asprintf(&foreignlink,"%s registrations by other users%s<P>",
                        option != HTTP_ADMIN_OPTION_FOREIGN ? "<A HREF=\"/NOTIF:?foreign\">View" : "<B>Viewing",
                        option != HTTP_ADMIN_OPTION_FOREIGN ? "</A>" : "</B>");
                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, "<html>\r\n\t<body>\r\n");
        asprintf(&ret, "<html>\r\n\t<body>\r\n"
                        "<h2><B>%s</B></h2>\r\n"
-                        "<ul>%s</ul>"
                        "<P>%s%s%s"
+                        "<ul>%s</ul>"
                        "\t</body>\r\n</html>",
                        heading,
-                        pomA, 
                        mylink ? mylink : "",
                        alllink ? alllink : "",
-                       foreignlink ? foreignlink : ""
+                       foreignlink ? foreignlink : "",
+                        pomA ? pomA : "No registrations found"
         );
         free(pomA);
        free(mylink);
index dab6849..1d22d4e 100644 (file)
@@ -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);
index 8fc970c..800de5a 100644 (file)
@@ -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;