"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" .
copyfile( ".", "texvc.phtml", $IP );
copydirectory( "./includes", $IP );
-copydirectory( "./stylesheets", $wgStyleSheetsDirectory );
+copydirectory( "./stylesheets", $wgStyleSheetDirectory );
copyfile( "./images", "wiki.png", $wgUploadDirectory );
copyfile( "./languages", "Language.php", $IP );
$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" ) );