asprintf(&ret, "<HTML>\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n<TITLE>Notifications</TITLE>\n<HEAD>\n<HEAD>\n%s\n</HEAD>\n<body>\r\n"
"<h2><B>%s</B></h2>\r\n"
"<P>%s%s%s"
+ "<P>Total of %d"
"<ul>%s</ul>"
"\t</body>\r\n</HTML>",
header,
mylink ? mylink : "",
alllink ? alllink : "",
foreignlink ? foreignlink : "",
- pomA ? pomA : "No registrations found"
+ i, pomA ? pomA : "No registrations found"
);
free(pomA);
free(mylink);
TR("Destination", "%s", ni->destination, NULL);
TR("Valid until", "%s", ni->valid, NULL);
TR("Flags", "%s", flags, NULL);
+ if (strcmp(ni->jobid,"all_jobs")) {
+ TRL("Job ID", "%s", ni->jobid, NULL); }
+ else {
+ TR("Job ID", "%s", "—", NULL);
+ }
free(flags);
if (! edg_wll_Condition_Dump(ni, &cond, 0)){
e = edg_wll_Error(ctx,&et,&ed);
header = get_html_header(ctx, 0);
- asprintf(&out, "<HTML>\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n<TITLE>Error</TITLE>\n<HEAD>\n<HEAD>\n%s\n</HEAD>\n"
+ asprintf(&out, "<HTML>\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n<HEAD>\n<TITLE>Error</TITLE>\n%s\n</HEAD>\n"
"<body><h1>%s</h1>\n"
"%d: %s (%s)</body></html>",header,msg,e,et,ed);
static int getNotifInfo(edg_wll_Context ctx, char *notifId, notifInfo *ni){
char *q = NULL;
glite_lbu_Statement notif = NULL;
- char *notifc[5] = {NULL, NULL, NULL, NULL, NULL};
+ char *notifc[6] = {NULL, NULL, NULL, NULL, NULL, NULL};
char *can_peername = NULL;
int retval = HTTP_OK;
- trio_asprintf(&q, "select n.destination, n.valid, n.conditions, n.flags, u.cert_subj "
- "from notif_registrations as n, users as u "
- "where (n.notifid='%s') AND (n.userid=u.userid)", notifId);
+ trio_asprintf(&q, "select n.destination, n.valid, n.conditions, n.flags, u.cert_subj, j.jobid "
+ "from notif_registrations as n, users as u, notif_jobs as j "
+ "where (n.notifid='%s') AND (n.userid=u.userid) AND (n.notifid=j.notifid)", notifId);
glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q);
if (edg_wll_ExecSQL(ctx, q, ¬if) < 0) return HTTP_INTERNAL;
free(q); q = NULL;
parseJobQueryRec(ctx, notifc[2], strlen(notifc[2]), &(ni->conditions));
ni->flags = atoi(notifc[3]);
ni->owner = notifc[4];
+ ni->jobid = notifc[5];
}
else {
retval = HTTP_UNAUTH;
}
if (ni->conditions_text) free(ni->conditions_text);
if (ni->owner) free(ni->owner);
+ if (ni->jobid) free(ni->jobid);
}
static int getJobsRSS(edg_wll_Context ctx, char *feedType, edg_wll_JobStat **statesOut){