3 -- Main account listing and password changing form
5 -- (c) 2013 Mark Wooding
8 <!------- Licensing notice --------------------------------------------------
10 -- This file is part of Chopwood: a password-changing service.
12 -- Chopwood is free software; you can redistribute it and/or modify
13 -- it under the terms of the GNU Affero General Public License as
14 -- published by the Free Software Foundation; either version 3 of the
15 -- License, or (at your option) any later version.
17 -- Chopwood is distributed in the hope that it will be useful,
18 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
19 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 -- GNU Affero General Public License for more details.
22 -- You should have received a copy of the GNU Affero General Public
23 -- License along with Chopwood; if not, see
24 -- <http://www.gnu.org/licenses/>.
27 <h1>Chopwood: accounts list</h1>
29 <form method=POST action="~={script}H">
31 <div class=expand-outer>
32 <div class=expand-inner>
35 <h2><label for=acct-list accesskey=a>Your <u>a</u>ccounts</label></h2>
37 <select multiple id=acct-list name=services>~={accts}{
38 <option value=~={@.service}H>~
39 ~={@.service}H: ~={@.friendly}:H~={@.alias}@[ (~H)~]~*~}
42 <script type="text/javascript"><!--
43 function check_accounts() {
44 if (elt('acct-list').selectedIndex == -1)
45 return 'No accounts selected.';
50 check: function () { return null; }
55 <div class=expand-reference>
57 <h2>Set a new password</h2>
61 <label for=set-first accesskey=p>New <u>p</u>assword:</label>
63 <input id=set-first type=password name=first>
66 <label for=set-second>Confirm password:</label>
68 <input id=set-second type=password name=second>
70 <button type=submit accesskey=s id=set-submit
71 name=%act value=set><u>S</u>et</button>
73 <td colspan=3 class=whinge id=set-whinge align=center>OK
75 <script type="text/javascript"><!--
76 function check_partial_passwd() {
77 if (elt('set-first').value != '' ||
78 elt('set-second').value != '')
79 return 'Password at least partially entered.';
83 elts: ['first', 'second'],
86 if ((w = check_accounts()) !== null)
88 else if (elt('set-first').value == "")
89 return 'Empty password not permitted.';
90 else if (elt('set-first').value != elt('set-second').value)
91 return 'Passwords don\u2019t match.';
97 <h2>Generate a new password</h2>
98 <button type=submit id=reset-submit accesskey=g
99 name=%act value=reset><u>G</u>enerate</button>
100 <span class=whinge id=reset-whinge>OK</span>
101 <script type="text/javascript"><!--
104 return check_accounts() || check_partial_passwd();
109 <h2>Clear the existing passwords</h2>
110 <button type=submit id=clear-submit accesskey=c
111 name=%act value=clear><u>C</u>lear</button>
112 <span class=whinge id=clear-whinge>OK</span>
113 <script type="text/javascript"><!--
116 return check_accounts() || check_partial_passwd();
124 <input type=hidden name=%user value="~={user}H">
125 <input type=hidden name=%nonce value="~={nonce}H">
128 ~1[<!------- That's all, folks ------------------------------------------>~]~