]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cgi-bin/jobs.c
Update svn:keyword properties.
[thirdparty/cups.git] / cgi-bin / jobs.c
index 20a5417270a9cef23d9bc9ecb474178ed92e80b5..e57b0218d0b5a9008ca329baa4c84683b0e3c97e 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$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
@@ -57,6 +57,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
   */
 
   cgiSetVariable("SECTION", "jobs");
+  cgiSetVariable("REFRESH_PAGE", "");
 
  /*
   * Connect to the HTTP server...
@@ -181,15 +182,20 @@ do_job_op(http_t      *http,              /* I - HTTP connection */
     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)
@@ -204,5 +210,5 @@ do_job_op(http_t      *http,                /* I - HTTP connection */
 
 
 /*
- * End of "$Id: jobs.c 6889 2007-08-29 22:23:35Z mike $".
+ * End of "$Id$".
  */