From: Zdenek Dohnal Date: Mon, 6 Sep 2021 09:27:40 +0000 (+0200) Subject: CUPS Web UI: Add warning about printer driver and raw queues deprecation X-Git-Tag: v2.4b1~68^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afe5c16dfd68b45272d0d8fe5471e551ded45773;p=thirdparty%2Fcups.git CUPS Web UI: Add warning about printer driver and raw queues deprecation --- diff --git a/CHANGES.md b/CHANGES.md index a2b393a1d4..dd789b5435 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 63b956e628..ff944b69a6 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -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 { /* diff --git a/templates/printer-added.tmpl b/templates/printer-added.tmpl index 0ccf6d3eed..9ebc8351b0 100644 --- a/templates/printer-added.tmpl +++ b/templates/printer-added.tmpl @@ -1,4 +1,15 @@ -

Add Printer

+

Add Printer {printer_name}

Printer {printer_name} has been added successfully. + +

+Note:Printer drivers and raw queues are deprecated and will stop working in a future version of CUPS. +
+ +
+ + + + +