Bug 115466 - Send requesting-user-name in CUPS_GET_PRINTERS and CUPS_GET_CLASSES
Summary: Send requesting-user-name in CUPS_GET_PRINTERS and CUPS_GET_CLASSES
Status: CLOSED FIXED
Alias: None
Product: kdeprint
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDEPrint Devel Mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-01 11:38 UTC by Erik forsberg
Modified: 2008-12-31 19:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Diff against svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/kdeprint Revision 476094 to fix problem (705 bytes, patch)
2005-11-01 11:40 UTC, Erik forsberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik forsberg 2005-11-01 11:38:22 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Beginning with CUPS v1.2, the list of printers returned by CUPS_GET_PRINTERS, CUPS_GET_CLASSES is filtered with respect to the printers a user is allowed to print to, but only if the attribute requesting-user-name is sent with the request, containing the current user's name.

This is useful functionality in organisations with one large CUPS server, but with many small usergroups, since it's easier to find the correct printer if only the ones that are relevant are shown in print dialogs. 

Current KDE code does not send requesting-user-name.
Comment 1 Erik forsberg 2005-11-01 11:40:39 UTC
Created attachment 13242 [details]
Diff against svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/kdeprint Revision 476094 to fix problem

This patch adds a requesting-user-name to void
KMCupsManager::loadServerPrinters(), which seems to be the correct place. At
least it limits the list shown by kprinter.
Comment 2 Cristian Tibirna 2005-11-28 04:56:52 UTC
SVN commit 483752 by tibirna:

Filter printers per user allowance (for CUPS>=1.2). Thanks to   Erik
Forsberg.
BUG:115466


 M  +3 -0      kmcupsmanager.cpp  


--- branches/KDE/3.5/kdelibs/kdeprint/cups/kmcupsmanager.cpp #483751:483752
@@ -431,6 +431,9 @@
 	keys.append("printer-is-accepting-jobs");
 	req.addKeyword(IPP_TAG_OPERATION,"requested-attributes",keys);
 
+	// filtering by username (hides printers user doesn't have allowance to use)
+	req.addName(IPP_TAG_OPERATION, "requesting-user-name", QString(cupsUser()));
+
 	if (req.doRequest("/printers/"))
 	{
 		processRequest(&req);
Comment 3 John Layt 2008-12-31 19:15:54 UTC
Closing old Resolved status bug.