How can I set different printer configs for users on the same machine?

Helge Blischke h.blischke at acm.org
Tue Nov 24 05:41:43 PST 2009


Lifeboy wrote:

> I have a ppd file with some special settings for a postscript printer.
> This is an OEM Kyocera printer, sold by Triumph-Adler (model DC-2240)
> 
> The printer is setup for user authentication via a pincode.  The ppd file
> contains the following lines:
> 
> *% Management Code Definitions
> *OpenUI *KmManagment/Job Accounting: PickOne
> *OrderDependency: 60 AnySetup *KmManagment
> *DefaultKmManagment: MG00000002
> *KmManagment Default/Off: ""
> *KmManagment MG00000000/Appollis: "(5463) statusdict /setmanagementnumber
> get exec" *KmManagment MG00000001/Wendy: "(7958) statusdict
> /setmanagementnumber get exec" *KmManagment MG00000002/Rozanne: "(0986)
> statusdict /setmanagementnumber get exec" *KmManagment MG00000003/Betsie:
> "(4621) statusdict /setmanagementnumber get exec" <snip>
> 
> This results in a "Job Accounting:" option to be displayed in the cups web
> interface as well as the Ubuntu system | administration | printing setup. 
> In the dropdown box I can select the user I would want to print as and the
> printed pages get counted for that user.
> 
> However, here is the problem: When I change the job accounting user, the
> value gets changed for all users on the server.  Since this is a
> multi-user server (aren't all linux machines by default?!) this creates a
> huge problem.
> 
> I have searched the web using almost all conceivable questions, but there
> doesn't seem to be a single person that has ever had this requirement,
> something I find really hard to believe.  Everything seems to be machine
> centric, not user centric.
> 
> I see there is a file ~/.cups/lpadmin that contains:
> 
> Default TA_DC_2240 Duplex=None PageSize=A4
> 
> This allows one some form of control per user, ie, each user can have
> his/her own default printer, and some form of printer control.  However,
> there does not seem to be a specification of the options that can be added
> to this file.
> 
> What I'm looking for here is a way to place /etc/cups/cupsd.conf into
> ~/.cups/cups.conf and more still to have a personal ppd file place in this
> location.  This would allow each user to specify his/her own settings,
> without affection the rest of the users.
> 
> I know the windows world has had this all the time, but cups is much older
> and more mature, not so?
> 
> Is my thinking wrong, ie. should I approach this problem differently? I
> could create a printer for each user and only allow that user to access
> the printer, but in a way that's crazy: Having 15 printers for 15 user? 
> What if I have 500 users?! It may be a temporary workaround, but it's not
> a solution.
> 
> Thanks all for your consideration.

There are (at least) two different approaches to this issue:
(1) For each user set up a .lpoptions file in the user's home directory
    which sets the respective option for that user 
    (e.g. "-o kmmanagement=MG00000002"). 
    But be aware that the user is able to modify hiw own .lpoptions file.
(2) Set up a special filter script (e.g. a Perl script) which greps the 
    KmManagement-statements from the PPD and inserts the respective
    PostScript stuff into the PS job. This filter then must be activated by
    a line
   *cupsFilter: "application/vnd-cups.postscript 0 your_special_filter"
    which has the advantage that only the (an) administrator can change 
    that. But still, a user may print under a foreign user name using the 
    "-U" option of the lp command.

Helge






More information about the cups mailing list