cvs: peardoc /fr/package/authentication/auth intro.xml
| From: | Christophe Gesch� | Date: | Sat, 22 Oct 2005 19:30:49 +0000 |
| Subject: | cvs: peardoc /fr/package/authentication/auth intro.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7042@lists.php.net to get a copy of this message | ||
moosh Sat Oct 22 15:30:49 2005 EDT
Modified files:
/peardoc/fr/package/authentication/auth intro.xml
Log:
- sync to EN 1.12
1.8 : MD5 isn't the only encryption algorithm that can be used with Auth. Bug: #770
1.9 : Fix logout example to avoid downle login screen in some cases
1.11 : Some doc updates
1.12 : * Call the file test.php. Bug 4524. * These are block comments, not docblocks, so use
"/*", not "/**".
http://cvs.php.net/diff.php/peardoc/fr/package/authentication/auth/intro.xml?r1=1.5&r2=1.6&ty=u
Index: peardoc/fr/package/authentication/auth/intro.xml
diff -u peardoc/fr/package/authentication/auth/intro.xml:1.5
peardoc/fr/package/authentication/auth/intro.xml:1.6
--- peardoc/fr/package/authentication/auth/intro.xml:1.5 Sat Oct 22 04:24:19 2005
+++ peardoc/fr/package/authentication/auth/intro.xml Sat Oct 22 15:30:43 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<!-- EN-Revision: 1.9 Maintainer: moosh Status: start -->
<refentry id="package.authentication.auth.intro">
<refnamediv>
@@ -40,7 +40,7 @@
$a->start();
-if ($a->getAuth()) {
+if ($a->checkAuth()) {
/*
* The output of your site goes here.
*/
@@ -52,11 +52,14 @@
</para>
<para>
The first line in the above script includes the file from your
- PEAR directory. It contains all the necessary code to run
- <classname>PEAR::Auth</classname>. Next, we define a function
- to display the login form which the visitor of your page has to
- use to enter his login data. You can change all the <acronym>HTML</acronym>
- formatting in this function.
+ PEAR directory.
+
+ It contains all the necessary code to run <classname>PEAR::Auth</classname>.
+
+ Next, we define a function to display the login form which the visitor
+ of your page has to use to enter his login data.
+
+ You can change all the <acronym>HTML</acronym> formatting in this function.
</para>
<para>
<warning>
@@ -69,16 +72,19 @@
Since we want to use a database to verify the login data, we now
create the variable <varname>$dsn</varname>, it contains a valid
DSN string that will be used to connect to the database via
- <link linkend="package.database.db">PEAR::DB</link>. For the default
- database table schema or to use a different storage container,
+ <link linkend="package.database.db">PEAR::DB</link>.
+
+ For the default database table schema
+ or to use a different storage container,
please see below for more information.
</para>
<para>
- After that we create the authentication object. The first
- parameter defines the name of the storage container. Because we
- want to use a database driven storage container, we pass "DB"
- here. The second parameter is the connection parameter for the
- container driver.
+ After that we create the authentication object.
+ The first parameter defines the name of the storage container.
+ Because we want to use a database driven storage container,
+ we pass "DB" here.
+
+ The second parameter is the connection parameter for the container driver.
We use the previously defined DSN string.
@@ -91,28 +97,12 @@
Maintenant notre objet d'authentification est initialisé
et nous devons vérifier si l'utilisateur est déjà connecté.
- Ce que nous faisons avec
- <function>checkAuth</function>.
+ Ce que nous faisons avec <function>checkAuth</function>.
S'il retourne &true;,
Nous pouvons passer le contenu de votre page
à l'utilisateur.
</para>
- <para>
- <warning>
- <para>
- For now one cannot use
- <programlisting role="php">
- <![CDATA[
- $auth = new Auth(...);
- ]]>
- </programlisting>
- with <literal>register_globals=on</literal>, because
- <varname>$auth</varname> is also the name of the session variable,
- that is internally used by <classname>PEAR::Auth</classname>.
- </para>
- </warning>
- </para>
</example>
<example>
<title>Utilisation d'une authentification optionelle</title>
@@ -120,13 +110,12 @@
<![CDATA[
// In this test, the file is named "test.php".
-require_once "Auth/Auth.php";
+require_once "Auth.php";
function loginFunction()
{
/*
- * Change the HTML output so that it fits to your
- * application.
+ * Adaptez le HTML à votre application.
*/
echo "<form method=\"post\" action=\"test.php?login=1\">";
echo "<input type=\"text\" name=\"username\">";
@@ -176,13 +165,13 @@
The following example performs a <quote>logout</quote> for the
current user and displays the login form again.
</simpara>
- <programlisting role="php">
+ <programlisting role="php"><![CDATA[
+ $myauth->start();
if ($_GET['action'] == "logout" && $myauth->checkAuth()) {
$myauth->logout();
+ $myauth->start();
}
-$myauth->start();
-
- </programlisting>
+ ]]></programlisting>
</example>
<para>