]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror classification stuff from 1.1.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 2 Jan 2002 16:16:14 +0000 (16:16 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 2 Jan 2002 16:16:14 +0000 (16:16 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@2007 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
scheduler/classes.c
scheduler/printers.c

index fafe57719bafe54d14e8fab755919ad2b808a005..607ea96009d1fae974106a984b2995b12f22a3e0 100644 (file)
@@ -3,6 +3,11 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.13
 
+       - The scheduler no longer replaces the JobSheets values
+         from the printers.conf and classes.conf files with the
+         classification level, if set.  This way the original
+         banner settings are preserved when classification
+         levels are changed or turned off.
        - The serial backend didn't drain the output queue, nor
          did it restore the original settings.
        - Updated the default system group under MacOS X.
index 9c53384c03391592944e9eb714b15d0c34280bc2..b0e4b86517128123f10ef329560777e7c1f91ddc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: classes.c,v 1.34.2.3 2001/12/27 00:04:52 mike Exp $"
+ * "$Id: classes.c,v 1.34.2.4 2002/01/02 16:16:14 mike Exp $"
  *
  *   Printer class routines for the Common UNIX Printing System (CUPS).
  *
@@ -335,7 +335,8 @@ LoadAllClasses(void)
   char         line[1024],             /* Line from file */
                name[256],              /* Parameter name */
                *nameptr,               /* Pointer into name */
-               *value;                 /* Pointer to value */
+               *value,                 /* Pointer to value */
+               *valueptr;              /* Pointer into value */
   printer_t    *p,                     /* Current printer class */
                *temp;                  /* Temporary pointer to printer */
 
@@ -490,6 +491,32 @@ LoadAllClasses(void)
       else
         p->accepting = 0;
     }
+    else if (strcmp(name, "JobSheets") == 0)
+    {
+     /*
+      * Set the initial job sheets...
+      */
+
+      for (valueptr = value; *valueptr && !isspace(*valueptr); valueptr ++);
+
+      if (*valueptr)
+        *valueptr++ = '\0';
+
+      strncpy(p->job_sheets[0], value, sizeof(p->job_sheets[0]) - 1);
+
+      while (isspace(*valueptr))
+        valueptr ++;
+
+      if (*valueptr)
+      {
+        for (value = valueptr; *valueptr && !isspace(*valueptr); valueptr ++);
+
+       if (*valueptr)
+          *valueptr++ = '\0';
+
+       strncpy(p->job_sheets[1], value, sizeof(p->job_sheets[1]) - 1);
+      }
+    }
     else if (strcmp(name, "AllowUser") == 0)
     {
       p->deny_users = 0;
@@ -629,5 +656,5 @@ SaveAllClasses(void)
 
 
 /*
- * End of "$Id: classes.c,v 1.34.2.3 2001/12/27 00:04:52 mike Exp $".
+ * End of "$Id: classes.c,v 1.34.2.4 2002/01/02 16:16:14 mike Exp $".
  */
index d6c94fe87fb15fd94f8d6b0053abb0fd7622593f..0a83bef255b2f49a0eabf0f7bcb63b39acab50f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.93.2.5 2001/12/27 00:04:53 mike Exp $"
+ * "$Id: printers.c,v 1.93.2.6 2002/01/02 16:16:14 mike Exp $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -101,16 +101,8 @@ AddPrinter(const char *name)       /* I - Name of printer */
   p->accepting = 0;
   p->filetype  = mimeAddType(MimeDatabase, "printer", name);
 
-  if (Classification[0])
-  {
-    strcpy(p->job_sheets[0], Classification);
-    strcpy(p->job_sheets[1], Classification);
-  }
-  else
-  {
-    strcpy(p->job_sheets[0], "none");
-    strcpy(p->job_sheets[1], "none");
-  }
+  strcpy(p->job_sheets[0], "none");
+  strcpy(p->job_sheets[1], "none");
 
  /*
   * Setup required filters and IPP attributes...
@@ -623,31 +615,28 @@ LoadAllPrinters(void)
     }
     else if (strcmp(name, "JobSheets") == 0)
     {
-      if (!Classification[0])
-      {
-       /*
-       * Set the initial job sheets...
-       */
+     /*
+      * Set the initial job sheets...
+      */
 
-       for (valueptr = value; *valueptr && !isspace(*valueptr); valueptr ++);
+      for (valueptr = value; *valueptr && !isspace(*valueptr); valueptr ++);
 
-       if (*valueptr)
-          *valueptr++ = '\0';
+      if (*valueptr)
+        *valueptr++ = '\0';
 
-       strncpy(p->job_sheets[0], value, sizeof(p->job_sheets[0]) - 1);
+      strncpy(p->job_sheets[0], value, sizeof(p->job_sheets[0]) - 1);
 
-       while (isspace(*valueptr))
-          valueptr ++;
+      while (isspace(*valueptr))
+        valueptr ++;
 
-       if (*valueptr)
-       {
-          for (value = valueptr; *valueptr && !isspace(*valueptr); valueptr ++);
+      if (*valueptr)
+      {
+        for (value = valueptr; *valueptr && !isspace(*valueptr); valueptr ++);
 
-         if (*valueptr)
-            *valueptr++ = '\0';
+       if (*valueptr)
+          *valueptr++ = '\0';
 
-         strncpy(p->job_sheets[1], value, sizeof(p->job_sheets[1]) - 1);
-       }
+       strncpy(p->job_sheets[1], value, sizeof(p->job_sheets[1]) - 1);
       }
     }
     else if (strcmp(name, "AllowUser") == 0)
@@ -943,7 +932,7 @@ SetPrinterAttrs(printer_t *p)               /* I - Printer to setup */
 
     if ((auth = FindBest(resource, HTTP_POST)) != NULL)
     {
-      if (auth->type == AUTH_BASIC)
+      if (auth->type == AUTH_BASIC || auth->type == AUTH_BASICDIGEST)
        auth_supported = "basic";
       else if (auth->type == AUTH_DIGEST)
        auth_supported = "digest";
@@ -1071,8 +1060,10 @@ SetPrinterAttrs(printer_t *p)            /* I - Printer to setup */
 
       if (attr != NULL)
       {
-       attr->values[0].string.text = strdup(p->job_sheets[0]);
-       attr->values[1].string.text = strdup(p->job_sheets[1]);
+       attr->values[0].string.text = strdup(Classification[0] ?
+                                            Classification : p->job_sheets[0]);
+       attr->values[1].string.text = strdup(Classification[0] ?
+                                            Classification : p->job_sheets[1]);
       }
     }
   }
@@ -1819,5 +1810,5 @@ write_printcap(void)
 
 
 /*
- * End of "$Id: printers.c,v 1.93.2.5 2001/12/27 00:04:53 mike Exp $".
+ * End of "$Id: printers.c,v 1.93.2.6 2002/01/02 16:16:14 mike Exp $".
  */