Page MenuHomePhabricator

Special:Userlogin don't shows Mail me password
Closed, DeclinedPublic

Description

Author: mr.primus

Description:
I just upgraded from 1.5beta3 to MW 1.5.8. and Special:Userlogin don't shows the
button for "Mail me my password". I have $wgEnableEmail = true in Localsettings.
The button is shown if I am logged in as admin but not if someone logs in as a
normal user.


Version: 1.5.x
Severity: normal
OS: Windows 2000
Platform: PC

Details

Reference
bz5522

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 9:10 PM
bzimport set Reference to bz5522.
bzimport added a subscriber: Unknown Object (MLST).

Please provide:

  1. Url to your site
  2. Your LocalSettings.php

mr.primus wrote:

I can't provide you the url because i use it in an intranet of a company. I can
recreate this result by using the following settings of Localsettings.php:

<?php

  1. This file was automatically generated by the MediaWiki installer.
  2. If you make manual changes, please keep track in case you need to
  3. recreate them later.

$IP = "E:\\htdocs\\test";
ini_set( "include_path", ".;$IP;$IP/includes;$IP/languages" );
require_once( "includes/DefaultSettings.php" );

  1. If PHP's memory limit is very low, some operations may fail.
  2. ini_set( 'memory_limit', '20M' );

if ( $wgCommandLineMode ) {
if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {

		die( "This script must be run from the command line\n" );

}
} elseif ( empty( $wgNoOutputBuffer ) ) {

  1. Compress output if the browser supports it

if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' );
}

$wgSitename = "Test";

$wgScriptPath = "/test";
$wgScript = "$wgScriptPath/index.php";
$wgRedirectScript = "$wgScriptPath/redirect.php";

If using PHP as a CGI module, use the ugly URLs

$wgArticlePath = "$wgScript/$1";

$wgArticlePath = "$wgScript?title=$1";

$wgStylePath = "$wgScriptPath/skins";
$wgStyleDirectory = "$IP/skins";
$wgLogo = "$wgScriptPath/images/logo/logo_test.jpg";

$wgUploadPath = "$wgScriptPath/images";
$wgUploadDirectory = "$IP/images";

$wgEnableEmail = true;
$wgEnableUserEmail = false;

$wgEmergencyContact = "name@localhost";
$wgPasswordSender = "name@localhost";

  1. For a detailed description of the following switches see
  2. http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
  3. There are many more options for fine tuning available see
  4. /includes/DefaultSettings.php
  5. UPO means: this is also a user preference option

$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = false;

$wgDBserver = "localhost";
$wgDBname = "wikidb";
$wgDBuser = "PASSWORD";
$wgDBpassword = "PASSWORD";
$wgDBprefix = "test";

If you're on MySQL 3.x, this next line must be FALSE:

$wgDBmysql4 = true;

Experimental charset support for MySQL 4.1/5.0.

$wgDBmysql5 = false;

Shared memory settings

$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();

  1. To enable image uploads, make sure the 'images' directory
  2. is writable, then uncomment this:

$wgEnableUploads = true;
$wgUseImageResize = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "convert";

    1. If you want to use image uploads under safe mode,
    2. create the directories images/archive, images/thumb and
    3. images/temp, and make them all writable. Then uncomment
    4. this, if it's not already uncommented:
  1. $wgHashedUploadDirectory = false;
    1. If you have the appropriate support software installed
    2. you can enable inline LaTeX equations:
  1. $wgUseTeX = true;

$wgMathPath = "{$wgUploadPath}/math";
$wgMathDirectory = "{$wgUploadDirectory}/math";
$wgTmpDirectory = "{$wgUploadDirectory}/tmp";

$wgLocalInterwiki = $wgSitename;

$wgLanguageCode = "de";

$wgProxyKey = "KEY";

    1. Default skin: you can change the default skin. Use the internal symbolic
    2. names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
  1. $wgDefaultSkin = 'monobook';
    1. For attaching licensing metadata to pages, and displaying an
    2. appropriate copyright notice / icon. GNU Free Documentation
    3. License and Creative Commons licenses are supported so far.
  1. $wgEnableCreativeCommonsRdf = true;

$wgRightsPage = ""; # Set to the title of a wiki page that describes your
license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";

$wgRightsCode = ""; # Not yet used

#readable sites for anonymous
$wgWhitelistRead = array(
"-",
"MediaWiki:Monobook.css",
"MediaWiki:Monobook.js",
"Test:Hauptseite",
"Spezial:Userlogin",
);

#setting user rights
$wgGroupPermissions['*' ]['createaccount'] = false;
$wgGroupPermissions['*' ]['read'] = false;
$wgGroupPermissions['*' ]['edit'] = false;

$wgGroupPermissions['user' ]['move'] = false;
$wgGroupPermissions['user' ]['read'] = true;
$wgGroupPermissions['user' ]['edit'] = false;
$wgGroupPermissions['user' ]['upload'] = false;

$wgGroupPermissions['writer' ]['move'] = true;
$wgGroupPermissions['writer' ]['read'] = true;
$wgGroupPermissions['writer' ]['edit'] = true;
$wgGroupPermissions['writer' ]['upload'] = true;

$wgGroupPermissions['bot' ]['bot'] = false;
$wgGroupPermissions['sysop']['block'] = true;
$wgGroupPermissions['sysop']['createaccount'] = true;
$wgGroupPermissions['sysop']['delete'] = true;
$wgGroupPermissions['sysop']['editinterface'] = true;
$wgGroupPermissions['sysop']['import'] = true;
$wgGroupPermissions['sysop']['importupload'] = true;
$wgGroupPermissions['sysop']['move'] = true;
$wgGroupPermissions['sysop']['patrol'] = true;
$wgGroupPermissions['sysop']['protect'] = true;
$wgGroupPermissions['sysop']['rollback'] = true;
$wgGroupPermissions['sysop']['upload'] = true;
$wgGroupPermissions['sysop']['edit'] = true;

$wgGroupPermissions['bureaucrat']['userrights'] = true;

?>

Upgrade to MediaWiki 1.6.3, it works fine on 1.6.

mr.primus wrote:

I can't upgrade to 1.6.3, because some special functions don't work anymore
then, i.e. Special:Validate. :/

Can you please give me a hint where to change a code to get this password
function back online?

mr.primus wrote:

I solved it using the following includes/templates/Userlogin.php :

<?php
/**

  • @package MediaWiki
  • @subpackage Templates */

if( !defined( 'MEDIAWIKI' ) ) die();

/** */
require_once( 'includes/SkinTemplate.php' );

/**

  • HTML template for Special:Userlogin form
  • @package MediaWiki
  • @subpackage Templates */

class UserloginTemplate extends QuickTemplate {
function execute() {

		if( $this->data['error'] ) {

?>
<h2><?php $this->msg('loginerror') ?>:</h2>
<p class='error'><?php $this->html('error') ?></p>
<?php } else { ?>
<h2><?php $this->msg('login' ) ?>:</h2>
<?php $this->msgWiki('loginprompt') ?>
<?php } ?>
<form name="userlogin" id="userlogin" method="post" action="<?php
$this->text('action') ?>">
<table border='0'>

		<tr>
			<td align='right'><label for='wpName'><?php $this->msg('yourname')

?>:</label></td>

			<td align='left'>
				<input tabindex='1' type='text' name="wpName" id="wpName"
					value="<?php $this->text('name') ?>" size='20' />
			</td>
			<td align='left'>
				<input tabindex='3' type='checkbox' name="wpRemember"
					value="1" id="wpRemember"
					<?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
					/><label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
			</td>
		</tr>
		<tr>
			<td align='right'><label for='wpPassword'><?php $this->msg('yourpassword')

?>:</label></td>

			<td align='left'>
				<input tabindex='2' type='password' name="wpPassword" id="wpPassword"
					value="<?php $this->text('password') ?>" size='20' />
			</td>
			<td align='left'>
				<input tabindex='4' type='submit' name="wpLoginattempt"
					value="<?php $this->msg('login') ?>" />
			</td>
		</tr>

<?php if( $this->data['usedomain'] ) {

		$doms = "";
		foreach( $this->data['domainnames'] as $dom ) {
			$doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
		}

?>

		<tr>
			<td align='right'><?php $this->msg( 'yourdomainname' ) ?>:</td>
			<td align='left'>
				<select tabindex='11' name="wpDomain" value="<?php $this->text( 'domain' ) ?>">
					<?php echo $doms ?>
				</select>
			</td>
		</tr>

<?php } ?>
<?php if( $this->data['create'] ) { ?>

		<tr>
			<td colspan='3'>&nbsp;</td>
		</tr>
		<tr>
			<td align='right'><label for='wpRetype'><?php $this->msg('yourpasswordagain')

?>:</label></td>

			<td align='left'>
				<input tabindex='5' type='password' name="wpRetype" id="wpRetype"
					value="<?php $this->text('retype') ?>" 
					size='20' />
			</td>
			<td><?php $this->msg('newusersonly') ?></td>
		</tr>
		<tr>
			<?php if( $this->data['useemail'] ) { ?>
				<td align='right'><label for='wpEmail'><?php $this->msg('youremail')

?>:</label></td>

				<td align='left'>
					<input tabindex='7' type='text' name="wpEmail" id="wpEmail"
						value="<?php $this->text('email') ?>" size='20' />
				</td>
			<?php } ?>
			<?php if( $this->data['userealname'] ) { ?>
				</tr>
				<tr>
					<td align='right'><label for='wpRealName'><?php $this->msg('yourrealname')

?>:</label></td>

					<td align='left'>
						<input tabindex='8' type='text' name="wpRealName" id="wpRealName"
							value="<?php $this->text('realname') ?>" size='20' />
					</td>
			<?php } ?>
			<td align='left'>
				<input tabindex='9' type='submit' name="wpCreateaccount"
					value="<?php $this->msg('createaccount') ?>" />
				<?php if( $this->data['createemail'] ) { ?>
				<input tabindex='6' type='submit' name="wpCreateaccountMail"
					value="<?php $this->msg('createaccountmail') ?>" />
				<?php } ?>
			</td>
		</tr>

<?php if( $this->data['useemail'] ) { ?> <?php } } ?>

		<tr>
			<td colspan='3'>&nbsp;</td>
		</tr>
		<tr>
			<td colspan='3' align='left'>
				<p>
				<?php if( $this->data['useemail'] ) { ?><input type='submit'

name="wpMailmypassword" id="wpMailmypassword"

									value="<?php $this->msg('mailmypassword') ?>" />
				<?php } ?>
				</p>
			</td>
		</tr>

</table>

</form>
<?php

		$this->msgWiki( 'loginend' );

}
}

?>