From 1b48c394e54cdc59a699622a08ea6ea2664df0de Mon Sep 17 00:00:00 2001 From: Julian Ostrow Date: Sat, 10 Jul 2004 10:38:36 +0000 Subject: [PATCH] Alters success message to include directory which contains LocalSettings.php --- config/index.php | 100 +++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/config/index.php b/config/index.php index 462f63dcca..233ec0ccf2 100644 --- a/config/index.php +++ b/config/index.php @@ -2,17 +2,17 @@ # MediaWiki web-based config/installation # Copyright (C) 2004 Brion Vibber # http://www.mediawiki.org/ -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -40,7 +40,7 @@ header( "Content-type: text/html; charset=utf-8" ); padding: 8px; margin-left: 8px; } - + dl.setup dd { margin-left: 0; } @@ -77,28 +77,28 @@ header( "Content-type: text/html; charset=utf-8" ); - + MediaWiki is Copyright (C) 2001-2004 by Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke and others.

- + - +

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

- +

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

- +

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -124,15 +124,15 @@ require_once( "../includes/Namespace.php" ); if( file_exists( "../LocalSettings.php" ) || file_exists( "../AdminSettings.php" ) ) { dieout( "

Wiki is configured.

- +

Already configured... return to the wiki.

- +

(You should probably remove this directory for added security.)

" ); } if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) ) { dieout( "

You're configured!

- +

Please move LocalSettings.php to the parent directory, then try out your wiki. (You should remove this config directory for added security once you're done.)

" ); @@ -140,14 +140,14 @@ if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) if( !is_writable( "." ) ) { dieout( "

Can't write config file, aborting

- +

In order to configure the wiki you have to make the config subdirectory writable by the web server. Once configuration is done you'll move the created LocalSettings.php to the parent directory, and for added safety you can then remove the config subdirectory entirely.

- +

To make the directory writable on a Unix/Linux system:

- +
 	cd /path/to/wiki
 	chmod a+w config
@@ -269,7 +269,7 @@ $conf->UseImageResize = $conf->HaveGD || $conf->ImageMagick;
 # $conf->IP = "/Users/brion/Sites/inplace";
 chdir( ".." );
 $conf->IP = getcwd();
-$conf->IP = preg_replace( "/\\\\/","\\\\\\\\",$conf->IP );  // For Windows, \ -> \\ 
+$conf->IP = preg_replace( "/\\\\/","\\\\\\\\",$conf->IP );  // For Windows, \ -> \\
 chdir( "config" );
 print "
  • Installation directory: " . htmlspecialchars( $conf->IP ) . "
  • \n"; @@ -278,7 +278,7 @@ $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_U print "
  • Script URI path: " . htmlspecialchars( $conf->ScriptPath ) . "
  • \n"; $conf->posted = ($_SERVER["REQUEST_METHOD"] == "POST"); - + $conf->Sitename = ucfirst( importPost( "Sitename", "" ) ); $conf->EmergencyContact = importPost( "EmergencyContact", $_SERVER["SERVER_ADMIN"] ); $conf->DBserver = importPost( "DBserver", "localhost" ); @@ -330,7 +330,7 @@ if( $conf->License == "gfdl" ) { if( $conf->posted && ( 0 == count( $errs ) ) ) { do { /* So we can 'continue' to end prematurely */ $conf->Root = ($conf->RootPW != ""); - + /* Load up the settings and get installin' */ $local = writeLocalSettings( $conf ); $wgCommandLineMode = false; @@ -348,7 +348,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $wgTitle = Title::newFromText( "Installation script" ); $wgDatabase = Database::newFromParams( $wgDBserver, "root", $conf->RootPW, "", 1 ); $wgDatabase->mIgnoreErrors = true; - + @$myver = mysql_get_server_info( $wgDatabase->mConn ); if( $myver ) { $conf->Root = true; @@ -393,7 +393,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { } if( !$ok ) continue; } - + if ( !$wgDatabase->isOpen() ) { $errs["DBserver"] = "Couldn't connect to database"; continue; @@ -406,7 +406,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $local = writeLocalSettings( $conf ); } print "\n"; - + @$sel = mysql_select_db( $wgDBname, $wgDatabase->mConn ); if( $sel ) { print "
  • Database " . htmlspecialchars( $wgDBname ) . " exists
  • \n"; @@ -421,12 +421,12 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { } print "
  • Created database " . htmlspecialchars( $wgDBname ) . "
  • \n"; } - + $wgDatabase->selectDB( $wgDBname ); - + if( $wgDatabase->tableExists( "cur" ) ) { print "
  • There are already MediaWiki tables in this database. Checking if updates are needed...
  • \n
    ";
    -			
    +
     			chdir( ".." );
     			flush();
     			do_ipblocks_update(); flush();
    @@ -441,7 +441,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
     			do_querycache_update(); flush();
     			do_objectcache_update(); flush();
     			do_categorylinks_update(); flush();
    -			
    +
     			if ( isTemplateInitialised() ) {
     				print "Template namespace already initialised\n";
     			} else {
    @@ -452,7 +452,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
     
     			initialiseMessages(); flush();
     			chdir( "config" );
    -			
    +
     			print "
    \n"; print "
  • Finished update checks.
  • \n"; } else { @@ -462,16 +462,16 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { dbsource( "../maintenance/interwiki.sql", $wgDatabase ); dbsource( "../maintenance/indexes.sql", $wgDatabase ); print " done.\n"; - + print "
  • Initializing data..."; $wgDatabase->query( "INSERT INTO site_stats (ss_row_id,ss_total_views," . "ss_total_edits,ss_good_articles) VALUES (1,0,0,0)" ); - # setting up the db user + # setting up the db user if( $conf->Root ) { print "
  • Granting user permissions...
  • \n"; dbsource( "../maintenance/users.sql", $wgDatabase ); } - + if( $conf->SysopName ) { $u = User::newFromName( $conf->getSysopName() ); if ( 0 == $u->idForName() ) { @@ -488,7 +488,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { } else { print "
  • Skipped sysop account creation, no name given.
  • \n"; } - + print "
  • Initialising log pages..."; $logs = array( "uploadlogpage" => "uploadlogpagetext", @@ -507,14 +507,14 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { "VALUES ($metaNamespace,'$logTitle','$logText','sysop','$now','$won','$now')" ); } print "
  • \n"; - + $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) ); $title = $titleobj->getDBkey(); $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text,cur_timestamp,inverse_timestamp,cur_touched) " . "VALUES (0,'$title','" . wfStrencode( wfMsg( "mainpagetext" ) . "\n\n" . wfMsg( "mainpagedocfooter" ) ) . "','$now','$won','$now')"; $wgDatabase->query( $sql, $fname ); - + print "
  • ";
     			initialiseMessages();
     			print "
  • \n"; @@ -523,14 +523,14 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { /* Write out the config file now that all is well */ print "

    Creating LocalSettings.php...

    \n\n"; $localSettings = "<" . "?php$endl$local$endl?" . ">"; - + if( version_compare( phpversion(), "4.3.2" ) >= 0 ) { $xt = "xt"; # Refuse to overwrite an existing file } else { $xt = "wt"; # 'x' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah } $f = fopen( "LocalSettings.php", $xt ); - + if( $f == false ) { dieout( "

    Couldn't write out LocalSettings.php. Check that the directory permissions are correct and that there isn't already a file of that name here...

    \n" . "

    Here's the file that would have been written, try to paste it into place manually:

    \n" . @@ -538,10 +538,10 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { } fwrite( $f, $localSettings ); fclose( $f ); - - print "

    Success! Move the LocalSettings.php file into the parent directory, then follow + + print "

    Success! Move the config/LocalSettings.php file into the parent directory, then follow this link to your wiki.

    \n"; - + } while( false ); } ?> @@ -552,7 +552,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { if( count( $errs ) ) { /* Display options form */ - + if( $conf->posted ) { echo "

    Something's not quite right yet; make sure everything below is filled out correctly.

    \n"; } @@ -607,7 +607,7 @@ if( count( $errs ) ) { more compatible with older browsers for some languages. Unicode will be used where not specified otherwise. - +
    Select one:
    @@ -616,7 +616,7 @@ if( count( $errs ) ) {
  • ScriptPath}/config/index.php?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" ); $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" ); @@ -635,8 +635,8 @@ if( count( $errs ) ) { the GNU FDL or a Creative Commons license. If you're not sure, leave it at "none". - - + +
    @@ -734,7 +734,7 @@ function writeLocalSettings( $conf ) { $pretty = ($conf->prettyURLs ? "" : "# "); $ugly = ($conf->prettyURLs ? "# " : ""); $rights = ($conf->RightsUrl) ? "" : "# "; - + $file = @fopen( "/dev/random", "r" ); if ( $file ) { $proxyKey = bin2hex( fread( $file, 32 ) ); @@ -750,7 +750,7 @@ function writeLocalSettings( $conf ) { # Add slashes to strings for double quoting $slconf = array_map( "addslashes", get_object_vars( $conf ) ); - + $sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":"; return " # This file was automatically generated by the MediaWiki installer. @@ -869,7 +869,7 @@ function aField( &$conf, $field, $text, $type = "", $value = "" ) { } else { $xtype = ""; } - + if(!(isset($id)) or ($id == "") ) $id = $field; $nolabel = ($type == "radio") || ($type == "hidden"); if( $nolabel ) { @@ -877,7 +877,7 @@ function aField( &$conf, $field, $text, $type = "", $value = "" ) { } else { echo "\t\t\n"; } - + if( $type == "radio" && $value == $conf->$field ) { $checked = "checked='checked'"; } else { @@ -893,7 +893,7 @@ function aField( &$conf, $field, $text, $type = "", $value = "" ) { if( $nolabel ) { echo " $text\n"; } - + global $errs; if(isset($errs[$field])) echo "" . $errs[$field] . "\n"; } @@ -906,10 +906,10 @@ function getLanguageList() { function wfLocalUrlE( $x ) { return $x; } require_once( "../languages/Names.php" ); } - + $codes = array(); $latin1 = array( "da", "de", "en", "es", "fr", "nl", "sv" ); - + $d = opendir( "../languages" ); while( false !== ($f = readdir( $d ) ) ) { if( preg_match( '/Language([A-Z][a-z]+)\.php$/', $f, $m ) ) { -- 2.20.1