LiveUser_Admin
[ class tree: LiveUser_Admin ] [ index: LiveUser_Admin ] [ all elements ]

Source for file area51.php

Documentation is available at area51.php

  1. <?php
  2. /**
  3.  * Test for the LiveUser class
  4.  * ===============================
  5.  *
  6.  * This example sets up an authorization system using the LiveUser
  7.  * class. You don't have to use this to use the LiveUser class(es), but
  8.  * this way you don't need to take care of the login-process, storing
  9.  * the user object in a session and more...
  10.  *
  11.  * This example is intended to be used with the DB_Medium Perm driver.
  12.  *
  13.  * @version $Id: area51.php 175041 2004-12-18 21:59:05Z lsmith $
  14.  ***/
  15.  
  16. // Include configuration.
  17. require_once 'conf.php';
  18.  
  19. if (!$LU{
  20.     die('An unknown error occurred');
  21. }
  22.  
  23. ?>
  24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25. <html>
  26. <head>
  27.     <title>Example Area51</title>
  28.     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  29.     <style type="text/css">
  30.     <!--
  31.     table {
  32.         background-color: #CCCCCC;
  33.         border-color: 1px solid #000;
  34.     }
  35.     body {
  36.         font-family: Verdana, Arial, Helvetica, sans-serif;
  37.         font-size: 12px;
  38.         color: #000000;
  39.         background-color: #FFFFFF
  40.     }
  41.  
  42.     .center {
  43.            text-align: center;
  44.     }
  45.     .center table {
  46.            margin: auto;
  47.     }
  48.     -->
  49.     </style>
  50. </head>
  51.  
  52. <body>
  53.     <h1>Area51</h1>
  54.     <p>&nbsp;</p>
  55. <?php
  56. if (!$LU->isLoggedIn()) {
  57.     $target 'area51.php';
  58.     include_once 'loginscreen.php';
  59.     exit();
  60. else {
  61.     if (!$LU->checkRight(ACCESS)) {
  62. ?>
  63.         <p>Hey, this is a top secret area. Access denied.</p>
  64. <?php
  65.     else {
  66. ?>
  67.             <p>Live long and prosper, <b><?php echo $LU->getProperty('handle')?> </b>.</p>
  68.             <p>You have access at the necessary level <b><?php echo $LU->checkRightLevel(ACCESS10)?></b></p>
  69.             <p>Please wait ... checking some rights ...<br />
  70. <?php
  71.         // you can even check multiple rights with one checkright call
  72.         if ($LU->checkRight(array(LAUNCH_ATOMIC_BOMBFLY_ALIEN_SPACE_CRAFT))) {
  73. ?>
  74.             <p>OK, you're the boss. Let's take our alien space craft, launch the orbital atomic bombs and kick some ass! ;-)<br />
  75.             (Ehm, that was just to test our right system ...)<p>
  76. <?php
  77.         else {
  78. ?>
  79.             <p>Don't touch anything!</p>
  80. <?php
  81.         }
  82.     }
  83. }
  84. ?>
  85.     <p>&nbsp;</p>
  86.     <p class="center"><a href="area51.php?logout=1">Logout</a></p>
  87. </body>
  88. </html>

Documentation generated on Mon, 11 Mar 2019 15:39:42 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.