return;
}
- /*
- * Check policy...
- */
-
- if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
- {
- send_http_error(con, status, NULL);
- return;
- }
-
/*
* See if the class already exists; if not, create a new class...
*/
}
/*
- * No, add the pclass...
+ * No, check the default policy and then add the class...
*/
+ if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
+
pclass = cupsdAddClass(resource + 9);
modify = 0;
}
else if (pclass->type & CUPS_PRINTER_IMPLICIT)
{
/*
- * Rename the implicit class to "AnyClass" or remove it...
+ * Check the default policy, then tename the implicit class to "AnyClass"
+ * or remove it...
*/
+ if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
+
if (ImplicitAnyClasses)
{
snprintf(newname, sizeof(newname), "Any%s", resource + 9);
else if (pclass->type & CUPS_PRINTER_DISCOVERED)
{
/*
- * Rename the remote class to "Class"...
+ * Check the default policy, then rename the remote class to "Class"...
*/
+ if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
+
snprintf(newname, sizeof(newname), "%s@%s", resource + 9, pclass->hostname);
cupsdRenamePrinter(pclass, newname);
pclass = cupsdAddClass(resource + 9);
modify = 0;
}
+ else if ((status = cupsdCheckPolicy(pclass->op_policy_ptr, con,
+ NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
else
modify = 1;
return;
}
- /*
- * Check policy...
- */
-
- if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
- {
- send_http_error(con, status, NULL);
- return;
- }
-
/*
* See if the printer already exists; if not, create a new printer...
*/
}
/*
- * No, add the printer...
+ * No, check the default policy then add the printer...
*/
+ if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
+
printer = cupsdAddPrinter(resource + 10);
modify = 0;
}
else if (printer->type & CUPS_PRINTER_IMPLICIT)
{
/*
- * Rename the implicit printer to "AnyPrinter" or delete it...
+ * Check the default policy, then rename the implicit printer to
+ * "AnyPrinter" or delete it...
*/
+ if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
+
if (ImplicitAnyClasses)
{
snprintf(newname, sizeof(newname), "Any%s", resource + 10);
else if (printer->type & CUPS_PRINTER_DISCOVERED)
{
/*
- * Rename the remote printer to "Printer@server"...
+ * Check the default policy, then rename the remote printer to
+ * "Printer@server"...
*/
+ if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
+
snprintf(newname, sizeof(newname), "%s@%s", resource + 10,
printer->hostname);
cupsdRenamePrinter(printer, newname);
printer = cupsdAddPrinter(resource + 10);
modify = 0;
}
+ else if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con,
+ NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, NULL);
+ return;
+ }
else
modify = 1;