lang
[phpmyadmin/crack.git] / index.php
blob95c5128b3e51b02b304833762409ad87ae13b893
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * Gets core libraries and defines some variables
7 */
8 require_once('./libraries/grab_globals.lib.php');
9 require_once('./libraries/common.lib.php');
10 /**
11 * Includes the ThemeManager if it hasn't been included yet
13 require_once('./libraries/select_theme.lib.php');
15 /**
16 * Saves collation_connection (coming from main.php) in a cookie
19 // (from grab_globals)
20 if (isset($collation_connection)) {
21 if (!isset($pma_uri_parts)) {
22 $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
23 $cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
24 $is_https = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0;
26 setcookie('pma_collation_connection', $collation_connection, time() + 60*60*24*30, $cookie_path, '', $is_https);
28 // Gets the default font sizes
29 PMA_setFontSizes();
31 // Gets the host name
32 // loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
33 if (empty($HTTP_HOST)) {
34 if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
35 $HTTP_HOST = $_ENV['HTTP_HOST'];
37 else if (@getenv('HTTP_HOST')) {
38 $HTTP_HOST = getenv('HTTP_HOST');
40 else {
41 $HTTP_HOST = '';
44 /**
45 * Defines the frameset
47 // loic1: If left light mode -> urldecode the db name
48 if (isset($lightm_db)) {
49 // no longer urlencoded because of html entities in the db name
50 // $db = urldecode($lightm_db);
51 $db = $lightm_db;
52 unset($lightm_db);
54 $url_query = PMA_generate_common_url(isset($db) ? $db : '');
55 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
57 require_once('./libraries/relation.lib.php');
58 $cfgRelation = PMA_getRelationsParam();
60 if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
61 PMA_purgeHistory($cfg['Server']['user']);
64 $phpmain_hash = md5($cfg['PmaAbsoluteUri']);
65 $phpmain_hash_js = time();
67 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
68 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
69 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
70 <head>
71 <title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
72 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
73 <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&amp;js_frame=right" />
74 </head>
76 <?php
77 $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_left.png';
78 $query_frame_height = 0;
79 if ($cfg['LeftDisplayLogo'] && @file_exists($logo_image)) {
80 $tmp_imgsize = @getimagesize($logo_image);
81 $query_frame_height = ($tmp_imgsize[1] + 60);
82 // increase the height to take into account font size differences in
83 // theme 'original'? (TODO: improve with a parameter in layout.inc.php)
84 $query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 25 : 0);
86 if ($query_frame_height == 0) {
87 $query_frame_height = 60;
89 // increase the height to take into account font size differences in
90 // theme 'original'? (TODO: improve with a parameter in layout.inc.php)
91 $query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 20 : 10);
93 if ($cfg['LeftDisplayServers'] && !$cfg['DisplayServersList']) {
94 $query_frame_height += 40;
96 if ($server > 0) {
97 PMA_availableDatabases(); // this function is defined in "common.lib.php"
98 } else {
99 $num_dbs = 0;
101 if ($num_dbs > 1) {
102 if ($cfg['LeftFrameLight']) {
103 $query_frame_height += 20;
106 if ($cfg['QueryFrame']) {
107 /* Will we show list of servers? */
108 if ($cfg['LeftDisplayServers'] && $cfg['DisplayServersList'] && count($cfg['Servers']) > 1) {
109 $query_frame_height += (count($cfg['Servers']) + 1)*15;
112 if ($cfg['QueryFrameJS']) {
113 echo '<script type="text/javascript">' . "\n";
114 echo '<!--' . "\n";
115 echo ' document.writeln(\'<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="1" name="mainFrameset" id="mainFrameset">\');' . "\n";
116 echo ' document.writeln(\' <frameset rows="' . $query_frame_height . ', *" framespacing="0" frameborder="0" border="0" name="leftFrameset" id="leftFrameset">\');' . "\n";
117 echo ' document.writeln(\' <frame src="queryframe.php?' . $url_query . '&amp;hash=' . $phpmain_hash . $phpmain_hash_js . '" name="queryframe" frameborder="0" scrolling="no" id="leftQueryframe" />\');' . "\n";
118 echo ' document.writeln(\' <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . $phpmain_hash_js . '" name="nav" frameborder="0" id="leftFrame" />\');' . "\n";
119 echo ' document.writeln(\' </frameset>\');' . "\n";
120 echo ' document.writeln(\' <frame src="' . (empty($db) ? $cfg['DefaultTabServer'] : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . $phpmain_hash_js . '" border="0" frameborder="0" style="border-left: 1px solid #000000;" id="rightFrame" />\');' . "\n";
121 echo ' document.writeln(\' <noframes>\');' . "\n";
122 echo ' document.writeln(\' <body bgcolor="#FFFFFF">\');' . "\n";
123 echo ' document.writeln(\' <p>' . str_replace("'", "\'", $strNoFrames) . '</p>\');' . "\n";
124 echo ' document.writeln(\' </body>\');' . "\n";
125 echo ' document.writeln(\' </noframes>\');' . "\n";
126 echo ' document.writeln(\'</frameset>\');' . "\n";
127 echo '//-->' . "\n";
128 echo '</script>' . "\n";
129 echo "\n";
130 echo '<noscript>' . "\n";
133 echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="1" name="mainFrameset" id="mainFrameset">' . "\n";
134 echo ' <frameset rows="' . $query_frame_height . ', *" framespacing="0" frameborder="0" border="0" name="leftFrameset" id="leftFrameset">' . "\n";
135 echo ' <frame src="queryframe.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="queryframe" frameborder="0" scrolling="no" id="leftQueryframe" />' . "\n";
136 echo ' <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="nav" frameborder="0" id="leftFrame" />' . "\n";
137 echo ' </frameset>' . "\n";
138 echo ' <frame src="' . (empty($db) ? $cfg['DefaultTabServer'] : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" frameborder="0" id="rightFrame" />' . "\n";
140 } else {
142 echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="1" id="leftFrameset" >' . "\n";
143 echo ' <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="nav" frameborder="0" id="leftFrame" />' . "\n";
144 echo ' <frame src="' . (empty($db) ? $cfg['DefaultTabServer'] : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" id="rightFrame" frameborder="1" />' . "\n";
149 <noframes>
150 <body bgcolor="#FFFFFF">
151 <p><?php echo $strNoFrames; ?></p>
152 </body>
153 </noframes>
154 </frameset>
155 <?php
156 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
157 echo '</noscript>' . "\n";
161 </html>