From 0ea65022bc57d15a77d166e81d588ef053ec19ae Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sun, 24 Dec 2006 08:27:34 +0000 Subject: [PATCH] (bug 6853) Use a checkbox on the installer form to indicate that a superuser account should be used; this is clearer than the old check which relied on the password never being an obscure value --- RELEASE-NOTES | 3 +++ config/index.php | 33 ++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index dcffaddcf5..70be248250 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -402,6 +402,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN watchlists use RecentChange::newFromRow() instead of newFromCurRow() * (bug 8351) Fix undo for simple reverts * (bug 6856) User::clearNotification() does not respect read-only mode +* (bug 6853) Use a checkbox on the installer form to indicate that a superuser + account should be used; this is clearer than the old check which relied on + the password never being an obscure value == Languages updated == diff --git a/config/index.php b/config/index.php index d6cbf8e95c..26aa3ec5d0 100644 --- a/config/index.php +++ b/config/index.php @@ -529,7 +529,8 @@ print "
  • Environment check $conf->SysopPass = importPost( "SysopPass" ); $conf->SysopPass2 = importPost( "SysopPass2" ); $conf->RootUser = importPost( "RootUser", "root" ); - $conf->RootPW = importPost( "RootPW", "-" ); + $conf->RootPW = importPost( "RootPW", "" ); + $useRoot = importCheck( 'useroot', false ); ## MySQL specific: $conf->DBprefix = importPost( "DBprefix" ); @@ -682,16 +683,13 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $ok = true; # Let's be optimistic # Decide if we're going to use the superuser or the regular database user - if( $conf->RootPW == '-' ) { - # Regular user - $conf->Root = false; - $db_user = $wgDBuser; - $db_pass = $wgDBpassword; - } else { - # Superuser - $conf->Root = true; + $conf->Root = $useRoot; + if( $conf->Root ) { $db_user = $conf->RootUser; $db_pass = $conf->RootPW; + } else { + $db_user = $wgDBuser; + $db_pass = $wgDBpassword; } # Attempt to connect @@ -742,7 +740,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { error_reporting( E_ALL ); $wgSuperUser = ''; ## Possible connect as a superuser - if( $conf->RootPW != '-' and strlen($conf->RootPW)) { + if( $conf->Root ) { $wgDBsuperuser = $conf->RootUser; echo( "
  • Attempting to connect to database \"postgres\" as superuser \"$wgDBsuperuser\"..." ); $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBsuperuser, $conf->RootPW, "postgres", 1); @@ -1186,9 +1184,14 @@ if( count( $errs ) ) { has SELECT, INSERT, UPDATE and DELETE permissions on the MediaWiki database.

    +
    + + checked="checked" /> +   +
    @@ -1199,8 +1202,8 @@ if( count( $errs ) ) {

    If the database user specified above does not exist, or does not have access to create - the database (if needed) or tables within it, please provide details of a superuser account, - such as root, which does. Leave the password set to - if this is not needed. + the database (if needed) or tables within it, please check the box and provide details + of a superuser account, such as root, which does.

    @@ -1540,6 +1543,10 @@ function importPost( $name, $default = "" ) { return importVar( $_POST, $name, $default ); } +function importCheck( $name ) { + return isset( $_POST[$name] ); +} + function importRequest( $name, $default = "" ) { return importVar( $_REQUEST, $name, $default ); } -- 2.20.1