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

Source for file openid-restricted.php

Documentation is available at openid-restricted.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 restricted providers</title>
  18.  </head>
  19.  
  20.  <body>
  21.   <h1>OpenID restricted providers</h1>
  22. <?php
  23. $auth $poa->authenticate();
  24. if ($auth{
  25. ?>
  26.   <p><strong>authenticate()</strong>: <div style="background: #ccffcc; padding: 5px"><tt>AUTHN_SUCCESS</tt></div></p>
  27.   <p><strong>getAttributes()</strong>:</p>
  28.   <div style="background: #cccccc; padding: 5px"><pre><?=print_r($poa->getAttributes());?></pre></div>
  29. <?php
  30. else {
  31. ?>
  32.   <p><strong>authenticate()</strong>: <div style="background: #ffcccc; padding: 5px"><tt>AUTHN_FAILED</tt></div></p>
  33.   <form method="post" action="">
  34.    <p>Please select your identity provider:</p>
  35.    <p>
  36.     <button type="submit" name="openid_identifier" value="https://yo.rediris.es/soy">
  37.      <img src="https://www.rediris.es/sir/imgs/sir-a3b1.png" alt="SIR" />
  38.     </button>
  39.     <button type="submit" name="openid_identifier" value="https://www.google.com/accounts/o8/id">
  40.      <img src="https://www.google.com/intl/es_ES/images/logos/accounts_logo.gif" alt="Google" />
  41.     </button>
  42.    </p>
  43.   </form>
  44. <?php
  45. }
  46. ?>
  47.  </body>
  48. </html>

Documentation generated on Tue, 14 Jun 2011 12:22:11 +0200 by phpDocumentor 1.4.3