cvs: peardoc /en/package/authentication/auth intro.xml /en/package/authentication/auth/auth setadvancedsecurity.xml setallowlogin.xml
setshowlogin.xml

From: Date: Sun, 04 Jul 2004 20:59:06 +0000
Subject: cvs: peardoc /en/package/authentication/auth intro.xml /en/package/authentication/auth/auth setadvancedsecurity.xml setallowlogin.xml
setshowlogin.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-4567@lists.php.net to get a copy of this message
yavo Sun Jul 4 16:59:06 2004 EDT Added files: /peardoc/en/package/authentication/auth/auth setadvancedsecurity.xml setallowlogin.xml Modified files: /peardoc/en/package/authentication/auth/auth setshowlogin.xml /peardoc/en/package/authentication/auth intro.xml Log: Some doc updates

http://cvs.php.net/diff.php/peardoc/en/package/authentication/auth/auth/setshowlogin.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/authentication/auth/auth/setshowlogin.xml diff -u peardoc/en/package/authentication/auth/auth/setshowlogin.xml:1.1 peardoc/en/package/authentication/auth/auth/setshowlogin.xml:1.2 --- peardoc/en/package/authentication/auth/auth/setshowlogin.xml:1.1 Fri Jun 25 13:45:58 2004 +++ peardoc/en/package/authentication/auth/auth/setshowlogin.xml Sun Jul 4 16:59:06 2004 @@ -1,8 +1,8 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.authentication.auth.auth.setshowlogin"> <refnamediv> <refname>Auth::setShowLogin()</refname> - <refpurpose>controls if the login form will be displayed</refpurpose> + <refpurpose>controls if the login form will be displayed. Turned on by default</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> http://cvs.php.net/diff.php/peardoc/en/package/authentication/auth/intro.xml?r1=1.10&r2=1.11&ty=u Index: peardoc/en/package/authentication/auth/intro.xml diff -u peardoc/en/package/authentication/auth/intro.xml:1.10 peardoc/en/package/authentication/auth/intro.xml:1.11 --- peardoc/en/package/authentication/auth/intro.xml:1.10 Mon Jun 28 03:50:19 2004 +++ peardoc/en/package/authentication/auth/intro.xml Sun Jul 4 16:59:06 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id="package.authentication.auth.intro"> <refnamediv> <refname>Introduction</refname> @@ -17,7 +17,7 @@ <title>Typical usage example for <classname>PEAR::Auth</classname></title> <programlisting role="php"> <![CDATA[ -require_once "Auth/Auth.php"; +require_once "Auth.php"; function loginFunction() { @@ -37,7 +37,7 @@ $a->start(); -if ($a->getAuth()) { +if ($a->checkAuth()) { /** * The output of your site goes here. */ @@ -56,13 +56,7 @@ formatting in this function. </para> <para> - <warning> - <simpara> - You can change all the HTML formatting in the function, but you - cannot change the names of the input boxes in the form. They have - to be <literal>username</literal> and <literal>password</literal>. - </simpara> - </warning> + <!-- Put example here for using custom post fields --> </para> <para> Since we want to use a database to verify the login data, we now @@ -84,30 +78,16 @@ <para> Now our authentication object is initialized and we need to check if the user is logged in. This is done via the method - <function>getAuth</function>. If it returns &true;, we can pass the + <function>checkAuth</function>. If it returns &true;, we can pass the content of our page to the user. </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>Using optional authentication</title> <programlisting role="php"> <![CDATA[ -require_once "Auth/Auth.php"; +require_once "Auth.php"; function loginFunction() { @@ -163,13 +143,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(); } - </programlisting> + ]]></programlisting> </example> <para> @@ -180,16 +160,14 @@ This SQL statement creates a table usable under the default database authentication scheme using MySQL: </para> - <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> + ]]></programlisting> <para> These are the table and field names necessary for working authentication. When hashing the passwords with the MD5 algorithm, http://cvs.php.net/co.php/peardoc/en/package/authentication/auth/auth/setadvancedsecurity.xml?r=1.1&p=1 Index: peardoc/en/package/authentication/auth/auth/setadvancedsecurity.xml +++ peardoc/en/package/authentication/auth/auth/setadvancedsecurity.xml <!-- $Revision: 1.1 $ --> <refentry id="package.authentication.auth.auth.setadvancedsecurity"> <refnamediv> <refname>Auth::setAdvancedSecurity()</refname> <refpurpose>Enables advanced security features. Turned off by default</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>Auth::setAdvancedSecurity</function></funcdef> <paramdef>bool <parameter>$flag = true</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.authentication.auth.auth.setadvancedsecurity.desc"> &title.desc; <para> Enables advanced security features to to make man in the middle atacks and session hijacking much harder. Cookies and java script must be enabled on the client browser for some of these features to function correctly. Enables the following security features of auth - Detection of client ip address change or user-agent header change if such a change is detected the user will be logged out - Each client request a special unique cookie is given to the client. He must present this cookie on his next request. This cookie changes on every request. If client does not present the valid cookie he will be logged out. - Enables challenge responce for the default login screen of auth. The user password will be hashed with javascript before sent back to the server. Prevents the user password being stolen using password sniffing tools. Password is hashed with a random key so the md5 hash is not subject to brute force password cracking. This will only work for storage containers which support challenge responce password authenthication. Currently only the DB container supports this for md5 and clear text passwords <note> <para> This method is available since <literal>1.3.0</literal> </para> </note> </para> </refsect1> <refsect1 id="package.authentication.auth.auth.setadvancedsecurity.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.bool; <parameter>$flag</parameter> </term> <listitem> <para> true if you want to enable advanced security features false if you want to disable them. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.authentication.auth.auth.setadvancedsecurity.note"> &title.note; &note.notstatic; <para> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/en/package/authentication/auth/auth/setallowlogin.xml?r=1.1&p=1 Index: peardoc/en/package/authentication/auth/auth/setallowlogin.xml +++ peardoc/en/package/authentication/auth/auth/setallowlogin.xml <!-- $Revision: 1.1 $ --> <refentry id="package.authentication.auth.auth.setallowlogin"> <refnamediv> <refname>Auth::setAllowLogin()</refname> <refpurpose>Controls if the user will be allowed to login. Turned on by default </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>Auth::setShowLogin</function></funcdef> <paramdef>bool <parameter>$allowLogin = true</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.authentication.auth.auth.setallowlogin.desc"> &title.desc; <para> Controls if auth will process the post variables and attempt to login the user from those pages. For better security of your application it is recomended to disable login in all pages except your login page. <note> <para> This method is available since <literal>1.3.0</literal> </para> </note> </para> </refsect1> <refsect1 id="package.authentication.auth.auth.setallowlogin.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$showLogin</parameter> </term> <listitem> <para> true if you want to allow login set this to true other wise set it to false. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.authentication.auth.auth.setallowlogin.note"> &title.note; &note.notstatic; <para> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#4567) next »