X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=install.php;h=c1b3a8c2ddfe0ed48be835dbf1c20d6830e6f6d1;hb=61fb81f125e45a9b98eb80a04210a4c267e526f9;hp=1348d95e2803c8e7c40e05f065dd85591e4ac88d;hpb=3c969496827a4ea71d87e4f535a664b15d68b84f;p=lhc%2Fweb%2Fwiklou.git diff --git a/install.php b/install.php index 1348d95e28..c1b3a8c2dd 100644 --- a/install.php +++ b/install.php @@ -1,9 +1,11 @@ -isOpen() ) { @@ -102,11 +140,6 @@ if ( !$wgDatabase->isOpen() ) { exit(); } -# Include rest of code to get things like internationalized messages. -# -include_once( "{$IP}/Setup.php" ); -$wgTitle = Title::newFromText( "Installation script" ); - # Now do the actual database creation # print "Creating database...\n"; @@ -161,20 +194,49 @@ function populatedata() { $sql = "DELETE FROM user"; $wgDatabase->query( $sql, $fname ); - $u = User::newFromName( "WikiSysop" ); - if ( 0 == $u->idForName() ) { - $u->addToDatabase(); - $u->setPassword( $wgDBadminpassword ); - $u->addRight( "sysop" ); - $u->saveSettings(); + print "Do you want to create a sysop account? A sysop can protect,\n"; + print "delete and undelete pages and ban users. Recomended. [Y/n] "; + $response = readconsole(); + if(strtolower($response)!="n") { + print "Enter the username [Sysop]: "; + $sysop_user=readconsole(); + if(!$sysop_user) { $sysop_user="Sysop"; } + while(!$sysop_password) { + print "Enter the password: "; + $sysop_password=readconsole(); + } + $u = User::newFromName( $sysop_user ); + if ( 0 == $u->idForName() ) { + $u->addToDatabase(); + $u->setPassword( $sysop_password ); + $u->addRight( "sysop" ); + $u->saveSettings(); + } else { + print "Could not create user - already exists!\n"; + } } - $u = User::newFromName( "WikiDeveloper" ); - if ( 0 == $u->idForName() ) { - $u->addToDatabase(); - $u->setPassword( $wgDBadminpassword ); - $u->addRight( "sysop" ); - $u->addRight( "developer" ); - $u->saveSettings(); + print "Do you want to create a sysop+developer account? A developer\n"; + print "can switch the database to read-only mode and run any type of\n"; + print "query through a web interface. [Y/n] "; + $response=readconsole(); + if(strtolower($response)!="n") { + print "Enter the username [Developer]: "; + $developer_user=readconsole(); + if(!$developer_user) { $developer_user="Developer"; } + while (!$developer_password) { + print "Enter the password: "; + $developer_password=readconsole(); + } + $u = User::newFromName( $developer_user ); + if ( 0 == $u->idForName() ) { + $u->addToDatabase(); + $u->setPassword( $developer_password ); + $u->addRight( "sysop" ); + $u->addRight( "developer" ); + $u->saveSettings(); + } else { + print "Could not create user - already exists!\n"; + } } $wns = Namespace::getWikipedia();