/*
- * "$Id: admin.c 5290 2006-03-14 21:43:57Z mike $"
+ * "$Id: admin.c 5360 2006-03-30 17:02:17Z mike $"
*
* Administration CGI for the Common UNIX Printing System (CUPS).
*
if (!strcmp(op, "redirect"))
{
const char *url; /* Redirection URL... */
+ char prefix[1024]; /* URL prefix */
+ if (getenv("HTTPS"))
+ snprintf(prefix, sizeof(prefix), "https://%s:%s",
+ getenv("SERVER_NAME"), getenv("SERVER_PORT"));
+ else
+ snprintf(prefix, sizeof(prefix), "http://%s:%s",
+ getenv("SERVER_NAME"), getenv("SERVER_PORT"));
+
if ((url = cgiGetVariable("URL")) != NULL)
- printf("Location: %s\n\n", url);
+ printf("Location: %s%s\n\n", prefix, url);
else
- puts("Location: /admin\n");
+ printf("Location: %s/admin\n\n", prefix);
}
else if (!strcmp(op, "start-printer"))
do_printer_op(http, IPP_RESUME_PRINTER, cgiText(_("Start Printer")));
/*
- * End of "$Id: admin.c 5290 2006-03-14 21:43:57Z mike $".
+ * End of "$Id: admin.c 5360 2006-03-30 17:02:17Z mike $".
*/