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