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">
37 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
38 <strong
><?php
$this->msg( 'loginerror' )?
></strong
><br
/>
40 <?php
$this->html('message') ?
>
42 <div
class="visualClear"></div
>
45 <div id
="loginstart"><?php
$this->msgWiki( 'loginstart' ); ?
></div
>
46 <div id
="userloginForm">
47 <form name
="userlogin" method
="post" action
="<?php $this->text('action') ?>">
48 <h2
><?php
$this->msg('login') ?
></h2
>
49 <p id
="userloginlink"><?php
$this->html('link') ?
></p
>
50 <?php
$this->html('header'); /* pre-table point for form plugins... */ ?
>
51 <div id
="userloginprompt"><?php
$this->msgWiki('loginprompt') ?
></div
>
52 <?php
if( $this->haveData( 'languages' ) ) { ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
} ?
>
55 <td
class="mw-label"><label
for='wpName1'><?php
$this->msg('yourname') ?
></label
></td
>
58 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
59 'class' => 'loginText',
64 # Can't do + array( 'autofocus' ) because + for arrays in PHP
65 # only works right for associative arrays! Thanks, PHP.
66 ) +
( $this->data
['name'] ?
array() : array( 'autofocus' => '' ) ) ); ?
>
71 <td
class="mw-label"><label
for='wpPassword1'><?php
$this->msg('yourpassword') ?
></label
></td
>
74 echo Html
::input( 'wpPassword', null, 'password', array(
75 'class' => 'loginPassword',
76 'id' => 'wpPassword1',
79 ) +
( $this->data
['name'] ?
array( 'autofocus' ) : array() ) ); ?
>
83 <?php
if( isset( $this->data
['usedomain'] ) && $this->data
['usedomain'] ) {
85 foreach( $this->data
['domainnames'] as $dom ) {
86 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
89 <tr id
="mw-user-domain-section">
90 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
92 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
100 if( $this->haveData( 'extrafields' ) ) {
101 echo $this->data
['extrafields'];
104 if( $this->data
['canremember'] ) { ?
>
107 <td
class="mw-input">
109 global $wgCookieExpiration;
110 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
111 echo Xml
::checkLabel(
112 wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
115 $this->data
['remember'],
116 array( 'tabindex' => '8' )
122 <?php
if( $this->data
['cansecurelogin'] ) { ?
>
125 <td
class="mw-input">
127 echo Xml
::checkLabel(
128 wfMessage( 'securelogin-stick-https' )->text(),
131 $this->data
['stickHTTPS'],
132 array( 'tabindex' => '9' )
140 <td
class="mw-submit">
142 echo Html
::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
143 'id' => 'wpLoginAttempt',
146 if ( $this->data
['useemail'] && $this->data
['canreset'] ) {
147 if( $this->data
['resetlink'] === true ){
150 SpecialPage
::getTitleFor( 'PasswordReset' ),
151 wfMessage( 'userlogin-resetlink' )
153 } elseif( $this->data
['resetlink'] === null ) {
157 wfMessage( 'mailmypassword' )->text(),
159 'id' => 'wpMailmypassword',
169 <?php
if( $this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
170 <?php
if( $this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpLoginToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>
173 <div id
="loginend"><?php
$this->html( 'loginend' ); ?
></div
>