]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cgi-bin/ipp-var.c
Load cups into easysw/current.
[thirdparty/cups.git] / cgi-bin / ipp-var.c
index dbc2ea2a5c69a9e53405f95dcbbc638a49670d73..274c8e9b8d8e026e8a2c14f2126d32795923d27e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp-var.c 5097 2006-02-10 04:06:23Z mike $"
+ * "$Id: ipp-var.c 5235 2006-03-06 13:02:23Z mike $"
  *
  *   CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
  *
@@ -661,7 +661,7 @@ cgiRewriteURL(const char *uri,              /* I - Current URI */
     if ((server = getenv("SERVER_NAME")) == NULL)
       server = "";
 
-    httpGetHostname(servername, sizeof(servername));
+    httpGetHostname(NULL, servername, sizeof(servername));
 
    /*
     * Then flag whether we are using SSL on this connection...
@@ -896,7 +896,8 @@ cgiSetIPPObjectVars(
            break;
 
        case IPP_TAG_URI :
-           if (strchr(attr->values[i].string.text, ':') != NULL)
+           if (strchr(attr->values[i].string.text, ':') &&
+               strcmp(name, "device_uri"))
            {
             /*
              * Rewrite URIs...
@@ -1151,7 +1152,10 @@ cgiShowJobs(http_t     *http,            /* I - Connection to server */
     if ((var = cgiGetVariable("ORDER")) != NULL)
       ascending = !strcasecmp(var, "asc");
     else
-      ascending = 1;
+    {
+      ascending = !which_jobs || !strcasecmp(which_jobs, "not-completed");
+      cgiSetVariable("ORDER", ascending ? "asc" : "dec");
+    }
 
     if (ascending)
     {
@@ -1273,5 +1277,5 @@ cgiText(const char *message)              /* I - Message */
 
 
 /*
- * End of "$Id: ipp-var.c 5097 2006-02-10 04:06:23Z mike $".
+ * End of "$Id: ipp-var.c 5235 2006-03-06 13:02:23Z mike $".
  */