Install and update script fixes.
authorLee Daniel Crocker <lcrocker@users.mediawiki.org>
Wed, 16 Apr 2003 18:49:45 +0000 (18:49 +0000)
committerLee Daniel Crocker <lcrocker@users.mediawiki.org>
Wed, 16 Apr 2003 18:49:45 +0000 (18:49 +0000)
Version.php
install.php
update.php

index cdbf6e3..e03fcc4 100644 (file)
@@ -1,3 +1,4 @@
+<?
 # This file is copied to the install directory so that
 # later update scripts will be able to use it to determine
 # what they need to update. The version number here must
@@ -9,4 +10,4 @@
 #
 
 $wgSoftwareRevision = 1001;
-
+?>
index 37775ca..25c18ae 100644 (file)
@@ -76,6 +76,8 @@ if ( $wgUseTeX ) {
        copyfile( "./math", "texvc_tex", "{$IP}/math", 0775 );
 }
 
+copyfile( ".", "Version.php", $IP );
+
 #
 # Make and initialize database
 #
@@ -117,8 +119,6 @@ populatedata(); # Needs internationalized messages
 print "Adding indexes...\n";
 dbsource( $rconn, "./maintenance/indexes.sql" );
 
-copyfile( ".", "Version.php", $IP );
-
 print "Done.\nBrowse \"{$wgServer}{$wgScript}\" to test,\n" .
   "or \"run WikiSuite -b -o\" in test suite.\n";
 exit();
index 0f63e53..9aaace1 100644 (file)
@@ -94,6 +94,13 @@ function copydirectory( $source, $dest ) {
        }
 }
 
+function readconsole() {
+       $fp = fopen( "php://stdin", "r" );
+       $resp = trim( fgets( $fp ) );
+       fclose( $fp );
+       return $resp;
+}
+
 function do_revision_updates() {
        global $wgSoftwareRevision;
 
@@ -102,7 +109,14 @@ function do_revision_updates() {
 
 function update_passwords() {
        $fname = "Update scripte: update_passwords()";
-       print "Updating passwords...\n";
+       print "\nIt appears that you need to update the user passwords in your\n" .
+         "database. If you have already done this (if you've run this update\n" .
+         "script once before, for example), doing so again will make all your\n" .
+         "user accounts inaccessible, so be sure you only do this once.\n" .
+         "Update user passwords? (yes/no) ";
+
+       $resp = readconsole();
+    if ( ! ( "Y" == $resp{0} || "y" == $resp{0} ) ) { return; }
 
        $sql = "SELECT user_id,user_password FROM user";
        $source = wfQuery( $sql, fname );