3 * Html form for user login.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
25 * @defgroup Templates Templates
29 * HTML template for Special:Userlogin form
32 class UserloginTemplate
extends QuickTemplate
{
34 if ( $this->data
['message'] ) {
36 <div
class="<?php $this->text( 'messagetype' ); ?>box">
38 if ( $this->data
['messagetype'] == 'error' ) {
39 ?
><strong
><?php
$this->msg( 'loginerror' ); ?
></strong
><br
/><?php
42 <?php
$this->html( 'message' ); ?
>
44 <div
class="visualClear"></div
><?php
48 <div id
="loginstart"><?php
$this->msgWiki( 'loginstart' ); ?
></div
>
49 <div id
="userloginForm">
50 <form name
="userlogin" method
="post" action
="<?php $this->text( 'action' ); ?>">
51 <h2
><?php
$this->msg( 'login' ); ?
></h2
>
52 <p id
="userloginlink"><?php
$this->html( 'link' ); ?
></p
>
53 <?php
$this->html( 'header' ); /* pre-table point for form plugins... */ ?
>
54 <div id
="userloginprompt"><?php
$this->msgWiki( 'loginprompt' ); ?
></div
>
56 if ( $this->haveData( 'languages' ) ) {
57 ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
62 <td
class="mw-label"><label
for='wpName1'><?php
$this->msg( 'yourname' ); ?
></label
></td
>
65 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
66 'class' => 'loginText',
71 # Can't do + array( 'autofocus' ) because + for arrays in PHP
72 # only works right for associative arrays! Thanks, PHP.
73 ) +
( $this->data
['name'] ?
array() : array( 'autofocus' => '' ) ) ); ?
>
78 <td
class="mw-label"><label
for='wpPassword1'><?php
$this->msg( 'yourpassword' ); ?
></label
></td
>
81 echo Html
::input( 'wpPassword', null, 'password', array(
82 'class' => 'loginPassword',
83 'id' => 'wpPassword1',
86 ) +
( $this->data
['name'] ?
array( 'autofocus' ) : array() ) ); ?
>
91 if ( isset( $this->data
['usedomain'] ) && $this->data
['usedomain'] ) {
93 foreach ( $this->data
['domainnames'] as $dom ) {
94 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
97 <tr id
="mw-user-domain-section">
98 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
100 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
109 if ( $this->haveData( 'extrafields' ) ) {
110 echo $this->data
['extrafields'];
113 if ( $this->data
['canremember'] ) {
117 <td
class="mw-input">
119 global $wgCookieExpiration;
120 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
121 echo Xml
::checkLabel(
122 wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
125 $this->data
['remember'],
126 array( 'tabindex' => '8' )
134 if ( $this->data
['cansecurelogin'] ) {
138 <td
class="mw-input">
140 echo Xml
::checkLabel(
141 wfMessage( 'securelogin-stick-https' )->text(),
144 $this->data
['stickHTTPS'],
145 array( 'tabindex' => '9' )
155 <td
class="mw-submit">
157 echo Html
::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
158 'id' => 'wpLoginAttempt',
161 if ( $this->data
['useemail'] && $this->data
['canreset'] ) {
162 if ( $this->data
['resetlink'] === true ) {
165 SpecialPage
::getTitleFor( 'PasswordReset' ),
166 wfMessage( 'userlogin-resetlink' )
168 } elseif ( $this->data
['resetlink'] === null ) {
172 wfMessage( 'mailmypassword' )->text(),
174 'id' => 'wpMailmypassword',
185 if ( $this->haveData( 'uselang' ) ) {
186 ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
189 if ( $this->haveData( 'token' ) ) {
190 ?
><input type
="hidden" name
="wpLoginToken" value
="<?php $this->text( 'token' ); ?>" /><?php
195 <div id
="loginend"><?php
$this->html( 'loginend' ); ?
></div
>