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
24 * Html form for user login with new VForm appearance.
26 class UserloginTemplateVForm
extends BaseTemplate
{
29 global $wgCookieExpiration;
30 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
32 <div
class="mw-ui-container">
34 if ( $this->haveData( 'languages' ) ) {
36 <div id
="languagelinks">
37 <p
><?php
$this->html( 'languages' ); ?
></p
>
42 <div id
="userloginForm">
43 <form name
="userlogin" class="mw-ui-vform" method
="post" action
="<?php $this->text( 'action' ); ?>">
44 <section
class="mw-form-header">
45 <?php
$this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?
>
49 if ( $this->data
['message'] ) {
51 <div
class="<?php $this->text( 'messagetype' ); ?>box">
53 if ( $this->data
['messagetype'] == 'error' ) {
55 <strong
><?php
$this->msg( 'loginerror' ) ?
></strong
><br
/>
58 $this->html( 'message' );
67 $this->msg( 'userlogin-yourname' );
68 if ( $this->data
['secureLoginUrl'] ) {
69 echo Html
::element( 'a', array(
70 'href' => $this->data
['secureLoginUrl'],
71 'class' => 'mw-ui-flush-right mw-secure',
72 ), $this->getMsg( 'userlogin-signwithsecure' )->text() );
76 $extraAttrs = array();
77 // Set focus to this field if its blank.
78 if ( !$this->data
['name'] ) {
79 $extraAttrs['autofocus'] = '';
81 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
82 'class' => 'loginText',
86 // 'required' is blacklisted for now in Html.php due to browser issues.
87 // Keeping here in case that changes
89 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text()
94 <label
for='wpPassword1'>
96 $this->msg( 'userlogin-yourpassword' );
98 if ( $this->data
['useemail'] && $this->data
['canreset'] && $this->data
['resetlink'] === true ) {
100 SpecialPage
::getTitleFor( 'PasswordReset' ),
101 $this->getMsg( 'userlogin-resetpassword-link' )->parse(),
102 array( 'class' => 'mw-ui-flush-right' )
104 // TODO: remove the wpMailmypassword code branch from
105 // templates/Userlogin.php as well; it is never executed and
111 $extraAttrs = array();
112 // Set focus to this field if username is filled in.
113 if ( $this->data
['name'] ) {
114 $extraAttrs['autofocus'] = '';
116 echo Html
::input( 'wpPassword', null, 'password', array(
117 'class' => 'loginPassword',
118 'id' => 'wpPassword1',
121 'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
126 if ( isset( $this->data
['usedomain'] ) && $this->data
['usedomain'] ) {
128 foreach ( $this->data
['domainnames'] as $dom ) {
129 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
132 <div id
="mw-user-domain-section">
133 <label
for='wpDomain' class="pos-above"><?php
$this->msg( 'yourdomain' ); ?
></label
>
134 <select name
="wpDomain" value
="<?php $this->text( 'domain' ); ?>"
141 if ( $this->haveData( 'extrafields' ) ) {
142 echo $this->data
['extrafields'];
147 <?php
if ( $this->data
['canremember'] ) { ?
>
148 <label
class="mw-ui-checkbox-label">
149 <input name
="wpRemember" type
="checkbox" value
="1" id
="wpRemember" tabindex
="4"
150 <?php
if ( $this->data
['remember'] ) {
151 echo 'checked="checked"';
154 <?php
echo $this->getMsg( 'userlogin-remembermypassword' )->numParams( $expirationDays )->escaped(); ?
>
159 <?php
if ( $this->data
['cansecurelogin'] ) { ?
>
161 <label
class="mw-ui-checkbox-label">
162 <input name
="wpStickHTTPS" type
="checkbox" value
="1" id
="wpStickHTTPS" tabindex
="5"
163 <?php
if ( $this->data
['stickHTTPS'] ) {
164 echo 'checked="checked"';
167 <?php
$this->msg( 'securelogin-stick-https' ); ?
>
173 echo Html
::input( 'wpLoginAttempt', $this->getMsg( 'login' )->text(), 'submit', array(
174 'id' => 'wpLoginAttempt',
176 'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-primary'
180 <div id
="mw-userlogin-help">
181 <?php
echo $this->getMsg( 'userlogin-helplink' )->parse(); ?
>
183 <?php
if ( $this->haveData( 'createOrLoginHref' ) ) { ?
>
184 <div id
="mw-createaccount-cta">
185 <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
>
188 <input type
="hidden" id
="mw-useNew" name
="useNew" value
="1" />
189 <?php
if ( $this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
190 <?php
if ( $this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpLoginToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>