chiark / gitweb /
Ask for -std=gnu99 if necessary to get full <limits.h>.
[disorder] / templates / login.html
index 65f1939242b07365389125fd9285bbc8ddf96524..723b6afcb513f147bd84f8a911c1e3958ca41691 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <!--
 This file is part of DisOrder.
-Copyright (C) 2007 Richard Kettlewell
+Copyright (C) 2007, 2008 Richard Kettlewell
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -25,21 +25,22 @@ USA
  </head>
  <body>
 @include{topbar}@
-   <h1 class=title>@label:login.title@</h1>
+   <h1>@label:login.title@</h1>
 
    @if{@ne{@label:error@}{error}@}{
    @#{error reporting from some earlier operation}@
-   <!-- TODO make error string visually intrusive, also error.html -->
-   <p>@label{error.@label:error@}@</p>
+   <div class=error>
+     <p class=error>@label{error.@label:error@}@</p>
+   </div>
    }@
 
    @if{@ne{@label:status@}{status}@}{
    @#{some action succeeded}@
-   <p class=loginstatus>@label{login.@label:status@}@</p>
+   <div class=loginstatus>
+     <p>@label{login.@label:status@}@</p>
+   </div>
    }@
 
-  <p>User: @user@</p>
-
    @if{@eq{@user@}{guest}@}{
    @#{guest user, allow login and registration}@
    <h2>Existing users</h2>
@@ -52,27 +53,56 @@ USA
        <tr>
          <td>@label:login.username@</td>
          <td>
-           <input class=username name=username type=text value="@arg:username@" size=32>
+           <input class=username name=username type=text size=32
+                 value="@arg:username@">
          </td>
        </tr>
        <tr>
          <td>@label:login.password@</td>
-         <td><input class=password name=password type=password value=""
-                    size=32></td>
          <td>
-           <button class=login name=action type=submit value=login>
+           <input class=password name=password type=password value=""
+                  size=32>
+         </td>
+       </tr>
+       <tr>
+         <td colspan=2>
+           <button class=login name=button type=submit>
              @label:login.login@
            </button>
          </td>
        </tr>
      </table>
-     <input name=nonce type=hidden value="@nonce@">
+     <input name=action type=hidden value=login>
      <input name=back type=hidden value="@arg:back@">
    </form>
 
-   <!-- TODO disable registration button if guest doesn't have
-   register right -->
+   <p>If you've forgotten your password, use this form to request an
+   email reminder.  A reminder can only be sent if you registered with
+   your email address, and if a reminder has been sent too recently
+   then it won't be possible to send one.</p>
+
+   <form class=reminder action="@url@" method=POST
+         enctype="multipart/form-data" accept-charset=utf-8>
+     <table class=login>
+       <tr>
+         <td>@label:login.username@</td>
+         <td>
+           <input class=username name=username type=text size=32
+                 value="@arg:username@">
+         </td>
+       </tr>
+       <tr>
+         <td colspan=2>
+           <button class=login name=button type=submit>
+             @label:login.reminder@
+           </button>
+         </td>
+       </tr>
+     </table>
+     <input name=action type=hidden value=reminder>
+   </form>
 
+   @right{register}{
    <h2>New Users</h2>
 
    <p>If you do not have a login enter a username, a password and your
@@ -86,70 +116,98 @@ USA
        <tr>
          <td>@label:login.username@</td>
          <td>
-           <input class=username name=username type=text value="" size=32>
+           <input class=username name=username type=text size=32
+                 value="">
          </td>
+         <td class=extra>@label:login.registerusernameextra@</td>
        </tr>
        <tr>
          <td>@label:login.email@</td>
          <td>
-           <input class=email name=email type=text value="" size=32>
+           <input class=email name=email type=text size=32
+                  value="">
          </td>
+         <td class=extra>@label:login.registeremailextra@</td>
        </tr>
        <tr>
-         <td>@label:login.password@</td>
-         <td><input class=password name=password type=password value=""
-                    size=32></td>
+         <td>@label:login.password1@</td>
          <td>
-           <button class=register name=action type=submit value=register>
+           <input class=password name=password1 type=password size=32
+                 value="">
+         </td>
+         <td class=extra>@label:login.registerpassword1extra@</td>
+       </tr>
+       <tr>
+         <td>@label:login.password2@</td>
+         <td>
+           <input class=password name=password2 type=password size=32
+                 value="">
+         </td>
+         <td class=extra>@label:login.registerpassword2extra@</td>
+       </tr>
+       <tr>
+         <td colspan=3>
+           <button class=register name=button>
              @label:login.register@
            </button>
          </td>
        </tr>
      </table>
-     <input name=nonce type=hidden value="@nonce@">
-   </form>
+     <input name=action type=hidden value=register>
+   </form>}@
    }{
    @#{not the guest user, allow change of details and logout}@
 
    <h2>Logged in as @user@</h2>
 
-   <p>TODO none of this stuff works yet</p>
+   <form class=logout action="@url@" method=POST
+         enctype="multipart/form-data" accept-charset=utf-8>
+     <div class=logout>
+       <button class=logout name=submit type=submit>
+         @label:login.logout@
+       </button>
+     </div>
+     <input name=action type=hidden value=logout>
+   </form>
 
    <p>Use this form to change your email address and/or password.</p>
 
-   <form class=register action="@url@" method=POST
+   <form class=edituser action="@url@" method=POST
          enctype="multipart/form-data" accept-charset=utf-8>
      <table class=edituser>
        <tr>
          <td>@label:login.email@</td>
          <td>
-           <input class=email name=email type=text value="TODO" size=32>
+           <input class=email name=email type=text size=32
+                 value="@userinfo:email@">
          </td>
+         <td class=extra>@label:login.edituseremailextra@</td>
        </tr>
        <tr>
-         <td>@label:login.password@</td>
-         <td><input class=password name=password type=password value=""
-                    size=32></td>
+         <td>@label:login.newpassword@</td>
+         <td>
+           <input class=password name=changepassword1 type=password size=32
+                 value="">
+         </td>
+         <td class=extra>@label:login.edituserpassword1extra@</td>
+       </tr>
+       <tr>
+         <td>@label:login.newpassword@</td>
          <td>
-           <button class=edituser name=action type=submit value=edituser>
+           <input class=password name=changepassword2 type=password size=32
+                 value="">
+         </td>
+         <td class=extra>@label:login.edituserpassword2extra@</td>
+       </tr>
+       <tr>
+         <td colspan=3>
+           <button class=edituser name=submit type=submit>
              @label:login.edituser@
            </button>
          </td>
        </tr>
      </table>
-     <input name=nonce type=hidden value="@nonce@">
-   </form>
-
-   <p>Use this button to log out @user@.</p>
-
-   <form class=register action="@url@" method=POST
-         enctype="multipart/form-data" accept-charset=utf-8>
-     <div class=logout>
-       <button class=logout name=action type=submit value=logout>
-         @label:login.logout@
-       </button>
-     </div>
-     <input name=nonce type=hidden value="@nonce@">
+     <input name=action type=hidden value=edituser>
    </form>
 
    }@