00001 <?php
00007 if( !defined( 'MEDIAWIKI' ) ) die( -1 );
00008
00013 class UserloginTemplate extends QuickTemplate {
00014 function execute() {
00015 if( $this->data['message'] ) {
00016 ?>
00017 <div class="<?php $this->text('messagetype') ?>box">
00018 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
00019 <h2><?php $this->msg('loginerror') ?></h2>
00020 <?php } ?>
00021 <?php $this->html('message') ?>
00022 </div>
00023 <div class="visualClear"></div>
00024 <?php } ?>
00025
00026 <div id="loginstart"><?php $this->msgWiki( 'loginstart' ); ?></div>
00027 <div id="userloginForm">
00028 <form name="userlogin" method="post" action="<?php $this->text('action') ?>">
00029 <h2><?php $this->msg('login') ?></h2>
00030 <p id="userloginlink"><?php $this->html('link') ?></p>
00031 <?php $this->html('header'); ?>
00032 <div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div>
00033 <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
00034 <table>
00035 <tr>
00036 <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
00037 <td class="mw-input">
00038 <input type='text' class='loginText' name="wpName" id="wpName1"
00039 tabindex="1"
00040 value="<?php $this->text('name') ?>" size='20' />
00041 </td>
00042 </tr>
00043 <tr>
00044 <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td>
00045 <td class="mw-input">
00046 <input type='password' class='loginPassword' name="wpPassword" id="wpPassword1"
00047 tabindex="2"
00048 value="" size='20' />
00049 </td>
00050 </tr>
00051 <?php if( $this->data['usedomain'] ) {
00052 $doms = "";
00053 foreach( $this->data['domainnames'] as $dom ) {
00054 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
00055 }
00056 ?>
00057 <tr id="mw-user-domain-section">
00058 <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
00059 <td class="mw-input">
00060 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
00061 tabindex="3">
00062 <?php echo $doms ?>
00063 </select>
00064 </td>
00065 </tr>
00066 <?php }
00067 if( $this->data['canremember'] ) { ?>
00068 <tr>
00069 <td></td>
00070 <td class="mw-input">
00071 <input type='checkbox' name="wpRemember"
00072 tabindex="4"
00073 value="1" id="wpRemember"
00074 <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
00075 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
00076 </td>
00077 </tr>
00078 <?php } ?>
00079 <tr>
00080 <td></td>
00081 <td class="mw-submit">
00082 <input type='submit' name="wpLoginattempt" id="wpLoginattempt" tabindex="5" value="<?php $this->msg('login') ?>" /> <?php if( $this->data['useemail'] && $this->data['canreset']) { ?><input type='submit' name="wpMailmypassword" id="wpMailmypassword"
00083 tabindex="6"
00084 value="<?php $this->msg('mailmypassword') ?>" />
00085 <?php } ?>
00086 </td>
00087 </tr>
00088 </table>
00089 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
00090 <?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
00091 </form>
00092 </div>
00093 <div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div>
00094 <?php
00095
00096 }
00097 }
00098
00102 class UsercreateTemplate extends QuickTemplate {
00103 function addInputItem( $name, $value, $type, $msg ) {
00104 $this->data['extraInput'][] = array(
00105 'name' => $name,
00106 'value' => $value,
00107 'type' => $type,
00108 'msg' => $msg,
00109 );
00110 }
00111
00112 function execute() {
00113 if( $this->data['message'] ) {
00114 ?>
00115 <div class="<?php $this->text('messagetype') ?>box">
00116 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
00117 <h2><?php $this->msg('loginerror') ?></h2>
00118 <?php } ?>
00119 <?php $this->html('message') ?>
00120 </div>
00121 <div class="visualClear"></div>
00122 <?php } ?>
00123 <div id="userlogin">
00124
00125 <form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>">
00126 <h2><?php $this->msg('createaccount') ?></h2>
00127 <p id="userloginlink"><?php $this->html('link') ?></p>
00128 <?php $this->html('header'); ?>
00129 <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
00130 <table>
00131 <tr>
00132 <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
00133 <td class="mw-input">
00134 <input type='text' class='loginText' name="wpName" id="wpName2"
00135 tabindex="1"
00136 value="<?php $this->text('name') ?>" size='20' />
00137 </td>
00138 </tr>
00139 <tr>
00140 <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td>
00141 <td class="mw-input">
00142 <input type='password' class='loginPassword' name="wpPassword" id="wpPassword2"
00143 tabindex="2"
00144 value="" size='20' />
00145 </td>
00146 </tr>
00147 <?php if( $this->data['usedomain'] ) {
00148 $doms = "";
00149 foreach( $this->data['domainnames'] as $dom ) {
00150 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
00151 }
00152 ?>
00153 <tr>
00154 <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
00155 <td class="mw-input">
00156 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
00157 tabindex="3">
00158 <?php echo $doms ?>
00159 </select>
00160 </td>
00161 </tr>
00162 <?php } ?>
00163 <tr>
00164 <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
00165 <td class="mw-input">
00166 <input type='password' class='loginPassword' name="wpRetype" id="wpRetype"
00167 tabindex="4"
00168 value=""
00169 size='20' />
00170 </td>
00171 </tr>
00172 <tr>
00173 <?php if( $this->data['useemail'] ) { ?>
00174 <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td>
00175 <td class="mw-input">
00176 <input type='text' class='loginText' name="wpEmail" id="wpEmail"
00177 tabindex="5"
00178 value="<?php $this->text('email') ?>" size='20' />
00179 <div class="prefsectiontip">
00180 <?php if( $this->data['emailrequired'] ) {
00181 $this->msgWiki('prefs-help-email-required');
00182 } else {
00183 $this->msgWiki('prefs-help-email');
00184 } ?>
00185 </div>
00186 </td>
00187 <?php } ?>
00188 <?php if( $this->data['userealname'] ) { ?>
00189 </tr>
00190 <tr>
00191 <td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
00192 <td class="mw-input">
00193 <input type='text' class='loginText' name="wpRealName" id="wpRealName"
00194 tabindex="6"
00195 value="<?php $this->text('realname') ?>" size='20' />
00196 <div class="prefsectiontip">
00197 <?php $this->msgWiki('prefs-help-realname'); ?>
00198 </div>
00199 </td>
00200 <?php } ?>
00201 </tr>
00202 <?php if( $this->data['canremember'] ) { ?>
00203 <tr>
00204 <td></td>
00205 <td class="mw-input">
00206 <input type='checkbox' name="wpRemember"
00207 tabindex="7"
00208 value="1" id="wpRemember"
00209 <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
00210 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
00211 </td>
00212 </tr>
00213 <?php }
00214
00215 $tabIndex = 8;
00216 if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
00217 foreach ( $this->data['extraInput'] as $inputItem ) { ?>
00218 <tr>
00219 <?php
00220 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
00221 ?><td class="mw-label"><label for="<?php
00222 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
00223 $this->msgWiki( $inputItem['msg'] ) ?></label><?php
00224 } else {
00225 ?><td><?php
00226 }
00227 ?></td>
00228 <td class="mw-input">
00229 <input type="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name="<?php
00230 echo htmlspecialchars( $inputItem['name'] ); ?>"
00231 tabindex="<?php echo $tabIndex++; ?>"
00232 value="<?php
00233 if ( $inputItem['type'] != 'checkbox' ) {
00234 echo htmlspecialchars( $inputItem['value'] );
00235 } else {
00236 echo '1';
00237 }
00238 ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
00239 <?php
00240 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
00241 echo 'checked="checked"';
00242 ?> /> <?php
00243 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
00244 ?>
00245 <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
00246 $this->msgHtml( $inputItem['msg'] ) ?></label><?php
00247 }
00248 ?>
00249 </td>
00250 </tr>
00251 <?php
00252
00253 }
00254 }
00255 ?>
00256 <tr>
00257 <td></td>
00258 <td class="mw-submit">
00259 <input type='submit' name="wpCreateaccount" id="wpCreateaccount"
00260 tabindex="<?php echo $tabIndex++; ?>"
00261 value="<?php $this->msg('createaccount') ?>" />
00262 <?php if( $this->data['createemail'] ) { ?>
00263 <input type='submit' name="wpCreateaccountMail" id="wpCreateaccountMail"
00264 tabindex="<?php echo $tabIndex++; ?>"
00265 value="<?php $this->msg('createaccountmail') ?>" />
00266 <?php } ?>
00267 </td>
00268 </tr>
00269 </table>
00270 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
00271 <?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
00272 </form>
00273 </div>
00274 <div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div>
00275 <?php
00276
00277 }
00278 }