chiark / gitweb /
'confirm' now logs the user in (and sends back their username so the
[disorder] / templates / login.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <!--
3 This file is part of DisOrder.
4 Copyright (C) 2007 Richard Kettlewell
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA
20 -->
21 <html>
22  <head>
23 @include:stdhead@
24   <title>@label:login.title@</title>
25  </head>
26  <body>
27 @include{topbar}@
28    <h1 class=title>@label:login.title@</h1>
29
30    @if{@ne{@label:error@}{error}@}{
31    @#{error reporting from some earlier operation}@
32    <p class=error>@label{error.@label:error@}@</p>
33    }@
34
35    @if{@ne{@label:status@}{status}@}{
36    @#{some action succeeded}@
37    <p class=loginstatus>@label{login.@label:status@}@</p>
38    }@
39
40    @if{@eq{@user@}{guest}@}{
41    @#{guest user, allow login and registration}@
42    <h2>Existing users</h2>
43
44    <p>If you have a username, use this form to log in.</p>
45
46    <form class=login action="@url@" method=POST
47          enctype="multipart/form-data" accept-charset=utf-8>
48      <table class=login>
49        <tr>
50          <td>@label:login.username@</td>
51          <td>
52            <input class=username name=username type=text value="@arg:username@" size=32>
53          </td>
54        </tr>
55        <tr>
56          <td>@label:login.password@</td>
57          <td><input class=password name=password type=password value=""
58                     size=32></td>
59          <td>
60            <button class=login name=action type=submit value=login>
61              @label:login.login@
62            </button>
63          </td>
64        </tr>
65      </table>
66      <input name=nonce type=hidden value="@nonce@">
67      <input name=back type=hidden value="@arg:back@">
68    </form>
69
70    @right{register}{
71    <h2>New Users</h2>
72
73    <p>If you do not have a login enter a username, a password and your
74    email address here.  You will be sent an email containing a URL,
75    which you must visit to activate your login before you can use
76    it.<p>
77
78    <form class=register action="@url@" method=POST
79          enctype="multipart/form-data" accept-charset=utf-8>
80      <table class=register>
81        <tr>
82          <td>@label:login.username@</td>
83          <td>
84            <input class=username name=username type=text value="" size=32>
85          </td>
86        </tr>
87        <tr>
88          <td>@label:login.email@</td>
89          <td>
90            <input class=email name=email type=text value="" size=32>
91          </td>
92        </tr>
93        <tr>
94          <td>@label:login.password@</td>
95          <td><input class=password name=password type=password value=""
96                     size=32></td>
97          <td>
98            <button class=register name=action type=submit value=register>
99              @label:login.register@
100            </button>
101          </td>
102        </tr>
103      </table>
104      <input name=nonce type=hidden value="@nonce@">
105    </form>}@
106    }{
107    @#{not the guest user, allow change of details and logout}@
108
109    <h2>Logged in as @user@</h2>
110
111    <p>TODO none of this stuff works yet</p>
112
113    <p>Use this form to change your email address and/or password.</p>
114
115    <form class=edituser action="@url@" method=POST
116          enctype="multipart/form-data" accept-charset=utf-8>
117      <table class=edituser>
118        <tr>
119          <td>@label:login.email@</td>
120          <td>
121            <input class=email name=email type=text value="TODO" size=32>
122          </td>
123        </tr>
124        <tr>
125          <td>@label:login.password@</td>
126          <td><input class=password name=password type=password value=""
127                     size=32></td>
128          <td>
129            <button class=edituser name=action type=submit value=edituser>
130              @label:login.edituser@
131            </button>
132          </td>
133        </tr>
134      </table>
135      <input name=nonce type=hidden value="@nonce@">
136    </form>
137
138    <p>Use this button to log out @user@.</p>
139
140    <form class=logout action="@url@" method=POST
141          enctype="multipart/form-data" accept-charset=utf-8>
142      <div class=logout>
143        <button class=logout name=action type=submit value=logout>
144          @label:login.logout@
145        </button>
146      </div>
147      <input name=nonce type=hidden value="@nonce@">
148    </form>
149
150    }@
151
152 @include{topbarend}@
153  </body>
154 </html>
155 @@
156 <!--
157 Local variables:
158 mode:sgml
159 sgml-always-quote-attributes:nil
160 sgml-indent-step:1
161 sgml-indent-data:t
162 End:
163 -->