From: Tim Starling Date: Sun, 26 Sep 2004 10:07:31 +0000 (+0000) Subject: Added check for valid user permissions when updating database X-Git-Tag: 1.5.0alpha1~1774 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=ce75d528b774c2d2418bcd53c7cd8570f82faf1f;p=lhc%2Fweb%2Fwiklou.git Added check for valid user permissions when updating database --- diff --git a/config/index.php b/config/index.php index 9ce8c170d9..25c511d953 100644 --- a/config/index.php +++ b/config/index.php @@ -461,11 +461,24 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $wgDatabase->selectDB( $wgDBname ); if( $wgDatabase->tableExists( "cur" ) ) { - print "
  • There are already MediaWiki tables in this database. Checking if updates are needed...
  • \n
    ";
    -
    +			print "
  • There are already MediaWiki tables in this database. Checking if updates are needed...
  • \n"; + + # Create user if required + if ( $conf->Root ) { + $conn = Database::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 ); + if ( $conn->isOpen() ) { + print "
  • DB user account ok
  • \n"; + $conn->close(); + } else { + print "
  • Granting user permissions...
  • \n"; + dbsource( "../maintenance/users.sql", $wgDatabase ); + } + } + print "
    \n";
     			chdir( ".." );
     			flush();
     
    +
     			# Add missing tables
     			foreach ( $wgNewTables as $tableRecord ) {
     				add_table( $tableRecord[0], $tableRecord[1] );