Fix links in docos.

Cleanup for comments, articles, strs, and documentation.

Fix comments in SQL schema.
pull/193/head
Michael R Sweet 21 years ago
parent 98d786165f
commit f367d28d41
  1. 26
      www/account.php
  2. 26
      www/comment.php
  3. 28
      www/docfiles/FindingandIteratingNodes.html
  4. 4
      www/docfiles/LegalStuff.html
  5. 32
      www/docfiles/LoadingandSavingXMLFiles.html
  6. 18
      www/docfiles/Nodes.html
  7. 39
      www/docfiles/OrganizationofThisDocument.html
  8. 8
      www/documentation.php
  9. 34
      www/phplib/auth.php
  10. 29
      www/phplib/common.php
  11. 80
      www/str.php

@ -1,6 +1,6 @@
<?php <?php
// //
// "$Id: account.php,v 1.8 2004/05/19 14:02:38 mike Exp $" // "$Id: account.php,v 1.9 2004/05/20 02:04:44 mike Exp $"
// //
// Account management page... // Account management page...
// //
@ -194,11 +194,13 @@ switch ($op)
html_footer(); html_footer();
} }
else if ($data == "disable") else if ($data == "batch")
{ {
// Disable accounts... // Disable/enable/expire/etc. accounts...
if ($REQUEST_METHOD == "POST") if ($REQUEST_METHOD == "POST" && array_key_exists("OP", $_POST))
{ {
$op = $_POST["OP"];
db_query("BEGIN TRANSACTION"); db_query("BEGIN TRANSACTION");
reset($_POST); reset($_POST);
@ -207,7 +209,10 @@ switch ($op)
{ {
$id = (int)substr($key, 3); $id = (int)substr($key, 3);
db_query("UPDATE users SET is_published = 0 WHERE id = $id"); if ($op == "disable")
db_query("UPDATE users SET is_published = 0 WHERE id = $id");
else if ($op == "enable")
db_query("UPDATE users SET is_published = 1 WHERE id = $id");
} }
db_query("COMMIT TRANSACTION"); db_query("COMMIT TRANSACTION");
@ -367,7 +372,7 @@ switch ($op)
$result = db_query("SELECT * FROM users ORDER BY name"); $result = db_query("SELECT * FROM users ORDER BY name");
print("<form method='POST' action='$PHP_SELF?Adisable'>\n"); print("<form method='POST' action='$PHP_SELF?Abatch'>\n");
html_start_table(array("Username", "EMail", "Level")); html_start_table(array("Username", "EMail", "Level"));
@ -392,8 +397,11 @@ switch ($op)
} }
html_start_row("header"); html_start_row("header");
print("<td align='center' colspan='3'>&nbsp;<br /><input type='submit' " print("<td align='center' colspan='3'>&nbsp;<br /><select name='OP'>"
."value='Disable Checked Accounts'/></td>"); ."<option value='disable'>Disable</option>"
."<option value='enable'>Enable</option>"
."</select>"
."<input type='submit' value='Checked Accounts'/></td>");
html_end_row(); html_end_row();
html_end_table(); html_end_table();
@ -604,6 +612,6 @@ switch ($op)
// //
// End of "$Id: account.php,v 1.8 2004/05/19 14:02:38 mike Exp $". // End of "$Id: account.php,v 1.9 2004/05/20 02:04:44 mike Exp $".
// //
?> ?>

@ -1,6 +1,6 @@
<?php <?php
// //
// "$Id: comment.php,v 1.6 2004/05/19 16:34:54 mike Exp $" // "$Id: comment.php,v 1.7 2004/05/20 02:04:44 mike Exp $"
// //
// Comment and moderation interface for PHP pages... // Comment and moderation interface for PHP pages...
// //
@ -51,7 +51,7 @@ for ($i = 0; $i < $argc; $i ++)
break; break;
case 'p' : // Set path case 'p' : // Set path
$path = substr($argv[$i], 1); $path = urldecode(substr($argv[$i], 1));
break; break;
} }
} }
@ -86,7 +86,9 @@ else
if ($REQUEST_METHOD == "POST") if ($REQUEST_METHOD == "POST")
{ {
if (array_key_exists("AUTHOR", $_POST)) if ($LOGIN_USER != "" && $LOGIN_LEVEL < AUTH_DEVEL)
$create_user = $LOGIN_USER;
else if (array_key_exists("AUTHOR", $_POST))
$create_user = trim($_POST["AUTHOR"]); $create_user = trim($_POST["AUTHOR"]);
else else
$create_user = ""; $create_user = "";
@ -106,10 +108,10 @@ else
else else
$contents = ""; $contents = "";
if (strpos($contents, "http:") === false && if (strpos($contents, "http:") === FALSE &&
strpos($contents, "https:") === false && strpos($contents, "https:") === FALSE &&
strpos($contents, "ftp:") === false && strpos($contents, "ftp:") === FALSE &&
strpos($contents, "mailto:") === false && strpos($contents, "mailto:") === FALSE &&
$contents != "" && $create_user != "" && $file != "") $contents != "" && $create_user != "" && $file != "")
$havedata = 1; $havedata = 1;
@ -130,7 +132,9 @@ else
} }
else else
{ {
if (array_key_exists("FROM", $_COOKIE)) if ($LOGIN_USER != "")
$create_user = $LOGIN_USER;
else if (array_key_exists("FROM", $_COOKIE))
$create_user = $_COOKIE["FROM"]; $create_user = $_COOKIE["FROM"];
else else
$create_user = "Anonymous <anonymous@easysw.com>"; $create_user = "Anonymous <anonymous@easysw.com>";
@ -143,7 +147,9 @@ else
} }
else else
{ {
if (array_key_exists("FROM", $_COOKIE)) if ($LOGIN_USER != "")
$create_user = $LOGIN_USER;
else if (array_key_exists("FROM", $_COOKIE))
$create_user = $_COOKIE["FROM"]; $create_user = $_COOKIE["FROM"];
else else
$create_user = "Anonymous <anonymous@easysw.com>"; $create_user = "Anonymous <anonymous@easysw.com>";
@ -367,6 +373,6 @@ else
} }
// //
// End of "$Id: comment.php,v 1.6 2004/05/19 16:34:54 mike Exp $". // End of "$Id: comment.php,v 1.7 2004/05/20 02:04:44 mike Exp $".
// //
?> ?>

@ -28,46 +28,46 @@ PRE { font-family: monospace }
<A HREF="3MoreMiniXMLProgrammingTechniques.html">Next</A> <A HREF="3MoreMiniXMLProgrammingTechniques.html">Next</A>
<HR NOSHADE> <HR NOSHADE>
<H3><A NAME="3_3_1">Finding and Iterating Nodes</A></H3> <H3><A NAME="3_3_1">Finding and Iterating Nodes</A></H3>
<P>The <A href="reference.html#mxmlWalkPrev"><TT>mxmlWalkPrev()</TT></A> <P>The <A href="mxmlWalkPrev.html#mxmlWalkPrev"><TT>mxmlWalkPrev()</TT></A>
and <A href="reference.html#mxmlWalkNext"><TT>mxmlWalkNext()</TT></A> and <A href="mxmlWalkNext.html#mxmlWalkNext"><TT>mxmlWalkNext()</TT></A>
functions can be used to iterate through the XML node tree:</P> functions can be used to iterate through the XML node tree:</P>
<PRE> <PRE>
<A href="reference.html#mxml_node_t">mxml_node_t</A> *node = <A href="reference.html#mxmlWalkPrev">mxmlWalkPrev</A>(current, tree, MXML_DESCEND); <A href="mxmlnodet.html#mxml_node_t">mxml_node_t</A> *node = <A href="mxmlWalkPrev.html#mxmlWalkPrev">mxmlWalkPrev</A>(current, tree, MXML_DESCEND);
<A href="reference.html#mxml_node_t">mxml_node_t</A> *node = <A href="reference.html#mxmlWalkNext">mxmlWalkNext</A>(current, tree, MXML_DESCEND); <A href="mxmlnodet.html#mxml_node_t">mxml_node_t</A> *node = <A href="mxmlWalkNext.html#mxmlWalkNext">mxmlWalkNext</A>(current, tree, MXML_DESCEND);
</PRE> </PRE>
<P>In addition, you can find a named element/node using the <A href="reference.html#mxmlFindElement"> <P>In addition, you can find a named element/node using the <A href="mxmlFindElement.html#mxmlFindElement">
<TT>mxmlFindElement()</TT></A> function:</P> <TT>mxmlFindElement()</TT></A> function:</P>
<PRE> <PRE>
<A href="reference.html#mxml_node_t">mxml_node_t</A> *node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;name&quot;, &quot;attr&quot;, <A href="mxmlnodet.html#mxml_node_t">mxml_node_t</A> *node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;name&quot;, &quot;attr&quot;,
&quot;value&quot;, MXML_DESCEND); &quot;value&quot;, MXML_DESCEND);
</PRE> </PRE>
<P>The <TT>name</TT>, <TT>attr</TT>, and <TT>value</TT> arguments can be <P>The <TT>name</TT>, <TT>attr</TT>, and <TT>value</TT> arguments can be
passed as <TT>NULL</TT> to act as wildcards, e.g.:</P> passed as <TT>NULL</TT> to act as wildcards, e.g.:</P>
<PRE> <PRE>
/* Find the first &quot;a&quot; element */ /* Find the first &quot;a&quot; element */
node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;a&quot;, NULL, NULL, MXML_DESCEND); node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;a&quot;, NULL, NULL, MXML_DESCEND);
/* Find the first &quot;a&quot; element with &quot;href&quot; attribute */ /* Find the first &quot;a&quot; element with &quot;href&quot; attribute */
node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;a&quot;, &quot;href&quot;, NULL, MXML_DESCEND); node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;a&quot;, &quot;href&quot;, NULL, MXML_DESCEND);
/* Find the first &quot;a&quot; element with &quot;href&quot; to a URL */ /* Find the first &quot;a&quot; element with &quot;href&quot; to a URL */
node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;a&quot;, &quot;href&quot;, node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;a&quot;, &quot;href&quot;,
&quot;http://www.easysw.com/~mike/mxml/&quot;, MXML_DESCEND); &quot;http://www.easysw.com/~mike/mxml/&quot;, MXML_DESCEND);
/* Find the first element with a &quot;src&quot; attribute*/ /* Find the first element with a &quot;src&quot; attribute*/
node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, NULL, &quot;src&quot;, NULL, MXML_DESCEND); node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, NULL, &quot;src&quot;, NULL, MXML_DESCEND);
/* Find the first element with a &quot;src&quot; = &quot;foo.jpg&quot; */ /* Find the first element with a &quot;src&quot; = &quot;foo.jpg&quot; */
node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, NULL, &quot;src&quot;, &quot;foo.jpg&quot;, MXML_DESCEND); node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, NULL, &quot;src&quot;, &quot;foo.jpg&quot;, MXML_DESCEND);
</PRE> </PRE>
<P>You can also iterate with the same function:</P> <P>You can also iterate with the same function:</P>
<PRE> <PRE>
<A href="reference.html#mxml_node_t">mxml_node_t</A> *node; <A href="mxmlnodet.html#mxml_node_t">mxml_node_t</A> *node;
for (node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;name&quot;, NULL, NULL, MXML_DESCEND); for (node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(tree, tree, &quot;name&quot;, NULL, NULL, MXML_DESCEND);
node != NULL; node != NULL;
node = <A href="reference.html#mxmlFindElement">mxmlFindElement</A>(node, tree, &quot;name&quot;, NULL, NULL, MXML_DESCEND)) node = <A href="mxmlFindElement.html#mxmlFindElement">mxmlFindElement</A>(node, tree, &quot;name&quot;, NULL, NULL, MXML_DESCEND))
{ {
... do something ... ... do something ...
} }

@ -30,8 +30,8 @@ PRE { font-family: monospace }
<H2><A NAME="1_1">Legal Stuff</A></H2> <H2><A NAME="1_1">Legal Stuff</A></H2>
<P>The Mini-XML library is copyright 2003-2004 by Michael Sweet.</P> <P>The Mini-XML library is copyright 2003-2004 by Michael Sweet.</P>
<P>This library is free software; you can redistribute it and/or modify <P>This library is free software; you can redistribute it and/or modify
it under the terms of the <A href="AGNULibraryGeneralPublicLicense.html#LICENSE"> it under the terms of the <A href="license.html#LICENSE">GNU Library
GNU Library General Public License</A> as published by the Free Software General Public License</A> as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any Foundation; either version 2 of the License, or (at your option) any
later version.</P> later version.</P>
<P>This library is distributed in the hope that it will be useful, but <P>This library is distributed in the hope that it will be useful, but

@ -28,14 +28,14 @@ PRE { font-family: monospace }
<A HREF="FindingandIteratingNodes.html">Next</A> <A HREF="FindingandIteratingNodes.html">Next</A>
<HR NOSHADE> <HR NOSHADE>
<H2><A NAME="3_3">Loading and Saving XML Files</A></H2> <H2><A NAME="3_3">Loading and Saving XML Files</A></H2>
<P>You load an XML file using the <A href="reference.html#mxmlLoadFile"><TT> <P>You load an XML file using the <A href="mxmlLoadFile.html#mxmlLoadFile">
mxmlLoadFile()</TT></A> function:</P> <TT>mxmlLoadFile()</TT></A> function:</P>
<PRE> <PRE>
FILE *fp; FILE *fp;
<A href="reference.html#mxml_node_t">mxml_node_t</A> *tree; <A href="mxmlnodet.html#mxml_node_t">mxml_node_t</A> *tree;
fp = fopen(&quot;filename.xml&quot;, &quot;r&quot;); fp = fopen(&quot;filename.xml&quot;, &quot;r&quot;);
tree = <A href="reference.html#mxmlLoadFile">mxmlLoadFile</A>(NULL, fp, MXML_NO_CALLBACK); tree = <A href="mxmlLoadFile.html#mxmlLoadFile">mxmlLoadFile</A>(NULL, fp, MXML_NO_CALLBACK);
fclose(fp); fclose(fp);
</PRE> </PRE>
<P>The third argument specifies a callback function which returns the <P>The third argument specifies a callback function which returns the
@ -45,14 +45,14 @@ MXML_TEXT</TT>. This function is called<I> after</I> the element and its
attributes have been read, so you can look at the element name, attributes have been read, so you can look at the element name,
attributes, and attribute values to determine the proper value type to attributes, and attribute values to determine the proper value type to
return. The default value type is MXML_TEXT if no callback is used.</P> return. The default value type is MXML_TEXT if no callback is used.</P>
<P>Similarly, you save an XML file using the <A href="reference.html#mxmlSaveFile"> <P>Similarly, you save an XML file using the <A href="mxmlSaveFile.html#mxmlSaveFile">
<TT>mxmlSaveFile()</TT></A> function:</P> <TT>mxmlSaveFile()</TT></A> function:</P>
<PRE> <PRE>
FILE *fp; FILE *fp;
<A href="reference.html#mxml_node_t">mxml_node_t</A> *tree; <A href="mxmlnodet.html#mxml_node_t">mxml_node_t</A> *tree;
fp = fopen(&quot;filename.xml&quot;, &quot;w&quot;); fp = fopen(&quot;filename.xml&quot;, &quot;w&quot;);
<A href="reference.html#mxmlSaveFile">mxmlSaveFile</A>(tree, fp, MXML_NO_CALLBACK); <A href="mxmlSaveFile.html#mxmlSaveFile">mxmlSaveFile</A>(tree, fp, MXML_NO_CALLBACK);
fclose(fp); fclose(fp);
</PRE> </PRE>
<P>Callback functions for saving are used to optionally insert <P>Callback functions for saving are used to optionally insert
@ -63,24 +63,24 @@ MXML_WS_AFTER_OPEN</TT>, <TT>MXML_WS_BEFORE_CLOSE</TT>, or <TT>
MXML_WS_AFTER_CLOSE</TT>. The callback function should return <TT>NULL</TT> MXML_WS_AFTER_CLOSE</TT>. The callback function should return <TT>NULL</TT>
if no whitespace should be added and the string to insert (spaces, if no whitespace should be added and the string to insert (spaces,
tabs, carriage returns, and newlines) otherwise.</P> tabs, carriage returns, and newlines) otherwise.</P>
<P>The <A href="reference.html#mxmlLoadString"><TT>mxmlLoadString()</TT></A> <P>The <A href="mxmlLoadString.html#mxmlLoadString"><TT>mxmlLoadString()</TT>
, <A href="reference.html#mxmlSaveAllocString"><TT>mxmlSaveAllocString()</TT> </A>, <A href="mxmlSaveAllocString.html#mxmlSaveAllocString"><TT>
</A>, and <A href="reference.html#mxmlSaveString"><TT>mxmlSaveString()</TT> mxmlSaveAllocString()</TT></A>, and <A href="mxmlSaveString.html#mxmlSaveString">
</A> functions load XML node trees from and save XML node trees to <TT>mxmlSaveString()</TT></A> functions load XML node trees from and
strings:</P> save XML node trees to strings:</P>
<PRE> <PRE>
char buffer[8192]; char buffer[8192];
char *ptr; char *ptr;
<A href="reference.html#mxml_node_t">mxml_node_t</A> *tree; <A href="mxmlnodet.html#mxml_node_t">mxml_node_t</A> *tree;
... ...
tree = <A href="reference.html#mxmlLoadString">mxmlLoadString</A>(NULL, buffer, MXML_NO_CALLBACK); tree = <A href="mxmlLoadString.html#mxmlLoadString">mxmlLoadString</A>(NULL, buffer, MXML_NO_CALLBACK);
... ...
<A href="reference.html#mxmlSaveString">mxmlSaveString</A>(tree, buffer, sizeof(buffer), MXML_NO_CALLBACK); <A href="mxmlSaveString.html#mxmlSaveString">mxmlSaveString</A>(tree, buffer, sizeof(buffer), MXML_NO_CALLBACK);
... ...
ptr = <A href="reference.html#mxmlSaveAllocString">mxmlSaveAllocString</A>(tree, MXML_NO_CALLBACK); ptr = <A href="mxmlSaveAllocString.html#mxmlSaveAllocString">mxmlSaveAllocString</A>(tree, MXML_NO_CALLBACK);
</PRE> </PRE>
<HR NOSHADE> <HR NOSHADE>
<A HREF="toc.html">Contents</A> <A HREF="toc.html">Contents</A>

@ -29,16 +29,16 @@ PRE { font-family: monospace }
<HR NOSHADE> <HR NOSHADE>
<H2><A NAME="3_2">Nodes</A></H2> <H2><A NAME="3_2">Nodes</A></H2>
<P>Every piece of information in an XML file (elements, text, numbers) <P>Every piece of information in an XML file (elements, text, numbers)
is stored in memory in &quot;nodes&quot;. Nodes are defined by the <A href="reference.html#mxml_node_t"> is stored in memory in &quot;nodes&quot;. Nodes are defined by the <A href="mxmlnodet.html#mxml_node_t">
<TT>mxml_node_t</TT></A> structure. The <A href="reference.html#mxml_type_t"> <TT>mxml_node_t</TT></A> structure. The <A href="mxmltypet.html#mxml_type_t">
<TT>type</TT></A> member defines the node type (element, integer, <TT>type</TT></A> member defines the node type (element, integer,
opaque, real, or text) which determines which value you want to look at opaque, real, or text) which determines which value you want to look at
in the <A href="reference.html#mxml_value_t"><TT>value</TT></A> union.</P> in the <A href="mxmlvaluet.html#mxml_value_t"><TT>value</TT></A> union.</P>
<P>New nodes can be created using the <A href="reference.html#mxmlNewElement"> <P>New nodes can be created using the <A href="mxmlNewElement.html#mxmlNewElement">
<TT>mxmlNewElement()</TT></A>, <A href="reference.html#mxmlNewInteger"><TT> <TT>mxmlNewElement()</TT></A>, <A href="mxmlNewInteger.html#mxmlNewInteger">
mxmlNewInteger()</TT></A>, <A href="reference.html#mxmlNewOpaque"><TT> <TT>mxmlNewInteger()</TT></A>, <A href="mxmlNewOpaque.html#mxmlNewOpaque">
mxmlNewOpaque()</TT></A>, <A href="reference.html#mxmlNewReal"><TT> <TT>mxmlNewOpaque()</TT></A>, <A href="mxmlNewReal.html#mxmlNewReal"><TT>
mxmlNewReal()</TT></A>, and <A href="reference.html#mxmlNewText"><TT> mxmlNewReal()</TT></A>, and <A href="mxmlNewText.html#mxmlNewText"><TT>
mxmlNewText()</TT></A> functions. Only elements can have child nodes, mxmlNewText()</TT></A> functions. Only elements can have child nodes,
and the top node must be an element, usually &quot;?xml&quot;.</P> and the top node must be an element, usually &quot;?xml&quot;.</P>
<P>Each node has pointers for the node above (<TT>parent</TT>), below (<TT> <P>Each node has pointers for the node above (<TT>parent</TT>), below (<TT>
@ -77,7 +77,7 @@ child</TT>), to the left (<TT>prev</TT>), and to the right (<TT>next</TT>
</PRE> </PRE>
<P>where &quot;-&quot; is a pointer to the next node and &quot;|&quot; is a pointer to the <P>where &quot;-&quot; is a pointer to the next node and &quot;|&quot; is a pointer to the
first child node.</P> first child node.</P>
<P>Once you are done with the XML data, use the <A href="reference.html#mxmlDelete"> <P>Once you are done with the XML data, use the <A href="mxmlDelete.html#mxmlDelete">
<TT>mxmlDelete()</TT></A> function to recursively free the memory that <TT>mxmlDelete()</TT></A> function to recursively free the memory that
is used for a particular node or the entire tree:</P> is used for a particular node or the entire tree:</P>
<PRE> <PRE>

@ -30,26 +30,25 @@ PRE { font-family: monospace }
<H2><A NAME="1_3">Organization of This Document</A></H2> <H2><A NAME="1_3">Organization of This Document</A></H2>
<P>This manual is organized into the following chapters and appendices:</P> <P>This manual is organized into the following chapters and appendices:</P>
<UL> <UL>
<LI>Chapter 1, &quot;<A href="1BuildingInstallingandPackagingMiniXML.html#INSTALL"> <LI>Chapter 1, &quot;<A href="install.html#INSTALL">Building, Installing, and
Building, Installing, and Packaging Mini-XML</A>&quot;, provides compilation, Packaging Mini-XML</A>&quot;, provides compilation, installation, and
installation, and packaging instructions for Mini-XML.</LI> packaging instructions for Mini-XML.</LI>
<LI>Chapter 2, &quot;<A href="2GettingStartedwithMiniXML.html#BASICS">Getting <LI>Chapter 2, &quot;<A href="basics.html#BASICS">Getting Started with
Started with Mini-XML</A>&quot;, shows how to use the Mini-XML library in Mini-XML</A>&quot;, shows how to use the Mini-XML library in your programs.</LI>
your programs.</LI> <LI>Chapter 3, &quot;<A href="advanced.html#ADVANCED">More Mini-XML
<LI>Chapter 3, &quot;<A href="3MoreMiniXMLProgrammingTechniques.html#ADVANCED"> Programming Techniques</A>&quot;, shows additional ways to use the Mini-XML
More Mini-XML Programming Techniques</A>&quot;, shows additional ways to use library.</LI>
the Mini-XML library.</LI> <LI>Chapter 4, &quot;<A href="mxmldoc.html#MXMLDOC">Using the mxmldoc Utility</A>
<LI>Chapter 4, &quot;<A href="4UsingthemxmldocUtility.html#MXMLDOC">Using the &quot;, describes how to use the <TT>mxmldoc(1)</TT> program to generate
mxmldoc Utility</A>&quot;, describes how to use the <TT>mxmldoc(1)</TT> software documentation.</LI>
program to generate software documentation.</LI> <LI>Appendix A, &quot;<A href="license.html#LICENSE">GNU Library General
<LI>Appendix A, &quot;<A href="AGNULibraryGeneralPublicLicense.html#LICENSE"> Public License</A>&quot;, provides the terms and conditions for using and
GNU Library General Public License</A>&quot;, provides the terms and distributing Mini-XML.</LI>
conditions for using and distributing Mini-XML.</LI> <LI>Appendix B, &quot;<A href="relnotes.html#RELNOTES">Release Notes</A>&quot;,
<LI>Appendix B, &quot;<A href="BReleaseNotes.html#RELNOTES">Release Notes</A> lists the changes in each release of Mini-XML.</LI>
&quot;, lists the changes in each release of Mini-XML.</LI> <LI>Appendix C, &quot;<A href="refapp.html#REFERENCE">Library Reference</A>&quot;,
<LI>Appendix C, &quot;<A href="CLibraryReference.html#REFERENCE">Library contains a complete reference for Mini-XML, generated by <TT>mxmldoc</TT>
Reference</A>&quot;, contains a complete reference for Mini-XML, generated .</LI>
by <TT>mxmldoc</TT>.</LI>
</UL> </UL>
<!-- NEED 4in --> <!-- NEED 4in -->

@ -1,6 +1,6 @@
<?php <?php
// //
// "$Id: documentation.php,v 1.2 2004/05/19 16:34:54 mike Exp $" // "$Id: documentation.php,v 1.3 2004/05/20 02:04:44 mike Exp $"
// //
// Mini-XML documentation page... // Mini-XML documentation page...
// //
@ -108,10 +108,10 @@ if (array_key_exists("PATH_INFO", $_SERVER) &&
print("<hr noshade/>\n" print("<hr noshade/>\n"
."<h2><a name='_USER_COMMENTS'>User Comments</a> [&nbsp;" ."<h2><a name='_USER_COMMENTS'>User Comments</a> [&nbsp;"
."<a href='comment.php?r0+p$path'>Add&nbsp;Comment</a>" ."<a href='../comment.php?r0+pdocumentation.php$path'>Add&nbsp;Comment</a>"
."&nbsp;]</h2>\n"); ."&nbsp;]</h2>\n");
$num_comments = show_comments("documentation.php$path"); $num_comments = show_comments("documentation.php$path", "../");
if ($num_comments == 0) if ($num_comments == 0)
print("<p>No comments for this page.</p>\n"); print("<p>No comments for this page.</p>\n");
@ -195,6 +195,6 @@ formats on-line:</p>
} }
// //
// End of "$Id: documentation.php,v 1.2 2004/05/19 16:34:54 mike Exp $". // End of "$Id: documentation.php,v 1.3 2004/05/20 02:04:44 mike Exp $".
// //
?> ?>

@ -1,14 +1,15 @@
<? <?
// //
// "$Id: auth.php,v 1.7 2004/05/19 21:17:47 mike Exp $" // "$Id: auth.php,v 1.8 2004/05/20 02:04:45 mike Exp $"
// //
// Authentication functions for PHP pages... // Authentication functions for PHP pages...
// //
// Contents: // Contents:
// //
// auth_current() - Return the currently logged in user... // auth_current() - Return the currently logged in user...
// auth_login() - Log a user into the system. // auth_login() - Log a user into the system.
// auth_logout() - Logout of the current user by clearing the session ID. // auth_logout() - Logout of the current user by clearing the session ID.
// auth_user_email() - Return the email address of a user...
// //
// //
@ -154,6 +155,29 @@ auth_logout()
// //
// End of "$Id: auth.php,v 1.7 2004/05/19 21:17:47 mike Exp $". // 'auth_user_email()' - Return the email address of a user...
//
function // O - Email address
auth_user_email($username) // I - Username
{
$result = db_query("SELECT * FROM users WHERE "
."name = '" . db_escape($username) . "'");
if (db_count($result) == 1)
{
$row = db_next($result);
$email = $row["email"];
}
else
$email = "";
db_free($result);
return ($email);
}
//
// End of "$Id: auth.php,v 1.8 2004/05/20 02:04:45 mike Exp $".
// //
?> ?>

@ -1,6 +1,6 @@
<? <?
// //
// "$Id: common.php,v 1.9 2004/05/19 21:17:47 mike Exp $" // "$Id: common.php,v 1.10 2004/05/20 02:04:45 mike Exp $"
// //
// Common utility functions for PHP pages... // Common utility functions for PHP pages...
// //
@ -16,6 +16,7 @@
// sanitize_text() - Sanitize text. // sanitize_text() - Sanitize text.
// select_is_published() - Do a <select> for the "is published" field... // select_is_published() - Do a <select> for the "is published" field...
// show_comments() - Show comments for the given path... // show_comments() - Show comments for the given path...
// validate_email() - Validate an email address...
// //
@ -577,7 +578,7 @@ show_comments($url, // I - URL for comment
$parent_id = 0, // I - Parent comment $parent_id = 0, // I - Parent comment
$heading = 3) // I - Heading level $heading = 3) // I - Heading level
{ {
global $_COOKIE; global $_COOKIE, $LOGIN_LEVEL;
$result = db_query("SELECT * FROM comment WHERE " $result = db_query("SELECT * FROM comment WHERE "
@ -621,6 +622,13 @@ show_comments($url, // I - URL for comment
."$contents\n"); ."$contents\n");
html_start_links(); html_start_links();
if ($LOGIN_LEVEL >= AUTH_DEVEL)
{
html_link("Edit", "${path}comment.php?e$row[id]+p$safeurl");
html_link("Delete", "${path}comment.php?d$row[id]+p$safeurl");
}
html_link("Reply", "${path}comment.php?r$row[id]+p$safeurl"); html_link("Reply", "${path}comment.php?r$row[id]+p$safeurl");
if ($modpoints > 0) if ($modpoints > 0)
@ -648,6 +656,21 @@ show_comments($url, // I - URL for comment
// //
// End of "$Id: common.php,v 1.9 2004/05/19 21:17:47 mike Exp $". // 'validate_email()' - Validate an email address...
//
function // O - TRUE if OK, FALSE otherwise
validate_email($email) // I - Email address
{
// Check for both "name@domain.com" and "Full Name <name@domain.com>"
return (eregi("^[a-zA-Z0-9_\.+-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}$",
$email) ||
eregi("^[^<]*<[a-zA-Z0-9_\.+-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}>$",
$email));
}
//
// End of "$Id: common.php,v 1.10 2004/05/20 02:04:45 mike Exp $".
// //
?> ?>

@ -1,12 +1,12 @@
<?php <?php
// //
// "$Id: str.php,v 1.10 2004/05/19 21:17:47 mike Exp $" // "$Id: str.php,v 1.11 2004/05/20 02:04:44 mike Exp $"
// //
// Software Trouble Report page... // Software Trouble Report page...
// //
// Contents: // Contents:
// //
// notify_creator() - Notify creator of a STR of changes... // notify_users() - Notify users of STR changes...
// //
// //
@ -77,13 +77,13 @@ db_free($result);
// //
// 'notify_creator()' - Notify creator of a STR of changes... // 'notify_users()' - Notify users of STR changes...
// //
function function
notify_creator($id, // I - STR # notify_users($id, // I - STR #
$what = "updated", // I - Reason for notification $what = "updated", // I - Reason for notification
$contents = "") // I - Notification message $contents = "") // I - Notification message
{ {
global $priority_long; global $priority_long;
global $scope_long; global $scope_long;
@ -110,9 +110,15 @@ notify_creator($id, // I - STR #
else else
$fix_version = "Unassigned"; $fix_version = "Unassigned";
if (eregi("[a-z0-9_.]+", $row['create_user']))
$email = auth_user_email($row['create_user']);
else
$email = $row['create_user'];
if ($row['create_user'] != $row['modify_user'] && if ($row['create_user'] != $row['modify_user'] &&
$row['create_user'] != $manager) $row['create_user'] != $manager &&
mail($row['create_user'], "$PROJECT_NAME STR #$id $what", $email != "")
mail($email, "$PROJECT_NAME STR #$id $what",
"Your software trouble report #$id has been $what. You can check\n" "Your software trouble report #$id has been $what. You can check\n"
."the status of the report and add additional comments and/or files\n" ."the status of the report and add additional comments and/or files\n"
."at the following URL:\n" ."at the following URL:\n"
@ -131,12 +137,12 @@ notify_creator($id, // I - STR #
."Thank you for using the $PROJECT_NAME Software Trouble Report page!", ."Thank you for using the $PROJECT_NAME Software Trouble Report page!",
"From: noreply@easysw.com\r\n"); "From: noreply@easysw.com\r\n");
$ccresult = db_query("SELECT email FROM strcc WHERE str_id = $id"); $ccresult = db_query("SELECT email FROM carboncopy WHERE url = 'str.php_L$id'");
if ($ccresult) if ($ccresult)
{ {
while ($ccrow = db_next($ccresult)) while ($ccrow = db_next($ccresult))
{ {
mail($ccrow->email, "$PROJECT_NAME STR #$id $what", mail($ccrow['email'], "$PROJECT_NAME STR #$id $what",
"Software trouble report #$id has been $what. You can check\n" "Software trouble report #$id has been $what. You can check\n"
."the status of the report and add additional comments and/or files\n" ."the status of the report and add additional comments and/or files\n"
."at the following URL:\n" ."at the following URL:\n"
@ -162,7 +168,7 @@ notify_creator($id, // I - STR #
if ($row['manager_email'] != "") if ($row['manager_email'] != "")
$manager = $row['manager_email']; $manager = $row['manager_email'];
else else
$manager = "$PROJECT_EMAIL"; $manager = $PROJECT_EMAIL;
if ($row['modify_user'] != $manager) if ($row['modify_user'] != $manager)
mail($manager, "$PROJECT_NAME STR #$id $what", mail($manager, "$PROJECT_NAME STR #$id $what",
@ -383,7 +389,7 @@ switch ($op)
db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents'," db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents',"
."$time,'$modify_user')"); ."$time,'$modify_user')");
notify_creator($id, "updated", $mailmsg); notify_users($id, "updated", $mailmsg);
} }
} }
@ -966,9 +972,9 @@ switch ($op)
$master_id = (int)$_POST["MASTER_ID"]; $master_id = (int)$_POST["MASTER_ID"];
$summary = db_escape($_POST["SUMMARY"]); $summary = db_escape($_POST["SUMMARY"]);
$subsystem = db_escape($_POST["SUBSYSTEM"]); $subsystem = db_escape($_POST["SUBSYSTEM"]);
$create_user = db_escape($_POST["CREATE_EMAIL"]); $create_user = db_escape($_POST["CREATE_EMAIL"]);
$manager_email = db_escape($_POST["MANAGER_EMAIL"]); $manager_email = db_escape($_POST["MANAGER_EMAIL"]);
$modify_user = db_escape($_COOKIE["FROM"]); $modify_user = db_escape($_COOKIE["FROM"]);
$contents = db_escape(trim($_POST["CONTENTS"])); $contents = db_escape(trim($_POST["CONTENTS"]));
$message = $_POST["MESSAGE"]; $message = $_POST["MESSAGE"];
@ -1007,7 +1013,7 @@ switch ($op)
header("Location: $PHP_SELF?L$id$options"); header("Location: $PHP_SELF?L$id$options");
notify_creator($id, "updated", $contents); notify_users($id, "updated", $contents);
} }
else if (array_key_exists("FILE_ID", $_POST)) else if (array_key_exists("FILE_ID", $_POST))
{ {
@ -1051,7 +1057,7 @@ switch ($op)
$row = db_next($result); $row = db_next($result);
$create_user = htmlspecialchars($row['create_user']); $create_user = htmlspecialchars($row['create_user']);
$manager_email = htmlspecialchars($row['manager_email']); $manager_email = htmlspecialchars($row['manager_email']);
$summary = htmlspecialchars($row['summary'], ENT_QUOTES); $summary = htmlspecialchars($row['summary'], ENT_QUOTES);
@ -1292,10 +1298,13 @@ switch ($op)
{ {
$contents = $_POST["CONTENTS"]; $contents = $_POST["CONTENTS"];
if (array_key_exists("EMAIL", $_POST)) if ($LOGIN_USER != "" && $LOGIN_LEVEL < AUTH_DEVEL)
$email = $LOGIN_USER;
else if (array_key_exists("EMAIL", $_POST) &&
validate_email($_POST["EMAIL"]))
{ {
$email = $_POST["EMAIL"]; $email = $_POST["EMAIL"];
setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME); setcookie("FROM", "$email", time() + 90 * 86400, "/");
} }
else if (array_key_exists("FROM", $_COOKIE)) else if (array_key_exists("FROM", $_COOKIE))
$email = $_COOKIE["FROM"]; $email = $_COOKIE["FROM"];
@ -1310,7 +1319,9 @@ switch ($op)
} }
else else
{ {
if (array_key_exists("FROM", $_COOKIE)) if ($LOGIN_USER != "")
$email = $LOGIN_USER;
else if (array_key_exists("FROM", $_COOKIE))
$email = $_COOKIE["FROM"]; $email = $_COOKIE["FROM"];
else else
$email = ""; $email = "";
@ -1338,7 +1349,7 @@ switch ($op)
header("Location: $PHP_SELF?L$id$options"); header("Location: $PHP_SELF?L$id$options");
notify_creator($id, "updated", "$contents\n\n"); notify_users($id, "updated", "$contents\n\n");
} }
else else
{ {
@ -1400,10 +1411,13 @@ switch ($op)
case 'F' : // Post file for STR # case 'F' : // Post file for STR #
if ($REQUEST_METHOD == "POST") if ($REQUEST_METHOD == "POST")
{ {
if (array_key_exists("EMAIL", $_POST)) if ($LOGIN_USER != "" && $LOGIN_LEVEL < AUTH_DEVEL)
$email = $LOGIN_USER;
else if (array_key_exists("EMAIL", $_POST) &&
validate_email($_POST["EMAIL"]))
{ {
$email = $_POST["EMAIL"]; $email = $_POST["EMAIL"];
setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME); setcookie("FROM", "$email", time() + 90 * 86400, "/");
} }
else if (array_key_exists("FROM", $_COOKIE)) else if (array_key_exists("FROM", $_COOKIE))
$email = $_COOKIE["FROM"]; $email = $_COOKIE["FROM"];
@ -1427,7 +1441,9 @@ switch ($op)
} }
else else
{ {
if (array_key_exists("FROM", $_COOKIE)) if ($LOGIN_USER != "")
$email = $LOGIN_USER;
else if (array_key_exists("FROM", $_COOKIE))
$email = $_COOKIE["FROM"]; $email = $_COOKIE["FROM"];
else else
$email = ""; $email = "";
@ -1484,7 +1500,7 @@ switch ($op)
header("Location: $PHP_SELF?L$id$options"); header("Location: $PHP_SELF?L$id$options");
notify_creator($id, "updated", "Added file $name\n\n"); notify_users($id, "updated", "Added file $name\n\n");
} }
else else
{ {
@ -1558,7 +1574,8 @@ switch ($op)
if ($LOGIN_USER != "" && $LOGIN_LEVEL < AUTH_DEVEL) if ($LOGIN_USER != "" && $LOGIN_LEVEL < AUTH_DEVEL)
$email = $LOGIN_USER; $email = $LOGIN_USER;
else if (array_key_exists("EMAIL", $_POST)) else if (array_key_exists("EMAIL", $_POST) &&
validate_email($_POST["EMAIL"]))
{ {
$email = $_POST["EMAIL"]; $email = $_POST["EMAIL"];
setcookie("FROM", "$email", time() + 90 * 86400, "/"); setcookie("FROM", "$email", time() + 90 * 86400, "/");
@ -1656,7 +1673,7 @@ switch ($op)
} }
header("Location: $PHP_SELF?L$id$options"); header("Location: $PHP_SELF?L$id$options");
notify_creator($id, "created", "$contents\n\n"); notify_users($id, "created", "$contents\n\n");
} }
else else
{ {
@ -1814,20 +1831,21 @@ switch ($op)
$notification = $_POST["NOTIFICATION"]; $notification = $_POST["NOTIFICATION"];
$email = $_POST["EMAIL"]; $email = $_POST["EMAIL"];
if (($notification != "ON" && $notification != "OFF") || $email == "") if (($notification != "ON" && $notification != "OFF") || $email == "" ||
!validate_email($email))
{ {
html_header("STR Error"); html_header("STR Error");
print("<p>Please press your browsers back button and enter an " print("<p>Please press your browsers back button and enter a valid "
."EMail address and choose whether to receive notification " ."EMail address and choose whether to receive notification "
."messages.</p>\n"); ."messages.</p>\n");
html_footer(); html_footer();
exit(); exit();
} }
setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME); setcookie("FROM", "$email", time() + 90 * 86400, "/");
$result = db_query("SELECT * FROM carboncopy WHERE " $result = db_query("SELECT * FROM carboncopy WHERE "
."url = 'str.php?L$id' AND email = '$email'"); ."url = 'str.php_L$id' AND email = '$email'");
html_header("STR #$id Notifications"); html_header("STR #$id Notifications");
@ -1872,6 +1890,6 @@ switch ($op)
} }
// //
// End of "$Id: str.php,v 1.10 2004/05/19 21:17:47 mike Exp $". // End of "$Id: str.php,v 1.11 2004/05/20 02:04:44 mike Exp $".
// //
?> ?>

Loading…
Cancel
Save