chiark / gitweb /
Never use the value attribute of <button> to encode anything we care
[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    <div class=error>
33      <p class=error>@label{error.@label:error@}@</p>
34    </div>
35    }@
36
37    @if{@ne{@label:status@}{status}@}{
38    @#{some action succeeded}@
39    <div class=loginstatus>
40      <p class=loginstatus>@label{login.@label:status@}@</p>
41    </div>
42    }@
43
44    @if{@eq{@user@}{guest}@}{
45    @#{guest user, allow login and registration}@
46    <h2>Existing users</h2>
47
48    <p>If you have a username, use this form to log in.</p>
49
50    <form class=login action="@url@" method=POST
51          enctype="multipart/form-data" accept-charset=utf-8>
52      <table class=login>
53        <tr>
54          <td>@label:login.username@</td>
55          <td>
56            <input class=username name=username type=text size=32
57                   value="@arg:username@">
58          </td>
59        </tr>
60        <tr>
61          <td>@label:login.password@</td>
62          <td>
63            <input class=password name=password type=password value=""
64                   size=32>
65          </td>
66        </tr>
67        <tr>
68          <td>
69            <button class=login name=button type=submit>
70              @label:login.login@
71            </button>
72          </td>
73        </tr>
74      </table>
75      <input name=action type=hidden value=login>
76      <input name=nonce type=hidden value="@nonce@">
77      <input name=back type=hidden value="@arg:back@">
78    </form>
79
80    @right{register}{
81    <h2>New Users</h2>
82
83    <p>If you do not have a login enter a username, a password and your
84    email address here.  You will be sent an email containing a URL,
85    which you must visit to activate your login before you can use
86    it.<p>
87
88    <form class=register action="@url@" method=POST
89          enctype="multipart/form-data" accept-charset=utf-8>
90      <table class=register>
91        <tr>
92          <td>@label:login.username@</td>
93          <td>
94            <input class=username name=username type=text size=32
95                   value="">
96          </td>
97          <td class=extra>@label:login.registerusernameextra@</td>
98        </tr>
99        <tr>
100          <td>@label:login.email@</td>
101          <td>
102            <input class=email name=email type=text size=32
103                   value="">
104          </td>
105          <td class=extra>@label:login.registeremailextra@</td>
106        </tr>
107        <tr>
108          <td>@label:login.password1@</td>
109          <td>
110            <input class=password name=password1 type=password size=32
111                   value="">
112          </td>
113          <td class=extra>@label:login.registerpassword1extra@</td>
114        </tr>
115        <tr>
116          <td>@label:login.password2@</td>
117          <td>
118            <input class=password name=password2 type=password size=32
119                   value="">
120          </td>
121          <td class=extra>@label:login.registerpassword2extra@</td>
122        </tr>
123        <tr>
124          <td>
125            <button class=register name=button>
126              @label:login.register@
127            </button>
128          </td>
129        </tr>
130      </table>
131      <input name=action type=hidden value=register>
132      <input name=nonce type=hidden value="@nonce@">
133    </form>}@
134    }{
135    @#{not the guest user, allow change of details and logout}@
136
137    <h2>Logged in as @user@</h2>
138
139    <form class=logout action="@url@" method=POST
140          enctype="multipart/form-data" accept-charset=utf-8>
141      <div class=logout>
142        <button class=logout name=submit type=submit>
143          @label:login.logout@
144        </button>
145      </div>
146      <input name=action type=hidden value=logout>
147      <input name=nonce type=hidden value="@nonce@">
148    </form>
149
150    <p>Use this form to change your email address and/or password.</p>
151
152    <form class=edituser action="@url@" method=POST
153          enctype="multipart/form-data" accept-charset=utf-8>
154      <table class=edituser>
155        <tr>
156          <td>@label:login.email@</td>
157          <td>
158            <input class=email name=email type=text size=32
159                   value="@userinfo:email@">
160          </td>
161          <td class=extra>@label:login.edituseremailextra@</td>
162        </tr>
163        <tr>
164          <td>@label:login.newpassword@</td>
165          <td>
166            <input class=password name=changepassword1 type=password size=32
167                   value="">
168          </td>
169          <td class=extra>@label:login.edituserpassword1extra@</td>
170        </tr>
171        <tr>
172          <td>@label:login.newpassword@</td>
173          <td>
174            <input class=password name=changepassword2 type=password size=32
175                   value="">
176          </td>
177          <td class=extra>@label:login.edituserpassword2extra@</td>
178        </tr>
179        <tr>
180          <td>
181            <button class=edituser name=submit type=submit>
182              @label:login.edituser@
183            </button>
184          </td>
185        </tr>
186      </table>
187      <input name=action type=hidden value=edituser>
188      <input name=nonce type=hidden value="@nonce@">
189    </form>
190
191    }@
192
193 @include{topbarend}@
194  </body>
195 </html>
196 @@
197 <!--
198 Local variables:
199 mode:sgml
200 sgml-always-quote-attributes:nil
201 sgml-indent-step:1
202 sgml-indent-data:t
203 End:
204 -->