From: Brion Vibber Date: Sun, 7 Mar 2004 01:07:08 +0000 (+0000) Subject: Try blank root password if user fails... fix (unused) math paths, use the libgd check... X-Git-Tag: 1.3.0beta1~849 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=f018a11c2df3dbafedeff7c55b59bf3e41001b4a;p=lhc%2Fweb%2Fwiklou.git Try blank root password if user fails... fix (unused) math paths, use the libgd check to disable/enable thumbnails (but upload is still off) --- diff --git a/config/index.php b/config/index.php index 93aae64f4d..cc22169f1e 100644 --- a/config/index.php +++ b/config/index.php @@ -175,14 +175,16 @@ print "
  • PHP " . phpversion() . " ok
  • \n"; $conf->zlib = function_exists( "gzencode" ); $z = $conf->zlib ? "Have" : "No"; print "
  • $z zlib support
  • \n"; +*/ -$conf->gd = function_exists( "imagejpeg" ); -if( $conf->gd ) { - print "
  • Found GD graphics library built-in
  • \n"; +$conf->HaveGD = function_exists( "imagejpeg" ); +if( $conf->HaveGD ) { + print "
  • Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.
  • \n"; } else { - print "
  • No built-in GD library
  • \n"; + print "
  • No built-in GD library, image thumbnailing disabled.
  • \n"; } +/* if( file_exists( "/usr/bin/convert" ) ) { $conf->ImageMagick = "/usr/bin/convert"; print "
  • Found ImageMagick: /usr/bin/convert
  • \n"; @@ -195,6 +197,8 @@ if( file_exists( "/usr/bin/convert" ) ) { } */ +$conf->UseImageResize = $conf->HaveGD; + # $conf->IP = "/Users/brion/Sites/inplace"; chdir( ".." ); $conf->IP = getcwd(); @@ -274,25 +278,42 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { if( !$myver ) { print "
  • MySQL error " . ($err = mysql_errno() ) . ": " . htmlspecialchars( mysql_error() ); + $ok = false; switch( $err ) { case 1045: if( $conf->Root ) { $errs["RootPW"] = "Check password"; } else { - $errs["DBuser"] = "Check name/pass"; - $errs["DBpassword"] = "or enter root"; - $errs["DBpassword2"] = "password below"; - $errs["RootPW"] = "Got root?"; + print "
  • Trying root...\n"; + /* Try a blank root password... */ + $wgDatabase = Database::newFromParams( $wgDBserver, "root", "", "", 1 ); + $wgDatabase->isOpen(); + $wgDatabase->mIgnoreErrors = true; + @$myver = mysql_get_server_info( $wgDatabase->mConn ); + if( !$myver ) { + $errs["DBuser"] = "Check name/pass"; + $errs["DBpassword"] = "or enter root"; + $errs["DBpassword2"] = "password below"; + $errs["RootPW"] = "Got root?"; + print " need password.
  • \n"; + } else { + $conf->Root = true; + $conf->RootPW = ""; + print " ok.\n"; + # And keep going... + $ok = true; + } + break; } - break; case 2002: case 2003: $errs["DBserver"] = "Connection failed"; break; default: $errs["DBserver"] = "Couldn't connect to database"; + break; } - continue; + if( !$ok ) continue; } print "
  • Connected to database... $myver"; if( version_compare( $myver, "4.0.0" ) >= 0 ) { @@ -613,14 +634,17 @@ if( \$wgCommandLineMode ) { \$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4}; +## To enable image uploads, make sure the 'images' directory +## is writable, then uncomment this: +# \$wgDisableUploads = false; \$wgUseImageResize = {$conf->UseImageResize}; ## If you have the appropriate support software installed ## you can enable inline LaTeX equations: # \$wgUseTeX = true; -# \$wgMathPath = \"{$wgUploadPath}/math\"; -# \$wgMathDirectory = \"{$wgUploadDirectory}/math\"; -# \$wgTmpDirectory = \"{$wgUploadDirectory}/tmp\"; +# \$wgMathPath = \"{\$wgUploadPath}/math\"; +# \$wgMathDirectory = \"{\$wgUploadDirectory}/math\"; +# \$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\"; \$wgLocalInterwiki = \$wgSitename;