cvs: pear /Perm_LiveUser/docs readme.html
| From: | Bj�rn Kraus | Date: | Sun, 23 Mar 2003 19:37:13 +0000 |
| Subject: | cvs: pear /Perm_LiveUser/docs readme.html | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-9594@lists.php.net to get a copy of this message | ||
krausbn Sun Mar 23 14:37:13 2003 EDT
Added files:
/pear/Perm_LiveUser/docs readme.html
Log:
Initial release.
Index: pear/Perm_LiveUser/docs/readme.html +++ pear/Perm_LiveUser/docs/readme.html <html> <head> <title>LiveUser readme</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- th { text-align: left} --> </style> </head> <body bgcolor="#FFFFFF"> <h1 align="center">LiveUser - The user authentication and<br> permission management framework</h1> <p align="center">Version 0.6 2002-03-23</p> <p align="center"><a href="mailto:krausbn@php.net">by Björn Kraus (krausbn@php.net)</a></p> <p> </p> <p>LiveUser is a set of classes for dealing with user authentication and permission management. Basically, there are three main elements that make up this package:</p> <ul> <li>The LoginManager</li> <li> The Auth containers</li> <li> The Perm containers</li> </ul> <p> The LoginManager 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 LoginManager 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<br /> 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 LoginManager.</p> <p> 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. 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!<br /> Currently available are RDBMS containers using PEAR::DB.</p> <h1>Auth containers</h1> <p>Currently there are only two containers available which both support the same features: The DB container, using PEAR::DB, and the XML container, using XML::Tree to extract the data from an xml file.</p> <p>Both containers have the following fields:</p> <ul> <li><b>userId</b>: The id of the user in the auth container</li> <li><b>handle</b>: Handle or username to login</li> <li><b>password</b>: Password, usually MD5 encrypted.</li> <li><b>currentLogin</b>: Time when the user has logged in</li> <li><b>lastLogin</b>: The last time the user has logged in</li> <li><b>isActive</b>: Flag to activate (=Y) or deactivate (=N) user's account</li> </ul> <p>There are several options to set up the auth containers and to customize the login process. In the first step, we'll take a look at the common and container specific options, second we'll talk about the properties you can get from the container.</p> <h2>Options</h2> <h3>Common options</h3> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>type</td> <td>"DB" <i>or</i> "XML"</td> <td>The "name" of the container. The LoginManager includes the container found in /LiveUser/Auth/Container/"type".php and creates a new object $_auth.</td> </tr> <tr valign="top"> <td>loginTimeout</td> <td><i>integer</i><br> Default: 12 </td> <td>Number of hours that must pass between two logins to be counted as a new login. If you want the auth container to count each login as new login, you've to set it to 0.</td> </tr> <tr valign="top"> <td>expireTime</td> <td><i>integer<br> </i>Default: 0</td> <td>Auth lifetime or maximum login time in seconds. If you want the user to be automaticly logged out after one hour, you've to set it to 3600.</td> </tr> <tr valign="top"> <td>idleTime</td> <td><i>integer<br> </i>Default: 0</td> <td>Maximum time of idleness in seconds. Idletime gets refreshed each time, init() is called. If this variable is set to 0, idle time is never checked.</td> </tr> <tr valign="top"> <td>allowDuplicateHandles</td> <td><i>bolean</i><br> Default: false</td> <td> Allow multiple users in the database to have the same login handle.</td> </tr> <tr valign="top"> <td>passwordEncryptionMode</td> <td>"MD5" <i>or</i> "PLAIN"<br> Default: "MD5"</td> <td>The encryption mode the password is stored in the container. You shouldn't use plain here for security reasons.</td> </tr> </table> <h3>Container specific options</h3> <h4>1. DB</h4> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>dsn</td> <td><i>string</i></td> <td>The DSN that is used to connect to the database (set only if no existing connection object has been reused).</td> </tr> <tr valign="top"> <td>connection</td> <td><i>object</i></td> <td>A PEAR::DB object to use an existing db connection.</td> </tr> </table> <h4>2. XML</h4> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>file</td> <td><i>string</i></td> <td>XML file in which the auth data is stored. The path can either be absolute or relative to the document root.</td> </tr> </table><h2>Properties</h2> <p>To get info about the current user use the getProperty() method in the LoginManager class.</p> <table border="1" cellspacing="0" cellpadding="5"> <tr> <th nowrap>Property name</th> <th>Description</th> </tr> <tr> <td valign="top">handle</td> <td>The handle (username) of the current user. Instead of using getProperty() you can use the wrapper method getHandle().</td> </tr> <tr> <td valign="top">passwd</td> <td>The (decrypted) password.</td> </tr> <tr> <td valign="top">authUserId</td> <td>Current user's database record id.</td> </tr> <tr> <td valign="top">isActive</td> <td>Is the current user allowed to login at all? If false, a call to login() will not set $logged_in to TRUE, even if handle and password were submitted correctly. This is useful when you want your users to be activated by an administrator before they can actually use your application.</td> </tr> <tr> <td valign="top">loggedIn</td> <td>Has the current user successfully logged in?</td> </tr> <tr> <td valign="top">lastLogin</td> <td>Timestamp of last login (previous to currentLogin).</td> </tr> <tr> <td valign="top">currentLogin</td> <td>Timestamp of current login (last to be written).</td> </tr> </table> <h1>Perm containers</h1> <p>The perm containers differ between very simple once with only a few options and complex containers with a large set of possibilities to maintain the different rights. Until we have no docu for each container, you have to look at the examples and the code to learn how they work and to choose the right one for your application.</p> <p>Here a short description for each container:</p> <ul> <li><b>DB_Complex</b><br> This container provides many features. It supports group/subgroup managed users, group- and individual rights, right inheritance and level based rights. It also supports different languages for the application, area and right names. Nearly all right constelations can be build with this container but it takes some time to set it up. <a href="Perm_DB_Complex.png">Click here</a> to view the SQL schema.</li> <li><b>DB_Medium</b><br> The container is very simillar to DB_Complex. The main difference is that it doesn't support right inheritance and subgroups. All other features should be available (check the sorce code to be sure ;-) )<br> The <a href="Perm_DB_Complex.png">SQL schema</a> of DB_Complex and DB_Medium are the same so you can easily upgrade from DB_Medium to DB_Complex.</li> <li><b>DB_Simple</b><br> The DB_Simple provides the following functionalities: userrights and areas. No more, no less.</li> <li><b>XML_Simple</b><br> The XML container works like his DB pendant. It uses a easy to understand XML file (see examples). Perhaps XML_Simple is a good start to get in touch with LiveUsers permission management. <a href="Perm_DB_Simple.png">Click here</a> to view the SQL schema.<br> </li> </ul> <h2>Options</h2> <p>There are only a few options that can be configured:</p> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>type</td> <td><i>string</i></td> <td>The "name" of the container. The LoginManager includes the container found in /LiveUser/Perm/Container/"type".php and creates a new object $_perm.</td> </tr> <tr valign="top"> <td>dsn</td> <td><i>string</i></td> <td>Only for the DB containers: The DSN that is used to connect to the database (set only if no existing connection object has been reused).</td> </tr> <tr valign="top"> <td>connection</td> <td><i>object</i></td> <td>Only for the DB containers: A PEAR::DB object to use an existing db connection.</td> </tr> <tr valign="top"> <td>file</td> <td><i>string</i></td> <td>Only for the XML containers: XML file in which the auth data is stored. The path can either be absolute or relative to the document root.</td> </tr> </table> <h2>Properties</h2> <p>To get info about the current user use the getProperty() method in the LoginManager class.</p> <table border="1" cellspacing="0" cellpadding="5"> <tr> <th nowrap>Property name</th> <th>Description</th> </tr> <tr> <td valign="top">permUserId</td> <td>Current user's database record id.</td> </tr> <tr> <td valign="top">rights</td> <td>One-dimensional array containing current user's rights. This already includes grouprights and possible overrides by individual right settings. </td> </tr> <tr> <td valign="top">userRights</td> <td>One-dimensional array containing only the individual rights for the actual user.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">groupRights</td> <td> Two-dimensional array containing all groups that the user belongs to and the grouprights.<br> This property is not supported in all containers.</td> </tr> <tr> <td valign="top">userType</td> <td>Defines the user type. See /LiveUser/Perm/Common.php for more information.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">areaAdmin</td> <td>Defines if the user is an area admin. If the user is an area admin this variable will be filled with an array of all areas in which the user is area admin.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">groupIds</td> <td>Defines the (sub)groups in which the user is a member.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">groupUserIds</td> <td>Defines the members of all (sub)groups in which the user is a member.<br> This property is not supported in all containers.</td> </tr> </table> <p> </p> </body> </html>
Index: pear/Perm_LiveUser/docs/readme.html +++ pear/Perm_LiveUser/docs/readme.html <html> <head> <title>LiveUser readme</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- th { text-align: left} --> </style> </head> <body bgcolor="#FFFFFF"> <h1 align="center">LiveUser - The user authentication and<br> permission management framework</h1> <p align="center">Version 0.6 2002-03-23</p> <p align="center"><a href="mailto:krausbn@php.net">by Björn Kraus (krausbn@php.net)</a></p> <p> </p> <p>LiveUser is a set of classes for dealing with user authentication and permission management. Basically, there are three main elements that make up this package:</p> <ul> <li>The LoginManager</li> <li> The Auth containers</li> <li> The Perm containers</li> </ul> <p> The LoginManager 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 LoginManager 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<br /> 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 LoginManager.</p> <p> 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. 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!<br /> Currently available are RDBMS containers using PEAR::DB.</p> <h1>Auth containers</h1> <p>Currently there are only two containers available which both support the same features: The DB container, using PEAR::DB, and the XML container, using XML::Tree to extract the data from an xml file.</p> <p>Both containers have the following fields:</p> <ul> <li><b>userId</b>: The id of the user in the auth container</li> <li><b>handle</b>: Handle or username to login</li> <li><b>password</b>: Password, usually MD5 encrypted.</li> <li><b>currentLogin</b>: Time when the user has logged in</li> <li><b>lastLogin</b>: The last time the user has logged in</li> <li><b>isActive</b>: Flag to activate (=Y) or deactivate (=N) user's account</li> </ul> <p>There are several options to set up the auth containers and to customize the login process. In the first step, we'll take a look at the common and container specific options, second we'll talk about the properties you can get from the container.</p> <h2>Options</h2> <h3>Common options</h3> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>type</td> <td>"DB" <i>or</i> "XML"</td> <td>The "name" of the container. The LoginManager includes the container found in /LiveUser/Auth/Container/"type".php and creates a new object $_auth.</td> </tr> <tr valign="top"> <td>loginTimeout</td> <td><i>integer</i><br> Default: 12 </td> <td>Number of hours that must pass between two logins to be counted as a new login. If you want the auth container to count each login as new login, you've to set it to 0.</td> </tr> <tr valign="top"> <td>expireTime</td> <td><i>integer<br> </i>Default: 0</td> <td>Auth lifetime or maximum login time in seconds. If you want the user to be automaticly logged out after one hour, you've to set it to 3600.</td> </tr> <tr valign="top"> <td>idleTime</td> <td><i>integer<br> </i>Default: 0</td> <td>Maximum time of idleness in seconds. Idletime gets refreshed each time, init() is called. If this variable is set to 0, idle time is never checked.</td> </tr> <tr valign="top"> <td>allowDuplicateHandles</td> <td><i>bolean</i><br> Default: false</td> <td> Allow multiple users in the database to have the same login handle.</td> </tr> <tr valign="top"> <td>passwordEncryptionMode</td> <td>"MD5" <i>or</i> "PLAIN"<br> Default: "MD5"</td> <td>The encryption mode the password is stored in the container. You shouldn't use plain here for security reasons.</td> </tr> </table> <h3>Container specific options</h3> <h4>1. DB</h4> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>dsn</td> <td><i>string</i></td> <td>The DSN that is used to connect to the database (set only if no existing connection object has been reused).</td> </tr> <tr valign="top"> <td>connection</td> <td><i>object</i></td> <td>A PEAR::DB object to use an existing db connection.</td> </tr> </table> <h4>2. XML</h4> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>file</td> <td><i>string</i></td> <td>XML file in which the auth data is stored. The path can either be absolute or relative to the document root.</td> </tr> </table><h2>Properties</h2> <p>To get info about the current user use the getProperty() method in the LoginManager class.</p> <table border="1" cellspacing="0" cellpadding="5"> <tr> <th nowrap>Property name</th> <th>Description</th> </tr> <tr> <td valign="top">handle</td> <td>The handle (username) of the current user. Instead of using getProperty() you can use the wrapper method getHandle().</td> </tr> <tr> <td valign="top">passwd</td> <td>The (decrypted) password.</td> </tr> <tr> <td valign="top">authUserId</td> <td>Current user's database record id.</td> </tr> <tr> <td valign="top">isActive</td> <td>Is the current user allowed to login at all? If false, a call to login() will not set $logged_in to TRUE, even if handle and password were submitted correctly. This is useful when you want your users to be activated by an administrator before they can actually use your application.</td> </tr> <tr> <td valign="top">loggedIn</td> <td>Has the current user successfully logged in?</td> </tr> <tr> <td valign="top">lastLogin</td> <td>Timestamp of last login (previous to currentLogin).</td> </tr> <tr> <td valign="top">currentLogin</td> <td>Timestamp of current login (last to be written).</td> </tr> </table> <h1>Perm containers</h1> <p>The perm containers differ between very simple once with only a few options and complex containers with a large set of possibilities to maintain the different rights. Until we have no docu for each container, you have to look at the examples and the code to learn how they work and to choose the right one for your application.</p> <p>Here a short description for each container:</p> <ul> <li><b>DB_Complex</b><br> This container provides many features. It supports group/subgroup managed users, group- and individual rights, right inheritance and level based rights. It also supports different languages for the application, area and right names. Nearly all right constelations can be build with this container but it takes some time to set it up. <a href="Perm_DB_Complex.png">Click here</a> to view the SQL schema.</li> <li><b>DB_Medium</b><br> The container is very simillar to DB_Complex. The main difference is that it doesn't support right inheritance and subgroups. All other features should be available (check the sorce code to be sure ;-) )<br> The <a href="Perm_DB_Complex.png">SQL schema</a> of DB_Complex and DB_Medium are the same so you can easily upgrade from DB_Medium to DB_Complex.</li> <li><b>DB_Simple</b><br> The DB_Simple provides the following functionalities: userrights and areas. No more, no less.</li> <li><b>XML_Simple</b><br> The XML container works like his DB pendant. It uses a easy to understand XML file (see examples). Perhaps XML_Simple is a good start to get in touch with LiveUsers permission management. <a href="Perm_DB_Simple.png">Click here</a> to view the SQL schema.<br> </li> </ul> <h2>Options</h2> <p>There are only a few options that can be configured:</p> <table border="1" cellpadding="5" cellspacing="0"> <tr> <th>Option</th> <th>Value</th> <th>Description</th> </tr> <tr valign="top"> <td>type</td> <td><i>string</i></td> <td>The "name" of the container. The LoginManager includes the container found in /LiveUser/Perm/Container/"type".php and creates a new object $_perm.</td> </tr> <tr valign="top"> <td>dsn</td> <td><i>string</i></td> <td>Only for the DB containers: The DSN that is used to connect to the database (set only if no existing connection object has been reused).</td> </tr> <tr valign="top"> <td>connection</td> <td><i>object</i></td> <td>Only for the DB containers: A PEAR::DB object to use an existing db connection.</td> </tr> <tr valign="top"> <td>file</td> <td><i>string</i></td> <td>Only for the XML containers: XML file in which the auth data is stored. The path can either be absolute or relative to the document root.</td> </tr> </table> <h2>Properties</h2> <p>To get info about the current user use the getProperty() method in the LoginManager class.</p> <table border="1" cellspacing="0" cellpadding="5"> <tr> <th nowrap>Property name</th> <th>Description</th> </tr> <tr> <td valign="top">permUserId</td> <td>Current user's database record id.</td> </tr> <tr> <td valign="top">rights</td> <td>One-dimensional array containing current user's rights. This already includes grouprights and possible overrides by individual right settings. </td> </tr> <tr> <td valign="top">userRights</td> <td>One-dimensional array containing only the individual rights for the actual user.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">groupRights</td> <td> Two-dimensional array containing all groups that the user belongs to and the grouprights.<br> This property is not supported in all containers.</td> </tr> <tr> <td valign="top">userType</td> <td>Defines the user type. See /LiveUser/Perm/Common.php for more information.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">areaAdmin</td> <td>Defines if the user is an area admin. If the user is an area admin this variable will be filled with an array of all areas in which the user is area admin.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">groupIds</td> <td>Defines the (sub)groups in which the user is a member.<br> This property is not supported in all containers. </td> </tr> <tr> <td valign="top">groupUserIds</td> <td>Defines the members of all (sub)groups in which the user is a member.<br> This property is not supported in all containers.</td> </tr> </table> <p> </p> </body> </html>