Roxen.git / server / modules / tags / sqltag.pike

version» Context lines:

Roxen.git/server/modules/tags/sqltag.pike:1:   /* -  * $Id: sqltag.pike,v 1.16 1997/11/26 22:12:27 grubba Exp $ +  * $Id: sqltag.pike,v 1.17 1997/11/29 22:25:03 grubba Exp $    *    * A module for Roxen Challenger, which gives the tags    * <SQLQUERY> and <SQLOUTPUT>.    *    * Henrik Grubbström 1997-01-12    */    - constant cvs_version="$Id: sqltag.pike,v 1.16 1997/11/26 22:12:27 grubba Exp $"; + constant cvs_version="$Id: sqltag.pike,v 1.17 1997/11/29 22:25:03 grubba Exp $";   constant thread_safe=1;   #include <module.h>      /* Compatibility with old versions of the sqltag module. */   // #define SQL_TAG_COMPAT      inherit "module";   inherit "roxenlib";      import Array;
Roxen.git/server/modules/tags/sqltag.pike:58:    "[<i>host</i>[:<i>port</i>]]/<i>database</i></pre><br>\n"    "</ul>Valid values for \"sqlserver\" depend on which "    "sql-servers your pike has support for, but the following "    "might exist: msql, mysql, odbc, oracle, postgres.</td></tr>\n"    "<tr><td valign=top><b>database</b></td>"    "<td>The name of the database to use.</td></tr>\n"    "<tr><td valign=top><b>user</b></td>"    "<td>The name of the user to access the database with.</td></tr>\n"    "<tr><td valign=top><b>password</b></td>"    "<td>The password to access the database.</td></tr>\n" +  "<tr><td valign=top><b>parse</b></td>" +  "<td>If specified, the query will be parsed by the " +  "RXML-parser</td></tr>"    "</table></ul><p>\n"    "The &lt;sqltable&gt; tag has an additional attribute "    "<b>ascii</b>, which generates a tab-separated table (usefull "    "with eg the &lt;diagram&gt; tag).<p>\n"    "\n"    "<b>NOTE</b>: Specifying passwords in the documents may prove "    "to be a security hole if the module is not loaded for some " -  "reason.<br>\n", +  "reason.<br>\n" +  "<b>SEE ALSO</b>: The &lt;FORMOUTPUT&gt; tag can be " +  "usefull to generate the queries.<br>\n",    0,    1 }) );   }      /*    * Tag handlers    */      string sqloutput_tag(string tag_name, mapping args, string contents, -  object request_id, mapping defines) +  object request_id, object f, +  mapping defines, object fd)   {    if (args->query) { -  +  +  if (args->parse) { +  args->query = parse_rxml(args->query, request_id, f, defines, fd); +  } +     string host = query("hostname");   #ifdef SQL_TAG_COMPAT    string database = query("database");    string user = query("user");    string password = query("password");   #else /* SQL_TAG_COMPAT */    string database, user, password;   #endif /* SQL_TAG_COMPAT */    object(sql) con;    array(mapping(string:mixed)) result;
Roxen.git/server/modules/tags/sqltag.pike:163:    } else {    contents = "<false>";    }    } else {    contents = "<!-- No query! --><false>";    }    return(contents);   }      string sqlquery_tag(string tag_name, mapping args, -  object request_id, mapping defines) +  object request_id, object f, +  mapping defines, object fd)   {    if (args->query) { -  +  +  if (args->parse) { +  args->query = parse_rxml(args->query, request_id, f, defines, fd); +  } +     string host = query("hostname");   #ifdef SQL_TAG_COMPAT    string database = query("database");    string user = query("user");    string password = query("password");   #else /* SQL_TAG_COMPAT */    string database, user, password;   #endif /* SQL_TAG_COMPAT */    object(sql) con;    mixed error;
Roxen.git/server/modules/tags/sqltag.pike:219:    con->error() + "</h1>\n" +    ((master()->describe_backtrace(error)/"\n")*"<br>\n"));    }    return(res?"<true>":"<false>");    } else {    return("<!-- No query! --><false>");    }   }      string sqltable_tag(string tag_name, mapping args, -  object request_id, mapping defines) +  object request_id, object f, +  mapping defines, object fd)   {    int ascii;       if (args->ascii) {    // ASCII-mode    ascii = 1;    }       if (args->query) { -  +  +  if (args->parse) { +  args->query = parse_rxml(args->query, request_id, f, defines, fd); +  } +     string host = query("hostname");   #ifdef SQL_TAG_COMPAT    string database = query("database");    string user = query("user");    string password = query("password");   #else /* SQL_TAG_COMPAT */    string database, user, password;   #endif /* SQL_TAG_COMPAT */    object(sql) con;    mixed error;