| 31 | */ |
| 32 | |
| 33 | int /* O - Exit status */ |
| 34 | main(void) |
| 35 | { |
| 36 | const char *pclass; /* Class name */ |
| 37 | const char *user; /* Username */ |
| 38 | http_t *http; /* Connection to the server */ |
| 39 | ipp_t *request, /* IPP request */ |
| 40 | *response; /* IPP response */ |
| 41 | ipp_attribute_t *attr; /* IPP attribute */ |
| 42 | const char *op; /* Operation to perform, if any */ |
| 43 | static const char *def_attrs[] = /* Attributes for default printer */ |
| 44 | { |
| 45 | "printer-name", |
| 46 | "printer-uri-supported" |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | /* |
| 51 | * Get any form variables... |
| 52 | */ |
| 53 | |
| 54 | cgiInitialize(); |
| 55 | |
| 56 | op = cgiGetVariable("OP"); |
| 57 | |
| 58 | /* |
| 59 | * Set the web interface section... |
| 60 | */ |
| 61 | |
| 62 | cgiSetVariable("SECTION", "classes"); |
| 63 | cgiSetVariable("REFRESH_PAGE", ""); |
| 64 | |
| 65 | /* |
| 66 | * See if we are displaying a printer or all classes... |
| 67 | */ |
| 68 | |
| 69 | if ((pclass = getenv("PATH_INFO")) != NULL) |
| 70 | { |
| 71 | pclass ++; |
| 72 | |
| 73 | if (!*pclass) |
| 74 | pclass = NULL; |
| 75 | |
| 76 | if (pclass) |
| 77 | cgiSetVariable("PRINTER_NAME", pclass); |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | * See who is logged in... |
| 82 | */ |
| 83 | |
| 84 | user = getenv("REMOTE_USER"); |
| 85 | |
| 86 | /* |
| 87 | * Connect to the HTTP server... |
| 88 | */ |
| 89 | |
| 90 | http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); |
nothing calls this directly
no test coverage detected