cvs: peardoc / global.ent /en/package/authentication liveuser.xml /en/package/authentication/liveuser intro.xml setup.xml

From: Date: Thu, 23 Nov 2006 06:52:58 +0000
Subject: cvs: peardoc / global.ent /en/package/authentication liveuser.xml /en/package/authentication/liveuser intro.xml setup.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8862@lists.php.net to get a copy of this message
cweiske Thu Nov 23 06:52:58 2006 UTC Added files: /peardoc/en/package/authentication/liveuser intro.xml setup.xml Modified files: /peardoc global.ent /peardoc/en/package/authentication liveuser.xml Log: Setup instructions for LiveUser, fixing bug #9422 Thanks to Tim Denby

http://cvs.php.net/viewvc.cgi/peardoc/global.ent?r1=1.70&r2=1.71&diff_format=u Index: peardoc/global.ent diff -u peardoc/global.ent:1.70 peardoc/global.ent:1.71 --- peardoc/global.ent:1.70 Tue Nov 21 12:19:45 2006 +++ peardoc/global.ent Thu Nov 23 06:52:57 2006 @@ -1,6 +1,6 @@ <!-- -*- SGML -*- - $Id: global.ent,v 1.70 2006/11/21 12:19:45 cweiske Exp $ + $Id: global.ent,v 1.71 2006/11/23 06:52:57 cweiske Exp $ Contains global "macros" for all the XML documents. @@ -92,6 +92,7 @@ <!ENTITY url.pear.docs.cachelite 'http://cvs.php.net/co.php/pear/Cache_Lite/docs/technical'> <!ENTITY url.pear.go 'http://go-pear.org/'> <!ENTITY url.pear.manual 'http://pear.php.net/manual/'> +<!ENTITY url.pear.manual.installation 'http://pear.php.net/manual/en/installation.php'> <!ENTITY url.pear.support 'http://pear.php.net/support/'> <!ENTITY url.pear.package 'http://pear.php.net/package/'> <!ENTITY url.pear.package.browse 'http://pear.php.net/packages.php'> http://cvs.php.net/viewvc.cgi/peardoc/en/package/authentication/liveuser.xml?r1=1.19&r2=1.20&diff_format=u Index: peardoc/en/package/authentication/liveuser.xml diff -u peardoc/en/package/authentication/liveuser.xml:1.19 peardoc/en/package/authentication/liveuser.xml:1.20 --- peardoc/en/package/authentication/liveuser.xml:1.19 Mon Oct 30 22:23:49 2006 +++ peardoc/en/package/authentication/liveuser.xml Thu Nov 23 06:52:57 2006 @@ -1,230 +1,9 @@ -<!-- $Revision: 1.19 $ --> +<!-- $Revision: 1.20 $ --> <sect1 id="package.authentication.liveuser"> <title>LiveUser</title> - <para> - <classname>LiveUser</classname> is an advanced authentication and permission - framework that comes - with a large array of out of the box features which can be used optionally. - - The base class is called <classname>LiveUser</classname> and is often - refered to as the "client" - and is what will be commonly be used to authenticate a specific user - and then optionally make permission checks on this user. - </para> - <para> - LiveUser provides the following key features: - - The LiveUser class takes care of the login process and can be configured to - use a certain permission container and one or more different - auth containers. - - That means, you can have your users' data scattered amongst many data - containers and have the LiveUser class try each defined container until - the user is found. - - For example, you can have all website users who can apply for a new account - online on the webserver's local database. - - Also, you want to enable all your company's employees to login to the site - without the need to create new accounts for all of them. - - To achieve that, a second container can be defined to be used by the - LiveUser class. - </para> - - <para> - You can also define a permission container of your choice that will manage - the rights for each user. - - Depending on the container, you can implement any kind of permission schemes - for your application while having one consistent API. - </para> - - <para> - Using different permission and auth containers, - it's easily possible to integrate newly written applications with older ones - that have their own ways of storing permissions and user data. - - Just make a new container type and you're ready to go! - </para> - - <para> - Currently available are containers using: - PEAR::DB, PEAR::MDB, PEAR::MDB2, ext/PDO, PEAR::XML_Tree, Session and PEAR::Auth. - </para> - - <para> - There is also an external <ulink url="&url.liveuser.wiki;">wiki</ulink> - dedicated to LiveUser: - </para> - - <para> - At this point LiveUser is still in beta stage. - - Even so LiveUser is already being used - on a wide range of production websites. - - A non exaustive list can be found - <ulink url="&url.liveuser.wiki.references;">here</ulink>. - </para> - - <para> - The current roadmap for LiveUser can be viewed - <ulink url="&url.liveuser.wiki.roadmap.client;">here</ulink>. - </para> - - <para> - A detailed introduction to the core concepts of LiveUser can be found - in the following phpmag - <ulink url="&url.liveuser.phpmag.article1;">article</ulink>. - </para> - - <para> - This article was published in april 2004 and is therefore not entirely - uptodate. - - However the core principles remain unchanged and most of the recent changes - resolve around making the API more consistent and flexible. - - As a result the API examples are mostly out of date. - - The article also fails to mention the fact that the permission containers - are now separated in a logic and a storage layer. - - This was done to remove logic duplication as well as to allow the - implementation of a stackable storage approach, where users could configure - LiveUser to first call a cache storage layer, which in turn would fetch - the necessary data on demand from the actual storage layer. - </para> - - <para> - A more recent article providing a step by step guide to LiveUser and the - different permission containers can be found - <ulink url="&url.liveuser.gvngroup.be.intro;">here</ulink>. - </para> - - <para> - Before you can use LiveUser you will need to setup the necessary data - structures for the chosen container. - - Through the use of the configuration options it is possible to customize - alot of the aspects of the storage layer. - - Most notably it is possible to alias field and table names. - - This should make it possible to integrate any legacy data into LiveUser. - - Depending on the container chosen you may have to use the database schema - installer. - - The installer requires the MDB2_Schema and MDB2 packages and is able to - handle most configuration options properly to be able to install the - database schema directly into your database. - - You can find the install class in "[PEAR]/data/misc/schema/install.php". - - There is some sample code which is partially commented out at the top. - - Basically its a two step process for both the auth and perm: (1) - generate the schema xml file, (2) install the schema. - </para> - - <para> - During the installation process the installer will create backup files of - the installed schema. - - These files will enable the installer to attempt to alter the database if - run again with a different configuration. - - However if these files exist the installer will always attempt to alter - instead of creating the tables from scratch as long as you are using the sam - DSN. - - If for some reason you need to create the tables from scratch again then - please delete the backup files with the matching DSN. - - You can find the installer inside the data directory of your pear install - directory. - - Its called install.php and at the top of the file you will find a number of - sample API calls which are commented out. - </para> - - <para> - An ER diagram of the database structure can be found - <ulink url="&url.liveuser.backendmedia.dbschema;">here</ulink>. - </para> - - <para> - The diagram details what tables are needed - for what permission complexity level. - - If you want to prevent the installer from installing tables you dont need - you can modify the "tables" property of the instance of the permission - container you pass to the generateSchema() method in the installer. - </para> - - <para> - In order to get started with LiveUser the following - <ulink url="&url.liveuser.jystewart.config;">two</ulink> - <ulink url="&url.liveuser.jystewart.start;">articles</ulink> should - help in getting off the ground. - </para> - - <para> - The observer support in LiveUser allows users to automatically have LiveUser - call certain callbacks on a number of internal events. - - It is documented - <ulink url="&url.liveuser.wiki.observer;">here</ulink>. - </para> - - <para> - LiveUser also ship with a wide range of examples. - - These will be installed into the "docs" directory in your PEAR install - directory. - They try to illustrate various usage scenarios. - - The database examples come with a schema file please see the demodata.php - in the examples root folder of the LiveUser package for details on how to - install these schema files from the command line or from a browser. - You will once again need MDB2_Schema to be able to install the schema files. - </para> - - <para> - LiveUser package: - <itemizedlist> - <listitem> - <simpara> - example1 illustrates using only a single authentication source - (in this case XML) - with several aliased fields and a custom field. - </simpara> - </listitem> - <listitem> - <simpara> - example2 illustrates using a single authentication with permissions - (in this case XML) - with the optional remember me feature and several aliased fields - </simpara> - </listitem> - <listitem> - <simpara> - example4 illustrates using multiple authentication sources - (XML and database) with permissions (database) in a more real world news - administration scenario - </simpara> - </listitem> - <listitem> - <simpara> - example5 illustrates using single authentication sources (database) with - permissions (database) in a more real world news administration scenario - </simpara> - </listitem> - </itemizedlist> - </para> + &package.authentication.liveuser.intro; + &package.authentication.liveuser.setup; </sect1> <!-- Generated by phpDocumentor v 1.2.2 http://www.phpdoc.org --> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/peardoc/en/package/authentication/liveuser/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/authentication/liveuser/intro.xml +++ peardoc/en/package/authentication/liveuser/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="package.authentication.liveuser.intro"> <refnamediv> <refname> Introduction </refname> <refpurpose> About <classname>LiveUser</classname> </refpurpose> </refnamediv> <refsect1 id="package.authentication.liveuser.intro.summary"> <title>About <classname>LiveUser</classname></title> <para> <classname>LiveUser</classname> is an advanced authentication and permission framework that comes with a large array of out of the box features which can be used optionally. The base class is called <classname>LiveUser</classname> and is often refered to as the "client" and is what will be commonly be used to authenticate a specific user and then optionally make permission checks on this user. </para> <para> LiveUser provides the following key features: The LiveUser class takes care of the login process and can be configured to use a certain permission container and one or more different auth containers. That means, you can have your users' data scattered amongst many data containers and have the LiveUser class try each defined container until the user is found. For example, you can have all website users who can apply for a new account online on the webserver's local database. Also, you want to enable all your company's employees to login to the site without the need to create new accounts for all of them. To achieve that, a second container can be defined to be used by the LiveUser class. </para> <para> You can also define a permission container of your choice that will manage the rights for each user. Depending on the container, you can implement any kind of permission schemes for your application while having one consistent API. </para> <para> Using different permission and auth containers, it's easily possible to integrate newly written applications with older ones that have their own ways of storing permissions and user data. Just make a new container type and you're ready to go! </para> <para> Currently available are containers using: PEAR::DB, PEAR::MDB, PEAR::MDB2, ext/PDO, PEAR::XML_Tree, Session and PEAR::Auth. </para> <para> There is also an external <ulink url="&url.liveuser.wiki;">wiki</ulink> dedicated to LiveUser: </para> <para> At this point LiveUser is still in beta stage. Even so LiveUser is already being used on a wide range of production websites. A non exaustive list can be found <ulink url="&url.liveuser.wiki.references;">here</ulink>. </para> <para> The current roadmap for LiveUser can be viewed <ulink url="&url.liveuser.wiki.roadmap.client;">here</ulink>. </para> <para> A detailed introduction to the core concepts of LiveUser can be found in the following phpmag <ulink url="&url.liveuser.phpmag.article1;">article</ulink>. </para> <para> This article was published in april 2004 and is therefore not entirely uptodate. However the core principles remain unchanged and most of the recent changes resolve around making the API more consistent and flexible. As a result the API examples are mostly out of date. The article also fails to mention the fact that the permission containers are now separated in a logic and a storage layer. This was done to remove logic duplication as well as to allow the implementation of a stackable storage approach, where users could configure LiveUser to first call a cache storage layer, which in turn would fetch the necessary data on demand from the actual storage layer. </para> <para> A more recent article providing a step by step guide to LiveUser and the different permission containers can be found <ulink url="&url.liveuser.gvngroup.be.intro;">here</ulink>. </para> <para> Before you can use LiveUser you will need to setup the necessary data structures for the chosen container. Through the use of the configuration options it is possible to customize alot of the aspects of the storage layer. Most notably it is possible to alias field and table names. This should make it possible to integrate any legacy data into LiveUser. Depending on the container chosen you may have to use the database schema installer. The installer requires the MDB2_Schema and MDB2 packages and is able to handle most configuration options properly to be able to install the database schema directly into your database. You can find the install class in "[PEAR]/data/misc/schema/install.php". There is some sample code which is partially commented out at the top. Basically its a two step process for both the auth and perm: (1) generate the schema xml file, (2) install the schema. </para> <para> During the installation process the installer will create backup files of the installed schema. These files will enable the installer to attempt to alter the database if run again with a different configuration. However if these files exist the installer will always attempt to alter instead of creating the tables from scratch as long as you are using the sam DSN. If for some reason you need to create the tables from scratch again then please delete the backup files with the matching DSN. You can find the installer inside the data directory of your pear install directory. Its called install.php and at the top of the file you will find a number of sample API calls which are commented out. </para> <para> An ER diagram of the database structure can be found <ulink url="&url.liveuser.backendmedia.dbschema;">here</ulink>. </para> <para> The diagram details what tables are needed for what permission complexity level. If you want to prevent the installer from installing tables you dont need you can modify the "tables" property of the instance of the permission container you pass to the generateSchema() method in the installer. </para> <para> In order to get started with LiveUser the following <ulink url="&url.liveuser.jystewart.config;">two</ulink> <ulink url="&url.liveuser.jystewart.start;">articles</ulink> should help in getting off the ground. </para> <para> The observer support in LiveUser allows users to automatically have LiveUser call certain callbacks on a number of internal events. It is documented <ulink url="&url.liveuser.wiki.observer;">here</ulink>. </para> <para> LiveUser also ship with a wide range of examples. These will be installed into the "docs" directory in your PEAR install directory. They try to illustrate various usage scenarios. The database examples come with a schema file please see the demodata.php in the examples root folder of the LiveUser package for details on how to install these schema files from the command line or from a browser. You will once again need MDB2_Schema to be able to install the schema files. </para> <para> LiveUser package: <itemizedlist> <listitem> <simpara> example1 illustrates using only a single authentication source (in this case XML) with several aliased fields and a custom field. </simpara> </listitem> <listitem> <simpara> example2 illustrates using a single authentication with permissions (in this case XML) with the optional remember me feature and several aliased fields </simpara> </listitem> <listitem> <simpara> example4 illustrates using multiple authentication sources (XML and database) with permissions (database) in a more real world news administration scenario </simpara> </listitem> <listitem> <simpara> example5 illustrates using single authentication sources (database) with permissions (database) in a more real world news administration scenario </simpara> </listitem> </itemizedlist> </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/peardoc/en/package/authentication/liveuser/setup.xml?view=markup&rev=1.1 Index: peardoc/en/package/authentication/liveuser/setup.xml +++ peardoc/en/package/authentication/liveuser/setup.xml <!-- $Revision: 1.1 $ --> <refentry id="package.authentication.liveuser.setup"> <!-- Section originally contributed by Tim Denby, pearbugs2006 at reddreamer dot com --> <refnamediv> <refname>Setting it up</refname> <refpurpose> Making the package and examples work </refpurpose> </refnamediv> <refsect1 id="package.authentication.liveuser.setup.description"> <title>Example Steps for Getting the Examples Going</title> <para> Getting the LiveUser examples working can be somewhat difficult for developers who are new to PHP and PEAR. Here is a list of steps necessary to get the <filename>example4</filename> and GVN examples working with a MySQL database in LiveUser <literal>0.16.12</literal>. <orderedlist> <listitem> <simpara> Install PHP and MySQL OR Sign up with a web host that provides PHP and MySQL. </simpara> </listitem> <listitem> <simpara> Install PEAR. This is done either with the <ulink url="&url.pear.manual.installation;">command line installer</ulink>, or by uploading <filename>go-pear.php</filename> to <link linkend="installation.shared">your web host through FTP</link>. </simpara> </listitem> <listitem> <simpara> Now install the PEAR packages <literal>LiveUser</literal>, <literal>MDB2</literal>, <literal>MDB2_Driver_mysql</literal>, <literal>HTML_Template_IT</literal>, <literal>HTML_QuickForm</literal>, and <literal>Var_Dump</literal>. Command line will be something like <command>pear install --alldeps LiveUser-beta</command> (repeat for each package). If you used the <filename>go-pear.php</filename>, there's some web-based way to install packages through that, but I haven't used it. </simpara> </listitem> <listitem> <simpara> Now create your empty database in MySQL. </simpara> </listitem> <listitem> <simpara> Now copy the files of <filename>example4</filename> to your web root. On my Linux system the examples ended up in <filename>/usr/share/pear/docs/LiveUser/docs/examples</filename> and my Apache web root is at <filename>/var/www</filename>. You can find out where the examples are by executing <command>pear list-files LiveUser</command>. </simpara> </listitem> <listitem> <simpara> Create the database by viewing the <filename>demodata.php</filename> through your web browser with a URL like <filename>http://www.example.com/LU/demodata.php?dsn=mysql://dbuser:pwd@localhost/databasename&amp;file=/var/www/LU/demodata.xml&amp;create=1</filename>. You must replace the file path values and the database <literal>user</literal>, <literal>password</literal>, <literal>host</literal>, and <literal>dabase name</literal> with values appropriate for your own system. If this gives you a "success" message and you have phpMyAdmin or something, you should be able to look at the database now and see tables with data in them. </simpara> <warning> <para> It is reported that on some systems, you must make alterations to the <filename>demodata.xml</filename> file before this will run properly. Within all &lt;is_active&gt;..&lt;/is_active&gt; tags replace the value "<literal>Y</literal>" with "<literal>1</literal>" and "<literal>N</literal>" with "<literal>0</literal>". </para> </warning> </listitem> <listitem> <simpara> Edit the <filename>conf.php</filename> file and enter your database information. </simpara> </listitem> <listitem> <simpara> At this point you should be able to view the <filename>index.html</filename> page through a web browser and log in and use <filename>example4</filename>. </simpara> </listitem> <listitem> <simpara> To get the <ulink url="&url.liveuser.gvngroup.be.intro;">GVN samples</ulink> going, first create a "GVN" folder under your web root. </simpara> </listitem> <listitem> <simpara> Go through the GVN tutorials, starting from the beginning because there are dependencies, and save all of the sample files. </simpara> </listitem> <listitem> <simpara> In most of the files I found that the include to <filename>LiveUser/LiveUser.php</filename> had to be corrected to just be <filename>LiveUser.php</filename>. </simpara> </listitem> <listitem> <simpara> Copy the file <filename>Auth_XML.xml</filename> from <filename>example4</filename> into the GVN folder. </simpara> </listitem> <listitem> <simpara> Copy your database information and the LiveUser configuration array from <filename>example4/conf.php</filename> into GVN's <filename>conf.php</filename> and <filename>conf_admin.php</filename> files. </simpara> </listitem> <listitem> <simpara> In example4, the users that are in the database are deactived for some reason... in the <literal>peoples</literal> table change the values in the <literal>isactive</literal> column to <literal>1</literal>. </simpara> </listitem> </orderedlist> </para> <para> The above steps got me to the point where I have the working sample app and pages that demonstrate adding users, etc. </para> </refsect1> </refentry>
« previous php.pear.doc (#8862) next »