/*
- * "$Id: jobs.c 6889 2007-08-29 22:23:35Z mike $"
+ * "$Id$"
*
- * Job status CGI for the Common UNIX Printing System (CUPS).
+ * Job status CGI for CUPS.
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
*/
cgiSetVariable("SECTION", "jobs");
+ cgiSetVariable("REFRESH_PAGE", "");
/*
* Connect to the HTTP server...
char url[1024]; /* Encoded URL */
- strcpy(url, "5;URL=");
+ strlcpy(url, "5;URL=", sizeof(url));
cgiFormEncode(url + 6, getenv("HTTP_REFERER"), sizeof(url) - 6);
cgiSetVariable("refresh_page", url);
}
+ else if (cupsLastError() == IPP_NOT_AUTHORIZED)
+ {
+ puts("Status: 401\n");
+ exit(0);
+ }
cgiStartHTML(cgiText(_("Jobs")));
if (cupsLastError() > IPP_OK_CONFLICT)
- cgiShowIPPError(_("Job operation failed:"));
+ cgiShowIPPError(_("Job operation failed"));
else if (op == IPP_CANCEL_JOB)
cgiCopyTemplateLang("job-cancel.tmpl");
else if (op == IPP_HOLD_JOB)
/*
- * End of "$Id: jobs.c 6889 2007-08-29 22:23:35Z mike $".
+ * End of "$Id$".
*/