index.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. require_once "common.php";
  3. global $pape_policy_uris;
  4. ?>
  5. <html>
  6. <head><title>PHP OpenID Authentication Example</title></head>
  7. <style type="text/css">
  8. * {
  9. font-family: verdana,sans-serif;
  10. }
  11. body {
  12. width: 50em;
  13. margin: 1em;
  14. }
  15. div {
  16. padding: .5em;
  17. }
  18. table {
  19. margin: none;
  20. padding: none;
  21. }
  22. .alert {
  23. border: 1px solid #e7dc2b;
  24. background: #fff888;
  25. }
  26. .success {
  27. border: 1px solid #669966;
  28. background: #88ff88;
  29. }
  30. .error {
  31. border: 1px solid #ff0000;
  32. background: #ffaaaa;
  33. }
  34. #verify-form {
  35. border: 1px solid #777777;
  36. background: #dddddd;
  37. margin-top: 1em;
  38. padding-bottom: 0em;
  39. }
  40. </style>
  41. <body>
  42. <h1>PHP OpenID Authentication Example</h1>
  43. <p>
  44. This example consumer uses the <a
  45. href="http://www.openidenabled.com/openid/libraries/php/">PHP
  46. OpenID</a> library. It just verifies that the URL that you enter
  47. is your identity URL.
  48. </p>
  49. <?php if (isset($msg)) { print "<div class=\"alert\">$msg</div>"; } ?>
  50. <?php if (isset($error)) { print "<div class=\"error\">$error</div>"; } ?>
  51. <?php if (isset($success)) { print "<div class=\"success\">$success</div>"; } ?>
  52. <div id="verify-form">
  53. <form method="get" action="try_auth.php">
  54. Identity&nbsp;URL:
  55. <input type="hidden" name="action" value="verify" />
  56. <input type="text" name="openid_identifier" value="" />
  57. <p>Optionally, request these PAPE policies:</p>
  58. <p>
  59. <?php foreach ($pape_policy_uris as $i => $uri) {
  60. print "<input type=\"checkbox\" name=\"policies[]\" value=\"$uri\" />";
  61. print "$uri<br/>";
  62. } ?>
  63. </p>
  64. <input type="submit" value="Verify" />
  65. </form>
  66. </div>
  67. </body>
  68. </html>