]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
CUPS Web UI: Add warning about printer driver and raw queues deprecation
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 6 Sep 2021 09:27:40 +0000 (11:27 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 6 Sep 2021 09:27:40 +0000 (11:27 +0200)
CHANGES.md
cgi-bin/admin.c
templates/printer-added.tmpl

index a2b393a1d459b479441d74d4c8810f2c1d02dfb8..dd789b543575f7122a8a2e496a838ba8fd99412b 100644 (file)
@@ -64,6 +64,7 @@ CUPS v2.4rc1 (Pending)
   `LPDConfigFile`, `KeepAliveTimeout`, `RIPCache`, and `SMBConfigFile`
   directives in `cupsd.conf` and `cups-files.conf`.
 - Stubbed out deprecated `httpMD5` functions.
+- Printer driver deprecation wasn't mentioned in CUPS Web UI
 
 
 CUPS v2.3.3op2 (February 1, 2021)
index 63b956e6280197ba8fa401d4e55d9ab9106a3f89..ff944b69a6cee22772562dd16d0ddabbc2bb1307 100644 (file)
@@ -619,6 +619,7 @@ do_am_printer(http_t *http,         /* I - HTTP connection */
                *oldinfo;               /* Old printer information */
   const cgi_file_t *file;              /* Uploaded file, if any */
   const char   *var;                   /* CGI variable */
+  char *ppd_name = NULL;       /* Pointer to PPD name */
   char         uri[HTTP_MAX_URI],      /* Device or printer URI */
                *uriptr,                /* Pointer into URI */
                evefile[1024] = "";     /* IPP Everywhere PPD file */
@@ -1124,10 +1125,10 @@ do_am_printer(http_t *http,             /* I - HTTP connection */
 
     if (!file)
     {
-      var = cgiGetVariable("PPD_NAME");
-      if (strcmp(var, "__no_change__"))
+      ppd_name = cgiGetVariable("PPD_NAME");
+      if (strcmp(ppd_name, "__no_change__"))
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
-                    NULL, var);
+                    NULL, ppd_name);
     }
 
     ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-location",
@@ -1217,6 +1218,16 @@ do_am_printer(http_t *http,              /* I - HTTP connection */
 
       cgiCopyTemplateLang("printer-modified.tmpl");
     }
+    else if (strcmp(ppd_name, "everywhere") && !strstr(ppd_name, "driverless"))
+    {
+      /*
+       * If we don't have an everywhere model, show printer-added
+       * template with warning about drivers going away...
+       */
+
+      cgiStartHTML(title);
+      cgiCopyTemplateLang("printer-added.tmpl");
+    }
     else
     {
      /*
index 0ccf6d3eed5085ce210a905145e823102ce23373..9ebc8351b0eb09bd637a90a47b28d9d04b380ca0 100644 (file)
@@ -1,4 +1,15 @@
-<H2 CLASS="title">Add Printer</H2>
+<H2 CLASS="title">Add Printer {printer_name}</H2>
 
 <P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> has been added
 successfully.
+
+<blockquote>
+<b>Note:<b>Printer drivers and raw queues are deprecated and will stop working in a future version of CUPS.
+</blockquote>
+
+<FORM ACTION="admin/" METHOD="POST">
+<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
+<INPUT TYPE="HIDDEN" NAME="OP" VALUE="set-printer-options">
+<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">
+<INPUT TYPE="SUBMIT" VALUE="Set Printer Options">
+</FORM>