chiark / gitweb /
avoid choose links that you cannot use
[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    <!-- TODO make error string visually intrusive, also error.html -->
33    <p>@label{error.@label:error@}@</p>
34    }@
35
36    @if{@ne{@label:registered@}{registered}@}{
37    @#{registration succeeded}@
38    <p>@label:login.registered@</p>
39    }@
40
41    @if{@eq{@user@}{guest}@}{
42    @#{guest user, allow login and registration}@
43    <h2>Existing users</h2>
44
45    <p>If you have a username, use this form to log in.</p>
46
47    <form class=login action="@url@" method=POST
48          enctype="multipart/form-data" accept-charset=utf-8>
49      <table class=login>
50        <tr>
51          <td>@label:login.username@</td>
52          <td>
53            <input class=username name=username type=text value="@arg:username@" size=32>
54          </td>
55        </tr>
56        <tr>
57          <td>@label:login.password@</td>
58          <td><input class=password name=password type=password value=""
59                     size=32></td>
60          <td>
61            <button class=login name=action type=submit value=login>
62              @label:login.login@
63            </button>
64          </td>
65        </tr>
66      </table>
67      <input name=nonce type=hidden value="@nonce@">
68      <input name=back type=hidden value="@arg:back@">
69    </form>
70
71    <!-- TODO disable registration button if guest doesn't have
72    register right -->
73
74    <h2>New Users</h2>
75
76    <p>If you do not have a login enter a username, a password and your
77    email address here.  You will be sent an email containing a URL,
78    which you must visit to activate your login before you can use
79    it.<p>
80
81    <form class=register action="@url@" method=POST
82          enctype="multipart/form-data" accept-charset=utf-8>
83      <table class=register>
84        <tr>
85          <td>@label:login.username@</td>
86          <td>
87            <input class=username name=username type=text value="" size=32>
88          </td>
89        </tr>
90        <tr>
91          <td>@label:login.email@</td>
92          <td>
93            <input class=email name=email type=text value="" size=32>
94          </td>
95        </tr>
96        <tr>
97          <td>@label:login.password@</td>
98          <td><input class=password name=changepassword type=password value=""
99                     size=32></td>
100          <td>
101            <button class=register name=action type=submit value=register>
102              @label:login.login@
103            </button>
104          </td>
105        </tr>
106      </table>
107      <input name=nonce type=hidden value="@nonce@">
108    </form>
109    }{
110    @#{not the guest user, allow change of details and logout}@
111
112    <h2>Logged in as @user@</h2>
113
114    <p>TODO none of this stuff works yet</p>
115
116    <p>Use this form to change your email address and/or password.</p>
117
118    <form class=register action="@url@" method=POST
119          enctype="multipart/form-data" accept-charset=utf-8>
120      <table class=edituser>
121        <tr>
122          <td>@label:login.email@</td>
123          <td>
124            <input class=email name=email type=text value="TODO" size=32>
125          </td>
126        </tr>
127        <tr>
128          <td>@label:login.password@</td>
129          <td><input class=password name=password type=password value=""
130                     size=32></td>
131          <td>
132            <button class=edituser name=action type=submit value=edituser>
133              @label:login.edituser@
134            </button>
135          </td>
136        </tr>
137      </table>
138      <input name=nonce type=hidden value="@nonce@">
139    </form>
140
141    <p>Use this button to log out @user@.</p>
142
143    <form class=register action="@url@" method=POST
144          enctype="multipart/form-data" accept-charset=utf-8>
145      <div class=logout>
146        <button class=logout name=action type=submit value=logout>
147          @label:login.logout@
148        </button>
149      </div>
150      <input name=nonce type=hidden value="@nonce@">
151    </form>
152
153    }@
154
155 @include{topbarend}@
156  </body>
157 </html>
158 @@
159 <!--
160 Local variables:
161 mode:sgml
162 sgml-always-quote-attributes:nil
163 sgml-indent-step:1
164 sgml-indent-data:t
165 End:
166 -->