Source for file coffeemaker.php
Documentation is available at coffeemaker.php
* Test for the LiveUser class
* ===============================
* This example sets up an authorization system using the LiveUser
* class. You don't have to use this to use the LiveUser class(es), but
* this way you don't need to take care of the login-process, storing
* the user object in a session and more...
* This example is intended to be used with the DB_Medium Perm driver.
* @version $Id: coffeemaker.php,v 1.2 2004/12/18 21:59:05 lsmith Exp $
// Include configuration.
die ('An unknown error occurred');
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>Example Coffeemaker</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
background-color: #CCCCCC;
border-color: 1px solid #000;
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #FFFFFF
<h1>Welcome in the Coffeemaker section!</h1>
if (!$LU->isLoggedIn ()) {
$target = 'coffeemaker.php';
include_once 'loginscreen.php';
<p>Sorry, but you don't have any rights in this section</p>
// Okay, he's in. Now let's display some content dependent of
// his access rights in our application. Let's pretend the current
// AuthArea of our application is the Coffeemaker section and we want to
// know whether to user is allowed to make some coffee
// (the area is not needed until we won't know whether our user is an area
<p>Congrats, you're in the Coffeemaker section and have
the right to make coffee!</p>
<p>Your coffee tastes so bad, I won't allow you to make some</p>
// check if the user is allowed to drink coffee. checkRight will return the level.
<p>Yey ! You can even drink some coffee (but perhaps you should ask your boss first ;-) ))</p>
<p>Hi <?php echo $LU->getProperty ('handle'); ?>! Taste this delicious coffee.</p>
<p>Well, sorry dude, you cannot drink in here</p>
<p class="center"><a href="coffeemaker.php?logout=1">Logout</a></p>
Documentation generated on Mon, 11 Mar 2019 14:16:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|