]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Allow job-billing to be an alias for job-account-id, and requesting-user-name to
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 3 Jul 2013 16:39:38 +0000 (16:39 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 3 Jul 2013 16:39:38 +0000 (16:39 +0000)
be an alias for job-accounting-user-id (<rdar://problem/14290027>)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11089 a1ca3aef-8c08-0410-bb20-df032aa958be

backend/ipp.c

index 7eec579468e8ed0ad1774c26f14a152ac4bfa811..b3049d85f823cf5274feb5da9ec1f69d2e2dc392 100644 (file)
@@ -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;