]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Explain the "forbidden" error better (Issue #5547)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 15 May 2019 14:42:54 +0000 (10:42 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 15 May 2019 14:42:54 +0000 (10:42 -0400)
CHANGES.md
scheduler/client.c

index aabae66f8921e6f4503f586b44b817e3d4214441..fdaec6d2a0dab89969aeacf1b824d7f4b0d42136 100644 (file)
@@ -7,6 +7,7 @@ Changes in CUPS v2.3rc1
 
 - The `cupsctl` command now prevents setting "cups-files.conf" directives
   (Issue #5530)
+- The "forbidden" message in the web interface is now explained (Issue #5547)
 - The footer in the web interface covered some content on small displays
   (Issue #5574)
 - The `ippeveprinter` command now looks for print commands in the "command"
index df146f4c2ea666ccca558534ac914bcd4f4fd24d..923a6e67a22e9b026b90f4caa29f279cb0def0ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Client routines for the CUPS scheduler.
  *
- * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 2007-2019 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
  * This file contains Kerberos support code, copyright 2006 by
@@ -1975,11 +1975,20 @@ cupsdSendError(cupsd_client_t *con,     /* I - Connection */
     redirect[0] = '\0';
 
     if (code == HTTP_STATUS_UNAUTHORIZED)
+    {
       text = _cupsLangString(con->language,
                              _("Enter your username and password or the "
                               "root username and password to access this "
                               "page. If you are using Kerberos authentication, "
                               "make sure you have a valid Kerberos ticket."));
+    }
+    else if (code == HTTP_STATUS_FORBIDDEN)
+    {
+      if (con->username[0])
+        text = _cupsLangString(con->language, _("Your account does not have the necessary privileges."));
+      else
+        text = _cupsLangString(con->language, _("You cannot access this page."));
+    }
     else if (code == HTTP_STATUS_UPGRADE_REQUIRED)
     {
       text = urltext;