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
28 if( !defined( 'MEDIAWIKI' ) ) die( -1 );
31 * HTML template for Special:Userlogin form
34 class UserloginTemplate
extends QuickTemplate
{
36 if( $this->data
['message'] ) {
38 <div
class="<?php $this->text('messagetype') ?>box">
39 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
40 <strong
><?php
$this->msg( 'loginerror' )?
></strong
><br
/>
42 <?php
$this->html('message') ?
>
44 <div
class="visualClear"></div
>
47 <div id
="loginstart"><?php
$this->msgWiki( 'loginstart' ); ?
></div
>
48 <div id
="userloginForm">
49 <form name
="userlogin" method
="post" action
="<?php $this->text('action') ?>">
50 <h2
><?php
$this->msg('login') ?
></h2
>
51 <p id
="userloginlink"><?php
$this->html('link') ?
></p
>
52 <?php
$this->html('header'); /* pre-table point for form plugins... */ ?
>
53 <div id
="userloginprompt"><?php
$this->msgWiki('loginprompt') ?
></div
>
54 <?php
if( $this->haveData( 'languages' ) ) { ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
} ?
>
57 <td
class="mw-label"><label
for='wpName1'><?php
$this->msg('yourname') ?
></label
></td
>
60 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
61 'class' => 'loginText',
66 # Can't do + array( 'autofocus' ) because + for arrays in PHP
67 # only works right for associative arrays! Thanks, PHP.
68 ) +
( $this->data
['name'] ?
array() : array( 'autofocus' => '' ) ) ); ?
>
73 <td
class="mw-label"><label
for='wpPassword1'><?php
$this->msg('yourpassword') ?
></label
></td
>
76 echo Html
::input( 'wpPassword', null, 'password', array(
77 'class' => 'loginPassword',
78 'id' => 'wpPassword1',
81 ) +
( $this->data
['name'] ?
array( 'autofocus' ) : array() ) ); ?
>
85 <?php
if( isset( $this->data
['usedomain'] ) && $this->data
['usedomain'] ) {
87 foreach( $this->data
['domainnames'] as $dom ) {
88 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
91 <tr id
="mw-user-domain-section">
92 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
94 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
102 if( $this->haveData( 'extrafields' ) ) {
103 echo $this->data
['extrafields'];
106 if( $this->data
['canremember'] ) { ?
>
109 <td
class="mw-input">
111 global $wgCookieExpiration;
112 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
113 echo Xml
::checkLabel(
114 wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
117 $this->data
['remember'],
118 array( 'tabindex' => '8' )
124 <?php
if( $this->data
['cansecurelogin'] ) { ?
>
127 <td
class="mw-input">
129 echo Xml
::checkLabel(
130 wfMessage( 'securelogin-stick-https' )->text(),
133 $this->data
['stickHTTPS'],
134 array( 'tabindex' => '9' )
142 <td
class="mw-submit">
144 echo Html
::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
145 'id' => 'wpLoginAttempt',
148 if ( $this->data
['useemail'] && $this->data
['canreset'] ) {
149 if( $this->data
['resetlink'] === true ){
152 SpecialPage
::getTitleFor( 'PasswordReset' ),
153 wfMessage( 'userlogin-resetlink' )
155 } elseif( $this->data
['resetlink'] === null ) {
159 wfMessage( 'mailmypassword' )->text(),
161 'id' => 'wpMailmypassword',
171 <?php
if( $this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
172 <?php
if( $this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpLoginToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>
175 <div id
="loginend"><?php
$this->html( 'loginend' ); ?
></div
>