login.phtml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Zend OpenID Server Example</title>
  5. <style>
  6. input.openid_login {
  7. background: url(login-bg.gif) no-repeat;
  8. background-color: #fff;
  9. background-position: 0 50%;
  10. color: #000;
  11. padding-left: 18px;
  12. width: 220px;
  13. margin-right: 10px;
  14. }
  15. input.openid_password {
  16. background-color: #fff;
  17. color: #000;
  18. padding-left: 18px;
  19. width: 220px;
  20. margin-right: 10px;
  21. }
  22. </style>
  23. <script language="JavaScript">
  24. function init() {
  25. <?php
  26. if (isset($this->error)) {
  27. echo ' alert("' . $this->error . '");' . "\n";
  28. }
  29. ?>
  30. if (document.forms['login'].elements['openid_url'].value == '') {
  31. document.forms['login'].elements['openid_url'].focus();
  32. } else {
  33. document.forms['login'].elements['openid_password'].focus();
  34. }
  35. }
  36. </script>
  37. </head>
  38. <body onLoad="init()">
  39. <?php
  40. if (isset($this->error)) {
  41. echo '<noscript><div><b><font color="#ff0000">Error: ' . $this->error . '</font></b></div></noscript>';
  42. }
  43. ?>
  44. <div>
  45. <form name="login" action="<?php echo $_SERVER['REQUEST_URI']; ?>"
  46. method="post" onsubmit="this.login.disabled=true;">
  47. <fieldset id="openid">
  48. <legend>OpenID Login</legend>
  49. <input type="hidden" name="openid_action" value="login">
  50. <table border="0"><tr><td>
  51. <label>OpenID URL:</label>
  52. </td><td>
  53. <input type="text" class="openid_login"
  54. <?php
  55. if (isset($this->id)) {
  56. echo ' value="' . $this->id . '"';
  57. }
  58. if (isset($this->ro)) {
  59. echo ' readonly="1" disabled="1">'."\n";
  60. echo '<input type="hidden" name="openid_url" value="' . $this->id . '"';
  61. } else {
  62. echo ' name="openid_url"';
  63. }
  64. ?>>
  65. </td></tr><tr><td>
  66. <label>Password:</label>
  67. </td><td>
  68. <input type="password" name="openid_password" class="openid_password">
  69. </td><td></tr><tr><td>&nbsp;</td><td>
  70. <input type="submit" name="login" value="login">
  71. </td></tr></table>
  72. <?php
  73. if (!isset($this->ro)) {
  74. echo '<br>';
  75. echo '<a href="?openid.action=register">register</a>';
  76. }
  77. ?>
  78. </fieldset>
  79. </form>
  80. </div>
  81. </body>
  82. </html>