Skip to content

Commit

Permalink
CUPS Web UI: Add warning about printer driver and raw queues deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
zdohnal committed Sep 6, 2021
1 parent c610c62 commit afe5c16
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 14 additions & 3 deletions cgi-bin/admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
{
/*
Expand Down
13 changes: 12 additions & 1 deletion templates/printer-added.tmpl
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit afe5c16

Please sign in to comment.