fde97067b24db4ae9e9803428c304770a343194b
[lhc/web/wiklou.git] / includes / templates / NoLocalSettings.php
1 <?php
2 /**
3 * @file
4 * @ingroup Templates
5 */
6
7 # Prevent XSS
8 if ( isset( $wgVersion ) ) {
9 $wgVersion = htmlspecialchars( $wgVersion );
10 } else {
11 $wgVersion = 'VERSION';
12 }
13 # Set the path in case we hit a page such as /index.php/Main_Page
14 # Could use <base href> but then we have to worry about http[s]/port #/etc.
15 $ext = strpos( $_SERVER['SCRIPT_NAME'], 'index.php5' ) === false ? 'php' : 'php5';
16 $path = '';
17 if( isset( $_SERVER['SCRIPT_NAME'] )) {
18 $path = htmlspecialchars( preg_replace('/index.php5?/', '', $_SERVER['SCRIPT_NAME']) );
19 }
20 #Remove filename in path, prevents going to corrupt URLs (e.g. http://server/path/api.phpconfig/index.php)
21 if(substr($path, strlen($path)-1) != "/"){
22 $path = substr($path, 0, strrpos($path, "/")+1);
23 }
24 ?>
25 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
26 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
27 <head>
28 <title>MediaWiki <?php echo $wgVersion ?></title>
29 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
30 <style type='text/css' media='screen, projection'>
31 html, body {
32 color: #000;
33 background-color: #fff;
34 font-family: sans-serif;
35 text-align: center;
36 }
37
38 h1 {
39 font-size: 150%;
40 }
41 </style>
42 </head>
43 <body>
44 <img src="<?php echo $path ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
45
46 <h1>MediaWiki <?php echo $wgVersion ?></h1>
47 <div class='error'>
48 <?php
49 if ( file_exists( 'config/LocalSettings.php' ) ) {
50 echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
51 } else {
52 echo( "Please <a href=\"${path}config/index.{$ext}\" title='setup'> set up the wiki</a> first." );
53 }
54 ?>
55
56 </div>
57 </body>
58 </html>