CUPS API: requesting-user-name-denied
Michael Sweet
mike at easysw.com
Mon Jun 5 13:15:09 PDT 2006
Rytis wrote:
> I'm not sure how should i add requesting-user-name-denied to printers attributes.(i want do deny printing to user of my choise) I've tried:
>
> ipp_t* request;
> ipp_t* response;
> ipp_attribute_t * attr;
> request = ippNewRequest(IPP_SET_PRINTER_ATTRIBUTES);
>
> ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
> "requesting-user-name-denied",NULL, "user1, user2, user3");
>
> ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
> "requesting-user-name", NULL, "root");
> ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
> NULL, "ipp://localhost/printers/HP");
> ippAddString (request,IPP_TAG_PRINTER, IPP_TAG_NAME,
> "printer-name", NULL, "HP");
> response = cupsDoRequest(m_connection, request, "/admin");
>
> What i get is:
> Attribute name: status-message
> Attribute value: Set-Printer-Attributes not supported!
>
> So what do i do wrong?
You need to use CUPS_ADD_MODIFY_PRINTER, not
IPP_SET_PRINTER_ATTRIBUTES. The latter IPP operation is very limited,
so we don't implement it.
As for the values themselves, create an array of char *'s to hold your
user names and then use ippAddStrings() instead with the number of
names (values).
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
More information about the cups-devel
mailing list