| 
<?php
/*
 Example - basic entry page for twzAuth (extended mode)
 ------------------------------------------------------
 
 Only valid, authenticated users can view this page.
 Admin users will get a link to admin.php
 
 */
 
 
 // clumsy "logout" (for testing only)..
 if(isset($_POST['logout']))
 { unset($_SERVER['PHP_AUTH_USER']); }
 
 
 require 'extended-include.php';
 
 
 ?><!DOCTYPE HTML>
 <html lang="en">
 <head>
 <title>twzAuth (extended mode)</title>
 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
 <style> form { display:inline; } </style>
 </head>
 <body>
 
 <h2>Welcome <?php echo $Username; ?></h2>
 <p>If you can see this page, you have authenticated successfully in <b>extended mode</b>.</p>
 
 <?php
 if($auth->isAdmin())
 { echo '<p><a href="extended-admin.php">User admin</a></p>'; }
 ?>
 
 <p> </p><p> </p><p> </p>
 
 <div>There is no "logout" facility with HTTP authentication (except <br />
 by restarting the browser). For testing purposes you can <br />
 click <form method="post"><input type="submit" name="logout" value=""logout"" /></form>,
 and then cancel the subsequent dialog.</div>
 
 <p><a href="./">home</a></p>
 
 </body>
 </html>
 |