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

Source for file openid.php

Documentation is available at openid.php

  1. <?php
  2. /**
  3.  * This is a sample file to demonstrate the functionality of the phpPoA2 package.
  4.  * @author Miguel Macías <miguel.macias@upv.es>
  5.  * @filesource
  6.  * @package phpPoA2
  7.  */
  8.  
  9. include('../PoA.php');
  10.  
  11. $poa new PoA('openid1');
  12. ?>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  14. <html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
  15.  <head>
  16.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  17.   <title>OpenID basic example</title>
  18.  </head>
  19.  
  20.  <body>
  21.   <h1>OpenID basic example</h1>
  22.   <h2>authenticate() + getAttributes()</h2>
  23.   <hr/>
  24. <?php
  25. $auth $poa->authenticate();
  26. if ($auth{
  27. ?>
  28.   <p><strong>authenticate()</strong>: <div style="background: #ccffcc; padding: 5px"><tt>AUTHN_SUCCESS</tt></div></p>
  29.   <p><strong>getAttributes()</strong>:</p>
  30.   <div style="background: #cccccc; padding: 5px"><pre><?=print_r($poa->getAttributes());?></pre></div>
  31.   <dl>
  32. <?php
  33. /*
  34.     foreach ($poa->getAttributes() as $nombre => $valor) {
  35. ?>
  36.     <dt><?php echo htmlentities($nombre); ?></dt>
  37.     <dd><?php echo htmlentities($valor); ?></dd>
  38. <?php
  39.     }
  40. ?>
  41.   </dl>
  42. <?php
  43. */
  44. else {
  45. ?>
  46.   <p><strong>authenticate()</strong>: <div style="background: #ffcccc; padding: 5px"><tt>AUTHN_FAILED</tt></div></p>
  47.   <form method="post" action="">
  48.   <p><input type="text" name="openid_identifier"/><input type="submit" value="Submit"/></p>
  49.   </form>
  50. <?php
  51. }
  52. ?>
  53.  </body>
  54. </html>

Documentation generated on Mon, 20 Feb 2012 12:07:06 +0100 by phpDocumentor 1.4.3