Fixed spacing in actions/cache/filebackend/filerepo/job folder
[mediawiki.git] / includes / templates / UserloginVForm.php
blob2e90c09f183a37ec461d13bb79db469e02971672
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
18 * @file
19 * @ingroup Templates
23 /**
24 * Html form for user login with new VForm appearance.
26 class UserloginTemplateVForm extends BaseTemplate {
28 function execute() {
29 global $wgCookieExpiration;
30 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
32 <div class="mw-ui-container">
33 <?php
34 // Some extensions including CAPTCHAs add content to header on UserLoginForm hook.
35 $this->html('header');
36 if( $this->haveData( 'languages' ) ) {
38 <div id="languagelinks">
39 <p><?php $this->html('languages' ); ?></p>
40 </div>
41 <?php
44 <div id="userloginForm">
45 <form name="userlogin" class="mw-ui-vform" method="post" action="<?php $this->text('action') ?>">
46 <?php
48 if( $this->data['message'] ) {
50 <div class="<?php $this->text('messagetype') ?>box">
51 <?php
52 if ( $this->data['messagetype'] == 'error' ) {
54 <strong><?php $this->msg( 'loginerror' )?></strong><br />
55 <?php
57 $this->html('message')
59 </div>
60 <?php
63 <div>
64 <label for='wpName1'>
65 <?php
66 $this->msg( 'userlogin-yourname' );
67 if ( $this->data['secureLoginUrl'] ) {
68 echo Html::element( 'a', array(
69 'href' => $this->data['secureLoginUrl'],
70 'class' => 'mw-ui-flush-right mw-secure',
71 ), $this->getMsg( 'userlogin-signwithsecure' )->text() );
72 } ?>
73 </label>
74 <?php
75 $extraAttrs = array();
76 // Set focus to this field if its blank.
77 if ( !$this->data['name'] ) {
78 $extraAttrs['autofocus'] = '';
80 echo Html::input( 'wpName', $this->data['name'], 'text', array(
81 'class' => 'loginText',
82 'id' => 'wpName1',
83 'tabindex' => '1',
84 'size' => '20',
85 // 'required' is blacklisted for now in Html.php due to browser issues.
86 // Keeping here in case that changes
87 'required',
88 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text()
89 ) + $extraAttrs );
91 </div>
92 <div>
93 <label for='wpPassword1'>
94 <?php
95 $this->msg('userlogin-yourpassword');
97 if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) {
98 echo Linker::link(
99 SpecialPage::getTitleFor( 'PasswordReset' ),
100 $this->getMsg( 'userlogin-resetlink' )->parse(),
101 array( 'class' => 'mw-ui-flush-right' )
103 // TODO: remove the wpMailmypassword code branch from
104 // templates/Userlogin.php as well; it is never executed and
105 // doesn't work.
108 </label>
109 <?php
110 $extraAttrs = array();
111 // Set focus to this field if username is filled in.
112 if ( $this->data['name'] ) {
113 $extraAttrs['autofocus'] = '';
115 echo Html::input( 'wpPassword', null, 'password', array(
116 'class' => 'loginPassword',
117 'id' => 'wpPassword1',
118 'tabindex' => '2',
119 'size' => '20',
120 'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
121 ) + $extraAttrs );
123 </div>
124 <?php
125 if( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
126 $doms = "";
127 foreach( $this->data['domainnames'] as $dom ) {
128 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
131 <div id="mw-user-domain-section">
132 <label for='wpDomain' class="pos-above"><?php $this->msg( 'yourdomain' ) ?></label>
133 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
134 tabindex="3">
135 <?php echo $doms ?>
136 </select>
137 </div>
138 <?php }
140 if( $this->haveData( 'extrafields' ) ) {
141 echo $this->data['extrafields'];
142 } ?>
144 <div>
146 <?php if( $this->data['canremember'] ) { ?>
147 <label class="mw-ui-checkbox-label">
148 <input name="wpRemember" type="checkbox" value="1" id="wpRemember" tabindex="4"
149 <?php if ( $this->data['remember'] ) {
150 echo 'checked="checked"';
151 } ?>
153 <?php echo $this->getMsg( 'userlogin-remembermypassword' )->numParams( $expirationDays )->escaped(); ?>
154 </label>
155 <?php } ?>
156 </div>
158 <?php if( $this->data['cansecurelogin'] ) { ?>
159 <div>
160 <label class="mw-ui-checkbox-label">
161 <input name="wpStickHTTPS" type="checkbox" value="1" id="wpStickHTTPS" tabindex="5"
162 <?php if ( $this->data['stickHTTPS'] ) {
163 echo 'checked="checked"';
164 } ?>
166 <?php $this->msg( 'securelogin-stick-https' ); ?>
167 </label>
168 </div>
169 <?php } ?>
170 <div>
171 <?php
172 echo Html::input( 'wpLoginAttempt', $this->getMsg( 'login' )->text(), 'submit', array(
173 'id' => 'wpLoginAttempt',
174 'tabindex' => '6',
175 'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-primary'
176 ) );
178 </div>
179 <div id="mw-userlogin-help">
180 <?php echo $this->getMsg( 'userlogin-helplink' )->parse() ?>
181 </div>
182 <?php if( $this->haveData( 'createOrLoginHref' ) ) { ?>
183 <div id="mw-createaccount-cta">
184 <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ) ?><a href="<?php $this->text( 'createOrLoginHref' ) ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ) ?></a></h3>
185 </div>
186 <?php } ?>
187 <input type="hidden" id="mw-useNew" name="useNew" value="1" />
188 <?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
189 <?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
190 </form>
191 </div>
192 </div>
193 <?php