summaryrefslogtreecommitdiff
path: root/cgi-bin
diff options
context:
space:
mode:
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2006-03-04 15:56:42 +0000
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2006-03-04 15:56:42 +0000
commit4744bd907e6750c26bba4354d986e342406147ca (patch)
tree1dee14bb6163fc453ebe124dee65155384b46ad6 /cgi-bin
parentb423cd4cb9fa8cf030cc046a59c28196f3edf6b4 (diff)
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@75 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cgi-bin')
-rw-r--r--cgi-bin/classes.c9
-rw-r--r--cgi-bin/help.c26
-rw-r--r--cgi-bin/printers.c9
3 files changed, 33 insertions, 11 deletions
diff --git a/cgi-bin/classes.c b/cgi-bin/classes.c
index 2aa9bed78..d7fd569e7 100644
--- a/cgi-bin/classes.c
+++ b/cgi-bin/classes.c
@@ -1,5 +1,5 @@
/*
- * "$Id: classes.c 5160 2006-02-24 01:14:18Z mike $"
+ * "$Id: classes.c 5202 2006-02-28 19:37:03Z mike $"
*
* Class status CGI for the Common UNIX Printing System (CUPS).
*
@@ -84,8 +84,13 @@ main(int argc, /* I - Number of command-line arguments */
*/
if ((pclass = getenv("PATH_INFO")) != NULL)
+ {
pclass ++;
+ if (!*pclass)
+ pclass = NULL;
+ }
+
/*
* See who is logged in...
*/
@@ -458,5 +463,5 @@ show_class(http_t *http, /* I - Connection to server */
/*
- * End of "$Id: classes.c 5160 2006-02-24 01:14:18Z mike $".
+ * End of "$Id: classes.c 5202 2006-02-28 19:37:03Z mike $".
*/
diff --git a/cgi-bin/help.c b/cgi-bin/help.c
index efee0fe5b..6dc512ead 100644
--- a/cgi-bin/help.c
+++ b/cgi-bin/help.c
@@ -56,6 +56,7 @@ main(int argc, /* I - Number of command-line arguments */
directory[1024]; /* Directory */
cups_file_t *fp; /* Help file */
char line[1024]; /* Line from file */
+ int printable; /* Show printable version? */
/*
@@ -64,6 +65,8 @@ main(int argc, /* I - Number of command-line arguments */
cgiInitialize();
+ printable = cgiGetVariable("PRINTABLE") != NULL;
+
/*
* Set the web interface section...
*/
@@ -92,7 +95,7 @@ main(int argc, /* I - Number of command-line arguments */
{
perror(filename);
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
cgiSetVariable("ERROR", "Unable to load help index!");
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -133,7 +136,7 @@ main(int argc, /* I - Number of command-line arguments */
{
perror(filename);
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
cgiSetVariable("ERROR", "Unable to access help file!");
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -143,7 +146,7 @@ main(int argc, /* I - Number of command-line arguments */
if ((n = helpFindNode(hi, helpfile, NULL)) == NULL)
{
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
cgiSetVariable("ERROR", "Help file not in index!");
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -162,7 +165,10 @@ main(int argc, /* I - Number of command-line arguments */
* Send a standard page header...
*/
- cgiStartHTML(n->text);
+ if (printable)
+ puts("Content-Type: text/html;charset=utf-8\n");
+ else
+ cgiStartHTML(n->text);
}
else
{
@@ -170,7 +176,7 @@ main(int argc, /* I - Number of command-line arguments */
* Send a standard page header...
*/
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
}
/*
@@ -311,7 +317,10 @@ main(int argc, /* I - Number of command-line arguments */
* Show the search and bookmark content...
*/
- cgiCopyTemplateLang("help-header.tmpl");
+ if (!helpfile || !printable)
+ cgiCopyTemplateLang("help-header.tmpl");
+ else
+ cgiCopyTemplateLang("help-printable.tmpl");
/*
* If we are viewing a file, copy it in now...
@@ -353,7 +362,10 @@ main(int argc, /* I - Number of command-line arguments */
* Send a standard trailer...
*/
- cgiEndHTML();
+ if (!printable)
+ cgiEndHTML();
+ else
+ puts("</BODY>\n</HTML>");
/*
* Delete the index...
diff --git a/cgi-bin/printers.c b/cgi-bin/printers.c
index 0b4a3a8cb..74b950d56 100644
--- a/cgi-bin/printers.c
+++ b/cgi-bin/printers.c
@@ -1,5 +1,5 @@
/*
- * "$Id: printers.c 5160 2006-02-24 01:14:18Z mike $"
+ * "$Id: printers.c 5202 2006-02-28 19:37:03Z mike $"
*
* Printer status CGI for the Common UNIX Printing System (CUPS).
*
@@ -87,8 +87,13 @@ main(int argc, /* I - Number of command-line arguments */
*/
if ((printer = getenv("PATH_INFO")) != NULL)
+ {
printer ++;
+ if (!*printer)
+ printer = NULL;
+ }
+
/*
* See who is logged in...
*/
@@ -633,5 +638,5 @@ show_printer(http_t *http, /* I - Connection to server */
/*
- * End of "$Id: printers.c 5160 2006-02-24 01:14:18Z mike $".
+ * End of "$Id: printers.c 5202 2006-02-28 19:37:03Z mike $".
*/