Index: backend/ipp.c =================================================================== --- backend/ipp.c (revision 10578) +++ backend/ipp.c (working copy) @@ -331,7 +331,7 @@ if ((auth_info_required = getenv("AUTH_INFO_REQUIRED")) == NULL) auth_info_required = "none"; - state_reasons = _cupsArrayNewStrings(getenv("PRINTER_STATE_REASONS")); + state_reasons = _cupsArrayNewStrings(getenv("PRINTER_STATE_REASONS"), ','); #ifdef HAVE_GSSAPI /* @@ -2297,7 +2297,8 @@ *media_size; /* media-size value */ const char *media_source, /* media-source value */ *media_type, /* media-type value */ - *collate_str; /* multiple-document-handling value */ + *collate_str, /* multiple-document-handling value */ + *mandatory; /* Mandatory attributes */ /* @@ -2366,6 +2367,85 @@ * Send standard IPP attributes... */ + if (pc->password && + (keyword = cupsGetOption("job-password", num_options, + options)) != NULL) + { + ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", + keyword, strlen(keyword)); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "job-password-encryption", NULL, "none"); + } + + 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 && + (keyword = cupsGetOption("job-accounting-user-id", num_options, + options)) != NULL) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, + "job-accounting-user-id", NULL, keyword); + + for (mandatory = (char *)cupsArrayFirst(pc->mandatory); + mandatory; + mandatory = (char *)cupsArrayNext(pc->mandatory)) + { + if (strcmp(mandatory, "copies") && + strcmp(mandatory, "destination-uris") && + strcmp(mandatory, "finishings") && + strcmp(mandatory, "job-account-id") && + strcmp(mandatory, "job-accounting-user-id") && + strcmp(mandatory, "job-password") && + strcmp(mandatory, "media") && + strncmp(mandatory, "media-col", 9) && + strcmp(mandatory, "multiple-document-handling") && + strcmp(mandatory, "output-bin") && + strcmp(mandatory, "print-color-mode") && + strcmp(mandatory, "print-quality") && + strcmp(mandatory, "sides") && + (keyword = cupsGetOption(mandatory, num_options, options)) != NULL) + { + _ipp_option_t *opt = _ippFindOption(mandatory); + /* Option type */ + ipp_tag_t value_tag = opt ? opt->value_tag : IPP_TAG_NAME; + /* Value type */ + + switch (value_tag) + { + case IPP_TAG_INTEGER : + case IPP_TAG_ENUM : + ippAddInteger(request, IPP_TAG_JOB, value_tag, mandatory, + atoi(keyword)); + break; + case IPP_TAG_BOOLEAN : + ippAddBoolean(request, IPP_TAG_JOB, mandatory, + !_cups_strcasecmp(keyword, "true")); + break; + case IPP_TAG_RANGE : + { + int lower, upper; /* Range */ + + if (sscanf(keyword, "%d-%d", &lower, &upper) != 2) + lower = upper = atoi(keyword); + + ippAddRange(request, IPP_TAG_JOB, mandatory, lower, upper); + } + break; + case IPP_TAG_STRING : + ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword, + strlen(keyword)); + break; + default : + ippAddString(request, IPP_TAG_JOB, value_tag, mandatory, + NULL, keyword); + break; + } + } + } + if ((keyword = cupsGetOption("PageSize", num_options, options)) == NULL) keyword = cupsGetOption("media", num_options, options); @@ -2431,19 +2511,19 @@ ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin", NULL, keyword); - if ((keyword = cupsGetOption("output-mode", num_options, + if ((keyword = cupsGetOption("print-color-mode", num_options, options)) != NULL) - ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode", + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "print-color-mode", NULL, keyword); else if ((keyword = cupsGetOption("ColorModel", num_options, options)) != NULL) { if (!_cups_strcasecmp(keyword, "Gray")) - ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode", - NULL, "monochrome"); + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, + "print-color-mode", NULL, "monochrome"); else - ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode", - NULL, "color"); + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, + "print-color-mode", NULL, "color"); } if ((keyword = cupsGetOption("print-quality", num_options, @@ -3133,7 +3213,7 @@ else op = '\0'; - new_reasons = _cupsArrayNewStrings(s); + new_reasons = _cupsArrayNewStrings(s, ','); } else return; Index: doc/help/api-cups.html =================================================================== --- doc/help/api-cups.html (revision 10583) +++ doc/help/api-cups.html (working copy) @@ -1025,7 +1025,7 @@

Discussion

New option arrays can be initialized simply by passing 0 for the "num_options" parameter.

-

 CUPS 1.2/OS X 10.5 cupsAdminCreateWindowsPPD

+

 DEPRECATED cupsAdminCreateWindowsPPD

Create the Windows PPD file for a printer.

char *cupsAdminCreateWindowsPPD (
@@ -1047,7 +1047,7 @@

Return Value

PPD file or NULL

-

 CUPS 1.2/OS X 10.5 cupsAdminExportSamba

+

 DEPRECATED cupsAdminExportSamba

Export a printer to Samba.

int cupsAdminExportSamba (
Index: doc/help/spec-ppd.html =================================================================== --- doc/help/spec-ppd.html (revision 10578) +++ doc/help/spec-ppd.html (working copy) @@ -410,7 +410,11 @@

  • cupsIPPFinishings
  • cupsIPPReason
  • cupsIPPSupplies
  • +
  • cupsJobAccountId
  • +
  • cupsJobAccountingUserId
  • +
  • cupsJobPassword
  • cupsLanguages
  • +
  • cupsMandatory
  • cupsManualCopies
  • cupsMarkerName
  • cupsMarkerNotice
  • @@ -1706,6 +1710,49 @@ *cupsIPPSupplies: False + +

    CUPS 1.7cupsJobAccountId

    + +

    *cupsJobAccountId: boolean

    + +

    This keyword defines whether the printer accepts the job-account-id IPP attribute.

    + +

    Example:

    + +
    +*% Specify the printer accepts the job-account-id IPP attribute.
    +*cupsJobAccountId: True
    +
    + + +

    CUPS 1.7cupsJobAccountingUserId

    + +

    *cupsJobAccountingUserId: boolean

    + +

    This keyword defines whether the printer accepts the job-accounting-user-id IPP attribute.

    + +

    Example:

    + +
    +*% Specify the printer accepts the job-accounting-user-id IPP attribute.
    +*cupsJobAccountingUserId: True
    +
    + + +

    CUPS 1.7cupsJobPassword

    + +

    *cupsJobPassword: "format"

    + +

    This keyword defines the format of the job-password IPP attribute, if supported by the printer. Currently the only supported format is "1111" indicating a 4-digit PIN code.

    + +

    Example:

    + +
    +*% Specify the printer supports 4-digit PIN codes.
    +*cupsJobPassword: "1111"
    +
    + +

    CUPS 1.2/OS X 10.5cupsLanguages

    *cupsLanguages: "locale list"

    @@ -1721,6 +1768,21 @@ *cupsLanguages: "en_CA en_UK en_US fr_CA fr_FR" + +

    CUPS 1.7cupsMandatory

    + +

    *cupsMandatory: "attribute1 attribute2 ... attributeN"

    + +

    This keyword defines a list of IPP attributes that must be provided when submitting a print job creation request.

    + +

    Example:

    + +
    +*% Specify that the user must supply a job-password
    +*cupsMandatory: "job-password job-password-encryption"
    +
    + +

    cupsManualCopies

    *cupsManualCopies: boolean

    @@ -2249,6 +2311,18 @@

    Change History

    +

    Changes in CUPS 1.7

    + + + +

    Changes in CUPS 1.6