X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=install.php;h=333c433e302c3b2ca8aeee562910ea883b50ac33;hb=832f275f5854724aaa66a1fdcfdda160fa4f9571;hp=25c18ae38b121d06610df97c14ad40c0980ea7fc;hpb=ec921a9d4243c84b9e14612274e2f4c2d67f6b18;p=lhc%2Fweb%2Fwiklou.git diff --git a/install.php b/install.php index 25c18ae38b..333c433e30 100644 --- a/install.php +++ b/install.php @@ -10,16 +10,16 @@ if ( ! ( is_readable( "./LocalSettings.php" ) "source directory before running this install script.\n"; exit(); } -if ( $wgUseTeX && ( ! is_executable( "./math/texvc" ) ) ) { - print "To use math functions, you must first compile texvc by\n" . - "running \"make\" in the math directory.\n"; - exit(); -} $DP = "./includes"; include_once( "./LocalSettings.php" ); include_once( "./AdminSettings.php" ); +if ( $wgUseTeX && ( ! is_executable( "./math/texvc" ) ) ) { + print "To use math functions, you must first compile texvc by\n" . + "running \"make\" in the math directory.\n"; + exit(); +} if ( is_file( "{$IP}/Version.php" ) ) { print "There appears to be an installation of the software\n" . "already present on \"{$IP}\". You may want to run the update\n" . @@ -53,7 +53,7 @@ copyfile( ".", "redirect.phtml", $IP ); copyfile( ".", "texvc.phtml", $IP ); copydirectory( "./includes", $IP ); -copydirectory( "./stylesheets", $wgStyleSheetsDirectory ); +copydirectory( "./stylesheets", $wgStyleSheetDirectory ); copyfile( "./images", "wiki.png", $wgUploadDirectory ); copyfile( "./languages", "Language.php", $IP ); @@ -246,11 +246,21 @@ function populatedata() { $sql = "DELETE FROM user"; wfQuery( $sql, $fname ); - $sql = "INSERT INTO user (user_name, user_password, user_rights)" . - "VALUES ('WikiSysop','" . User::encryptPassword( $wgDBadminpassword ) . - "','sysop'),('WikiDeveloper','" . User::encryptPassword( - $wgDBadminpassword ) . "','sysop,developer')"; - wfQuery( $sql, $fname ); + $u = User::newFromName( "WikiSysop" ); + if ( 0 == $u->idForName() ) { + $u->addToDatabase(); + $u->setPassword( $wgDBadminpassword ); + $u->addRight( "sysop" ); + $u->saveSettings(); + } + $u = User::newFromName( "WikiDeveloper" ); + if ( 0 == $u->idForName() ) { + $u->addToDatabase(); + $u->setPassword( $wgDBadminpassword ); + $u->addRight( "sysop" ); + $u->addRight( "developer" ); + $u->saveSettings(); + } $wns = Namespace::getWikipedia(); $ulp = addslashes( wfMsg( "uploadlogpage" ) );