From ec921a9d4243c84b9e14612274e2f4c2d67f6b18 Mon Sep 17 00:00:00 2001 From: Lee Daniel Crocker Date: Wed, 16 Apr 2003 18:49:45 +0000 Subject: [PATCH] Install and update script fixes. --- Version.php | 3 ++- install.php | 4 ++-- update.php | 16 +++++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Version.php b/Version.php index cdbf6e376f..e03fcc4679 100644 --- a/Version.php +++ b/Version.php @@ -1,3 +1,4 @@ + diff --git a/install.php b/install.php index 37775cada7..25c18ae38b 100644 --- a/install.php +++ b/install.php @@ -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(); diff --git a/update.php b/update.php index 0f63e53619..9aaace1698 100644 --- a/update.php +++ b/update.php @@ -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 ); -- 2.20.1