summaryrefslogtreecommitdiff
path: root/includes/templates
diff options
context:
space:
mode:
Diffstat (limited to 'includes/templates')
-rw-r--r--includes/templates/PHP4.php102
-rw-r--r--includes/templates/Userlogin.php48
2 files changed, 30 insertions, 120 deletions
diff --git a/includes/templates/PHP4.php b/includes/templates/PHP4.php
deleted file mode 100644
index 69f7d55d..00000000
--- a/includes/templates/PHP4.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-/**
- * Template used when the installer detects that this is PHP 4
- *
- * @file
- * @ingroup Templates
- */
-
-if( !defined( 'MW_PHP4' ) ) {
- die( "Not an entry point.");
-}
-
-if( isset( $_SERVER['SCRIPT_NAME'] ) ) {
- // Probably IIS; doesn't set REQUEST_URI
- $scriptUrl = $_SERVER['SCRIPT_NAME'];
-} elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
- // We're trying SCRIPT_NAME first because it won't include PATH_INFO... hopefully
- $scriptUrl = $_SERVER['REQUEST_URI'];
-} else {
- $scriptUrl = '';
-}
-if ( preg_match( '!^(.*)/(mw-)?config/[^/]*.php$!', $scriptUrl, $m ) ) {
- $baseUrl = $m[1];
-} elseif ( preg_match( '!^(.*)/[^/]*.php$!', $scriptUrl, $m ) ) {
- $baseUrl = $m[1];
-} else {
- $baseUrl = dirname( $scriptUrl );
-}
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
- <head>
- <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></title>
- <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
- <style type='text/css' media='screen'>
- html, body {
- color: #000;
- background-color: #fff;
- font-family: sans-serif;
- text-align: center;
- }
-
- p {
- text-align: left;
- margin-left: 2em;
- margin-right: 2em;
- }
-
- h1 {
- font-size: 150%;
- }
- </style>
- </head>
- <body>
- <img src="<?php echo htmlspecialchars( $baseUrl ) ?>/skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
-
- <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></h1>
- <div class='error'>
-<p>
- MediaWiki requires PHP 5.1.x or higher. You are running PHP
- <?php echo htmlspecialchars( phpversion() ); ?>.
-</p>
-<?php
-flush();
-/**
- * Test the *.php5 extension
- */
-$downloadOther = true;
-if ( $baseUrl ) {
- $testUrl = "$wgServer$baseUrl/php5.php5";
- if( function_exists( 'file_get_contents' ) ) {
- $errorLevel = error_reporting();
- error_reporting( $errorLevel & !E_WARNING );
-
- ini_set( 'allow_url_fopen', '1' );
- $s = file_get_contents( $testUrl );
-
- error_reporting( $errorLevel );
- }
-
- if ( strpos( $s, 'yes' ) !== false ) {
- $encUrl = htmlspecialchars( str_replace( '.php', '.php5', $scriptUrl ) );
- echo "<p>You may be able to use MediaWiki using a <a href=\"$encUrl\">.php5</a> file extension.</p>";
- $downloadOther = false;
- }
-}
-if ( $downloadOther ) {
-?>
-<p>Please consider
-<a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>.
-PHP 4 is at the end of its lifecycle and will not receive further security updates.</p>
-<p>If for some reason you really really need to run MediaWiki on PHP 4, you will need to
-<a href="http://www.mediawiki.org/wiki/Download">download version 1.6.x</a>
-from our website. </p>
-<?php
-}
-?>
-
- </div>
- </body>
-</html>
diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php
index 99ab2d8e..0bfd9737 100644
--- a/includes/templates/Userlogin.php
+++ b/includes/templates/Userlogin.php
@@ -36,7 +36,7 @@ class UserloginTemplate extends QuickTemplate {
<p id="userloginlink"><?php $this->html('link') ?></p>
<?php $this->html('header'); /* pre-table point for form plugins... */ ?>
<div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div>
- <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
+ <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
<table>
<tr>
<td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
@@ -130,21 +130,29 @@ class UserloginTemplate extends QuickTemplate {
'tabindex' => '9'
) );
if ( $this->data['useemail'] && $this->data['canreset'] ) {
- echo '&#160;';
- echo Html::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array(
- 'id' => 'wpMailmypassword',
- 'tabindex' => '10'
- ) );
+ if( $this->data['resetlink'] === true ){
+ echo '&#160;';
+ echo Linker::link(
+ SpecialPage::getTitleFor( 'PasswordReset' ),
+ wfMessage( 'userlogin-resetlink' )
+ );
+ } elseif( $this->data['resetlink'] === null ) {
+ echo '&#160;';
+ echo Html::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array(
+ 'id' => 'wpMailmypassword',
+ 'tabindex' => '10'
+ ) );
+ }
} ?>
</td>
</tr>
</table>
-<?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-<?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
+<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
</form>
</div>
-<div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div>
+<div id="loginend"><?php $this->html( 'loginend' ); ?></div>
<?php
}
@@ -183,7 +191,7 @@ class UsercreateTemplate extends QuickTemplate {
<h2><?php $this->msg('createaccount') ?></h2>
<p id="userloginlink"><?php $this->html('link') ?></p>
<?php $this->html('header'); /* pre-table point for form plugins... */ ?>
- <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
+ <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
<table>
<tr>
<td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
@@ -251,11 +259,15 @@ class UsercreateTemplate extends QuickTemplate {
'size' => '20'
) ); ?>
<div class="prefsectiontip">
- <?php if( $this->data['emailrequired'] ) {
- $this->msgWiki('prefs-help-email-required');
- } else {
- $this->msgWiki('prefs-help-email');
- } ?>
+ <?php // duplicated in Preferences.php profilePreferences()
+ if( $this->data['emailrequired'] ) {
+ $this->msgWiki('prefs-help-email-required');
+ } else {
+ $this->msgWiki('prefs-help-email');
+ }
+ if( $this->data['emailothers'] ) {
+ $this->msgWiki('prefs-help-email-others');
+ } ?>
</div>
</td>
<?php } ?>
@@ -361,11 +373,11 @@ class UsercreateTemplate extends QuickTemplate {
</td>
</tr>
</table>
-<?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-<?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
+<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
</form>
</div>
-<div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div>
+<div id="signupend"><?php $this->html( 'signupend' ); ?></div>
<?php
}