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