MediaWiki  REL1_21
Userlogin.php
Go to the documentation of this file.
00001 <?php
00032 class UserloginTemplate extends QuickTemplate {
00033         function execute() {
00034                 if( $this->data['message'] ) {
00035 ?>
00036         <div class="<?php $this->text('messagetype') ?>box">
00037                 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
00038                         <strong><?php $this->msg( 'loginerror' )?></strong><br />
00039                 <?php } ?>
00040                 <?php $this->html('message') ?>
00041         </div>
00042         <div class="visualClear"></div>
00043 <?php } ?>
00044 
00045 <div id="loginstart"><?php $this->msgWiki( 'loginstart' ); ?></div>
00046 <div id="userloginForm">
00047 <form name="userlogin" method="post" action="<?php $this->text('action') ?>">
00048         <h2><?php $this->msg('login') ?></h2>
00049         <p id="userloginlink"><?php $this->html('link') ?></p>
00050         <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
00051         <div id="userloginprompt"><?php  $this->msgWiki('loginprompt') ?></div>
00052         <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
00053         <table>
00054                 <tr>
00055                         <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
00056                         <td class="mw-input">
00057                                 <?php
00058                         echo Html::input( 'wpName', $this->data['name'], 'text', array(
00059                                 'class' => 'loginText',
00060                                 'id' => 'wpName1',
00061                                 'tabindex' => '1',
00062                                 'size' => '20',
00063                                 'required'
00064                                 # Can't do + array( 'autofocus' ) because + for arrays in PHP
00065                                 # only works right for associative arrays!  Thanks, PHP.
00066                         ) + ( $this->data['name'] ? array() : array( 'autofocus' => '' ) ) ); ?>
00067 
00068                         </td>
00069                 </tr>
00070                 <tr>
00071                         <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td>
00072                         <td class="mw-input">
00073                                 <?php
00074                         echo Html::input( 'wpPassword', null, 'password', array(
00075                                 'class' => 'loginPassword',
00076                                 'id' => 'wpPassword1',
00077                                 'tabindex' => '2',
00078                                 'size' => '20'
00079                         ) + ( $this->data['name'] ? array( 'autofocus' ) : array() ) ); ?>
00080 
00081                         </td>
00082                 </tr>
00083         <?php if( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
00084                 $doms = "";
00085                 foreach( $this->data['domainnames'] as $dom ) {
00086                         $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
00087                 }
00088         ?>
00089                 <tr id="mw-user-domain-section">
00090                         <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
00091                         <td class="mw-input">
00092                                 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
00093                                         tabindex="3">
00094                                         <?php echo $doms ?>
00095                                 </select>
00096                         </td>
00097                 </tr>
00098         <?php }
00099 
00100         if( $this->haveData( 'extrafields' ) ) {
00101                 echo $this->data['extrafields'];
00102         }
00103 
00104         if( $this->data['canremember'] ) { ?>
00105                 <tr>
00106                         <td></td>
00107                         <td class="mw-input">
00108                                 <?php
00109                                 global $wgCookieExpiration;
00110                                 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
00111                                 echo Xml::checkLabel(
00112                                         wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
00113                                         'wpRemember',
00114                                         'wpRemember',
00115                                         $this->data['remember'],
00116                                         array( 'tabindex' => '8' )
00117                                 )
00118                                 ?>
00119                         </td>
00120                 </tr>
00121 <?php } ?>
00122 <?php if( $this->data['cansecurelogin'] ) { ?>
00123                 <tr>
00124                         <td></td>
00125                         <td class="mw-input">
00126                         <?php
00127                         echo Xml::checkLabel(
00128                                 wfMessage( 'securelogin-stick-https' )->text(),
00129                                 'wpStickHTTPS',
00130                                 'wpStickHTTPS',
00131                                 $this->data['stickHTTPS'],
00132                                 array( 'tabindex' => '9' )
00133                         );
00134                 ?>
00135                         </td>
00136                 </tr>
00137 <?php } ?>
00138                 <tr>
00139                         <td></td>
00140                         <td class="mw-submit">
00141                                 <?php
00142                 echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
00143                         'id' => 'wpLoginAttempt',
00144                         'tabindex' => '9'
00145                 ) );
00146                 if ( $this->data['useemail'] && $this->data['canreset'] ) {
00147                         if( $this->data['resetlink'] === true ) {
00148                                 echo '&#160;';
00149                                 echo Linker::link(
00150                                         SpecialPage::getTitleFor( 'PasswordReset' ),
00151                                         wfMessage( 'userlogin-resetlink' )
00152                                 );
00153                         } elseif( $this->data['resetlink'] === null ) {
00154                                 echo '&#160;';
00155                                 echo Html::input(
00156                                         'wpMailmypassword',
00157                                         wfMessage( 'mailmypassword' )->text(),
00158                                         'submit', array(
00159                                                 'id' => 'wpMailmypassword',
00160                                                 'tabindex' => '10'
00161                                         )
00162                                 );
00163                         }
00164                 } ?>
00165 
00166                         </td>
00167                 </tr>
00168         </table>
00169 <?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
00170 <?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
00171 </form>
00172 </div>
00173 <div id="loginend"><?php $this->html( 'loginend' ); ?></div>
00174 <?php
00175 
00176         }
00177 }