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