Skip to content

Commit

Permalink
Support IPP Everywhere driver in web interface (Issue #5338)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Jun 18, 2018
1 parent 05bb584 commit 24a5ffa
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CHANGES - 2.2.9 - 2018-06-11
CHANGES - 2.2.9 - 2018-06-18
============================


Expand All @@ -7,6 +7,7 @@ Changes in CUPS v2.2.9

- Fixed a regression in the changes to ippValidateAttribute (Issue #5322,
Issue #5330)
- The web interface did not list the IPP Everywhere "driver" (Issue #5338)
- Fixed a memory leak for some IPP (extension) syntaxes.


Expand Down
9 changes: 8 additions & 1 deletion backend/dnssd.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DNS-SD discovery backend for CUPS.
*
* Copyright 2008-2017 by Apple Inc.
* Copyright 2008-2018 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
Expand Down Expand Up @@ -1257,6 +1257,13 @@ query_callback(
strlcat(make_and_model, " ", sizeof(make_and_model));
strlcat(make_and_model, model, sizeof(make_and_model));

if (!_cups_strncasecmp(make_and_model, "EPSON EPSON ", 12))
_cups_strcpy(make_and_model, make_and_model + 6);
else if (!_cups_strncasecmp(make_and_model, "HP HP ", 6))
_cups_strcpy(make_and_model, make_and_model + 3);
else if (!_cups_strncasecmp(make_and_model, "Lexmark International Lexmark ", 30))
_cups_strcpy(make_and_model, make_and_model + 22);

device->make_and_model = strdup(make_and_model);
}
else
Expand Down
6 changes: 5 additions & 1 deletion cgi-bin/admin.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Administration CGI for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
Expand Down Expand Up @@ -1137,6 +1137,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
else if (!file &&
(!cgiGetVariable("PPD_NAME") || cgiGetVariable("SELECT_MAKE")))
{
int ipp_everywhere = !strncmp(var, "ipp://", 6) || !strncmp(var, "ipps://", 7) || (!strncmp(var, "dnssd://", 8) && (strstr(var, "_ipp._tcp") || strstr(var, "_ipps._tcp")));

if (modify && !cgiGetVariable("SELECT_MAKE"))
{
/*
Expand Down Expand Up @@ -1285,6 +1287,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
if (!modify)
cgiSetVariable("CURRENT_MAKE_AND_MODEL",
cgiGetArray("PPD_MAKE_AND_MODEL", 0));
if (ipp_everywhere)
cgiSetVariable("SHOW_IPP_EVERYWHERE", "1");
cgiCopyTemplateLang("choose-model.tmpl");
cgiEndHTML();
}
Expand Down
1 change: 1 addition & 0 deletions templates/choose-model.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Current Driver - {current_make_and_model}</OPTION>:}
{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>IPP Everywhere &trade;</OPTION>:}
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
}</SELECT>
</TD>
Expand Down
1 change: 1 addition & 0 deletions templates/de/choose-model.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Drucker {?printer_is_shared=?nicht:{?printer_is_shared=0?nicht:}} im Netzwerk fr
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Aktueller Treiber - {current_make_and_model}</OPTION>:}
{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>IPP Everywhere &trade;</OPTION>:}
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
}</SELECT>
</TD>
Expand Down
1 change: 1 addition & 0 deletions templates/es/choose-model.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Controlador actual - {current_make_and_model}</OPTION>:}
{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>IPP Everywhere &trade;</OPTION>:}
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
}</SELECT>
</TD>
Expand Down
1 change: 1 addition & 0 deletions templates/fr/choose-model.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Pilote actuel - {current_make_and_model}</OPTION>:}
{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>IPP Everywhere &trade;</OPTION>:}
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
}</SELECT>
</TD>
Expand Down
1 change: 1 addition & 0 deletions templates/ja/choose-model.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>現在のドライバー - {current_make_and_model}</OPTION>:}
{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>IPP Everywhere &trade;</OPTION>:}
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
}</SELECT>
</TD>
Expand Down
1 change: 1 addition & 0 deletions templates/pt_BR/choose-model.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Driver atual - {current_make_and_model}</OPTION>:}
{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>IPP Everywhere &trade;</OPTION>:}
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
}</SELECT>
</TD>
Expand Down
1 change: 1 addition & 0 deletions templates/ru/choose-model.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Текущий драйвер - {current_make_and_model}</OPTION>:}
{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>IPP Everywhere &trade;</OPTION>:}
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
}</SELECT>
</TD>
Expand Down

0 comments on commit 24a5ffa

Please sign in to comment.