Bug 115466

Summary: Send requesting-user-name in CUPS_GET_PRINTERS and CUPS_GET_CLASSES
Product: [Applications] kdeprint Reporter: Erik forsberg <forsberg+kde>
Component: generalAssignee: KDEPrint Devel Mailinglist <kde-print-devel>
Status: CLOSED FIXED    
Severity: wishlist CC: jlayt
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Diff against svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/kdeprint Revision 476094 to fix problem

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.