]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cgi-bin/admin.c
Merge changes from CUPS 1.4svn-r7394.
[thirdparty/cups.git] / cgi-bin / admin.c
index 6fa500d71c83b8f15b464b0fc9fb3aee40a60e5b..b54d27fdc86920c81b6d1dc5430e59cd7e308dca 100644 (file)
@@ -308,6 +308,16 @@ do_add_rss_subscription(http_t *http)      /* I - HTTP connection */
     return;
   }
 
+ /*
+  * Make sure we have a username...
+  */
+
+  if ((user = getenv("REMOTE_USER")) == NULL)
+  {
+    puts("Status: 401\n");
+    exit(0);
+  }
+
  /*
   * Validate the subscription name...
   */
@@ -352,9 +362,6 @@ do_add_rss_subscription(http_t *http)       /* I - HTTP connection */
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
                  NULL, printer_uri);
 
-  if ((user = getenv("REMOTE_USER")) == NULL)
-    user = "guest";
-
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
                NULL, user);
 
@@ -1305,6 +1312,16 @@ do_cancel_subscription(http_t *http)/* I - HTTP connection */
     return;
   }
 
+ /*
+  * Require a username...
+  */
+
+  if ((user = getenv("REMOTE_USER")) == NULL)
+  {
+    puts("Status: 401\n");
+    exit(0);
+  }
+
  /*
   * Cancel the subscription...
   */
@@ -1316,9 +1333,6 @@ do_cancel_subscription(http_t *http)/* I - HTTP connection */
   ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER,
                 "notify-subscription-id", id);
 
-  if ((user = getenv("REMOTE_USER")) == NULL)
-    user = "guest";
-
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
                NULL, user);