[cups.development] [RFE] STR #3489: display current user in web interface (root, <user>, anonymous, ...)

Jon Peatfield jp107 at cam.ac.uk
Wed Feb 3 11:44:27 PST 2010


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

At least back in cups-1.1 I used to modify some of the teplate files e.g.
printer.tmpl to include fragments like:

	{remote_user=?:<p />You are authenticated as
<strong>{remote_user}</strong>. Be very careful with any of the
following!<p />
	<a href="/printers/{printer_name}?op=print-test-page">
	<img src="/images/print-test-page.gif" alt="Print Test Page" border="0"
/></a>
	{printer_state=5?
	<a href="/admin/?op=start-printer&printer_name={printer_name}">
	<img src="/images/start-printer.gif" alt="Start Printer" border="0"
/></a>
	:
	<a href="/admin/?op=stop-printer&printer_name={printer_name}">
	<img src="/images/stop-printer.gif" alt="Stop Printer" border="0" /></a>
	}

since I wanted the pages to show the logged-in username and also hide the
options to do various things iff a user wasn't logged in at all.

I've not tested this on any recent version of cups since we switched how
we present info to our users and also I've not had time to work out how to
apply the other (mostly style) changes we wanted to do on the various
templates...

(before anyone asks we were also removing the other even more significant
options like delete etc though in theory they could be made only visible
for people authenticated as a user with permission to use them...)

Of course to do a proper job all the translations of the .tmpl files also
need to be updated.

Link: http://www.cups.org/str.php?L3489
Version:  -feature





More information about the cups mailing list