(bug 8931) Prevent password from being repeated in HTML of log-in form after unsucces...
[lhc/web/wiklou.git] / includes / templates / Userlogin.php
1 <?php
2 /**
3 * @addtogroup Templates
4 */
5 if( !defined( 'MEDIAWIKI' ) ) die( -1 );
6
7 /** */
8 require_once( 'includes/SkinTemplate.php' );
9
10 /**
11 * HTML template for Special:Userlogin form
12 * @addtogroup Templates
13 */
14 class UserloginTemplate extends QuickTemplate {
15 function execute() {
16 if( $this->data['message'] ) {
17 ?>
18 <div class="<?php $this->text('messagetype') ?>box">
19 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
20 <h2><?php $this->msg('loginerror') ?>:</h2>
21 <?php } ?>
22 <?php $this->html('message') ?>
23 </div>
24 <div class="visualClear"></div>
25 <?php } ?>
26
27 <div id="userloginForm">
28 <form name="userlogin" method="post" action="<?php $this->text('action') ?>">
29 <h2><?php $this->msg('login') ?></h2>
30 <p id="userloginlink"><?php $this->html('link') ?></p>
31 <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
32 <div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div>
33 <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
34 <table>
35 <tr>
36 <td align='right'><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
37 <td align='left'>
38 <input type='text' class='loginText' name="wpName" id="wpName1"
39 tabindex="1"
40 value="<?php $this->text('name') ?>" size='20' />
41 </td>
42 </tr>
43 <tr>
44 <td align='right'><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td>
45 <td align='left'>
46 <input type='password' class='loginPassword' name="wpPassword" id="wpPassword1"
47 tabindex="2"
48 value="" size='20' />
49 </td>
50 </tr>
51 <?php if( $this->data['usedomain'] ) {
52 $doms = "";
53 foreach( $this->data['domainnames'] as $dom ) {
54 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
55 }
56 ?>
57 <tr>
58 <td align='right'><?php $this->msg( 'yourdomainname' ) ?></td>
59 <td align='left'>
60 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
61 tabindex="3">
62 <?php echo $doms ?>
63 </select>
64 </td>
65 </tr>
66 <?php } ?>
67 <tr>
68 <td></td>
69 <td align='left'>
70 <input type='checkbox' name="wpRemember"
71 tabindex="4"
72 value="1" id="wpRemember"
73 <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
74 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
75 </td>
76 </tr>
77 <tr>
78 <td></td>
79 <td align='left' style="white-space:nowrap">
80 <input type='submit' name="wpLoginattempt" id="wpLoginattempt" tabindex="5" value="<?php $this->msg('login') ?>" />&nbsp;<?php if( $this->data['useemail'] && $this->data['canreset']) { ?><input type='submit' name="wpMailmypassword" id="wpMailmypassword"
81 tabindex="6"
82 value="<?php $this->msg('mailmypassword') ?>" />
83 <?php } ?>
84 </td>
85 </tr>
86 </table>
87 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
88 </form>
89 </div>
90 <div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div>
91 <?php
92
93 }
94 }
95
96 /**
97 * @addtogroup Templates
98 */
99 class UsercreateTemplate extends QuickTemplate {
100 function execute() {
101 if( $this->data['message'] ) {
102 ?>
103 <div class="<?php $this->text('messagetype') ?>box">
104 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
105 <h2><?php $this->msg('loginerror') ?>:</h2>
106 <?php } ?>
107 <?php $this->html('message') ?>
108 </div>
109 <div class="visualClear"></div>
110 <?php } ?>
111 <div id="userlogin">
112
113 <form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>">
114 <h2><?php $this->msg('createaccount') ?></h2>
115 <p id="userloginlink"><?php $this->html('link') ?></p>
116 <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
117 <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
118 <table>
119 <tr>
120 <td align='right'><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
121 <td align='left'>
122 <input type='text' class='loginText' name="wpName" id="wpName2"
123 tabindex="1"
124 value="<?php $this->text('name') ?>" size='20' />
125 </td>
126 </tr>
127 <tr>
128 <td align='right'><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td>
129 <td align='left'>
130 <input type='password' class='loginPassword' name="wpPassword" id="wpPassword2"
131 tabindex="2"
132 value="" size='20' />
133 </td>
134 </tr>
135 <?php if( $this->data['usedomain'] ) {
136 $doms = "";
137 foreach( $this->data['domainnames'] as $dom ) {
138 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
139 }
140 ?>
141 <tr>
142 <td align='right'><?php $this->msg( 'yourdomainname' ) ?></td>
143 <td align='left'>
144 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
145 tabindex="3">
146 <?php echo $doms ?>
147 </select>
148 </td>
149 </tr>
150 <?php } ?>
151 <tr>
152 <td align='right'><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
153 <td align='left'>
154 <input type='password' class='loginPassword' name="wpRetype" id="wpRetype"
155 tabindex="4"
156 value=""
157 size='20' />
158 </td>
159 </tr>
160 <tr>
161 <?php if( $this->data['useemail'] ) { ?>
162 <td align='right' style='vertical-align: top'><label for='wpEmail'><?php $this->msg('youremail') ?></label></td>
163 <td align='left'>
164 <input type='text' class='loginText' name="wpEmail" id="wpEmail"
165 tabindex="5"
166 value="<?php $this->text('email') ?>" size='20' />
167 <div class="prefsectiontip">
168 <?php $this->msgWiki('prefs-help-email'); ?>
169 </div>
170 </td>
171 <?php } ?>
172 <?php if( $this->data['userealname'] ) { ?>
173 </tr>
174 <tr>
175 <td align='right' style='vertical-align: top'><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
176 <td align='left'>
177 <input type='text' class='loginText' name="wpRealName" id="wpRealName"
178 tabindex="6"
179 value="<?php $this->text('realname') ?>" size='20' />
180 <div class="prefsectiontip">
181 <?php $this->msgWiki('prefs-help-realname'); ?>
182 </div>
183 </td>
184 <?php } ?>
185 </tr>
186 <tr>
187 <td></td>
188 <td align='left'>
189 <input type='checkbox' name="wpRemember"
190 tabindex="7"
191 value="1" id="wpRemember"
192 <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
193 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
194 </td>
195 </tr>
196 <tr>
197 <td></td>
198 <td align='left'>
199 <input type='submit' name="wpCreateaccount" id="wpCreateaccount"
200 tabindex="8"
201 value="<?php $this->msg('createaccount') ?>" />
202 <?php if( $this->data['createemail'] ) { ?>
203 <input type='submit' name="wpCreateaccountMail" id="wpCreateaccountMail"
204 tabindex="9"
205 value="<?php $this->msg('createaccountmail') ?>" />
206 <?php } ?>
207 </td>
208 </tr>
209 </table>
210 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
211 </form>
212 </div>
213 <div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div>
214 <?php
215
216 }
217 }
218
219 ?>