cvs: peardoc /en/packages/authentication auth.xml
| From: | Martin Jansen | Date: | Sun, 03 Nov 2002 17:18:48 +0000 |
| Subject: | cvs: peardoc /en/packages/authentication auth.xml | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-7277@lists.php.net to get a copy of this message | ||
mj Sun Nov 3 12:18:48 2002 EDT
Modified files:
/peardoc/en/packages/authentication auth.xml
Log:
* Add overview.
* Fix some markup.
Index: peardoc/en/packages/authentication/auth.xml
diff -u peardoc/en/packages/authentication/auth.xml:1.11
peardoc/en/packages/authentication/auth.xml:1.12
--- peardoc/en/packages/authentication/auth.xml:1.11 Sun Nov 3 12:06:01 2002
+++ peardoc/en/packages/authentication/auth.xml Sun Nov 3 12:18:48 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<refentry id="packages.Auth.Auth">
<refnamediv>
<refname><classname>Auth</classname></refname>
@@ -8,6 +8,32 @@
</refpurpose>
</refnamediv>
+ <refsect1 id="pacakges.Auth.Auth.overview">
+ <title>Overview</title>
+ <para>
+ <classname>PEAR::Auth</classname> provides an API for creating
+ authentication system (<quote>Login systems</quote>).
+ </para>
+ <para>
+ The login data can be stored in a number of storage containers:
+ <itemizedlist>
+ <listitem>
+ <simpara>Databases that are supported by PEAR::DB</simpara>
+ </listitem>
+ <listitem>
+ <simpara>.htaccess-like files</simpara>
+ </listitem>
+ <listitem>
+ <simpara>LDAP servers</simpara>
+ </listitem>
+ <listitem>
+ <simpara>Vpopmail servers</simpara>
+ </listitem>
+ </itemizedlist>
+ (It is very easy to create customized storage containers also.)
+ </para>
+ </refsect1>
+
<refsect1 id="packages.Auth.Auth.tutorial">
<title>Usage example</title>
@@ -19,7 +45,7 @@
At the top of the site to secured, place the
following code snippet:
</para>
- <example>
+ <example id="packages.Auth.Auth.tutorial.example.1">
<title>Typical usage example for
<classname>PEAR::Auth</classname></title>
<programlisting role="php">
<![CDATA[
@@ -27,13 +53,11 @@
function loginFunction()
{
- global $PHP_SELF;
-
/**
* Change the HTML output so that it fits to your
* application.
*/
- echo "<form method=\"post\" action=\"" . $PHP_SELF .
"\">";
+ echo "<form method=\"post\" action=\"" .
$_SERVER['PHP_SELF'] . "\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
@@ -168,31 +192,23 @@
<para>
This SQL statement creates a table usable under the default
database authentication scheme using MySQL:
- </para>
- <example>
- <title>Authentication table DDL statement</title>
- <programlisting role="sql">
- <![CDATA[
+ <programlisting role="sql">
+ <![CDATA[
CREATE TABLE auth (
username VARCHAR(50) default '' NOT NULL,
password VARCHAR(32) default '' NOT NULL,
PRIMARY KEY (username),
KEY (password)
);
- ]]>
- </programlisting>
- </example>
+ ]]>
+ </programlisting>
+ </para>
<para>
These are the table and field names necessary for working
authentication. The password column must be at least 32 characters
long because we store passwords encrypted using md5() and that is
the length of the values returned by md5().
</para>
- <para>
- This next feature is useful for sites which provide some services
- to all users that visit the sites and some services only to users
- that are logged in, such as portals.
- </para>
</refsect1>
<refsect1 id="packages.Auth.Auth.Auth">
@@ -226,7 +242,7 @@
function myOutput($username, $status)
{
- ... /** See example 1 for the full listing */
+ ... /** See <link linkend="packages.Auth.Auth.tutorial.example.1">example
1</link> for the full listing */
}
$params = array(