(bug 8781) Remind users to check file permissions for LocalSettings.php post-installation
[lhc/web/wiklou.git] / config / index.php
1 <?php
2
3 # MediaWiki web-based config/installation
4 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>, 2006 Rob Church <robchur@gmail.com>
5 # http://www.mediawiki.org/
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # http://www.gnu.org/copyleft/gpl.html
21
22 error_reporting( E_ALL );
23 header( "Content-type: text/html; charset=utf-8" );
24 @ini_set( "display_errors", true );
25
26 # In case of errors, let output be clean.
27 $wgRequestTime = microtime( true );
28
29 # Attempt to set up the include path, to fix problems with relative includes
30 $IP = dirname( dirname( __FILE__ ) );
31 define( 'MW_INSTALL_PATH', $IP );
32 $sep = PATH_SEPARATOR;
33 if( !ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" ) ) {
34 set_include_path( ".$sep$IP$sep$IP/includes$sep$IP/languages" );
35 }
36
37 # Define an entry point and include some files
38 define( "MEDIAWIKI", true );
39 define( "MEDIAWIKI_INSTALL", true );
40
41 // Run version checks before including other files
42 // so people don't see a scary parse error.
43 require_once( "install-utils.inc" );
44 install_version_checks();
45
46 require_once( "includes/Defines.php" );
47 require_once( "includes/DefaultSettings.php" );
48 require_once( "includes/AutoLoader.php" );
49 require_once( "includes/MagicWord.php" );
50 require_once( "includes/Namespace.php" );
51 require_once( "includes/ProfilerStub.php" );
52 require_once( "includes/GlobalFunctions.php" );
53 require_once( "includes/Hooks.php" );
54
55 # If we get an exception, the user needs to know
56 # all the details
57 $wgShowExceptionDetails = true;
58
59 ## Databases we support:
60
61 $ourdb = array();
62 $ourdb['mysql']['fullname'] = 'MySQL';
63 $ourdb['mysql']['havedriver'] = 0;
64 $ourdb['mysql']['compile'] = 'mysql';
65 $ourdb['mysql']['bgcolor'] = '#ffe5a7';
66 $ourdb['mysql']['rootuser'] = 'root';
67
68 $ourdb['postgres']['fullname'] = 'PostgreSQL';
69 $ourdb['postgres']['havedriver'] = 0;
70 $ourdb['postgres']['compile'] = 'pgsql';
71 $ourdb['postgres']['bgcolor'] = '#aaccff';
72 $ourdb['postgres']['rootuser'] = 'postgres';
73
74 ?>
75 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
76 <html>
77 <head>
78 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
79 <title>MediaWiki <?php echo( $wgVersion ); ?> Installation</title>
80 <style type="text/css">
81
82 @import "../skins/monobook/main.css";
83
84 .env-check {
85 font-size: 90%;
86 margin: 1em 0 1em 2.5em;
87 }
88
89 .config-section {
90 margin-top: 2em;
91 }
92
93 .config-section label.column {
94 clear: left;
95 font-weight: bold;
96 width: 13em;
97 float: left;
98 text-align: right;
99 padding-right: 1em;
100 padding-top: .2em;
101 }
102
103 .config-input {
104 clear: left;
105 zoom: 100%; /* IE hack */
106 }
107
108 .config-section .config-desc {
109 clear: left;
110 margin: 0 0 2em 18em;
111 padding-top: 1em;
112 font-size: 85%;
113 }
114
115 .iput-text, .iput-password {
116 width: 14em;
117 margin-right: 1em;
118 }
119
120 .error {
121 color: red;
122 background-color: #fff;
123 font-weight: bold;
124 left: 1em;
125 font-size: 100%;
126 }
127
128 .error-top {
129 color: red;
130 background-color: #FFF0F0;
131 border: 2px solid red;
132 font-size: 130%;
133 font-weight: bold;
134 padding: 1em 1.5em;
135 margin: 2em 0 1em;
136 }
137
138 ul.plain {
139 list-style-type: none;
140 list-style-image: none;
141 float: left;
142 margin: 0;
143 padding: 0;
144 }
145
146 .btn-install {
147 font-weight: bold;
148 font-size: 110%;
149 padding: .2em .3em;
150 }
151
152 .license {
153 font-size: 85%;
154 padding-top: 3em;
155 }
156
157 </style>
158 <script type="text/javascript">
159 <!--
160 function hideall() {
161 <?php foreach (array_keys($ourdb) as $db) {
162 echo "\n document.getElementById('$db').style.display='none';";
163 }
164 ?>
165
166 }
167 function toggleDBarea(id,defaultroot) {
168 hideall();
169 var dbarea = document.getElementById(id).style;
170 dbarea.display = (dbarea.display == 'none') ? 'block' : 'none';
171 var db = document.getElementById('RootUser');
172 if (defaultroot) {
173 <?php foreach (array_keys($ourdb) as $db) {
174 echo " if (id == '$db') { db.value = '".$ourdb[$db]['rootuser']."';}\n";
175 }?>
176 }
177 }
178 // -->
179 </script>
180 </head>
181
182 <body>
183 <div id="globalWrapper">
184 <div id="column-content">
185 <div id="content">
186 <div id="bodyContent">
187
188 <h1>MediaWiki <?php print $wgVersion ?> Installation</h1>
189
190 <?php
191
192 /* Check for existing configurations and bug out! */
193
194 if( file_exists( "../LocalSettings.php" ) ) {
195 dieout( "<p><strong>Setup has completed, <a href='../index.php'>your wiki</a> is configured.</strong></p>
196
197 <p>Please delete the /config directory for extra security.</p></div></div></div></div>" );
198 }
199
200 if( file_exists( "./LocalSettings.php" ) ) {
201 writeSuccessMessage();
202
203 dieout( '' );
204 }
205
206 if( !is_writable( "." ) ) {
207 dieout( "<h2>Can't write config file, aborting</h2>
208
209 <p>In order to configure the wiki you have to make the <tt>config</tt> subdirectory
210 writable by the web server. Once configuration is done you'll move the created
211 <tt>LocalSettings.php</tt> to the parent directory, and for added safety you can
212 then remove the <tt>config</tt> subdirectory entirely.</p>
213
214 <p>To make the directory writable on a Unix/Linux system:</p>
215
216 <pre>
217 cd <i>/path/to/wiki</i>
218 chmod a+w config
219 </pre>
220
221 <p>Afterwards retry to start the <a href=\"\">setup</a>.</p>" );
222 }
223
224
225 require_once( "install-utils.inc" );
226 require_once( "maintenance/updaters.inc" );
227
228 class ConfigData {
229 function getEncoded( $data ) {
230 # removing latin1 support, no need...
231 return $data;
232 }
233 function getSitename() { return $this->getEncoded( $this->Sitename ); }
234 function getSysopName() { return $this->getEncoded( $this->SysopName ); }
235 function getSysopPass() { return $this->getEncoded( $this->SysopPass ); }
236
237 function setSchema( $schema ) {
238 $this->DBschema = $schema;
239 switch ( $this->DBschema ) {
240 case 'mysql5':
241 $this->DBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=utf8';
242 $this->DBmysql5 = 'true';
243 break;
244 case 'mysql5-binary':
245 $this->DBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=binary';
246 $this->DBmysql5 = 'true';
247 break;
248 default:
249 $this->DBTableOptions = 'TYPE=InnoDB';
250 $this->DBmysql5 = 'false';
251 }
252 # Set the global for use during install
253 global $wgDBTableOptions;
254 $wgDBTableOptions = $this->DBTableOptions;
255 }
256 }
257
258 ?>
259
260 <ul>
261 <li>
262 <b>Don't forget security updates!</b> Keep an eye on the
263 <a href="http://mail.wikimedia.org/mailman/listinfo/mediawiki-announce">low-traffic
264 release announcements mailing list</a>.
265 </li>
266 </ul>
267
268
269 <h2>Checking environment...</h2>
270 <p><em>Please include all of the lines below when reporting installation problems.</em></p>
271 <ul class="env-check">
272 <?php
273 $endl = "
274 ";
275 define( 'MW_NO_OUTPUT_BUFFER', 1 );
276 $conf = new ConfigData;
277
278 install_version_checks();
279 $self = 'Installer'; # Maintenance script name, to please Setup.php
280
281 print "<li>PHP " . phpversion() . " installed</li>\n";
282
283 error_reporting( 0 );
284 $phpdatabases = array();
285 foreach (array_keys($ourdb) as $db) {
286 $compname = $ourdb[$db]['compile'];
287 if (extension_loaded($compname) or dl($compname . '.' . PHP_SHLIB_SUFFIX)) {
288 array_push($phpdatabases, $db);
289 $ourdb[$db]['havedriver'] = 1;
290 }
291 }
292 error_reporting( E_ALL );
293
294 if (!$phpdatabases) {
295 print "Could not find a suitable database driver!<ul>";
296 foreach (array_keys($ourdb) AS $db) {
297 $comp = $ourdb[$db]['compile'];
298 $full = $ourdb[$db]['fullname'];
299 print "<li>For <b>$full</b>, compile PHP using <b>--with-$comp</b>, "
300 ."or install the $comp.so module</li>\n";
301 }
302 dieout( "</ul></ul>" );
303 }
304
305 print "<li>Found database drivers for:";
306 foreach (array_keys($ourdb) AS $db) {
307 if ($ourdb[$db]['havedriver']) {
308 $DefaultDBtype = $db;
309 print " ".$ourdb[$db]['fullname'];
310 }
311 }
312 print "</li>\n";
313 if (count($phpdatabases) != 1)
314 $DefaultDBtype = '';
315
316 if( ini_get( "register_globals" ) ) {
317 ?>
318 <li>
319 <div style="font-size:110%">
320 <strong class="error">Warning:</strong>
321 <strong>PHP's <tt><a href="http://php.net/register_globals">register_globals</a></tt> option is enabled. Disable it if you can.</strong>
322 </div>
323 MediaWiki will work, but your server is more exposed to PHP-based security vulnerabilities.
324 </li>
325 <?php
326 }
327
328 $fatal = false;
329
330 if( ini_get( "magic_quotes_runtime" ) ) {
331 $fatal = true;
332 ?><li class='error'><strong>Fatal: <a href='http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime'>magic_quotes_runtime</a> is active!</strong>
333 This option corrupts data input unpredictably; you cannot install or use
334 MediaWiki unless this option is disabled.
335 <?php
336 }
337
338 if( ini_get( "magic_quotes_sybase" ) ) {
339 $fatal = true;
340 ?><li class='error'><strong>Fatal: <a href='http://www.php.net/manual/en/ref.sybase.php#ini.magic-quotes-sybase'>magic_quotes_sybase</a> is active!</strong>
341 This option corrupts data input unpredictably; you cannot install or use
342 MediaWiki unless this option is disabled.
343 <?php
344 }
345
346 if( ini_get( "mbstring.func_overload" ) ) {
347 $fatal = true;
348 ?><li class='error'><strong>Fatal: <a href='http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload'>mbstring.func_overload</a> is active!</strong>
349 This option causes errors and may corrupt data unpredictably;
350 you cannot install or use MediaWiki unless this option is disabled.
351 <?php
352 }
353
354 if( ini_get( "zend.ze1_compatibility_mode" ) ) {
355 $fatal = true;
356 ?><li class="error"><strong>Fatal: <a href="http://www.php.net/manual/en/ini.core.php">zend.ze1_compatibility_mode</a> is active!</strong>
357 This option causes horrible bugs with MediaWiki; you cannot install or use
358 MediaWiki unless this option is disabled.
359 <?php
360 }
361
362
363 if( $fatal ) {
364 dieout( "</ul><p>Cannot install MediaWiki.</p>" );
365 }
366
367 if( ini_get( "safe_mode" ) ) {
368 $conf->safeMode = true;
369 ?>
370 <li><b class='error'>Warning:</b> <strong>PHP's
371 <a href='http://www.php.net/features.safe-mode'>safe mode</a> is active.</strong>
372 You may have problems caused by this, particularly if using image uploads.
373 </li>
374 <?php
375 } else {
376 $conf->safeMode = false;
377 }
378
379 $sapi = php_sapi_name();
380 print "<li>PHP server API is $sapi; ";
381 if( $wgUsePathInfo ) {
382 print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
383 } else {
384 print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
385 }
386 print "</li>\n";
387
388 $conf->xml = function_exists( "utf8_encode" );
389 if( $conf->xml ) {
390 print "<li>Have XML / Latin1-UTF-8 conversion support.</li>\n";
391 } else {
392 dieout( "PHP's XML module is missing; the wiki requires functions in
393 this module and won't work in this configuration.
394 If you're running Mandrake, install the php-xml package." );
395 }
396
397 # Check for session support
398 if( !function_exists( 'session_name' ) )
399 dieout( "PHP's session module is missing. MediaWiki requires session support in order to function." );
400
401 # session.save_path doesn't *have* to be set, but if it is, and it's
402 # not valid/writable/etc. then it can cause problems
403 $sessionSavePath = mw_get_session_save_path();
404 $ssp = htmlspecialchars( $sessionSavePath );
405 # Warn the user if it's not set, but let them proceed
406 if( !$sessionSavePath ) {
407 print "<li><strong>Warning:</strong> A value for <tt>session.save_path</tt>
408 has not been set in PHP.ini. If the default value causes problems with
409 saving session data, set it to a valid path which is read/write/execute
410 for the user your web server is running under.</li>";
411 } elseif ( is_dir( $sessionSavePath ) && is_writable( $sessionSavePath ) ) {
412 # All good? Let the user know
413 print "<li>Session save path (<tt>{$ssp}</tt>) appears to be valid.</li>";
414 } else {
415 # Something not right? Warn the user, but let them proceed
416 print "<li><strong>Warning:</strong> Your <tt>session.save_path</tt> value (<tt>{$ssp}</tt>)
417 appears to be invalid or is not writable. PHP needs to be able to save data to
418 this location for correct session operation.</li>";
419 }
420
421 # Check for PCRE support
422 if( !function_exists( 'preg_match' ) )
423 dieout( "The PCRE support module appears to be missing. MediaWiki requires the
424 Perl-compatible regular expression functions." );
425
426 $memlimit = ini_get( "memory_limit" );
427 $conf->raiseMemory = false;
428 if( empty( $memlimit ) || $memlimit == -1 ) {
429 print "<li>PHP is configured with no <tt>memory_limit</tt>.</li>\n";
430 } else {
431 print "<li>PHP's <tt>memory_limit</tt> is " . htmlspecialchars( $memlimit ) . ". ";
432 $n = intval( $memlimit );
433 if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) {
434 $n = intval( $m[1] * (1024*1024) );
435 }
436 if( $n < 20*1024*1024 ) {
437 print "Attempting to raise limit to 20M... ";
438 if( false === ini_set( "memory_limit", "20M" ) ) {
439 print "failed.<br /><b>" . htmlspecialchars( $memlimit ) . " seems too low, installation may fail!</b>";
440 } else {
441 $conf->raiseMemory = true;
442 print "ok.";
443 }
444 }
445 print "</li>\n";
446 }
447
448 $conf->turck = function_exists( 'mmcache_get' );
449 if ( $conf->turck ) {
450 print "<li><a href=\"http://turck-mmcache.sourceforge.net/\">Turck MMCache</a> installed</li>\n";
451 }
452
453 $conf->xcache = function_exists( 'xcache_get' );
454 if( $conf->xcache )
455 print "<li><a href=\"http://trac.lighttpd.net/xcache/\">XCache</a> installed</li>";
456
457 $conf->apc = function_exists('apc_fetch');
458 if ($conf->apc ) {
459 print "<li><a href=\"http://www.php.net/apc\">APC</a> installed</li>";
460 }
461
462 $conf->eaccel = function_exists( 'eaccelerator_get' );
463 if ( $conf->eaccel ) {
464 $conf->turck = 'eaccelerator';
465 print "<li><a href=\"http://eaccelerator.sourceforge.net/\">eAccelerator</a> installed</li>\n";
466 }
467
468 if( !( $conf->turck || $conf->eaccel || $conf->apc || $conf->xcache ) ) {
469 echo( '<li>Couldn\'t find <a href="http://turck-mmcache.sourceforge.net">Turck MMCache</a>,
470 <a href="http://eaccelerator.sourceforge.net">eAccelerator</a>,
471 <a href="http://www.php.net/apc">APC</a> or <a href="http://trac.lighttpd.net/xcache/">XCache</a>.
472 Object caching functions cannot be used.</li>' );
473 }
474
475 $conf->diff3 = false;
476 $diff3locations = array_merge(
477 array(
478 "/usr/bin",
479 "/usr/local/bin",
480 "/opt/csw/bin",
481 "/usr/gnu/bin",
482 "/usr/sfw/bin" ),
483 explode( $sep, getenv( "PATH" ) ) );
484 $diff3names = array( "gdiff3", "diff3", "diff3.exe" );
485
486 $diff3versioninfo = array( '$1 --version 2>&1', 'diff3 (GNU diffutils)' );
487 foreach ($diff3locations as $loc) {
488 $exe = locate_executable($loc, $diff3names, $diff3versioninfo);
489 if ($exe !== false) {
490 $conf->diff3 = $exe;
491 break;
492 }
493 }
494
495 if ($conf->diff3)
496 print "<li>Found GNU diff3: <tt>$conf->diff3</tt>.</li>";
497 else
498 print "<li>GNU diff3 not found.</li>";
499
500 $conf->ImageMagick = false;
501 $imcheck = array( "/usr/bin", "/opt/csw/bin", "/usr/local/bin", "/sw/bin", "/opt/local/bin" );
502 foreach( $imcheck as $dir ) {
503 $im = "$dir/convert";
504 if( file_exists( $im ) ) {
505 print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
506 $conf->ImageMagick = $im;
507 break;
508 }
509 }
510
511 $conf->HaveGD = function_exists( "imagejpeg" );
512 if( $conf->HaveGD ) {
513 print "<li>Found GD graphics library built-in";
514 if( !$conf->ImageMagick ) {
515 print ", image thumbnailing will be enabled if you enable uploads";
516 }
517 print ".</li>\n";
518 } else {
519 if( !$conf->ImageMagick ) {
520 print "<li>Couldn't find GD library or ImageMagick; image thumbnailing disabled.</li>\n";
521 }
522 }
523
524 $conf->IP = dirname( dirname( __FILE__ ) );
525 print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP ) . "</tt></li>\n";
526
527
528 // PHP_SELF isn't available sometimes, such as when PHP is CGI but
529 // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME
530 // to get the path to the current script... hopefully it's reliable. SIGH
531 $path = ($_SERVER["PHP_SELF"] === '')
532 ? $_SERVER["SCRIPT_NAME"]
533 : $_SERVER["PHP_SELF"];
534 $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $path );
535 print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n";
536
537 print "<li style='font-weight:bold;color:green;font-size:110%'>Environment checked. You can install MediaWiki.</li>\n";
538 $conf->posted = ($_SERVER["REQUEST_METHOD"] == "POST");
539
540 $conf->Sitename = ucfirst( importPost( "Sitename", "" ) );
541 $defaultEmail = empty( $_SERVER["SERVER_ADMIN"] )
542 ? 'root@localhost'
543 : $_SERVER["SERVER_ADMIN"];
544 $conf->EmergencyContact = importPost( "EmergencyContact", $defaultEmail );
545 $conf->DBtype = importPost( "DBtype", $DefaultDBtype );
546 ?>
547
548 <?php
549 $conf->DBserver = importPost( "DBserver", "localhost" );
550 $conf->DBname = importPost( "DBname", "wikidb" );
551 $conf->DBuser = importPost( "DBuser", "wikiuser" );
552 $conf->DBpassword = importPost( "DBpassword" );
553 $conf->DBpassword2 = importPost( "DBpassword2" );
554 $conf->SysopName = importPost( "SysopName", "WikiSysop" );
555 $conf->SysopPass = importPost( "SysopPass" );
556 $conf->SysopPass2 = importPost( "SysopPass2" );
557 $conf->RootUser = importPost( "RootUser", "root" );
558 $conf->RootPW = importPost( "RootPW", "" );
559 $useRoot = importCheck( 'useroot', false );
560 $conf->LanguageCode = importPost( "LanguageCode", "en" );
561
562 ## MySQL specific:
563 $conf->DBprefix = importPost( "DBprefix" );
564 $conf->setSchema( importPost( "DBschema", "mysql4" ) );
565
566 ## Postgres specific:
567 $conf->DBport = importPost( "DBport", "5432" );
568 $conf->DBmwschema = importPost( "DBmwschema", "mediawiki" );
569 $conf->DBts2schema = importPost( "DBts2schema", "public" );
570
571 /* Check for validity */
572 $errs = array();
573
574 if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki" || $conf->Sitename == "Mediawiki" ) {
575 $errs["Sitename"] = "Must not be blank or \"MediaWiki\"";
576 }
577 if( $conf->DBuser == "" ) {
578 $errs["DBuser"] = "Must not be blank";
579 }
580 if( ($conf->DBtype == 'mysql') && (strlen($conf->DBuser) > 16) ) {
581 $errs["DBuser"] = "Username too long";
582 }
583 if( $conf->DBpassword == "" && $conf->DBtype != "postgres" ) {
584 $errs["DBpassword"] = "Must not be blank";
585 }
586 if( $conf->DBpassword != $conf->DBpassword2 ) {
587 $errs["DBpassword2"] = "Passwords don't match!";
588 }
589 if( !preg_match( '/^[A-Za-z_0-9]*$/', $conf->DBprefix ) ) {
590 $errs["DBprefix"] = "Invalid table prefix";
591 }
592
593 error_reporting( E_ALL );
594
595 /**
596 * Initialise $wgLang and $wgContLang to something so we can
597 * call case-folding methods. Per Brion, this is English for
598 * now, although we could be clever and initialise to the
599 * user-selected language.
600 */
601 $wgContLang = Language::factory( 'en' );
602 $wgLang = $wgContLang;
603
604 /**
605 * We're messing about with users, so we need a stub
606 * authentication plugin...
607 */
608 $wgAuth = new AuthPlugin();
609
610 /**
611 * Validate the initial administrator account; username,
612 * password checks, etc.
613 */
614 if( $conf->SysopName ) {
615 # Check that the user can be created
616 $u = User::newFromName( $conf->SysopName );
617 if( $u instanceof User ) {
618 # Various password checks
619 if( $conf->SysopPass != '' ) {
620 if( $conf->SysopPass == $conf->SysopPass2 ) {
621 if( !$u->isValidPassword( $conf->SysopPass ) ) {
622 $errs['SysopPass'] = "Bad password";
623 }
624 } else {
625 $errs['SysopPass2'] = "Passwords don't match";
626 }
627 } else {
628 $errs['SysopPass'] = "Cannot be blank";
629 }
630 unset( $u );
631 } else {
632 $errs['SysopName'] = "Bad username";
633 }
634 }
635
636 $conf->License = importRequest( "License", "none" );
637 if( $conf->License == "gfdl" ) {
638 $conf->RightsUrl = "http://www.gnu.org/copyleft/fdl.html";
639 $conf->RightsText = "GNU Free Documentation License 1.2";
640 $conf->RightsCode = "gfdl";
641 $conf->RightsIcon = '${wgScriptPath}/skins/common/images/gnu-fdl.png';
642 } elseif( $conf->License == "none" ) {
643 $conf->RightsUrl = $conf->RightsText = $conf->RightsCode = $conf->RightsIcon = "";
644 } else {
645 $conf->RightsUrl = importRequest( "RightsUrl", "" );
646 $conf->RightsText = importRequest( "RightsText", "" );
647 $conf->RightsCode = importRequest( "RightsCode", "" );
648 $conf->RightsIcon = importRequest( "RightsIcon", "" );
649 }
650
651 $conf->Shm = importRequest( "Shm", "none" );
652 $conf->MCServers = importRequest( "MCServers" );
653
654 /* Test memcached servers */
655
656 if ( $conf->Shm == 'memcached' && $conf->MCServers ) {
657 $conf->MCServerArray = array_map( 'trim', explode( ',', $conf->MCServers ) );
658 foreach ( $conf->MCServerArray as $server ) {
659 $error = testMemcachedServer( $server );
660 if ( $error ) {
661 $errs["MCServers"] = $error;
662 break;
663 }
664 }
665 } else if ( $conf->Shm == 'memcached' ) {
666 $errs["MCServers"] = "Please specify at least one server if you wish to use memcached";
667 }
668
669 /* default values for installation */
670 $conf->Email = importRequest("Email", "email_enabled");
671 $conf->Emailuser = importRequest("Emailuser", "emailuser_enabled");
672 $conf->Enotif = importRequest("Enotif", "enotif_allpages");
673 $conf->Eauthent = importRequest("Eauthent", "eauthent_enabled");
674
675 if( $conf->posted && ( 0 == count( $errs ) ) ) {
676 do { /* So we can 'continue' to end prematurely */
677 $conf->Root = ($conf->RootPW != "");
678
679 /* Load up the settings and get installin' */
680 $local = writeLocalSettings( $conf );
681 echo "<li style=\"list-style: none\">\n";
682 echo "<p><b>Generating configuration file...</b></p>\n";
683 echo "</li>\n";
684
685 $wgCommandLineMode = false;
686 chdir( ".." );
687 $ok = eval( $local );
688 if( $ok === false ) {
689 dieout( "Errors in generated configuration; " .
690 "most likely due to a bug in the installer... " .
691 "Config file was: " .
692 "<pre>" .
693 htmlspecialchars( $local ) .
694 "</pre>" .
695 "</ul>" );
696 }
697 $conf->DBtypename = '';
698 foreach (array_keys($ourdb) as $db) {
699 if ($conf->DBtype === $db)
700 $conf->DBtypename = $ourdb[$db]['fullname'];
701 }
702 if ( ! strlen($conf->DBtype)) {
703 $errs["DBpicktype"] = "Please choose a database type";
704 continue;
705 }
706
707 if (! $conf->DBtypename) {
708 $errs["DBtype"] = "Unknown database type '$conf->DBtype'";
709 continue;
710 }
711 print "<li>Database type: {$conf->DBtypename}</li>\n";
712 $dbclass = 'Database'.ucfirst($conf->DBtype);
713 $wgDBtype = $conf->DBtype;
714 $wgDBadminuser = "root";
715 $wgDBadminpassword = $conf->RootPW;
716
717 ## Mysql specific:
718 $wgDBprefix = $conf->DBprefix;
719
720 ## Postgres specific:
721 $wgDBport = $conf->DBport;
722 $wgDBmwschema = $conf->DBmwschema;
723 $wgDBts2schema = $conf->DBts2schema;
724
725 $wgCommandLineMode = true;
726 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
727 require_once( "includes/Setup.php" );
728 chdir( "config" );
729
730 $wgTitle = Title::newFromText( "Installation script" );
731 error_reporting( E_ALL );
732 print "<li>Loading class: $dbclass";
733 $dbc = new $dbclass;
734
735 if( $conf->DBtype == 'mysql' ) {
736 $mysqlOldClient = version_compare( mysql_get_client_info(), "4.1.0", "lt" );
737 if( $mysqlOldClient ) {
738 print "<li><b>PHP is linked with old MySQL client libraries. If you are
739 using a MySQL 4.1 server and have problems connecting to the database,
740 see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'
741 >http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b></li>\n";
742 }
743 $ok = true; # Let's be optimistic
744
745 # Decide if we're going to use the superuser or the regular database user
746 $conf->Root = $useRoot;
747 if( $conf->Root ) {
748 $db_user = $conf->RootUser;
749 $db_pass = $conf->RootPW;
750 } else {
751 $db_user = $wgDBuser;
752 $db_pass = $wgDBpassword;
753 }
754
755 # Attempt to connect
756 echo( "<li>Attempting to connect to database server as $db_user..." );
757 $wgDatabase = Database::newFromParams( $wgDBserver, $db_user, $db_pass, '', 1 );
758
759 # Check the connection and respond to errors
760 if( $wgDatabase->isOpen() ) {
761 # Seems OK
762 $ok = true;
763 $wgDBadminuser = $db_user;
764 $wgDBadminpassword = $db_pass;
765 echo( "success.</li>\n" );
766 $wgDatabase->ignoreErrors( true );
767 $myver = $wgDatabase->getServerVersion();
768 } else {
769 # There were errors, report them and back out
770 $ok = false;
771 $errno = mysql_errno();
772 $errtx = htmlspecialchars( mysql_error() );
773 switch( $errno ) {
774 case 1045:
775 case 2000:
776 echo( "failed due to authentication errors. Check passwords.</li>" );
777 if( $conf->Root ) {
778 # The superuser details are wrong
779 $errs["RootUser"] = "Check username";
780 $errs["RootPW"] = "and password";
781 } else {
782 # The regular user details are wrong
783 $errs["DBuser"] = "Check username";
784 $errs["DBpassword"] = "and password";
785 }
786 break;
787 case 2002:
788 case 2003:
789 default:
790 # General connection problem
791 echo( "failed with error [$errno] $errtx.</li>\n" );
792 $errs["DBserver"] = "Connection failed";
793 break;
794 } # switch
795 } #conn. att.
796
797 if( !$ok ) { continue; }
798
799 } else /* not mysql */ {
800 error_reporting( E_ALL );
801 $wgSuperUser = '';
802 ## Possible connect as a superuser
803 if( $useRoot ) {
804 $wgDBsuperuser = $conf->RootUser;
805 echo( "<li>Attempting to connect to database \"postgres\" as superuser \"$wgDBsuperuser\"..." );
806 $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBsuperuser, $conf->RootPW, "postgres", 1);
807 if (!$wgDatabase->isOpen()) {
808 print " error: " . $wgDatabase->lastError() . "</li>\n";
809 $errs["DBserver"] = "Could not connect to database as superuser";
810 $errs["RootUser"] = "Check username";
811 $errs["RootPW"] = "and password";
812 continue;
813 }
814 }
815 echo( "<li>Attempting to connect to database \"$wgDBname\" as \"$wgDBuser\"..." );
816 $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1);
817 if (!$wgDatabase->isOpen()) {
818 print " error: " . $wgDatabase->lastError() . "</li>\n";
819 } else {
820 $myver = $wgDatabase->getServerVersion();
821 }
822 }
823
824 if ( !$wgDatabase->isOpen() ) {
825 $errs["DBserver"] = "Couldn't connect to database";
826 continue;
827 }
828
829 print "<li>Connected to $myver";
830 if ($conf->DBtype == 'mysql') {
831 if( version_compare( $myver, "4.0.14" ) < 0 ) {
832 dieout( " -- mysql 4.0.14 or later required. Aborting." );
833 }
834 $mysqlNewAuth = version_compare( $myver, "4.1.0", "ge" );
835 if( $mysqlNewAuth && $mysqlOldClient ) {
836 print "; <b class='error'>You are using MySQL 4.1 server, but PHP is linked
837 to old client libraries; if you have trouble with authentication, see
838 <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'
839 >http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
840 }
841 if( $wgDBmysql5 ) {
842 if( $mysqlNewAuth ) {
843 print "; enabling MySQL 4.1/5.0 charset mode";
844 } else {
845 print "; <b class='error'>MySQL 4.1/5.0 charset mode enabled,
846 but older version detected; will likely fail.</b>";
847 }
848 }
849 print "</li>\n";
850
851 @$sel = $wgDatabase->selectDB( $wgDBname );
852 if( $sel ) {
853 print "<li>Database <tt>" . htmlspecialchars( $wgDBname ) . "</tt> exists</li>\n";
854 } else {
855 $err = mysql_errno();
856 $databaseSafe = htmlspecialchars( $wgDBname );
857 if( $err == 1102 /* Invalid database name */ ) {
858 print "<ul><li><strong>{$databaseSafe}</strong> is not a valid database name.</li></ul>";
859 continue;
860 } elseif( $err != 1049 /* Database doesn't exist */ ) {
861 print "<ul><li>Error selecting database <strong>{$databaseSafe}</strong>: {$err} ";
862 print htmlspecialchars( mysql_error() ) . "</li></ul>";
863 continue;
864 }
865 print "<li>Attempting to create database...</li>";
866 $res = $wgDatabase->query( "CREATE DATABASE `$wgDBname`" );
867 if( !$res ) {
868 print "<li>Couldn't create database <tt>" .
869 htmlspecialchars( $wgDBname ) .
870 "</tt>; try with root access or check your username/pass.</li>\n";
871 $errs["RootPW"] = "&lt;- Enter";
872 continue;
873 }
874 print "<li>Created database <tt>" . htmlspecialchars( $wgDBname ) . "</tt></li>\n";
875 }
876 $wgDatabase->selectDB( $wgDBname );
877 }
878 else if ($conf->DBtype == 'postgres') {
879 if( version_compare( $myver, "PostgreSQL 8.0" ) < 0 ) {
880 dieout( " <b>Postgres 8.0 or later is required</b>. Aborting.</li></ul>" );
881 }
882 }
883
884 if( $wgDatabase->tableExists( "cur" ) || $wgDatabase->tableExists( "revision" ) ) {
885 print "<li>There are already MediaWiki tables in this database. Checking if updates are needed...</li>\n";
886
887 if ( $conf->DBtype == 'mysql') {
888
889 # Determine existing default character set
890 if ( $wgDatabase->tableExists( "revision" ) ) {
891 $revision = $wgDatabase->escapeLike( $conf->DBprefix . 'revision' );
892 $res = $wgDatabase->query( "SHOW TABLE STATUS LIKE '$revision'" );
893 $row = $wgDatabase->fetchObject( $res );
894 if ( !$row ) {
895 echo "<li>SHOW TABLE STATUS query failed!</li>\n";
896 $existingSchema = false;
897 } elseif ( preg_match( '/^latin1/', $row->Collation ) ) {
898 $existingSchema = 'mysql4';
899 } elseif ( preg_match( '/^utf8/', $row->Collation ) ) {
900 $existingSchema = 'mysql5';
901 } elseif ( preg_match( '/^binary/', $row->Collation ) ) {
902 $existingSchema = 'mysql5-binary';
903 } else {
904 $existingSchema = false;
905 echo "<li><strong>Warning:</strong> Unrecognised existing collation</li>\n";
906 }
907 if ( $existingSchema && $existingSchema != $conf->DBschema ) {
908 print "<li><strong>Warning:</strong> you requested the {$conf->DBschema} schema, " .
909 "but the existing database has the $existingSchema schema. This upgrade script ".
910 "can't convert it, so it will remain $existingSchema.</li>\n";
911 $conf->setSchema( $existingSchema );
912 }
913 }
914
915 # Create user if required
916 if ( $conf->Root ) {
917 $conn = $dbc->newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 );
918 if ( $conn->isOpen() ) {
919 print "<li>DB user account ok</li>\n";
920 $conn->close();
921 } else {
922 print "<li>Granting user permissions...";
923 if( $mysqlOldClient && $mysqlNewAuth ) {
924 print " <b class='error'>If the next step fails, see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'>http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
925 }
926 print "</li>\n";
927 dbsource( "../maintenance/users.sql", $wgDatabase );
928 }
929 }
930 }
931 print "</ul><pre>\n";
932 chdir( ".." );
933 flush();
934 do_all_updates();
935 chdir( "config" );
936 print "</pre>\n";
937 print "<ul><li>Finished update checks.</li>\n";
938 } else {
939 # FIXME: Check for errors
940 print "<li>Creating tables...";
941 if ($conf->DBtype == 'mysql') {
942 dbsource( "../maintenance/tables.sql", $wgDatabase );
943 dbsource( "../maintenance/interwiki.sql", $wgDatabase );
944 } else if ($conf->DBtype == 'postgres') {
945 $wgDatabase->setup_database();
946 }
947 else {
948 $errs["DBtype"] = "Do not know how to handle database type '$conf->DBtype'";
949 continue;
950 }
951
952 print " done.</li>\n";
953
954 print "<li>Initializing data...</li>\n";
955 $wgDatabase->insert( 'site_stats',
956 array ( 'ss_row_id' => 1,
957 'ss_total_views' => 0,
958 'ss_total_edits' => 0,
959 'ss_good_articles' => 0 ) );
960
961 # Set up the "regular user" account *if we can, and if we need to*
962 if( $conf->Root and $conf->DBtype == 'mysql') {
963 # See if we need to
964 $wgDatabase2 = $dbc->newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 );
965 if( $wgDatabase2->isOpen() ) {
966 # Nope, just close the test connection and continue
967 $wgDatabase2->close();
968 echo( "<li>User $wgDBuser exists. Skipping grants.</li>\n" );
969 } else {
970 # Yes, so run the grants
971 echo( "<li>Granting user permissions to $wgDBuser on $wgDBname..." );
972 dbsource( "../maintenance/users.sql", $wgDatabase );
973 echo( "success.</li>\n" );
974 }
975 }
976
977 if( $conf->SysopName ) {
978 $u = User::newFromName( $conf->getSysopName() );
979 if ( !$u ) {
980 print "<li><strong class=\"error\">Warning:</strong> Skipped sysop account creation - invalid username!</li>\n";
981 }
982 else if ( 0 == $u->idForName() ) {
983 $u->addToDatabase();
984 $u->setPassword( $conf->getSysopPass() );
985 $u->saveSettings();
986
987 $u->addGroup( "sysop" );
988 $u->addGroup( "bureaucrat" );
989
990 print "<li>Created sysop account <tt>" .
991 htmlspecialchars( $conf->SysopName ) . "</tt>.</li>\n";
992 } else {
993 print "<li>Could not create user - already exists!</li>\n";
994 }
995 } else {
996 print "<li>Skipped sysop account creation, no name given.</li>\n";
997 }
998
999 $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) );
1000 $article = new Article( $titleobj );
1001 $newid = $article->insertOn( $wgDatabase );
1002 $revision = new Revision( array(
1003 'page' => $newid,
1004 'text' => wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ),
1005 'comment' => '',
1006 'user' => 0,
1007 'user_text' => 'MediaWiki default',
1008 ) );
1009 $revid = $revision->insertOn( $wgDatabase );
1010 $article->updateRevisionOn( $wgDatabase, $revision );
1011 }
1012
1013 /* Write out the config file now that all is well */
1014 print "<li style=\"list-style: none\">\n";
1015 print "<p>Creating LocalSettings.php...</p>\n\n";
1016 $localSettings = "<" . "?php$endl$local";
1017 // Fix up a common line-ending problem (due to CVS on Windows)
1018 $localSettings = str_replace( "\r\n", "\n", $localSettings );
1019 $f = fopen( "LocalSettings.php", 'xt' );
1020
1021 if( $f == false ) {
1022 dieout( "<p>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...</p>\n" .
1023 "<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" .
1024 "<pre>\n" . htmlspecialchars( $localSettings ) . "</pre>\n" );
1025 }
1026 if(fwrite( $f, $localSettings ) ) {
1027 fclose( $f );
1028 writeSuccessMessage();
1029 } else {
1030 fclose( $f );
1031 die("<p class='error'>An error occured while writing the config/LocalSettings.php file. Check user rights and disk space then try again.</p>\n");
1032
1033 }
1034 print "</li>\n";
1035
1036 } while( false );
1037 }
1038 ?>
1039 </ul>
1040
1041
1042 <?php
1043
1044 if( count( $errs ) ) {
1045 /* Display options form */
1046
1047 if( $conf->posted ) {
1048 echo "<p class='error-top'>Something's not quite right yet; make sure everything below is filled out correctly.</p>\n";
1049 }
1050 ?>
1051
1052 <form action="index.php" name="config" method="post">
1053
1054
1055 <h2>Site config</h2>
1056
1057 <div class="config-section">
1058 <div class="config-input">
1059 <?php
1060 aField( $conf, "Sitename", "Wiki name:" );
1061 ?>
1062 </div>
1063 <p class="config-desc">
1064 Preferably a short word without punctuation, i.e. "Wikipedia".<br />
1065 Will appear as the namespace name for "meta" pages, and throughout the interface.
1066 </p>
1067
1068 <div class="config-input">
1069 <?php
1070 aField( $conf, "EmergencyContact", "Contact e-mail:" );
1071 ?>
1072 </div>
1073 <p class="config-desc">
1074 Displayed to users in some error messages, used as the return address for password reminders, and used as the default sender address of e-mail notifications.
1075 </p>
1076
1077 <div class="config-input">
1078 <label class='column' for="LanguageCode">Language:</label>
1079 <select id="LanguageCode" name="LanguageCode">
1080
1081 <?php
1082 $list = getLanguageList();
1083 foreach( $list as $code => $name ) {
1084 $sel = ($code == $conf->LanguageCode) ? 'selected="selected"' : '';
1085 echo "\t\t<option value=\"$code\" $sel>$name</option>\n";
1086 }
1087 ?>
1088 </select>
1089 </div>
1090 <p class="config-desc">
1091 Select the language for your wiki's interface. Some localizations aren't fully complete. Unicode (UTF-8) is used for all localizations.
1092 </p>
1093
1094 <div class="config-input">
1095 <label class='column'>Copyright/license:</label>
1096
1097 <ul class="plain">
1098 <li><?php aField( $conf, "License", "No license metadata", "radio", "none" ); ?></li>
1099 <li><?php aField( $conf, "License", "GNU Free Documentation License 1.2 (Wikipedia-compatible)", "radio", "gfdl" ); ?></li>
1100 <li><?php
1101 aField( $conf, "License", "A Creative Commons license - ", "radio", "cc" );
1102 $partner = "MediaWiki";
1103 $exit = urlencode( "$wgServer{$conf->ScriptPath}/config/index.php?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" );
1104 $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" );
1105 $ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" );
1106 print "<a href=\"$ccApp\" target='_blank'>choose</a>";
1107 ?>
1108 <?php if( $conf->License == "cc" ) { ?>
1109 <ul>
1110 <li><?php aField( $conf, "RightsIcon", "<img src=\"" . htmlspecialchars( $conf->RightsIcon ) . "\" alt='(Creative Commons icon)' />", "hidden" ); ?></li>
1111 <li><?php aField( $conf, "RightsText", htmlspecialchars( $conf->RightsText ), "hidden" ); ?></li>
1112 <li><?php aField( $conf, "RightsCode", "code: " . htmlspecialchars( $conf->RightsCode ), "hidden" ); ?></li>
1113 <li><?php aField( $conf, "RightsUrl", "<a href=\"" . htmlspecialchars( $conf->RightsUrl ) . "\">" . htmlspecialchars( $conf->RightsUrl ) . "</a>", "hidden" ); ?></li>
1114 </ul>
1115 <?php } ?>
1116 </li>
1117 </ul>
1118 </div>
1119 <p class="config-desc">
1120 A notice, icon, and machine-readable copyright metadata will be displayed for the license you pick.
1121 </p>
1122
1123
1124 <div class="config-input">
1125 <?php aField( $conf, "SysopName", "Admin username:" ) ?>
1126 </div>
1127 <div class="config-input">
1128 <?php aField( $conf, "SysopPass", "Password:", "password" ) ?>
1129 </div>
1130 <div class="config-input">
1131 <?php aField( $conf, "SysopPass2", "Password confirm:", "password" ) ?>
1132 </div>
1133 <p class="config-desc">
1134 An admin can lock/delete pages, block users from editing, and do other maintenance tasks.<br />
1135 A new account will be added only when creating a new wiki database.
1136 <br /><br />
1137 The password cannot be the same as the username.
1138 </p>
1139
1140 <div class="config-input">
1141 <label class='column'>Shared memory caching:</label>
1142
1143 <ul class="plain">
1144 <li><?php aField( $conf, "Shm", "No caching", "radio", "none" ); ?></li>
1145 <?php
1146 if ( $conf->turck ) {
1147 echo "<li>";
1148 aField( $conf, "Shm", "Turck MMCache", "radio", "turck" );
1149 echo "</li>";
1150 }
1151 if( $conf->xcache ) {
1152 echo( '<li>' );
1153 aField( $conf, 'Shm', 'XCache', 'radio', 'xcache' );
1154 echo( '</li>' );
1155 }
1156 if ( $conf->apc ) {
1157 echo "<li>";
1158 aField( $conf, "Shm", "APC", "radio", "apc" );
1159 echo "</li>";
1160 }
1161 if ( $conf->eaccel ) {
1162 echo "<li>";
1163 aField( $conf, "Shm", "eAccelerator", "radio", "eaccel" );
1164 echo "</li>";
1165 }
1166 ?>
1167 <li><?php aField( $conf, "Shm", "Memcached", "radio", "memcached" ); ?></li>
1168 </ul>
1169 <div style="clear:left"><?php aField( $conf, "MCServers", "Memcached servers:", "text" ) ?></div>
1170 </div>
1171 <p class="config-desc">
1172 An object caching system such as memcached will provide a significant performance boost,
1173 but needs to be installed. Provide the server addresses and ports in a comma-separated list.
1174 <br /><br />
1175 MediaWiki can also detect and support eAccelerator, Turck MMCache, APC, and XCache, but
1176 these should not be used if the wiki will be running on multiple application servers.
1177 </p>
1178 </div>
1179
1180 <h2>E-mail, e-mail notification and authentication setup</h2>
1181
1182 <div class="config-section">
1183 <div class="config-input">
1184 <label class='column'>E-mail features (global):</label>
1185 <ul class="plain">
1186 <li><?php aField( $conf, "Email", "Enabled", "radio", "email_enabled" ); ?></li>
1187 <li><?php aField( $conf, "Email", "Disabled", "radio", "email_disabled" ); ?></li>
1188 </ul>
1189 </div>
1190 <p class="config-desc">
1191 Use this to disable all e-mail functions (password reminders, user-to-user e-mail, and e-mail notifications)
1192 if sending mail doesn't work on your server.
1193 </p>
1194
1195 <div class="config-input">
1196 <label class='column'>User-to-user e-mail:</label>
1197 <ul class="plain">
1198 <li><?php aField( $conf, "Emailuser", "Enabled", "radio", "emailuser_enabled" ); ?></li>
1199 <li><?php aField( $conf, "Emailuser", "Disabled", "radio", "emailuser_disabled" ); ?></li>
1200 </ul>
1201 </div>
1202 <p class="config-desc">
1203 The user-to-user e-mail feature (Special:Emailuser) lets the wiki act as a relay to allow users to exchange e-mail without publicly advertising their e-mail address.
1204 </p>
1205 <div class="config-input">
1206 <label class='column'>E-mail notification about changes:</label>
1207 <ul class="plain">
1208 <li><?php aField( $conf, "Enotif", "Disabled", "radio", "enotif_disabled" ); ?></li>
1209 <li><?php aField( $conf, "Enotif", "Enabled for changes to user discussion pages only", "radio", "enotif_usertalk" ); ?></li>
1210 <li><?php aField( $conf, "Enotif", "Enabled for changes to user discussion pages, and to pages on watchlists (not recommended for large wikis)", "radio", "enotif_allpages" ); ?></li>
1211 </ul>
1212 </div>
1213 <div class="config-desc">
1214 <p>
1215 For this feature to work, an e-mail address must be present for the user account, and the notification
1216 options in the user's preferences must be enabled. Also note the
1217 authentication option below. When testing the feature, keep in mind that your own changes will never trigger notifications to be sent to yourself.</p>
1218
1219 <p>There are additional options for fine tuning in /includes/DefaultSettings.php; copy these to your LocalSettings.php and edit them there to change them.</p>
1220 </div>
1221
1222 <div class="config-input">
1223 <label class='column'>E-mail address authentication:</label>
1224 <ul class="plain">
1225 <li><?php aField( $conf, "Eauthent", "Disabled", "radio", "eauthent_disabled" ); ?></li>
1226 <li><?php aField( $conf, "Eauthent", "Enabled", "radio", "eauthent_enabled" ); ?></li>
1227 </ul>
1228 </div>
1229 <div class="config-desc">
1230 <p>If this option is enabled, users have to confirm their e-mail address using a magic link sent to them whenever they set or change it, and only authenticated e-mail addresses can receive mails from other users and/or
1231 change notification mails. Setting this option is <B>recommended</B> for public wikis because of potential abuse of the e-mail features above.</p>
1232 </div>
1233
1234 </div>
1235
1236 <h2>Database config</h2>
1237
1238 <div class="config-section">
1239 <div class="config-input">
1240 <label class='column'>Database type:</label>
1241 <?php if (isset($errs['DBpicktype'])) print "<span class='error'>$errs[DBpicktype]</span>\n"; ?>
1242 <ul class='plain'><?php database_picker($conf) ?></ul>
1243 </div>
1244
1245 <div class="config-input" style="clear:left"><?php
1246 aField( $conf, "DBserver", "Database host:" );
1247 ?></div>
1248 <p class="config-desc">
1249 If your database server isn't on your web server, enter the name or IP address here.
1250 </p>
1251
1252 <div class="config-input"><?php
1253 aField( $conf, "DBname", "Database name:" );
1254 ?></div>
1255 <div class="config-input"><?php
1256 aField( $conf, "DBuser", "DB username:" );
1257 ?></div>
1258 <div class="config-input"><?php
1259 aField( $conf, "DBpassword", "DB password:", "password" );
1260 ?></div>
1261 <div class="config-input"><?php
1262 aField( $conf, "DBpassword2", "DB password confirm:", "password" );
1263 ?></div>
1264 <p class="config-desc">
1265 If you only have a single user account and database available,
1266 enter those here. If you have database root access (see below)
1267 you can specify new accounts/databases to be created. This account
1268 will not be created if it pre-exists. If this is the case, ensure that it
1269 has SELECT, INSERT, UPDATE, and DELETE permissions on the MediaWiki database.
1270 </p>
1271
1272 <div class="config-input">
1273 <label class="column">Superuser account:</label>
1274 <input type="checkbox" name="useroot" id="useroot" <?php if( $useRoot ) { ?>checked="checked" <?php } ?>/>
1275 &nbsp;<label for="useroot">Use superuser account</label>
1276 </div>
1277 <div class="config-input">
1278 <?php
1279 aField( $conf, "RootUser", "Superuser name:", "superuser" );
1280 ?>
1281 </div>
1282 <div class="config-input">
1283 <?php
1284 aField( $conf, "RootPW", "Superuser password:", "password" );
1285 ?>
1286 </div>
1287
1288 <p class="config-desc">
1289 If the database user specified above does not exist, or does not have access to create
1290 the database (if needed) or tables within it, please check the box and provide details
1291 of a superuser account, such as <strong>root</strong>, which does.
1292 </p>
1293
1294 <?php database_switcher('mysql'); ?>
1295 <div class="config-input"><?php
1296 aField( $conf, "DBprefix", "Database table prefix:" );
1297 ?></div>
1298 <div class="config-desc">
1299 <p>If you need to share one database between multiple wikis, or
1300 between MediaWiki and another web application, you may choose to
1301 add a prefix to all the table names to avoid conflicts.</p>
1302
1303 <p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
1304 </div>
1305
1306 <div class="config-input"><label class="column">Database charset</label>
1307 <div>Select one:</div>
1308 <ul class="plain">
1309 <li><?php aField( $conf, "DBschema", "Backwards-compatible UTF-8", "radio", "mysql4" ); ?></li>
1310 <li><?php aField( $conf, "DBschema", "Experimental MySQL 4.1/5.0 UTF-8", "radio", "mysql5" ); ?></li>
1311 <li><?php aField( $conf, "DBschema", "Experimental MySQL 4.1/5.0 binary", "radio", "mysql5-binary" ); ?></li>
1312 </ul>
1313 </div>
1314 <p class="config-desc">
1315 <b>EXPERIMENTAL:</b> You can enable explicit Unicode charset support
1316 for MySQL 4.1 and 5.0 servers. This is not well tested and may
1317 cause things to break. <b>If upgrading an older installation, leave
1318 in backwards-compatible mode.</b>
1319 </p>
1320 </div>
1321
1322 <?php database_switcher('postgres'); ?>
1323 <div class="config-input"><?php
1324 aField( $conf, "DBport", "Database port:" );
1325 ?></div>
1326 <div class="config-input"><?php
1327 aField( $conf, "DBmwschema", "Schema for mediawiki:" );
1328 ?></div>
1329 <div class="config-input"><?php
1330 aField( $conf, "DBts2schema", "Schema for tsearch2:" );
1331 ?></div>
1332 <div class="config-desc">
1333 <p>The username specified above (at "DB username") will have its search path set to the above schemas,
1334 so it is recommended that you create a new user. The above schemas are generally correct:
1335 only change them if you are sure you need to.</p>
1336 </div>
1337 </div>
1338
1339 <div class="config-input" style="padding:2em 0 3em">
1340 <label class='column'>&nbsp;</label>
1341 <input type="submit" value="Install MediaWiki!" class="btn-install" />
1342 </div>
1343
1344 </div>
1345
1346 <script type="text/javascript">
1347 window.onload = toggleDBarea('<?php echo $conf->DBtype; ?>',
1348 <?php
1349 ## If they passed in a root user name, don't populate it on page load
1350 echo strlen(importPost('RootUser', '')) ? 0 : 1;
1351 ?>);
1352 </script>
1353
1354 </form>
1355
1356 <?php
1357 }
1358
1359 /* -------------------------------------------------------------------------------------- */
1360 function writeSuccessMessage() {
1361 if ( ini_get( 'safe_mode' ) && !ini_get( 'open_basedir' ) ) {
1362 echo <<<EOT
1363 <p>Installation successful!</p>
1364 <p>To complete the installation, please do the following:
1365 <ol>
1366 <li>Download config/LocalSettings.php with your FTP client or file manager</li>
1367 <li>Upload it to the parent directory</li>
1368 <li>Delete config/LocalSettings.php</li>
1369 <li>Start using <a href='../index.php'>your wiki</a>!
1370 </ol>
1371 <p>If you are in a shared hosting environment, do <strong>not</strong> just move LocalSettings.php
1372 remotely. LocalSettings.php is currently owned by the user your webserver is running under,
1373 which means that anyone on the same server can read your database password! Downloading
1374 it and uploading it again will hopefully change the ownership to a user ID specific to you.</p>
1375 EOT;
1376 } else {
1377 echo <<<EOT
1378 <p>
1379 <span class="success-message">Installation successful!</span>
1380 Move the <tt>config/LocalSettings.php</tt> file to the parent directory, then follow
1381 <a href="../index.php"> this link</a> to your wiki.</p>
1382 <p>You should change file permissions for <tt>LocalSettings.php</tt> as required to
1383 prevent other users on the server reading passwords and altering configuration data.</p>
1384 EOT;
1385 }
1386 }
1387
1388
1389 function escapePhpString( $string ) {
1390 return strtr( $string,
1391 array(
1392 "\n" => "\\n",
1393 "\r" => "\\r",
1394 "\t" => "\\t",
1395 "\\" => "\\\\",
1396 "\$" => "\\\$",
1397 "\"" => "\\\""
1398 ));
1399 }
1400
1401 function writeLocalSettings( $conf ) {
1402 $conf->PasswordSender = $conf->EmergencyContact;
1403 $magic = ($conf->ImageMagick ? "" : "# ");
1404 $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" );
1405 $rights = ($conf->RightsUrl) ? "" : "# ";
1406 $hashedUploads = $conf->safeMode ? '' : '# ';
1407
1408 switch ( $conf->Shm ) {
1409 case 'memcached':
1410 $cacheType = 'CACHE_MEMCACHED';
1411 $mcservers = var_export( $conf->MCServerArray, true );
1412 break;
1413 case 'turck':
1414 case 'xcache':
1415 case 'apc':
1416 case 'eaccel':
1417 $cacheType = 'CACHE_ACCEL';
1418 $mcservers = 'array()';
1419 break;
1420 default:
1421 $cacheType = 'CACHE_NONE';
1422 $mcservers = 'array()';
1423 }
1424
1425 if ( $conf->Email == 'email_enabled' ) {
1426 $enableemail = 'true';
1427 $enableuseremail = ( $conf->Emailuser == 'emailuser_enabled' ) ? 'true' : 'false' ;
1428 $eauthent = ( $conf->Eauthent == 'eauthent_enabled' ) ? 'true' : 'false' ;
1429 switch ( $conf->Enotif ) {
1430 case 'enotif_usertalk':
1431 $enotifusertalk = 'true';
1432 $enotifwatchlist = 'false';
1433 break;
1434 case 'enotif_allpages':
1435 $enotifusertalk = 'true';
1436 $enotifwatchlist = 'true';
1437 break;
1438 default:
1439 $enotifusertalk = 'false';
1440 $enotifwatchlist = 'false';
1441 }
1442 } else {
1443 $enableuseremail = 'false';
1444 $enableemail = 'false';
1445 $eauthent = 'false';
1446 $enotifusertalk = 'false';
1447 $enotifwatchlist = 'false';
1448 }
1449
1450 $file = @fopen( "/dev/urandom", "r" );
1451 if ( $file ) {
1452 $secretKey = bin2hex( fread( $file, 32 ) );
1453 fclose( $file );
1454 } else {
1455 $secretKey = "";
1456 for ( $i=0; $i<8; $i++ ) {
1457 $secretKey .= dechex(mt_rand(0, 0x7fffffff));
1458 }
1459 print "<li>Warning: \$wgSecretKey key is insecure, generated with mt_rand(). Consider changing it manually.</li>\n";
1460 }
1461
1462 # Add slashes to strings for double quoting
1463 $slconf = array_map( "escapePhpString", get_object_vars( $conf ) );
1464 if( $conf->License == 'gfdl' ) {
1465 # Needs literal string interpolation for the current style path
1466 $slconf['RightsIcon'] = $conf->RightsIcon;
1467 }
1468
1469 $localsettings = "
1470 # This file was automatically generated by the MediaWiki installer.
1471 # If you make manual changes, please keep track in case you need to
1472 # recreate them later.
1473 #
1474 # See includes/DefaultSettings.php for all configurable settings
1475 # and their default values, but don't forget to make changes in _this_
1476 # file, not there.
1477
1478 # If you customize your file layout, set \$IP to the directory that contains
1479 # the other MediaWiki files. It will be used as a base to locate files.
1480 if( defined( 'MW_INSTALL_PATH' ) ) {
1481 \$IP = MW_INSTALL_PATH;
1482 } else {
1483 \$IP = dirname( __FILE__ );
1484 }
1485
1486 \$path = array( \$IP, \"\$IP/includes\", \"\$IP/languages\" );
1487 set_include_path( implode( PATH_SEPARATOR, \$path ) . PATH_SEPARATOR . get_include_path() );
1488
1489 require_once( \"includes/DefaultSettings.php\" );
1490
1491 # If PHP's memory limit is very low, some operations may fail.
1492 " . ($conf->raiseMemory ? '' : '# ' ) . "ini_set( 'memory_limit', '20M' );" . "
1493
1494 if ( \$wgCommandLineMode ) {
1495 if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
1496 die( \"This script must be run from the command line\\n\" );
1497 }
1498 }
1499 ## Uncomment this to disable output compression
1500 # \$wgDisableOutputCompression = true;
1501
1502 \$wgSitename = \"{$slconf['Sitename']}\";
1503
1504 ## The URL base path to the directory containing the wiki;
1505 ## defaults for all runtime URL paths are based off of this.
1506 \$wgScriptPath = \"{$slconf['ScriptPath']}\";
1507
1508 ## For more information on customizing the URLs please see:
1509 ## http://www.mediawiki.org/wiki/Manual:Short_URL
1510
1511 \$wgEnableEmail = $enableemail;
1512 \$wgEnableUserEmail = $enableuseremail;
1513
1514 \$wgEmergencyContact = \"{$slconf['EmergencyContact']}\";
1515 \$wgPasswordSender = \"{$slconf['PasswordSender']}\";
1516
1517 ## For a detailed description of the following switches see
1518 ## http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
1519 ## There are many more options for fine tuning available see
1520 ## /includes/DefaultSettings.php
1521 ## UPO means: this is also a user preference option
1522 \$wgEnotifUserTalk = $enotifusertalk; # UPO
1523 \$wgEnotifWatchlist = $enotifwatchlist; # UPO
1524 \$wgEmailAuthentication = $eauthent;
1525
1526 \$wgDBtype = \"{$slconf['DBtype']}\";
1527 \$wgDBserver = \"{$slconf['DBserver']}\";
1528 \$wgDBname = \"{$slconf['DBname']}\";
1529 \$wgDBuser = \"{$slconf['DBuser']}\";
1530 \$wgDBpassword = \"{$slconf['DBpassword']}\";
1531
1532 # MySQL specific settings
1533 \$wgDBprefix = \"{$slconf['DBprefix']}\";
1534
1535 # MySQL table options to use during installation or update
1536 \$wgDBTableOptions = \"{$slconf['DBTableOptions']}\";
1537
1538 # Experimental charset support for MySQL 4.1/5.0.
1539 \$wgDBmysql5 = {$conf->DBmysql5};
1540
1541 # Postgres specific settings
1542 \$wgDBport = \"{$slconf['DBport']}\";
1543 \$wgDBmwschema = \"{$slconf['DBmwschema']}\";
1544 \$wgDBts2schema = \"{$slconf['DBts2schema']}\";
1545
1546 ## Shared memory settings
1547 \$wgMainCacheType = $cacheType;
1548 \$wgMemCachedServers = $mcservers;
1549
1550 ## To enable image uploads, make sure the 'images' directory
1551 ## is writable, then set this to true:
1552 \$wgEnableUploads = false;
1553 {$magic}\$wgUseImageMagick = true;
1554 {$magic}\$wgImageMagickConvertCommand = \"{$convert}\";
1555
1556 ## If you want to use image uploads under safe mode,
1557 ## create the directories images/archive, images/thumb and
1558 ## images/temp, and make them all writable. Then uncomment
1559 ## this, if it's not already uncommented:
1560 {$hashedUploads}\$wgHashedUploadDirectory = false;
1561
1562 ## If you have the appropriate support software installed
1563 ## you can enable inline LaTeX equations:
1564 \$wgUseTeX = false;
1565
1566 \$wgLocalInterwiki = \$wgSitename;
1567
1568 \$wgLanguageCode = \"{$slconf['LanguageCode']}\";
1569
1570 \$wgProxyKey = \"$secretKey\";
1571
1572 ## Default skin: you can change the default skin. Use the internal symbolic
1573 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
1574 \$wgDefaultSkin = 'monobook';
1575
1576 ## For attaching licensing metadata to pages, and displaying an
1577 ## appropriate copyright notice / icon. GNU Free Documentation
1578 ## License and Creative Commons licenses are supported so far.
1579 {$rights}\$wgEnableCreativeCommonsRdf = true;
1580 \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
1581 \$wgRightsUrl = \"{$slconf['RightsUrl']}\";
1582 \$wgRightsText = \"{$slconf['RightsText']}\";
1583 \$wgRightsIcon = \"{$slconf['RightsIcon']}\";
1584 # \$wgRightsCode = \"{$slconf['RightsCode']}\"; # Not yet used
1585
1586 \$wgDiff3 = \"{$slconf['diff3']}\";
1587
1588 # When you make changes to this configuration file, this will make
1589 # sure that cached pages are cleared.
1590 \$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) );
1591 \$wgCacheEpoch = max( \$wgCacheEpoch, \$configdate );
1592 "; ## End of setting the $localsettings string
1593
1594 // Keep things in Unix line endings internally;
1595 // the system will write out as local text type.
1596 return str_replace( "\r\n", "\n", $localsettings );
1597 }
1598
1599 function dieout( $text ) {
1600 die( $text . "\n\n</body>\n</html>" );
1601 }
1602
1603 function importVar( &$var, $name, $default = "" ) {
1604 if( isset( $var[$name] ) ) {
1605 $retval = $var[$name];
1606 if ( get_magic_quotes_gpc() ) {
1607 $retval = stripslashes( $retval );
1608 }
1609 } else {
1610 $retval = $default;
1611 }
1612 return $retval;
1613 }
1614
1615 function importPost( $name, $default = "" ) {
1616 return importVar( $_POST, $name, $default );
1617 }
1618
1619 function importCheck( $name ) {
1620 return isset( $_POST[$name] );
1621 }
1622
1623 function importRequest( $name, $default = "" ) {
1624 return importVar( $_REQUEST, $name, $default );
1625 }
1626
1627 $radioCount = 0;
1628
1629 function aField( &$conf, $field, $text, $type = "text", $value = "", $onclick = '' ) {
1630 global $radioCount;
1631 if( $type != "" ) {
1632 $xtype = "type=\"$type\"";
1633 } else {
1634 $xtype = "";
1635 }
1636
1637 $id = $field;
1638 $nolabel = ($type == "radio") || ($type == "hidden");
1639
1640 if ($type == 'radio')
1641 $id .= $radioCount++;
1642
1643 if( $nolabel ) {
1644 echo "\t\t<label>";
1645 } else {
1646 echo "\t\t<label class='column' for=\"$id\">$text</label>\n";
1647 }
1648
1649 if( $type == "radio" && $value == $conf->$field ) {
1650 $checked = "checked='checked'";
1651 } else {
1652 $checked = "";
1653 }
1654 echo "\t\t<input $xtype name=\"$field\" id=\"$id\" class=\"iput-$type\" $checked ";
1655 if ($onclick) {
1656 echo " onclick='toggleDBarea(\"$value\",1)' " ;
1657 }
1658 echo "value=\"";
1659 if( $type == "radio" ) {
1660 echo htmlspecialchars( $value );
1661 } else {
1662 echo htmlspecialchars( $conf->$field );
1663 }
1664
1665
1666 echo "\" />\n";
1667 if( $nolabel ) {
1668 echo " $text</label>\n";
1669 }
1670
1671 global $errs;
1672 if(isset($errs[$field])) echo "<span class='error'>" . $errs[$field] . "</span>\n";
1673 }
1674
1675 function getLanguageList() {
1676 global $wgLanguageNames;
1677 if( !isset( $wgLanguageNames ) ) {
1678 require_once( "languages/Names.php" );
1679 }
1680
1681 $codes = array();
1682
1683 $d = opendir( "../languages/messages" );
1684 /* In case we are called from the root directory */
1685 if (!$d)
1686 $d = opendir( "languages/messages");
1687 while( false !== ($f = readdir( $d ) ) ) {
1688 $m = array();
1689 if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $f, $m ) ) {
1690 $code = str_replace( '_', '-', strtolower( $m[1] ) );
1691 if( isset( $wgLanguageNames[$code] ) ) {
1692 $name = $code . ' - ' . $wgLanguageNames[$code];
1693 } else {
1694 $name = $code;
1695 }
1696 $codes[$code] = $name;
1697 }
1698 }
1699 closedir( $d );
1700 ksort( $codes );
1701 return $codes;
1702 }
1703
1704 #Check for location of an executable
1705 # @param string $loc single location to check
1706 # @param array $names filenames to check for.
1707 # @param mixed $versioninfo array of details to use when checking version, use false for no version checking
1708 function locate_executable($loc, $names, $versioninfo = false) {
1709 if (!is_array($names))
1710 $names = array($names);
1711
1712 foreach ($names as $name) {
1713 $command = "$loc".DIRECTORY_SEPARATOR."$name";
1714 if (file_exists($command)) {
1715 if (!$versioninfo)
1716 return $command;
1717
1718 $file = str_replace('$1', $command, $versioninfo[0]);
1719 if (strstr(`$file`, $versioninfo[1]) !== false)
1720 return $command;
1721 }
1722 }
1723 return false;
1724 }
1725
1726 # Test a memcached server
1727 function testMemcachedServer( $server ) {
1728 $hostport = explode(":", $server);
1729 $errstr = false;
1730 $fp = false;
1731 if ( !function_exists( 'fsockopen' ) ) {
1732 $errstr = "Can't connect to memcached, fsockopen() not present";
1733 }
1734 if ( !$errstr && count( $hostport ) != 2 ) {
1735 $errstr = 'Please specify host and port';
1736 var_dump( $hostport );
1737 }
1738 if ( !$errstr ) {
1739 list( $host, $port ) = $hostport;
1740 $errno = 0;
1741 $fsockerr = '';
1742
1743 $fp = @fsockopen( $host, $port, $errno, $fsockerr, 1.0 );
1744 if ( $fp === false ) {
1745 $errstr = "Cannot connect to memcached on $host:$port : $fsockerr";
1746 }
1747 }
1748 if ( !$errstr ) {
1749 $command = "version\r\n";
1750 $bytes = fwrite( $fp, $command );
1751 if ( $bytes != strlen( $command ) ) {
1752 $errstr = "Cannot write to memcached socket on $host:$port";
1753 }
1754 }
1755 if ( !$errstr ) {
1756 $expected = "VERSION ";
1757 $response = fread( $fp, strlen( $expected ) );
1758 if ( $response != $expected ) {
1759 $errstr = "Didn't get correct memcached response from $host:$port";
1760 }
1761 }
1762 if ( $fp ) {
1763 fclose( $fp );
1764 }
1765 if ( !$errstr ) {
1766 echo "<li>Connected to memcached on $host:$port successfully";
1767 }
1768 return $errstr;
1769 }
1770
1771 function database_picker($conf) {
1772 global $ourdb;
1773 print "\n";
1774 foreach(array_keys($ourdb) as $db) {
1775 if ($ourdb[$db]['havedriver']) {
1776 print "<li>";
1777 aField( $conf, "DBtype", $ourdb[$db]['fullname'], 'radio', $db, 'onclick');
1778 print "</li>\n";
1779 }
1780 }
1781 print "\n";
1782 }
1783
1784 function database_switcher($db) {
1785 global $ourdb;
1786 $color = $ourdb[$db]['bgcolor'];
1787 $full = $ourdb[$db]['fullname'];
1788 print "<div id='$db' style='display:none; background: $color'>\n";
1789 print "<h3>$full specific options:</h3>\n";
1790 }
1791
1792 function printListItem( $item ) {
1793 print "<li>$item</li>";
1794 }
1795
1796 ?>
1797
1798 <div class="license">
1799 <hr>
1800 <p>This program is free software; you can redistribute it and/or modify
1801 it under the terms of the GNU General Public License as published by
1802 the Free Software Foundation; either version 2 of the License, or
1803 (at your option) any later version.</p>
1804
1805 <p>This program is distributed in the hope that it will be useful,
1806 but WITHOUT ANY WARRANTY; without even the implied warranty of
1807 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1808 GNU General Public License for more details.</p>
1809
1810 <p>You should have received <a href="../COPYING">a copy of the GNU General Public License</a>
1811 along with this program; if not, write to the Free Software
1812 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1813 or <a href="http://www.gnu.org/copyleft/gpl.html">read it online</a></p>
1814 </div>
1815
1816 </div></div></div>
1817
1818
1819 <div id="column-one">
1820 <div class="portlet" id="p-logo">
1821 <a style="background-image: url(../skins/common/images/mediawiki.png);"
1822 href="http://www.mediawiki.org/"
1823 title="Main Page"></a>
1824 </div>
1825 <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
1826 <div class='portlet'><div class='pBody'>
1827 <ul>
1828 <li><strong><a href="http://www.mediawiki.org/">MediaWiki home</a></strong></li>
1829 <li><a href="../README">Readme</a></li>
1830 <li><a href="../RELEASE-NOTES">Release notes</a></li>
1831 <li><a href="../docs/">Documentation</a></li>
1832 <li><a href="http://meta.wikipedia.org/wiki/MediaWiki_User's_Guide">User's Guide</a></li>
1833 <li><a href="http://meta.wikimedia.org/wiki/MediaWiki_FAQ">FAQ</a></li>
1834 </ul>
1835 <p style="font-size:90%;margin-top:1em">MediaWiki is Copyright &copy; 2001-2007 by Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik M&ouml;ller, Gabriel Wicke and others.</p>
1836 </div></div>
1837 </div>
1838
1839 </div>
1840
1841 </body>
1842 </html>