From: msweet Date: Wed, 3 Jul 2013 16:39:38 +0000 (+0000) Subject: Allow job-billing to be an alias for job-account-id, and requesting-user-name to X-Git-Tag: release-1.7rc1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94446c2699d9feecb803da7931ae44aeedf1304b;p=thirdparty%2Fcups.git Allow job-billing to be an alias for job-account-id, and requesting-user-name to be an alias for job-accounting-user-id () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11089 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/backend/ipp.c b/backend/ipp.c index 7eec579468..b3049d85f8 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -2602,17 +2602,27 @@ new_request( "job-password-encryption", NULL, keyword); } - if (pc->account_id && - (keyword = cupsGetOption("job-account-id", num_options, - options)) != NULL) - ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id", - NULL, keyword); + if (pc->account_id) + { + if ((keyword = cupsGetOption("job-account-id", num_options, + options)) == NULL) + keyword = cupsGetOption("job-billing", num_options, options); - if (pc->accounting_user_id && - (keyword = cupsGetOption("job-accounting-user-id", num_options, - options)) != NULL) - ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, - "job-accounting-user-id", NULL, keyword); + if (keyword) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id", + NULL, keyword); + } + + if (pc->accounting_user_id) + { + if ((keyword = cupsGetOption("job-accounting-user-id", num_options, + options)) == NULL) + keyword = user; + + if (keyword) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, + "job-accounting-user-id", NULL, keyword); + } for (mandatory = (char *)cupsArrayFirst(pc->mandatory); mandatory;