From 553f29c967a3451cb142a7a91561fcc4c20bb354 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 18 Jun 2018 13:13:40 -0400 Subject: [PATCH] Support IPP Everywhere driver in web interface (Issue #5338) --- CHANGES.md | 1 + backend/dnssd.c | 9 ++++++++- cgi-bin/admin.c | 11 ++++++++--- templates/choose-model.tmpl | 1 + templates/de/choose-model.tmpl | 1 + templates/es/choose-model.tmpl | 1 + templates/fr/choose-model.tmpl | 1 + templates/ja/choose-model.tmpl | 1 + templates/pt_BR/choose-model.tmpl | 1 + templates/ru/choose-model.tmpl | 1 + 10 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c7438f9b72..4fa1803cd1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ Changes in CUPS v2.3b6 - Localization update (Issue #5339) - Fixed a regression in the changes to ippValidateAttribute (Issue #5322, Issue #5330) +- The web interface did not list the IPP Everywhere "driver" (Issue #5338) - The scheduler did not report all of the supported job options and values (Issue #5340) - Fixed a memory leak for some IPP (extension) syntaxes. diff --git a/backend/dnssd.c b/backend/dnssd.c index 34781d5cea..7074f4294a 100644 --- a/backend/dnssd.c +++ b/backend/dnssd.c @@ -1,7 +1,7 @@ /* * DNS-SD discovery backend for CUPS. * - * Copyright © 2008-2017 by Apple Inc. + * Copyright © 2008-2018 by Apple Inc. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -1252,6 +1252,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 diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index f788083fb0..a3b5057b0e 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1,10 +1,11 @@ /* * Administration CGI for CUPS. * - * Copyright 2007-2017 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products. + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1997-2007 by Easy Software Products. * - * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. */ /* @@ -928,6 +929,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")) { /* @@ -1076,6 +1079,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(); } diff --git a/templates/choose-model.tmpl b/templates/choose-model.tmpl index ee9338cc5c..d72534236f 100644 --- a/templates/choose-model.tmpl +++ b/templates/choose-model.tmpl @@ -39,6 +39,7 @@ diff --git a/templates/de/choose-model.tmpl b/templates/de/choose-model.tmpl index cb9b6f3bc2..a08a8e3e0c 100644 --- a/templates/de/choose-model.tmpl +++ b/templates/de/choose-model.tmpl @@ -39,6 +39,7 @@ Drucker {?printer_is_shared=?nicht:{?printer_is_shared=0?nicht:}} im Netzwerk fr diff --git a/templates/es/choose-model.tmpl b/templates/es/choose-model.tmpl index 8a5a4ba90a..74f0a9bb9d 100644 --- a/templates/es/choose-model.tmpl +++ b/templates/es/choose-model.tmpl @@ -39,6 +39,7 @@ diff --git a/templates/fr/choose-model.tmpl b/templates/fr/choose-model.tmpl index 1e154f18a7..3038b3fe3c 100644 --- a/templates/fr/choose-model.tmpl +++ b/templates/fr/choose-model.tmpl @@ -39,6 +39,7 @@ diff --git a/templates/ja/choose-model.tmpl b/templates/ja/choose-model.tmpl index daf1375fd8..b3c286b117 100644 --- a/templates/ja/choose-model.tmpl +++ b/templates/ja/choose-model.tmpl @@ -39,6 +39,7 @@ diff --git a/templates/pt_BR/choose-model.tmpl b/templates/pt_BR/choose-model.tmpl index 55d8bd8d5d..a5939ee9cb 100644 --- a/templates/pt_BR/choose-model.tmpl +++ b/templates/pt_BR/choose-model.tmpl @@ -39,6 +39,7 @@ diff --git a/templates/ru/choose-model.tmpl b/templates/ru/choose-model.tmpl index 2f0d6d9bab..86507814dc 100644 --- a/templates/ru/choose-model.tmpl +++ b/templates/ru/choose-model.tmpl @@ -39,6 +39,7 @@ -- 2.47.2