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