* (bug 18768) Remove AdminSettings requirements. Maintenance environment will still load it if it exists, but it's not required for anything
+++ /dev/null
-<?php
-/**
- * This file should be copied to AdminSettings.php, and modified
- * to reflect local settings. It is required for the maintenance
- * scripts which run on the command line, as an extra security
- * measure to allow using a separate user account with higher
- * privileges to do maintenance work.
- *
- * Developers: Do not check AdminSettings.php into Subversion
- */
-
-/*
- * This data is used by all database maintenance scripts
- * (see directory maintenance/). The SQL user MUST BE
- * MANUALLY CREATED or set to an existing user with
- * necessary permissions.
- *
- * This is not to be confused with sysop accounts for the
- * wiki.
- *
- * NOTE: for PostgreSQL this should be set to the same user and
- * password as the web user, that is, the same as $wgDBuser and
- * $wgDBpassword in LocalSettings.php. This is necessary to
- * ensure that the owner for new tables is set correctly.
- */
-$wgDBadminuser = 'wikiadmin';
-$wgDBadminpassword = 'adminpass';
-
-/*
- * Whether to enable the profileinfo.php script.
- */
-$wgEnableProfileInfo = false;
this. Was used when mwEmbed was going to be an extension.
* $wgDebugJavaScript if we want to enable fresh debug javascript
* $wgPhpCliPath Path to php-cli for spinning up background php processes
-
* (bug 18222) $wgMinimalPasswordLength default is now 1
* $wgSessionHandler can be used to configure session.save_handler
* $wgLocalFileRepo/$wgForeignFileRepos now have a 'fileMode' parameter to
thumbnails to be stored in a separate location to the source images.
* If config/ directory is not executable, the command to make it executable
now asks the user to cd to the correct directory
-* Add experimental new external authentication framework, ExternalAuth.
+* Add experimental new external authentication framework, ExternalAuth
+* (bug 14201) Set $wgDBadminuser/$wgDBadminpassword during setup
+* (bug 18768) Remove AdminSettings requirements. Maintenance environment
+ will still load it if it exists, but it's not required for anything
=== Bug fixes in 1.16 ===
repository, via a checkout or export operation.
Replace the existing MediaWiki files with the new. You should preserve the
-LocalSettings.php file, AdminSettings.php file (if present), and the
-"extensions" and "images" directories.
+LocalSettings.php file and the "extensions" and "images" directories.
Depending upon your configuration, you may also need to preserve additional
directories, including a custom upload directory ($wgUploadDirectory),
=== Perform the database upgrade ===
-You will need an AdminSettings.php file set up in the correct format; see
-AdminSettings.sample in the wiki root for more information and examples.
+You will need to have $wgDBadminuser and $wgDBadminpass set in your
+LocalSettings.php, see there for more info.
From the command line, browse to the "maintenance" directory and run the
update.php script to check and update the schema. This will insert missing
=== Web installer ===
You can use the web-based installer wizard if you first remove the
-LocalSettings.php (and AdminSettings.php, if any) files; be sure to
-give the installer the same information as you did on the original
-install (language/encoding, database name, password, etc). This will
-also generate a fresh LocalSettings.php, which you may need to customize.
+LocalSettings.php file; be sure to give the installer the same
+information as you did on the original install (language/encoding,
+database name, password, etc). This will also generate a fresh
+LocalSettings.php, which you may need to customize.
You may change some settings during the install, but be very careful!
Changing the encoding in particular will generally leave you with a
Additionally, as of 1.4.0 you can run an in-place upgrade script from
the command line, keeping your existing LocalSettings.php. This requires
-that you create an AdminSettings.php giving an appropriate database user
-and password with privileges to modify the database structure.
+that you set $wgDBadminuser and $wgDBadminpassword with an appropriate
+database user and password with privileges to modify the database structure.
Once the new files are in place, go into the maintenance subdirectory and
run the script:
$conf->RootUser = importPost( "RootUser", "root" );
$conf->RootPW = importPost( "RootPW", "" );
$useRoot = importCheck( 'useroot', false );
+ $conf->populateadmin = importCheck( 'populateadmin', false );
$conf->LanguageCode = importPost( "LanguageCode", "en" );
## MySQL specific:
$conf->DBprefix = importPost( "DBprefix" );
if ($wgDatabase->isOpen()) {
$wgDBOracleDefTS = $conf->DBdefTS_ora;
$wgDBOracleTempTS = $conf->DBtempTS_ora;
- dbsource( "../maintenance/ora/user.sql", $wgDatabase );
+ $wgDatabase->sourceFile( "../maintenance/ora/user.sql" );
} else {
echo "<li>Invalid database superuser, please supply a valid superuser account.</li>";
echo "<li>ERR: ".print_r(oci_error(), true)."</li>";
print " <b class='error'>If the next step fails, see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'>http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
}
print "</li>\n";
- dbsource( "../maintenance/users.sql", $wgDatabase );
+ $wgDatabase->sourceFile( "../maintenance/users.sql" );
}
}
}
# FIXME: Check for errors
print "<li>Creating tables...";
if ($conf->DBtype == 'mysql') {
- dbsource( "../maintenance/tables.sql", $wgDatabase );
- dbsource( "../maintenance/interwiki.sql", $wgDatabase );
+ $wgDatabase->sourceFile( "../maintenance/tables.sql" );
+ $wgDatabase->sourceFile( "../maintenance/interwiki.sql" );
} elseif (is_callable(array($wgDatabase, 'setup_database'))) {
$wgDatabase->setup_database();
}
} else {
# Yes, so run the grants
echo( "<li>" . htmlspecialchars( "Granting user permissions to $wgDBuser on $wgDBname..." ) );
- dbsource( "../maintenance/users.sql", $wgDatabase );
+ $wgDatabase->sourceFile( "../maintenance/users.sql" );
echo( "success.</li>\n" );
}
}
<label class="column">Superuser account:</label>
<input type="checkbox" name="useroot" id="useroot" <?php if( $useRoot ) { ?>checked="checked" <?php } ?> />
<label for="useroot">Use superuser account</label>
+ <input type="checkbox" name="populateadmin" id="populateadmin" <?php if( $conf->populateadmin ) { ?>checked="checked" <?php } ?> />
+ <label for="populateadmin">Set as admin user for maintenance</label>
</div>
<div class="config-input"><?php aField( $conf, "RootUser", "Superuser name:", "text" ); ?></div>
<div class="config-input"><?php aField( $conf, "RootPW", "Superuser password:", "password" ); ?></div>
# Needs literal string interpolation for the current style path
$slconf['RightsIcon'] = $conf->RightsIcon;
}
+
+ if( $conf->populateadmin ) {
+ $slconf['DBadminuser'] = $conf->RootUser;
+ $slconf['DBadminpassword'] = $conf->RootPW;
+ }
if( $conf->DBtype == 'mysql' ) {
$dbsettings =
{$dbsettings}
+## Database admin settings, used for maintenance scripts
+\$wgDBadminuser = \"{$slconf['DBadminuser']}\";
+\$wgDBadminpassword = \"{$slconf['DBadminpassword']}\";
+
## Shared memory settings
\$wgMainCacheType = $cacheType;
\$wgMemCachedServers = $mcservers;
to force the profiler to save the informations in the database and apply the
maintenance/archives/patch-profiling.sql patch to the database.
- To enable the profileinfo.php itself, you'll need to create the
- AdminSettings.php file (see AdminSettings.sample for more information) and
- set $wgEnableProfileInfo to true in that file. See also
- http://www.mediawiki.org/wiki/How_to_debug#Profiling.
+ To enable the profileinfo.php itself, you'll need to set $wgDBadminuser
+ and $wgDBadminpassword in your LocalSettings.php, as well as $wgEnableProfileInfo
+ See also http://www.mediawiki.org/wiki/How_to_debug#Profiling.
redirect.php
Script that only redirect to the article passed in the wpDropdown parameter
Certain scripts will require elevated access to the database. In order to
provide this, first create a MySQL user with "all" permissions on the wiki
-database, and then place their username and password in an AdminSettings.php
-file in the directory above. See AdminSettings.sample for specifics on this.
+database, and then set $wgDBadminuser and $wgDBadminpassword in your
+LocalSettings.php
=== Brief explanation of files ===
Immediately complete all jobs in the job queue
stats.php
- Show all statistics stored in memcached
+ Show all statistics stored in the cache
undelete.php
Undelete all revisions of a page
#require_once( $IP.'/includes/ProfilerStub.php' );
require( $IP.'/includes/Defines.php' );
require( $IP.'/CommonSettings.php' );
- if ( !$wgUseNormalUser ) {
- require( $IP.'/AdminSettings.php' );
+ if ( !$wgUseNormalUser && is_readable( "$IP/AdminSettings.php" ) ) {
+ require( "$IP/AdminSettings.php" );
}
} else {
$wgWikiFarm = false;
}
// --------- End ---------
- Also add/change this in AdminSettings.php:
+ Also add/change this in LocalSettings.php:
// --------- Start ---------
$wgEnableProfileInfo = true;
$wgDBserver = "localhost"; // replace with DB server hostname
$wgEnableProfileInfo = $wgProfileToDatabase = false;
require_once( './includes/WebStart.php' );
-@include_once( './AdminSettings.php' );
?>
<!--
require 'includes/Defines.php';
require 'includes/ProfilerStub.php';
require 'LocalSettings.php';
-require 'AdminSettings.php';
require 'includes/Setup.php';
function buildTestDatabase( $tables ) {
- global $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname, $wgDBtype;
+ global $wgDBprefix, $wgDBserver, $wgDBname, $wgDBtype;
$oldPrefix = $wgDBprefix;
$wgDBprefix = 'parsertest';