Huge set of optimizations, please test!

This commit is contained in:
Alexander M. Turek
2003-11-26 22:52:25 +00:00
parent 0500480bcf
commit 37d50c1822
115 changed files with 12275 additions and 12579 deletions

View File

@@ -5,6 +5,23 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2003-11-26 Alexander M. Turek <lifeforrent@derrabus.de>
* Almost every file:
- Replaced all include / require commands by require_once where possible;
- Further php 4.1+ optimizations;
- footer.inc.php now automatically stops the script execution;
- Coding standards.
* config.inc.php: Don't include select_lang.lib.php here.
* libraries/common.lib.php, libraries/defines.lib.php,
libraries/defines_php.lib.php, libraries/defines_mysql.lib.php,
scripts/create-release.sh:
defines.lib.php was included twice. For optimization reasons I moved all
the code that is independent from the MySQL connection out of defines.lib
into defines_php.lib.
To point out the (new) meanings of the files I renamed defines.lib.php to
defines_mysql.lib.php while defines_php.lib.php is now known as
defines.lib.php.
2003-11-26 Michal Cihar <cleanerfasterbetter@cihar.com> 2003-11-26 Michal Cihar <cleanerfasterbetter@cihar.com>
* lang/check_lang.sh: Cleanup. * lang/check_lang.sh: Cleanup.
* lang/sort_lang.sh: Cleanup. * lang/sort_lang.sh: Cleanup.

View File

@@ -5,25 +5,23 @@
/** /**
* Get the variables sent or posted to this script and displays the header * Get the variables sent or posted to this script and displays the header
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
/** /**
* Gets a core script and starts output buffering work * Gets a core script and starts output buffering work
*/ */
if (!defined('PMA_COMMON_LIB_INCLUDED')) { require_once('./libraries/common.lib.php');
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db', 'table', 'field')); PMA_checkParameters(array('db', 'table', 'field'));
require('./libraries/ob.lib.php'); require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) { if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet(); $ob_mode = PMA_outBufferModeGet();
if ($ob_mode) { if ($ob_mode) {
PMA_outBufferPre($ob_mode); PMA_outBufferPre($ob_mode);
} }
} }
include('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
$field = urldecode($field); $field = urldecode($field);
/** /**
@@ -58,8 +56,8 @@ PMA_setFontSizes();
<body bgcolor="<?php echo $cfg['LeftBgColor']; ?>" style="margin-left: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 0px"> <body bgcolor="<?php echo $cfg['LeftBgColor']; ?>" style="margin-left: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 0px">
<?php <?php
$per_page = 200; $per_page = 200;
require('./libraries/relation.lib.php'); // foreign keys require_once('./libraries/relation.lib.php'); // foreign keys
require('./libraries/transformations.lib.php'); // Transformations require_once('./libraries/transformations.lib.php'); // Transformations
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE); $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE);
@@ -74,7 +72,7 @@ if (isset($foreign_navig) && $foreign_navig == $strShowAll) {
unset($foreign_limit); unset($foreign_limit);
} }
include('./libraries/get_foreign.lib.php'); require('./libraries/get_foreign.lib.php');
?> ?>
<form action="browse_foreigners.php" method="post"> <form action="browse_foreigners.php" method="post">

View File

@@ -6,10 +6,10 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./db_details_common.php'); require_once('./db_details_common.php');
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
/** /**
@@ -21,6 +21,5 @@ $cfgRelation = PMA_getRelationsParam(TRUE);
/** /**
* Displays the footer * Displays the footer
*/ */
echo "\n"; require_once('./footer.inc.php');
require('./footer.inc.php');
?> ?>

View File

@@ -434,10 +434,6 @@ $cfg['AvailableCharsets'] = array(
'SHIFT_JIS' 'SHIFT_JIS'
); );
// Loads language file
require('./libraries/select_lang.lib.php');
/** /**
* Customization & design * Customization & design
*/ */

View File

@@ -4,8 +4,8 @@
chdir('..'); chdir('..');
$is_minimum_common = TRUE; $is_minimum_common = TRUE;
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
// Gets the default font sizes // Gets the default font sizes
// garvin: TODO: Should be optimized to not include the whole common.lib.php bunch // garvin: TODO: Should be optimized to not include the whole common.lib.php bunch
@@ -13,7 +13,7 @@ require('./libraries/common.lib.php');
PMA_setFontSizes(); PMA_setFontSizes();
$ctype = 'css'; $ctype = 'css';
require('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
if (!isset($js_frame)) { if (!isset($js_frame)) {
$js_frame = 'left'; $js_frame = 'left';

View File

@@ -6,13 +6,11 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
require('./header.inc.php'); require_once('./header.inc.php');
require_once('./libraries/common.lib.php');
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db')); PMA_checkParameters(array('db'));
@@ -32,6 +30,6 @@ $result = PMA_mysql_query('CREATE DATABASE ' . PMA_backquote($db)) or PMA_m
* Displays the result and calls default page * Displays the result and calls default page
*/ */
$message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated; $message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
require('./' . $cfg['DefaultTabDatabase']); require_once('./' . $cfg['DefaultTabDatabase']);
?> ?>

View File

@@ -6,16 +6,16 @@
* Gets the variables sent or posted to this script, then displays headers * Gets the variables sent or posted to this script, then displays headers
*/ */
if (!isset($selected_tbl)) { if (!isset($selected_tbl)) {
include('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
include('./header.inc.php'); require_once('./header.inc.php');
} }
/** /**
* Gets the relations settings * Gets the relations settings
*/ */
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -317,5 +317,5 @@ function printPage()
<?php <?php
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="' . $strPrint . '" onclick="printPage()">' . "\n"; echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -35,7 +35,7 @@ $sub_part = '';
require('./db_details_db_info.php'); require('./db_details_db_info.php');
if ($num_tables == 0 && empty($db_query_force)) { if ($num_tables == 0 && empty($db_query_force)) {
$is_info = TRUE; $is_info = TRUE;
include('./db_details_structure.php'); require('./db_details_structure.php');
exit(); exit();
} }
@@ -200,5 +200,5 @@ if (function_exists('PMA_set_enc_form')) {
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -5,15 +5,9 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { require_once('./libraries/grab_globals.lib.php');
include('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php');
} require_once('./libraries/bookmark.lib.php');
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
include('./libraries/bookmark.lib.php');
}
PMA_checkParameters(array('db')); PMA_checkParameters(array('db'));
@@ -35,13 +29,13 @@ if (!isset($is_db) || !$is_db) {
} }
if (empty($db) || !$is_db) { if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit;
} }
} // end if (ensures db exists) } // end if (ensures db exists)
// Displays headers // Displays headers
if (!isset($message)) { if (!isset($message)) {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php'); require_once('./header.inc.php');
// Reloads the navigation frame via JavaScript if required // Reloads the navigation frame via JavaScript if required
if (isset($reload) && $reload) { if (isset($reload) && $reload) {
echo "\n"; echo "\n";

View File

@@ -5,9 +5,7 @@
// Check parameters // Check parameters
if (!defined('PMA_COMMON_LIB_INCLUDED')) { require_once('./libraries/common.lib.php');
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db')); PMA_checkParameters(array('db'));

View File

@@ -52,15 +52,14 @@ if ($num_tables > 1) {
<br /><br />'; <br /><br />';
} elseif ($num_tables == 0) { } elseif ($num_tables == 0) {
echo $strDatabaseNoTable; echo $strDatabaseNoTable;
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} // end if } // end if
$export_type = 'database'; $export_type = 'database';
require('./libraries/display_export.lib.php'); require_once('./libraries/display_export.lib.php');
/** /**
* Displays the footer * Displays the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -12,13 +12,13 @@
* Get the values of the variables posted or sent to this script and display * Get the values of the variables posted or sent to this script and display
* the headers * the headers
*/ */
require('./libraries/read_dump.lib.php'); require_once('./libraries/read_dump.lib.php');
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./header.inc.php'); require_once('./header.inc.php');
//require common added for string importing - Robbat2, 15 January 2003 9.34PM //require common added for string importing - Robbat2, 15 January 2003 9.34PM
//all hardcoded strings converted by Robbat2, 15 January 2003 9.34PM //all hardcoded strings converted by Robbat2, 15 January 2003 9.34PM
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
// Check parameters // Check parameters
PMA_checkParameters(array('db')); PMA_checkParameters(array('db'));
@@ -148,7 +148,7 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
} }
// Get relation settings // Get relation settings
include('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
// Gets the query from a file if required // Gets the query from a file if required
@@ -299,6 +299,6 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -7,9 +7,9 @@
* Get the values of the variables posted or sent to this script and display * Get the values of the variables posted or sent to this script and display
* the headers * the headers
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
/** /**
@@ -25,13 +25,13 @@ if (isset($submit_sql) && preg_match('@^SELECT@i', $encoded_sql_query)) {
$goto = 'db_details.php'; $goto = 'db_details.php';
$zero_rows = htmlspecialchars($strSuccess); $zero_rows = htmlspecialchars($strSuccess);
$sql_query = urldecode($encoded_sql_query); $sql_query = urldecode($encoded_sql_query);
include('./sql.php'); require('./sql.php');
exit(); exit();
} else { } else {
$sub_part = '_qbe'; $sub_part = '_qbe';
include('./db_details_common.php'); require('./db_details_common.php');
$url_query .= '&amp;goto=db_details_qbe.php'; $url_query .= '&amp;goto=db_details_qbe.php';
include('./db_details_db_info.php'); require('./db_details_db_info.php');
} }
if (isset($submit_sql) && !preg_match('@^SELECT@i', $encoded_sql_query)) { if (isset($submit_sql) && !preg_match('@^SELECT@i', $encoded_sql_query)) {
@@ -1076,5 +1076,5 @@ if (!empty($qry_orderby)) {
/** /**
* Displays the footer * Displays the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -8,26 +8,22 @@
* because there is no table in the database ($is_info is TRUE) * because there is no table in the database ($is_info is TRUE)
*/ */
if (empty($is_info)) { if (empty($is_info)) {
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { require_once('./libraries/grab_globals.lib.php');
include('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php');
}
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
// Drops/deletes/etc. multiple tables if required // Drops/deletes/etc. multiple tables if required
if ((!empty($submit_mult) && isset($selected_tbl)) if ((!empty($submit_mult) && isset($selected_tbl))
|| isset($mult_btn)) { || isset($mult_btn)) {
$action = 'db_details_structure.php'; $action = 'db_details_structure.php';
$err_url = 'db_details_structure.php?'. PMA_generate_common_url($db); $err_url = 'db_details_structure.php?'. PMA_generate_common_url($db);
include('./mult_submits.inc.php'); require('./mult_submits.inc.php');
} }
include('./db_details_common.php'); require('./db_details_common.php');
$url_query .= '&amp;goto=db_details_structure.php'; $url_query .= '&amp;goto=db_details_structure.php';
// Gets the database structure // Gets the database structure
$sub_part = '_structure'; $sub_part = '_structure';
include('./db_details_db_info.php'); require('./db_details_db_info.php');
echo "\n"; echo "\n";
/** /**
@@ -82,7 +78,7 @@ function pma_TableHeader($alternate = FALSE) {
/** /**
* Settings for relations stuff * Settings for relations stuff
*/ */
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
/** /**
@@ -251,7 +247,7 @@ else {
</td> </td>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php <?php
include('./libraries/bookmark.lib.php'); require_once('./libraries/bookmark.lib.php');
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label'); $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
if (!empty($sts_data['Rows'])) { if (!empty($sts_data['Rows'])) {
@@ -692,5 +688,5 @@ echo "\n" . '</ul>';
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -6,14 +6,11 @@
/** /**
* Gets the variables sent or posted to this script, then displays headers * Gets the variables sent or posted to this script, then displays headers
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./header.inc.php'); require_once('./header.inc.php');
// Check parameters // Check parameters
require_once('./libraries/common.lib.php');
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db')); PMA_checkParameters(array('db'));
@@ -25,7 +22,7 @@ $err_url = 'db_details.php?' . PMA_generate_common_url($db);
/** /**
* Settings for relations stuff * Settings for relations stuff
*/ */
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
/** /**
@@ -308,5 +305,5 @@ function printPage()
<?php <?php
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="' . $strPrint . '" onclick="printPage()">' . "\n"; echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -379,5 +379,5 @@ echo"\n";
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -5,9 +5,9 @@
/** /**
* Get the variables sent or posted to this script and a core script * Get the variables sent or posted to this script and a core script
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./libraries/zip.lib.php'); require_once('./libraries/zip.lib.php');
PMA_checkParameters(array('what')); PMA_checkParameters(array('what'));
@@ -263,16 +263,16 @@ if ($save_on_server) {
} }
if (isset($message)) { if (isset($message)) {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php'); require_once('./header.inc.php');
if ($export_type == 'server') { if ($export_type == 'server') {
$active_page = 'server_export.php'; $active_page = 'server_export.php';
include('./server_export.php'); require('./server_export.php');
} elseif ($export_type == 'database') { } elseif ($export_type == 'database') {
$active_page = 'db_details_export.php'; $active_page = 'db_details_export.php';
include('./db_details_export.php'); require('./db_details_export.php');
} else { } else {
$active_page = 'tbl_properties_export.php'; $active_page = 'tbl_properties_export.php';
include('./tbl_properties_export.php'); require('./tbl_properties_export.php');
} }
exit(); exit();
} }
@@ -299,7 +299,7 @@ if (!$save_on_server) {
} else { } else {
// HTML // HTML
$backup_cfgServer = $cfg['Server']; $backup_cfgServer = $cfg['Server'];
include('./header.inc.php'); require_once('./header.inc.php');
$cfg['Server'] = $backup_cfgServer; $cfg['Server'] = $backup_cfgServer;
unset($backup_cfgServer); unset($backup_cfgServer);
echo '<div align="' . $cell_align_left . '">' . "\n"; echo '<div align="' . $cell_align_left . '">' . "\n";
@@ -314,16 +314,16 @@ if ($export_type == 'database') {
if ($num_tables == 0) { if ($num_tables == 0) {
$message = $strNoTablesFound; $message = $strNoTablesFound;
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php'); require_once('./header.inc.php');
if ($export_type == 'server') { if ($export_type == 'server') {
$active_page = 'server_export.php'; $active_page = 'server_export.php';
include('./server_export.php'); require('./server_export.php');
} elseif ($export_type == 'database') { } elseif ($export_type == 'database') {
$active_page = 'db_details_export.php'; $active_page = 'db_details_export.php';
include('./db_details_export.php'); require('./db_details_export.php');
} else { } else {
$active_page = 'tbl_properties_export.php'; $active_page = 'tbl_properties_export.php';
include('./tbl_properties_export.php'); require('./tbl_properties_export.php');
} }
exit(); exit();
} }
@@ -337,11 +337,11 @@ $do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_comments']); $do_comments = isset($GLOBALS[$what . '_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']); $do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) { if ($do_relation || $do_comments || $do_mime) {
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
} }
if ($do_mime) { if ($do_mime) {
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
} }
// Include dates in export? // Include dates in export?
@@ -455,10 +455,9 @@ if (!empty($asfile)) {
if (@function_exists('bzcompress')) { if (@function_exists('bzcompress')) {
$dump_buffer = bzcompress($dump_buffer); $dump_buffer = bzcompress($dump_buffer);
if ($dump_buffer === -8) { if ($dump_buffer === -8) {
include('./header.inc.php'); require_once('./header.inc.php');
echo sprintf($strBzError, '<a href="http://bugs.php.net/bug.php?id=17300" target="_blank">17300</a>'); echo sprintf($strBzError, '<a href="http://bugs.php.net/bug.php?id=17300" target="_blank">17300</a>');
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
} }
} }
@@ -481,16 +480,16 @@ if (!empty($asfile)) {
} }
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php'); require_once('./header.inc.php');
if ($export_type == 'server') { if ($export_type == 'server') {
$active_page = 'server_export.php'; $active_page = 'server_export.php';
include('./server_export.php'); require_once('./server_export.php');
} elseif ($export_type == 'database') { } elseif ($export_type == 'database') {
$active_page = 'db_details_export.php'; $active_page = 'db_details_export.php';
include('./db_details_export.php'); require_once('./db_details_export.php');
} else { } else {
$active_page = 'tbl_properties_export.php'; $active_page = 'tbl_properties_export.php';
include('./tbl_properties_export.php'); require_once('./tbl_properties_export.php');
} }
exit(); exit();
} else { } else {
@@ -507,6 +506,6 @@ else {
echo ' </pre>' . "\n"; echo ' </pre>' . "\n";
echo '</div>' . "\n"; echo '</div>' . "\n";
echo "\n"; echo "\n";
include('./footer.inc.php'); require_once('./footer.inc.php');
} // end if } // end if
?> ?>

View File

@@ -2,10 +2,15 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
// In this file you may add PHP or HTML statements that will be used to define /**
// the footer for phpMyAdmin pages. * In this file you may add PHP or HTML statements that will be used to define
* the footer for phpMyAdmin pages.
*
* WARNING: This script has to be included at the very end of your code because
* it will stop the script execution!
*/
require('./libraries/relation.lib.php'); // for PMA_setHistory() require_once('./libraries/relation.lib.php'); // for PMA_setHistory()
/** /**
* Query window * Query window
@@ -14,6 +19,7 @@ require('./libraries/relation.lib.php'); // for PMA_setHistory()
// If query window is wanted and open, update with latest selected db/table. // If query window is wanted and open, update with latest selected db/table.
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) { if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
<?php <?php
@@ -137,10 +143,10 @@ if (isset($GLOBALS['cfg']['DBG']['enable'])
&& isset($GLOBALS['cfg']['DBG']['profile']['enable']) && isset($GLOBALS['cfg']['DBG']['profile']['enable'])
&& $GLOBALS['cfg']['DBG']['profile']['enable']) { && $GLOBALS['cfg']['DBG']['profile']['enable']) {
//run the basic setup code first //run the basic setup code first
include('./libraries/dbg/setup.php'); require_once('./libraries/dbg/setup.php');
//if the setup ran fine, then do the profiling //if the setup ran fine, then do the profiling
if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) { if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
include('./libraries/dbg/profiling.php'); require_once('./libraries/dbg/profiling.php');
dbg_dump_profiling_results(); dbg_dump_profiling_results();
} }
} }
@@ -153,4 +159,9 @@ if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
PMA_outBufferPost($GLOBALS['ob_mode']); PMA_outBufferPost($GLOBALS['ob_mode']);
} }
/**
* Stops the script execution
*/
exit;
?> ?>

View File

@@ -2,135 +2,128 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_HEADER_INC_INCLUDED')) { /**
define('PMA_HEADER_INC_INCLUDED', 1);
/**
* Gets a core script and starts output buffering work * Gets a core script and starts output buffering work
*/ */
if (!defined('PMA_COMMON_LIB_INCLUDED')) { require_once('./libraries/common.lib.php');
include('./libraries/common.lib.php'); require_once('./libraries/ob.lib.php');
} if ($GLOBALS['cfg']['OBGzip']) {
if (!defined('PMA_OB_LIB_INCLUDED')) {
include('./libraries/ob.lib.php');
}
if ($GLOBALS['cfg']['OBGzip']) {
$GLOBALS['ob_mode'] = PMA_outBufferModeGet(); $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
if ($GLOBALS['ob_mode']) { if ($GLOBALS['ob_mode']) {
PMA_outBufferPre($GLOBALS['ob_mode']); PMA_outBufferPre($GLOBALS['ob_mode']);
} }
} }
// garvin: For re-usability, moved http-headers and stylesheets // garvin: For re-usability, moved http-headers and stylesheets
// to a seperate file. It can now be included by header.inc.php, // to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php. // queryframe.php, querywindow.php.
include('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
include('./libraries/header_meta_style.inc.php'); require_once('./libraries/header_meta_style.inc.php');
$title = ''; $title = '';
if (isset($GLOBALS['db'])) { if (isset($GLOBALS['db'])) {
$title .= str_replace('\'', '\\\'', $GLOBALS['db']); $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
} }
if (isset($GLOBALS['table'])) { if (isset($GLOBALS['table'])) {
$title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']); $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
} }
if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) { if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
$title .= (empty($title) ? 'phpMyAdmin ' : ' ') $title .= (empty($title) ? 'phpMyAdmin ' : ' ')
. sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose']))); . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
} }
$title .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION; $title .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
?> ?>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
<!-- <!--
// Updates the title of the frameset if possible (ns4 does not allow this) // Updates the title of the frameset if possible (ns4 does not allow this)
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown' if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
&& typeof(parent.document.title) == 'string') { && typeof(parent.document.title) == 'string') {
parent.document.title = '<?php echo $title; ?>'; parent.document.title = '<?php echo $title; ?>';
} }
<?php <?php
// Add some javascript instructions if required // Add some javascript instructions if required
if (isset($js_to_run) && $js_to_run == 'functions.js') { if (isset($js_to_run) && $js_to_run == 'functions.js') {
echo "\n"; echo "\n";
?> ?>
// js form validation stuff // js form validation stuff
var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>'; var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>'; var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>'; var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>'; var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
var confirmMsg = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>'; var confirmMsg = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
//--> //-->
</script> </script>
<script src="libraries/functions.js" type="text/javascript" language="javascript"></script> <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
<?php <?php
} else if (isset($js_to_run) && $js_to_run == 'user_password.js') { } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
echo "\n"; echo "\n";
?> ?>
// js form validation stuff // js form validation stuff
var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>'; var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>'; var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>'; var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>'; var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
//--> //-->
</script> </script>
<script src="libraries/user_password.js" type="text/javascript" language="javascript"></script> <script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
<?php <?php
} else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') { } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
echo "\n"; echo "\n";
?> ?>
// js form validation stuff // js form validation stuff
var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>'; var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>'; var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>'; var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>'; var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
//--> //-->
</script> </script>
<script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script> <script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
<?php <?php
} else if (isset($js_to_run) && $js_to_run == 'indexes.js') { } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
echo "\n"; echo "\n";
?> ?>
// js index validation stuff // js index validation stuff
var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>'; var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>'; var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>'; var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
//--> //-->
</script> </script>
<script src="libraries/indexes.js" type="text/javascript" language="javascript"></script> <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
<?php <?php
} else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') { } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
echo "\n"; echo "\n";
?> ?>
//--> //-->
</script> </script>
<script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script> <script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
<?php <?php
} else { } else {
echo "\n"; echo "\n";
?> ?>
//--> //-->
</script> </script>
<?php <?php
} }
echo "\n"; echo "\n";
?> ?>
<meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" /> <meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
</head> </head>
<?php <?php
if ($GLOBALS['cfg']['RightBgImage'] != '') { if ($GLOBALS['cfg']['RightBgImage'] != '') {
$bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"'; $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
} else { } else {
$bkg_img = ''; $bkg_img = '';
} }
?> ?>
<body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>> <body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
<?php <?php
if (!defined('PMA_DISPLAY_HEADING')) { if (!defined('PMA_DISPLAY_HEADING')) {
define('PMA_DISPLAY_HEADING', 1); define('PMA_DISPLAY_HEADING', 1);
} }
if (PMA_DISPLAY_HEADING) { if (PMA_DISPLAY_HEADING) {
$header_url_qry = '?' . PMA_generate_common_url(); $header_url_qry = '?' . PMA_generate_common_url();
echo '<h1>' . "\n"; echo '<h1>' . "\n";
$server_info = (!empty($cfg['Server']['verbose']) $server_info = (!empty($cfg['Server']['verbose'])
@@ -150,13 +143,13 @@ if (!defined('PMA_HEADER_INC_INCLUDED')) {
echo ' ' . sprintf($GLOBALS['strServer'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>'); echo ' ' . sprintf($GLOBALS['strServer'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>');
} }
echo "\n" . '</h1>' . "\n"; echo "\n" . '</h1>' . "\n";
} }
echo "\n"; echo "\n";
/** /**
* Sets a variable to remember headers have been sent * Sets a variable to remember headers have been sent
*/ */
$GLOBALS['is_header_sent'] = TRUE; $GLOBALS['is_header_sent'] = TRUE;
} // PMA_HEADER_INC_INCLUDED
?> ?>

View File

@@ -5,8 +5,8 @@
/** /**
* Gets a core script and starts output buffering work * Gets a core script and starts output buffering work
*/ */
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./libraries/ob.lib.php'); require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) { if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet(); $ob_mode = PMA_outBufferModeGet();
if ($ob_mode) { if ($ob_mode) {
@@ -23,7 +23,7 @@ PMA_checkParameters(array('db', 'full_sql_query'));
// to a seperate file. It can now be included by header.inc.php, // to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php. // queryframe.php, querywindow.php.
include('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
/** /**
* Sends the beginning of the html page then returns to the calling script * Sends the beginning of the html page then returns to the calling script

View File

@@ -6,8 +6,8 @@
/** /**
* Gets core libraries and defines some variables * Gets core libraries and defines some variables
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
// Gets the default font sizes // Gets the default font sizes
PMA_setFontSizes(); PMA_setFontSizes();
@@ -41,7 +41,7 @@ $url_query = PMA_generate_common_url(isset($db) ? $db : '');
header('Content-Type: text/html; charset=' . $GLOBALS['charset']); header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) { if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {

View File

@@ -18,8 +18,8 @@
/** /**
* Gets some core scripts * Gets some core scripts
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
// Check parameters // Check parameters
@@ -80,9 +80,9 @@ if (isset($btnLDI) && isset($local_textfile) && $local_textfile != '') {
*/ */
if (isset($btnLDI) && empty($textfile)) { if (isset($btnLDI) && empty($textfile)) {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php'); require_once('./header.inc.php');
$message = $strMustSelectFile; $message = $strMustSelectFile;
include('./ldi_table.php'); require('./ldi_table.php');
} elseif (isset($btnLDI) && ($textfile != 'none')) { } elseif (isset($btnLDI) && ($textfile != 'none')) {
if (!isset($replace)) { if (!isset($replace)) {
$replace = ''; $replace = '';
@@ -91,7 +91,7 @@ if (isset($btnLDI) && empty($textfile)) {
// the error message does not correspond exactly to the error... // the error message does not correspond exactly to the error...
if (!@chmod($textfile, 0644)) { if (!@chmod($textfile, 0644)) {
echo $strFileCouldNotBeRead . ' ' . $textfile . '<br />'; echo $strFileCouldNotBeRead . ' ' . $textfile . '<br />';
exit(); require_once('./footer.inc.php');
} }
// Kanji encoding convert appended by Y.Kawada // Kanji encoding convert appended by Y.Kawada
@@ -159,7 +159,7 @@ if (isset($btnLDI) && empty($textfile)) {
// //
// The $goto in ldi_table.php is set to tbl_properties.php but maybe // The $goto in ldi_table.php is set to tbl_properties.php but maybe
// if would be better to Browse the latest inserted data. // if would be better to Browse the latest inserted data.
include('./sql.php'); require('./sql.php');
if ($unlink_local_textfile) { if ($unlink_local_textfile) {
unlink($textfile); unlink($textfile);
} }
@@ -170,6 +170,6 @@ if (isset($btnLDI) && empty($textfile)) {
* The form used to define the query hasn't been yet submitted -> loads it * The form used to define the query hasn't been yet submitted -> loads it
*/ */
else { else {
include('./ldi_table.php'); require('./ldi_table.php');
} }
?> ?>

View File

@@ -7,12 +7,10 @@
* This file defines the forms used to insert a textfile into a table * This file defines the forms used to insert a textfile into a table
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
// Check parameters // Check parameters
if (!defined('PMA_COMMON_LIB_INCLUDED')) { require_once('./libraries/common.lib.php');
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db', 'table')); PMA_checkParameters(array('db', 'table'));
@@ -194,5 +192,5 @@ if (PMA_MYSQL_INT_VERSION > 40003) {
/** /**
* Displays the footer * Displays the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -7,7 +7,7 @@
* Gets the variables sent to this script, retains the db name that may have * Gets the variables sent to this script, retains the db name that may have
* been defined as startup option and include a core library * been defined as startup option and include a core library
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
if (isset($lightm_db) && !empty($lightm_db)) { if (isset($lightm_db) && !empty($lightm_db)) {
// no longer urlencoded because of html entities in the db name // no longer urlencoded because of html entities in the db name
// $db = urldecode($lightm_db); // $db = urldecode($lightm_db);
@@ -22,8 +22,8 @@ if (!empty($db)) {
/** /**
* Gets a core script and starts output buffering work * Gets a core script and starts output buffering work
*/ */
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./libraries/ob.lib.php'); require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) { if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet(); $ob_mode = PMA_outBufferModeGet();
if ($ob_mode) { if ($ob_mode) {
@@ -33,8 +33,8 @@ if ($cfg['OBGzip']) {
PMA_checkParameters(array('hash')); PMA_checkParameters(array('hash'));
include('./libraries/bookmark.lib.php'); require_once('./libraries/bookmark.lib.php');
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
function PMA_reduceNest($_table) { function PMA_reduceNest($_table) {
@@ -192,7 +192,7 @@ if ($server > 0) {
// to a seperate file. It can now be included by header.inc.php, // to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php. // queryframe.php, querywindow.php.
include('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
/** /**
* Displays the frame * Displays the frame

View File

@@ -8,49 +8,46 @@
// +--------------------------------------------------------------------------+ // +--------------------------------------------------------------------------+
if (!defined('PMA_CONFIG_AUTH_INCLUDED')) { /**
define('PMA_CONFIG_AUTH_INCLUDED', 1);
/**
* Displays authentication form * Displays authentication form
* *
* @return boolean always true * @return boolean always true
* *
* @access public * @access public
*/ */
function PMA_auth() function PMA_auth()
{ {
return TRUE; return TRUE;
} // end of the 'PMA_auth()' function } // end of the 'PMA_auth()' function
/** /**
* Gets advanced authentication settings * Gets advanced authentication settings
* *
* @return boolean always true * @return boolean always true
* *
* @access public * @access public
*/ */
function PMA_auth_check() function PMA_auth_check()
{ {
return TRUE; return TRUE;
} // end of the 'PMA_auth_check()' function } // end of the 'PMA_auth_check()' function
/** /**
* Set the user and password after last checkings if required * Set the user and password after last checkings if required
* *
* @return boolean always true * @return boolean always true
* *
* @access public * @access public
*/ */
function PMA_auth_set_user() function PMA_auth_set_user()
{ {
return TRUE; return TRUE;
} // end of the 'PMA_auth_set_user()' function } // end of the 'PMA_auth_set_user()' function
/** /**
* User is not allowed to login to MySQL -> authentication failed * User is not allowed to login to MySQL -> authentication failed
* *
* @global string the MySQL error message PHP returns * @global string the MySQL error message PHP returns
@@ -68,8 +65,8 @@ if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_auth_fails() function PMA_auth_fails()
{ {
global $php_errormsg; global $php_errormsg;
global $connect_func, $server_port, $server_socket, $cfg; global $connect_func, $server_port, $server_socket, $cfg;
global $right_font_family, $font_size, $font_bigger; global $right_font_family, $font_size, $font_bigger;
@@ -122,7 +119,6 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
PMA_mysqlDie($conn_error, $local_query, FALSE); PMA_mysqlDie($conn_error, $local_query, FALSE);
return TRUE; return TRUE;
} // end of the 'PMA_auth_fails()' function } // end of the 'PMA_auth_fails()' function
} // $__PMA_CONFIG_AUTH_LIB__
?> ?>

View File

@@ -10,23 +10,20 @@
// +--------------------------------------------------------------------------+ // +--------------------------------------------------------------------------+
if (!defined('PMA_COOKIE_AUTH_INCLUDED')) { if (!isset($coming_from_common)) {
define('PMA_COOKIE_AUTH_INCLUDED', 1);
if (!isset($coming_from_common)) {
exit(); exit();
} }
include('./libraries/blowfish.php'); require_once('./libraries/blowfish.php');
// Gets the default font sizes // Gets the default font sizes
PMA_setFontSizes(); PMA_setFontSizes();
// Defines the cookie path and whether the server is using https or not // Defines the cookie path and whether the server is using https or not
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']); $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
$cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')); $cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
$is_https = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0; $is_https = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0;
/** /**
* String padding * String padding
* *
* @param string input string * @param string input string
@@ -38,7 +35,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
* *
* @access public * @access public
*/ */
function full_str_pad($input, $pad_length, $pad_string = '', $pad_type = 0) { function full_str_pad($input, $pad_length, $pad_string = '', $pad_type = 0) {
$str = ''; $str = '';
$length = $pad_length - strlen($input); $length = $pad_length - strlen($input);
if ($length > 0) { // str_repeat doesn't like negatives if ($length > 0) { // str_repeat doesn't like negatives
@@ -55,9 +52,9 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
$str = $input; $str = $input;
} }
return $str; return $str;
} }
/** /**
* Encryption using blowfish algorithm * Encryption using blowfish algorithm
* *
* @param string original data * @param string original data
@@ -69,7 +66,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
* *
* @author lem9 * @author lem9
*/ */
function PMA_blowfish_encrypt($data, $secret) { function PMA_blowfish_encrypt($data, $secret) {
$pma_cipher = new Horde_Cipher_blowfish; $pma_cipher = new Horde_Cipher_blowfish;
$encrypt = ''; $encrypt = '';
for ($i=0; $i<strlen($data); $i+=8) { for ($i=0; $i<strlen($data); $i+=8) {
@@ -80,9 +77,9 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
$encrypt .= $pma_cipher->encryptBlock($block, $secret); $encrypt .= $pma_cipher->encryptBlock($block, $secret);
} }
return $encrypt; return $encrypt;
} }
/** /**
* Decryption using blowfish algorithm * Decryption using blowfish algorithm
* *
* @param string encrypted data * @param string encrypted data
@@ -94,16 +91,16 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
* *
* @author lem9 * @author lem9
*/ */
function PMA_blowfish_decrypt($data, $secret) { function PMA_blowfish_decrypt($data, $secret) {
$pma_cipher = new Horde_Cipher_blowfish; $pma_cipher = new Horde_Cipher_blowfish;
$decrypt = ''; $decrypt = '';
for ($i=0; $i<strlen($data); $i+=8) { for ($i=0; $i<strlen($data); $i+=8) {
$decrypt .= $pma_cipher->decryptBlock(substr($data, $i, 8), $secret); $decrypt .= $pma_cipher->decryptBlock(substr($data, $i, 8), $secret);
} }
return trim($decrypt); return trim($decrypt);
} }
/** /**
* Sorts available languages by their true names * Sorts available languages by their true names
* *
* @param array the array to be sorted * @param array the array to be sorted
@@ -113,13 +110,13 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
* *
* @access private * @access private
*/ */
function PMA_cookie_cmp(&$a, $b) function PMA_cookie_cmp(&$a, $b)
{ {
return (strcmp($a[1], $b[1])); return (strcmp($a[1], $b[1]));
} // end of the 'PMA_cmp()' function } // end of the 'PMA_cmp()' function
/** /**
* Displays authentication form * Displays authentication form
* *
* @global string the font face to use * @global string the font face to use
@@ -137,8 +134,8 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_auth() function PMA_auth()
{ {
global $right_font_family, $font_size, $font_bigger; global $right_font_family, $font_size, $font_bigger;
global $cfg, $available_languages; global $cfg, $available_languages;
global $lang, $server, $convcharset; global $lang, $server, $convcharset;
@@ -340,8 +337,6 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
<?php <?php
} // end if (server choice) } // end if (server choice)
echo "\n"; echo "\n";
?>
<?php
if (!empty($conn_error)) { if (!empty($conn_error)) {
echo '<tr><td colspan="2" align="center"><p class="warning">'. $conn_error . '</p></td></tr>' . "\n"; echo '<tr><td colspan="2" align="center"><p class="warning">'. $conn_error . '</p></td></tr>' . "\n";
} }
@@ -381,10 +376,10 @@ if (uname.value == '') {
exit(); exit();
return TRUE; return TRUE;
} // end of the 'PMA_auth()' function } // end of the 'PMA_auth()' function
/** /**
* Gets advanced authentication settings * Gets advanced authentication settings
* *
* @global string the username if register_globals is on * @global string the username if register_globals is on
@@ -402,8 +397,8 @@ if (uname.value == '') {
* *
* @access public * @access public
*/ */
function PMA_auth_check() function PMA_auth_check()
{ {
global $PHP_AUTH_USER, $PHP_AUTH_PW, $pma_auth_server; global $PHP_AUTH_USER, $PHP_AUTH_PW, $pma_auth_server;
global $pma_servername, $pma_username, $pma_password, $old_usr; global $pma_servername, $pma_username, $pma_password, $old_usr;
global $from_cookie; global $from_cookie;
@@ -483,10 +478,10 @@ if (uname.value == '') {
// we don't need to strip here, it is done in grab_globals // we don't need to strip here, it is done in grab_globals
return TRUE; return TRUE;
} }
} // end of the 'PMA_auth_check()' function } // end of the 'PMA_auth_check()' function
/** /**
* Set the user and password after last checkings if required * Set the user and password after last checkings if required
* *
* @global array the valid servers settings * @global array the valid servers settings
@@ -501,8 +496,8 @@ if (uname.value == '') {
* *
* @access public * @access public
*/ */
function PMA_auth_set_user() function PMA_auth_set_user()
{ {
global $cfg, $server; global $cfg, $server;
global $PHP_AUTH_USER, $PHP_AUTH_PW, $pma_auth_server; global $PHP_AUTH_USER, $PHP_AUTH_PW, $pma_auth_server;
global $from_cookie; global $from_cookie;
@@ -579,19 +574,19 @@ if (uname.value == '') {
} // end if } // end if
return TRUE; return TRUE;
} // end of the 'PMA_auth_set_user()' function } // end of the 'PMA_auth_set_user()' function
/** /**
* User is not allowed to login to MySQL -> authentication failed * User is not allowed to login to MySQL -> authentication failed
* *
* @return boolean always true (no return indeed) * @return boolean always true (no return indeed)
* *
* @access public * @access public
*/ */
function PMA_auth_fails() function PMA_auth_fails()
{ {
global $conn_error; global $conn_error;
// Deletes password cookie and displays the login form // Deletes password cookie and displays the login form
setcookie('pma_cookie_password', base64_encode(''), 0, $GLOBALS['cookie_path'], '' , $GLOBALS['is_https']); setcookie('pma_cookie_password', base64_encode(''), 0, $GLOBALS['cookie_path'], '' , $GLOBALS['is_https']);
@@ -607,7 +602,6 @@ if (uname.value == '') {
PMA_auth(); PMA_auth();
return TRUE; return TRUE;
} // end of the 'PMA_auth_fails()' function } // end of the 'PMA_auth_fails()' function
} // $__PMA_COOKIE_AUTH_LIB__
?> ?>

View File

@@ -8,10 +8,7 @@
// +--------------------------------------------------------------------------+ // +--------------------------------------------------------------------------+
if (!defined('PMA_HTTP_AUTH_INCLUDED')) { /**
define('PMA_HTTP_AUTH_INCLUDED', 1);
/**
* Displays authentication form * Displays authentication form
* *
* @global string the font face to use in case of failure * @global string the font face to use in case of failure
@@ -22,8 +19,8 @@ if (!defined('PMA_HTTP_AUTH_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_auth() function PMA_auth()
{ {
global $right_font_family, $font_size, $font_bigger; global $right_font_family, $font_size, $font_bigger;
header('WWW-Authenticate: Basic realm="phpMyAdmin ' . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'',$GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose']))) . '"'); header('WWW-Authenticate: Basic realm="phpMyAdmin ' . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'',$GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose']))) . '"');
@@ -63,10 +60,10 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
exit(); exit();
return TRUE; return TRUE;
} // end of the 'PMA_auth()' function } // end of the 'PMA_auth()' function
/** /**
* Gets advanced authentication settings * Gets advanced authentication settings
* *
* @global string the username if register_globals is on * @global string the username if register_globals is on
@@ -85,8 +82,8 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
* *
* @access public * @access public
*/ */
function PMA_auth_check() function PMA_auth_check()
{ {
global $PHP_AUTH_USER, $PHP_AUTH_PW; global $PHP_AUTH_USER, $PHP_AUTH_PW;
global $REMOTE_USER, $AUTH_USER, $REMOTE_PASSWORD, $AUTH_PASSWORD; global $REMOTE_USER, $AUTH_USER, $REMOTE_PASSWORD, $AUTH_PASSWORD;
global $HTTP_AUTHORIZATION; global $HTTP_AUTHORIZATION;
@@ -180,10 +177,10 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
} }
return TRUE; return TRUE;
} }
} // end of the 'PMA_auth_check()' function } // end of the 'PMA_auth_check()' function
/** /**
* Set the user and password after last checkings if required * Set the user and password after last checkings if required
* *
* @global array the valid servers settings * @global array the valid servers settings
@@ -196,8 +193,8 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
* *
* @access public * @access public
*/ */
function PMA_auth_set_user() function PMA_auth_set_user()
{ {
global $cfg, $server; global $cfg, $server;
global $PHP_AUTH_USER, $PHP_AUTH_PW; global $PHP_AUTH_USER, $PHP_AUTH_PW;
@@ -219,22 +216,21 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
$cfg['Server']['password'] = $PHP_AUTH_PW; $cfg['Server']['password'] = $PHP_AUTH_PW;
return TRUE; return TRUE;
} // end of the 'PMA_auth_set_user()' function } // end of the 'PMA_auth_set_user()' function
/** /**
* User is not allowed to login to MySQL -> authentication failed * User is not allowed to login to MySQL -> authentication failed
* *
* @return boolean always true (no return indeed) * @return boolean always true (no return indeed)
* *
* @access public * @access public
*/ */
function PMA_auth_fails() function PMA_auth_fails()
{ {
PMA_auth(); PMA_auth();
return TRUE; return TRUE;
} // end of the 'PMA_auth_fails()' function } // end of the 'PMA_auth_fails()' function
} // $__PMA_HTTP_AUTH_LIB__
?> ?>

View File

@@ -7,11 +7,7 @@
*/ */
/**
if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
define('PMA_BOOKMARK_LIB_INCLUDED', 1);
/**
* Defines the bookmark parameters for the current user * Defines the bookmark parameters for the current user
* *
* @return array the bookmark parameters for the current user * @return array the bookmark parameters for the current user
@@ -20,8 +16,8 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_getBookmarksParam() function PMA_getBookmarksParam()
{ {
global $server; global $server;
$cfgBookmark = ''; $cfgBookmark = '';
@@ -36,10 +32,10 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
$cfgBookmark['table'] = $GLOBALS['cfg']['Server']['bookmarktable']; $cfgBookmark['table'] = $GLOBALS['cfg']['Server']['bookmarktable'];
return $cfgBookmark; return $cfgBookmark;
} // end of the 'PMA_getBookmarksParam()' function } // end of the 'PMA_getBookmarksParam()' function
/** /**
* Gets the list of bookmarks defined for the current database * Gets the list of bookmarks defined for the current database
* *
* @param string the current database name * @param string the current database name
@@ -49,8 +45,8 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_listBookmarks($db, $cfgBookmark) function PMA_listBookmarks($db, $cfgBookmark)
{ {
$query = 'SELECT label, id FROM '. PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) $query = 'SELECT label, id FROM '. PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table'])
. ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\''
. ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' . ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\''
@@ -74,10 +70,10 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
else { else {
return FALSE; return FALSE;
} }
} // end of the 'PMA_listBookmarks()' function } // end of the 'PMA_listBookmarks()' function
/** /**
* Gets the sql command from a bookmark * Gets the sql command from a bookmark
* *
* @param string the current database name * @param string the current database name
@@ -89,8 +85,8 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_queryBookmarks($db, $cfgBookmark, $id, $id_field = 'id') function PMA_queryBookmarks($db, $cfgBookmark, $id, $id_field = 'id')
{ {
if (empty($cfgBookmark['db']) || empty($cfgBookmark['table'])) { if (empty($cfgBookmark['db']) || empty($cfgBookmark['table'])) {
return ''; return '';
@@ -109,10 +105,10 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
$bookmark_query = @PMA_mysql_result($result, 0, 'query') OR FALSE; $bookmark_query = @PMA_mysql_result($result, 0, 'query') OR FALSE;
return $bookmark_query; return $bookmark_query;
} // end of the 'PMA_queryBookmarks()' function } // end of the 'PMA_queryBookmarks()' function
/** /**
* Adds a bookmark * Adds a bookmark
* *
* @param array the properties of the bookmark to add * @param array the properties of the bookmark to add
@@ -123,31 +119,31 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_addBookmarks($fields, $cfgBookmark, $all_users = false) function PMA_addBookmarks($fields, $cfgBookmark, $all_users = false)
{ {
$query = 'INSERT INTO ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) $query = 'INSERT INTO ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table'])
. ' (id, dbase, user, query, label) VALUES (\'\', \'' . PMA_sqlAddslashes($fields['dbase']) . '\', \'' . ($all_users ? '' : PMA_sqlAddslashes($fields['user'])) . '\', \'' . PMA_sqlAddslashes(urldecode($fields['query'])) . '\', \'' . PMA_sqlAddslashes($fields['label']) . '\')'; . ' (id, dbase, user, query, label) VALUES (\'\', \'' . PMA_sqlAddslashes($fields['dbase']) . '\', \'' . ($all_users ? '' : PMA_sqlAddslashes($fields['user'])) . '\', \'' . PMA_sqlAddslashes(urldecode($fields['query'])) . '\', \'' . PMA_sqlAddslashes($fields['label']) . '\')';
if (isset($GLOBALS['dbh'])) { if (isset($GLOBALS['dbh'])) {
$result = PMA_mysql_query($query, $GLOBALS['dbh']); $result = PMA_mysql_query($query, $GLOBALS['dbh']);
if (PMA_mysql_error($GLOBALS['dbh'])) { if (PMA_mysql_error($GLOBALS['dbh'])) {
$error = PMA_mysql_error($GLOBALS['dbh']); $error = PMA_mysql_error($GLOBALS['dbh']);
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie($error); PMA_mysqlDie($error);
} }
} else { } else {
$result = PMA_mysql_query($query); $result = PMA_mysql_query($query);
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
$error = PMA_mysql_error(); $error = PMA_mysql_error();
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie($error); PMA_mysqlDie($error);
} }
} }
return TRUE; return TRUE;
} // end of the 'PMA_addBookmarks()' function } // end of the 'PMA_addBookmarks()' function
/** /**
* Deletes a bookmark * Deletes a bookmark
* *
* @param string the current database name * @param string the current database name
@@ -156,8 +152,8 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_deleteBookmarks($db, $cfgBookmark, $id) function PMA_deleteBookmarks($db, $cfgBookmark, $id)
{ {
$query = 'DELETE FROM ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) $query = 'DELETE FROM ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table'])
. ' WHERE (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' . ' WHERE (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\''
. ' OR user = \'\')' . ' OR user = \'\')'
@@ -167,14 +163,12 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
} else { } else {
$result = PMA_mysql_query($query); $result = PMA_mysql_query($query);
} }
} // end of the 'PMA_deleteBookmarks()' function } // end of the 'PMA_deleteBookmarks()' function
/** /**
* Bookmark Support * Bookmark Support
*/ */
$cfg['Bookmark'] = PMA_getBookmarksParam(); $cfg['Bookmark'] = PMA_getBookmarksParam();
} // $__PMA_BOOKMARK_LIB__
?> ?>

View File

@@ -8,27 +8,19 @@
*/ */
if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){ /**
define('PMA_CHARSET_CONVERSION_LIB_INCLUDED', 1);
/**
* Loads the recode or iconv extensions if any of it is not loaded yet * Loads the recode or iconv extensions if any of it is not loaded yet
*/ */
if (isset($cfg['AllowAnywhereRecoding']) if (isset($cfg['AllowAnywhereRecoding'])
&& $cfg['AllowAnywhereRecoding'] && $cfg['AllowAnywhereRecoding']
&& $allow_recoding) { && $allow_recoding) {
// Initializes configuration for default, if not set:
if (!isset($cfg['RecodingEngine'])) {
$cfg['RecodingEngine'] = 'auto';
}
if ($cfg['RecodingEngine'] == 'recode') { if ($cfg['RecodingEngine'] == 'recode') {
if (!@extension_loaded('recode')) { if (!@extension_loaded('recode')) {
PMA_dl('recode'); PMA_dl('recode');
if (!@extension_loaded('recode')) { if (!@extension_loaded('recode')) {
echo $strCantLoadRecodeIconv; echo $strCantLoadRecodeIconv;
exit(); exit;
} }
} }
$PMA_recoding_engine = 'recode'; $PMA_recoding_engine = 'recode';
@@ -37,7 +29,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
PMA_dl('iconv'); PMA_dl('iconv');
if (!@extension_loaded('iconv')) { if (!@extension_loaded('iconv')) {
echo $strCantLoadRecodeIconv; echo $strCantLoadRecodeIconv;
exit(); exit;
} }
} }
$PMA_recoding_engine = 'iconv'; $PMA_recoding_engine = 'iconv';
@@ -52,7 +44,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
PMA_dl('recode'); PMA_dl('recode');
if (!@extension_loaded('recode')) { if (!@extension_loaded('recode')) {
echo $strCantLoadRecodeIconv; echo $strCantLoadRecodeIconv;
exit(); exit;
} else { } else {
$PMA_recoding_engine = 'recode'; $PMA_recoding_engine = 'recode';
} }
@@ -61,19 +53,19 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
} }
} }
} }
} // end load recode/iconv extension } // end load recode/iconv extension
define('PMA_CHARSET_NONE', 0); define('PMA_CHARSET_NONE', 0);
define('PMA_CHARSET_ICONV', 1); define('PMA_CHARSET_ICONV', 1);
define('PMA_CHARSET_LIBICONV', 2); define('PMA_CHARSET_LIBICONV', 2);
define('PMA_CHARSET_RECODE', 3); define('PMA_CHARSET_RECODE', 3);
if (!isset($cfg['IconvExtraParams'])) { if (!isset($cfg['IconvExtraParams'])) {
$cfg['IconvExtraParams'] = ''; $cfg['IconvExtraParams'] = '';
} }
// Finally detects which function will we use: // Finally detects which function will we use:
if (isset($cfg['AllowAnywhereRecoding']) if (isset($cfg['AllowAnywhereRecoding'])
&& $cfg['AllowAnywhereRecoding'] && $cfg['AllowAnywhereRecoding']
&& $allow_recoding) { && $allow_recoding) {
@@ -92,7 +84,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
include('./header.inc.php'); include('./header.inc.php');
} }
echo $strCantUseRecodeIconv; echo $strCantUseRecodeIconv;
include('./footer.inc.php'); require_once('./footer.inc.php');
exit(); exit();
} }
} else if ($PMA_recoding_engine == 'recode') { } else if ($PMA_recoding_engine == 'recode') {
@@ -101,12 +93,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
} else { } else {
$PMA_recoding_engine = PMA_CHARSET_NONE; $PMA_recoding_engine = PMA_CHARSET_NONE;
if (!isset($GLOBALS['is_header_sent'])) { require_once('./header.inc.php');
include('./header.inc.php');
}
echo $strCantUseRecodeIconv; echo $strCantUseRecodeIconv;
include('./footer.inc.php'); require_once('./footer.inc.php');
exit(); exit;
} }
} else { } else {
if (@function_exists('iconv')) { if (@function_exists('iconv')) {
@@ -118,20 +108,18 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
} else { } else {
$PMA_recoding_engine = PMA_CHARSET_NONE; $PMA_recoding_engine = PMA_CHARSET_NONE;
if (!isset($GLOBALS['is_header_sent'])) { require_once('./header.inc.php');
include('./header.inc.php');
}
echo $strCantUseRecodeIconv; echo $strCantUseRecodeIconv;
include('./footer.inc.php'); require_once('./footer.inc.php');
exit(); exit;
} }
} }
} else { } else {
$PMA_recoding_engine = PMA_CHARSET_NONE; $PMA_recoding_engine = PMA_CHARSET_NONE;
} }
/** /**
* Converts encoding according to current settings. * Converts encoding according to current settings.
* *
* @param mixed what to convert (string or array of strings or object returned by mysql_fetch_field) * @param mixed what to convert (string or array of strings or object returned by mysql_fetch_field)
@@ -147,7 +135,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
* *
* @author nijel * @author nijel
*/ */
function PMA_convert_display_charset($what) { function PMA_convert_display_charset($what) {
global $cfg, $allow_recoding, $charset, $convcharset; global $cfg, $allow_recoding, $charset, $convcharset;
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) { if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
@@ -172,13 +160,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
switch ($GLOBALS['PMA_recoding_engine']) { switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE: case PMA_CHARSET_RECODE:
return recode_string($convcharset . '..' . $charset, $what); return recode_string($convcharset . '..' . $charset, $what);
break;
case PMA_CHARSET_ICONV: case PMA_CHARSET_ICONV:
return iconv($convcharset, $charset . $cfg['IconvExtraParams'], $what); return iconv($convcharset, $charset . $cfg['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV: case PMA_CHARSET_LIBICONV:
return libiconv($convcharset, $charset, $what); return libiconv($convcharset, $charset, $what);
break;
default: default:
return $what; return $what;
} }
@@ -200,10 +185,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
// when we don't know what it is we don't touch it... // when we don't know what it is we don't touch it...
return $what; return $what;
} }
} // end of the "PMA_convert_display_charset()" function } // end of the "PMA_convert_display_charset()" function
/** /**
* Converts encoding of text according to current settings. * Converts encoding of text according to current settings.
* *
* @param string what to convert * @param string what to convert
@@ -219,7 +204,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
* *
* @author nijel * @author nijel
*/ */
function PMA_convert_charset($what) { function PMA_convert_charset($what) {
global $cfg, $allow_recoding, $charset, $convcharset; global $cfg, $allow_recoding, $charset, $convcharset;
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) { if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
@@ -228,20 +213,17 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
switch ($GLOBALS['PMA_recoding_engine']) { switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE: case PMA_CHARSET_RECODE:
return recode_string($charset . '..' . $convcharset, $what); return recode_string($charset . '..' . $convcharset, $what);
break;
case PMA_CHARSET_ICONV: case PMA_CHARSET_ICONV:
return iconv($charset, $convcharset . $cfg['IconvExtraParams'], $what); return iconv($charset, $convcharset . $cfg['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV: case PMA_CHARSET_LIBICONV:
return libiconv($charset, $convcharset, $what); return libiconv($charset, $convcharset, $what);
break;
default: default:
return $what; return $what;
} }
} }
} // end of the "PMA_convert_charset()" function } // end of the "PMA_convert_charset()" function
/** /**
* Converts encoding of text according to parameters with detected * Converts encoding of text according to parameters with detected
* conversion function. * conversion function.
* *
@@ -255,24 +237,21 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
* *
* @author nijel * @author nijel
*/ */
function PMA_convert_string($src_charset, $dest_charset, $what) { function PMA_convert_string($src_charset, $dest_charset, $what) {
switch ($GLOBALS['PMA_recoding_engine']) { switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE: case PMA_CHARSET_RECODE:
return recode_string($src_charset . '..' . $dest_charset, $what); return recode_string($src_charset . '..' . $dest_charset, $what);
break;
case PMA_CHARSET_ICONV: case PMA_CHARSET_ICONV:
return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what); return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV: case PMA_CHARSET_LIBICONV:
return libiconv($src_charset, $dest_charset, $what); return libiconv($src_charset, $dest_charset, $what);
break;
default: default:
return $what; return $what;
} }
} // end of the "PMA_convert_string()" function } // end of the "PMA_convert_string()" function
/** /**
* Converts encoding of file according to parameters with detected * Converts encoding of file according to parameters with detected
* conversion function. The old file will be unlinked and new created and * conversion function. The old file will be unlinked and new created and
* its file name is returned. * its file name is returned.
@@ -287,7 +266,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
* *
* @author nijel * @author nijel
*/ */
function PMA_convert_file($src_charset, $dest_charset, $file) { function PMA_convert_file($src_charset, $dest_charset, $file) {
switch ($GLOBALS['PMA_recoding_engine']) { switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE: case PMA_CHARSET_RECODE:
case PMA_CHARSET_ICONV: case PMA_CHARSET_ICONV:
@@ -313,11 +292,9 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
unlink($file); unlink($file);
return $tmpfname; return $tmpfname;
break;
default: default:
return $file; return $file;
} }
} // end of the "PMA_convert_file()" function } // end of the "PMA_convert_file()" function
} // $__PMA_CHARSET_CONVERSION_LIB__
?> ?>

View File

@@ -7,22 +7,16 @@
* Among other things, it contains the advanced authentification work. * Among other things, it contains the advanced authentification work.
*/ */
if (!defined('PMA_COMMON_LIB_INCLUDED')) { /**
define('PMA_COMMON_LIB_INCLUDED', 1);
/**
* Order of sections for common.lib.php: * Order of sections for common.lib.php:
* *
* in PHP3, functions and constants must be physically defined
* before they are referenced
*
* some functions need the constants of libraries/defines.lib.php * some functions need the constants of libraries/defines.lib.php
* and defines_php.lib.php * and defines_mysql.lib.php
* *
* the PMA_setFontSizes() function must be before the call to the * the PMA_setFontSizes() function must be before the call to the
* libraries/auth/cookie.auth.lib.php library * libraries/auth/cookie.auth.lib.php library
* *
* the include of libraries/defines.lib.php must be after the connection * the include of libraries/defines_mysql.lib.php must be after the connection
* to db to get the MySql version * to db to get the MySql version
* *
* the PMA_sqlAddslashes() function must be before the connection to db * the PMA_sqlAddslashes() function must be before the connection to db
@@ -38,8 +32,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
* ... so the required order is: * ... so the required order is:
* *
* - parsing of the configuration file * - parsing of the configuration file
* - first load of the libraries/defines_php.lib.php library (won't get the * - load of the libraries/defines.lib.php library
* MySQL release number)
* - load of mysql extension (if necessary) * - load of mysql extension (if necessary)
* - definition of PMA_sqlAddslashes() * - definition of PMA_sqlAddslashes()
* - definition of PMA_format_sql() * - definition of PMA_format_sql()
@@ -49,57 +42,57 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
* - loading of an authentication library * - loading of an authentication library
* - db connection * - db connection
* - authentication work * - authentication work
* - second load of the libraries/define.lib.php library to get the MySQL * - load of the libraries/defines_mysql.lib.php library to get the MySQL
* release number) * release number
* - other functions, respecting dependencies * - other functions, respecting dependencies
*/ */
/** /**
* Minimum inclusion? (i.e. for the stylesheet builder) * Minimum inclusion? (i.e. for the stylesheet builder)
*/ */
if (!isset($is_minimum_common)) { if (!isset($is_minimum_common)) {
$is_minimum_common = FALSE; $is_minimum_common = FALSE;
} }
/** /**
* Avoids undefined variables * Avoids undefined variables
*/ */
if (!isset($use_backquotes)) { if (!isset($use_backquotes)) {
$use_backquotes = 0; $use_backquotes = 0;
} }
if (!isset($pos)) { if (!isset($pos)) {
$pos = 0; $pos = 0;
} }
/** /**
* Detects the config file we want to load * Detects the config file we want to load
*/ */
if (file_exists('./config.inc.developer.php')) { if (file_exists('./config.inc.developer.php')) {
$cfgfile_to_load = './config.inc.developer.php'; $cfgfile_to_load = './config.inc.developer.php';
} else { } else {
$cfgfile_to_load = './config.inc.php'; $cfgfile_to_load = './config.inc.php';
} }
/** /**
* Parses the configuration file and gets some constants used to define * Parses the configuration file and gets some constants used to define
* versions of phpMyAdmin/php/mysql... * versions of phpMyAdmin/php/mysql...
*/ */
$old_error_reporting = error_reporting(0); $old_error_reporting = error_reporting(0);
include($cfgfile_to_load); include_once($cfgfile_to_load);
// Include failed // Include failed
if (!isset($cfgServers) && !isset($cfg['Servers'])) { if (!isset($cfgServers) && !isset($cfg['Servers'])) {
// Creates fake settings // Creates fake settings
$cfg = array('DefaultLang' => 'en-iso-8859-1', $cfg = array('DefaultLang' => 'en-iso-8859-1',
'AllowAnywhereRecoding' => FALSE); 'AllowAnywhereRecoding' => FALSE);
// Loads the language file // Loads the language file
include('./libraries/select_lang.lib.php'); require_once('./libraries/select_lang.lib.php');
// Sends the Content-Type header // Sends the Content-Type header
header('Content-Type: text/html; charset=' . $charset); header('Content-Type: text/html; charset=' . $charset);
// Displays the error message // Displays the error message
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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; ?>"> <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; ?>">
<head> <head>
@@ -118,58 +111,55 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
<body bgcolor="#ffffff"> <body bgcolor="#ffffff">
<h1>phpMyAdmin - <?php echo $strError; ?></h1> <h1>phpMyAdmin - <?php echo $strError; ?></h1>
<p> <p>
<?php echo $strConfigFileError; ?><br /><br /> <?php echo $strConfigFileError; ?><br /><br />
<a href="config.inc.php" target="_blank">config.inc.php</a> <a href="config.inc.php" target="_blank">config.inc.php</a>
</p> </p>
</body> </body>
</html> </html>
<?php <?php
exit(); exit();
} }
error_reporting($old_error_reporting); error_reporting($old_error_reporting);
unset($old_error_reporting); unset($old_error_reporting, $cfgfile_to_load);
unset($cfgfile_to_load);
/** /**
* Includes compatibility code for older config.inc.php revisions * Includes compatibility code for older config.inc.php revisions
* if necessary * if necessary
*/ */
if (isset($cfg['FileRevision'])) { if (isset($cfg['FileRevision'])) {
// converting revision string into an array // converting revision string into an array
// e.g. "Revision: 2.0" becomes array(2, 0). // e.g. "Revision: 2.0" becomes array(2, 0).
$cfg['FileRevision'] = str_replace('$' . 'Revision: ', '', $cfg['FileRevision']); $cfg['FileRevision'] = str_replace('$' . 'Revision: ', '', $cfg['FileRevision']);
$cfg['FileRevision'] = str_replace(' $', '', $cfg['FileRevision']); $cfg['FileRevision'] = str_replace(' $', '', $cfg['FileRevision']);
$cfg['FileRevision'] = explode('.', $cfg['FileRevision']); $cfg['FileRevision'] = explode('.', $cfg['FileRevision']);
} else { } else {
$cfg['FileRevision'] = array(1, 1); $cfg['FileRevision'] = array(1, 1);
} }
if ($cfg['FileRevision'][0] < 2) { if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 1)) {
include('./libraries/config_import.lib.php'); require_once('./libraries/config_import.lib.php');
} }
/** /**
* Includes the language file if it hasn't been included yet * Includes the language file if it hasn't been included yet
*/ */
if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) { require_once('./libraries/select_lang.lib.php');
include('./libraries/select_lang.lib.php');
}
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* Include MySQL wrappers. * Include MySQL wrappers.
*/ */
include('./libraries/mysql_wrappers.lib.php'); require_once('./libraries/mysql_wrappers.lib.php');
} }
/** /**
* Gets constants that defines the PHP version number. * Gets constants that defines the PHP version number.
* This include must be located physically before any code that needs to * This include must be located physically before any code that needs to
* reference the constants, else PHP 3.0.16 won't be happy. * reference the constants, else PHP 3.0.16 won't be happy.
*/ */
include('./libraries/defines_php.lib.php'); require_once('./libraries/defines.lib.php');
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* Define $is_upload * Define $is_upload
*/ */
@@ -183,65 +173,56 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
/** /**
* Charset conversion. * Charset conversion.
*/ */
include('./libraries/charset_conversion.lib.php'); require_once('./libraries/charset_conversion.lib.php');
} }
/** if ($is_minimum_common == FALSE) {
* Gets constants that defines the MySQL version number.
* This include must be located physically before any code that needs to
* reference the constants, else PHP 3.0.16 won't be happy; and must be
* located after we are connected to db to get the MySql version (see
* below).
*/
include('./libraries/defines.lib.php');
if ($is_minimum_common == FALSE) {
/** /**
* String handling * String handling
*/ */
include('./libraries/string.lib.php'); require_once('./libraries/string.lib.php');
} }
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* SQL Parser data * SQL Parser data
*/ */
include('./libraries/sqlparser.data.php'); require_once('./libraries/sqlparser.data.php');
} }
/** /**
* SQL Parser code * SQL Parser code
*/ */
include('./libraries/sqlparser.lib.php'); require_once('./libraries/sqlparser.lib.php');
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* SQL Validator interface code * SQL Validator interface code
*/ */
include('./libraries/sqlvalidator.lib.php'); require_once('./libraries/sqlvalidator.lib.php');
} }
// If zlib output compression is set in the php configuration file, no // If zlib output compression is set in the php configuration file, no
// output buffering should be run // output buffering should be run
if (@ini_get('zlib.output_compression')) { if (@ini_get('zlib.output_compression')) {
$cfg['OBGzip'] = FALSE; $cfg['OBGzip'] = FALSE;
} }
// disable output-buffering (if set to 'auto') for IE6, else enable it. // disable output-buffering (if set to 'auto') for IE6, else enable it.
if (strtolower($cfg['OBGzip']) == 'auto') { if (strtolower($cfg['OBGzip']) == 'auto') {
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER < 7) { if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER < 7) {
$cfg['OBGzip'] = FALSE; $cfg['OBGzip'] = FALSE;
} else { } else {
$cfg['OBGzip'] = TRUE; $cfg['OBGzip'] = TRUE;
} }
} }
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* Include URL/hidden inputs generating. * Include URL/hidden inputs generating.
*/ */
include('./libraries/url_generating.lib.php'); require_once('./libraries/url_generating.lib.php');
/** /**
* Loads the mysql extensions if it is not loaded yet * Loads the mysql extensions if it is not loaded yet
@@ -253,7 +234,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// check whether mysql is available // check whether mysql is available
if (!@function_exists('mysql_connect')) { if (!@function_exists('mysql_connect')) {
if (empty($is_header_sent)) { if (empty($is_header_sent)) {
include('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
} }
echo $strCantLoadMySQL . '<br />' . "\n" echo $strCantLoadMySQL . '<br />' . "\n"
. '<a href="./Documentation.html#faqmysql" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n"; . '<a href="./Documentation.html#faqmysql" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n";
@@ -435,9 +416,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
{ {
global $cfg, $table, $db, $sql_query; global $cfg, $table, $db, $sql_query;
if (empty($GLOBALS['is_header_sent'])) { require_once('./header.inc.php');
include('./header.inc.php');
}
if (!$error_message) { if (!$error_message) {
$error_message = PMA_mysql_error(); $error_message = PMA_mysql_error();
@@ -510,8 +489,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
echo "\n"; echo "\n";
if ($exit) { if ($exit) {
include('./footer.inc.php'); require_once('./footer.inc.php');
exit();
} }
} // end of the 'PMA_mysqlDie()' function } // end of the 'PMA_mysqlDie()' function
@@ -536,9 +514,9 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
return ($i < $max) ? $i : -1; return ($i < $max) ? $i : -1;
} // end of the 'PMA_isInto()' function } // end of the 'PMA_isInto()' function
} }
/** /**
* Get the complete list of Databases a user can access * Get the complete list of Databases a user can access
* *
* @param boolean whether to include check on failed 'only_db' operations * @param boolean whether to include check on failed 'only_db' operations
@@ -553,7 +531,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* *
* @access private * @access private
*/ */
function PMA_safe_db_list($only_db_check, $dbh, $dblist_cnt, $rs, $userlink, $cfg, $dblist) { function PMA_safe_db_list($only_db_check, $dbh, $dblist_cnt, $rs, $userlink, $cfg, $dblist) {
if ($only_db_check == FALSE) { if ($only_db_check == FALSE) {
// ... first checks whether the "safe_show_database" is on or not // ... first checks whether the "safe_show_database" is on or not
@@ -682,9 +660,9 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
} // end building available dbs from the "mysql" db } // end building available dbs from the "mysql" db
return $dblist; return $dblist;
} }
/** /**
* Determines the font sizes to use depending on the os and browser of the * Determines the font sizes to use depending on the os and browser of the
* user. * user.
* *
@@ -702,8 +680,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* *
* @version 1.1 * @version 1.1
*/ */
function PMA_setFontSizes() function PMA_setFontSizes()
{ {
global $font_size, $font_biggest, $font_bigger, $font_smaller, $font_smallest; global $font_size, $font_biggest, $font_bigger, $font_smaller, $font_smallest;
// IE (<6)/Opera (<7) for win case: needs smaller fonts than anyone else // IE (<6)/Opera (<7) for win case: needs smaller fonts than anyone else
@@ -769,10 +747,10 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
} }
return TRUE; return TRUE;
} // end of the 'PMA_setFontSizes()' function } // end of the 'PMA_setFontSizes()' function
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be * $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be
* set properly and, depending on browsers, inserting or updating a * set properly and, depending on browsers, inserting or updating a
@@ -940,7 +918,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// (for a quick check of path disclosure in auth/cookies:) // (for a quick check of path disclosure in auth/cookies:)
$coming_from_common = TRUE; $coming_from_common = TRUE;
include('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php'); require_once('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php');
if (!PMA_auth_check()) { if (!PMA_auth_check()) {
PMA_auth(); PMA_auth();
} else { } else {
@@ -954,7 +932,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// Look at: "static int check_dir_access(request_rec *r)" // Look at: "static int check_dir_access(request_rec *r)"
// Robbat2 - May 10, 2002 // Robbat2 - May 10, 2002
if (isset($cfg['Server']['AllowDeny']) && isset($cfg['Server']['AllowDeny']['order'])) { if (isset($cfg['Server']['AllowDeny']) && isset($cfg['Server']['AllowDeny']['order'])) {
include('./libraries/ip_allow_deny.lib.php'); require_once('./libraries/ip_allow_deny.lib.php');
$allowDeny_forbidden = FALSE; // default $allowDeny_forbidden = FALSE; // default
if ($cfg['Server']['AllowDeny']['order'] == 'allow,deny') { if ($cfg['Server']['AllowDeny']['order'] == 'allow,deny') {
@@ -1033,9 +1011,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
. $cfg['Server']['controlpass'] . $cfg['Server']['controlpass']
. (empty($client_flags) ? '' : ', FALSE, ' . $client_flags) . (empty($client_flags) ? '' : ', FALSE, ' . $client_flags)
. ')'; . ')';
if (empty($GLOBALS['is_header_sent'])) { require_once('./header.inc.php');
include('./header.inc.php');
}
//PMA_mysqlDie($conn_error, $local_query, FALSE); //PMA_mysqlDie($conn_error, $local_query, FALSE);
PMA_mysqlDie($conn_error, '', FALSE); PMA_mysqlDie($conn_error, '', FALSE);
} // end if } // end if
@@ -1075,9 +1051,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$dbh = $userlink; $dbh = $userlink;
} }
// Runs the "defines.lib.php" for the second time to get the mysql // Gets the mysql release number
// release number require_once('./libraries/defines_mysql.lib.php');
include('./libraries/defines.lib.php');
// if 'only_db' is set for the current user, there is no need to check for // if 'only_db' is set for the current user, there is no need to check for
// available databases in the "mysql" db // available databases in the "mysql" db
@@ -1322,7 +1297,9 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$showtable = PMA_mysql_fetch_array($result); $showtable = PMA_mysql_fetch_array($result);
$num = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); $num = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
if ($num < $cfg['MaxExactCount']) unset($num); if ($num < $cfg['MaxExactCount']) {
unset($num);
}
mysql_free_result($result); mysql_free_result($result);
if (!isset($num)) { if (!isset($num)) {
@@ -1357,14 +1334,14 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
echo "\n"; echo "\n";
$reload_url = './left.php?' . PMA_generate_common_url((isset($GLOBALS['db']) ? $GLOBALS['db'] : ''), '', '&') $reload_url = './left.php?' . PMA_generate_common_url((isset($GLOBALS['db']) ? $GLOBALS['db'] : ''), '', '&')
?> ?>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">
<!-- <!--
if (typeof(window.parent) != 'undefined' if (typeof(window.parent) != 'undefined'
&& typeof(window.parent.frames['nav']) != 'undefined') { && typeof(window.parent.frames['nav']) != 'undefined') {
window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>&hash=' + <?php echo (($cfg['QueryFrame'] && $cfg['QueryFrameJS']) ? 'window.parent.frames[\'queryframe\'].document.hashform.hash.value' : "'" . md5($cfg['PmaAbsoluteUri']) . "'"); ?>); window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>&hash=' + <?php echo (($cfg['QueryFrame'] && $cfg['QueryFrameJS']) ? 'window.parent.frames[\'queryframe\'].document.hashform.hash.value' : "'" . md5($cfg['PmaAbsoluteUri']) . "'"); ?>);
} }
//--> //-->
</script> </script>
<?php <?php
unset($GLOBALS['reload']); unset($GLOBALS['reload']);
} }
@@ -1382,18 +1359,18 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$md5_tbl = md5($GLOBALS['table']); $md5_tbl = md5($GLOBALS['table']);
echo "\n"; echo "\n";
?> ?>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">
<!-- <!--
if (typeof(document.getElementById) != 'undefined' if (typeof(document.getElementById) != 'undefined'
&& typeof(window.parent.frames['nav']) != 'undefined' && typeof(window.parent.frames['nav']) != 'undefined'
&& typeof(window.parent.frames['nav'].document) != 'undefined' && typeof(window.parent.frames['nav'].document) != 'unknown' && typeof(window.parent.frames['nav'].document) != 'undefined' && typeof(window.parent.frames['nav'].document) != 'unknown'
&& (window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>')) && (window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>'))
&& typeof(window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>')) != 'undefined' && typeof(window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>')) != 'undefined'
&& typeof(window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>').title) == 'string') { && typeof(window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>').title) == 'string') {
window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>').title = '<?php echo PMA_jsFormat($tooltip, FALSE); ?>'; window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>').title = '<?php echo PMA_jsFormat($tooltip, FALSE); ?>';
} }
//--> //-->
</script> </script>
<?php <?php
} // end if } // end if
} // end if... else if } // end if... else if
@@ -1416,7 +1393,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
echo "\n"; echo "\n";
?> ?>
<div align="<?php echo $GLOBALS['cell_align_left']; ?>"> <div align="<?php echo $GLOBALS['cell_align_left']; ?>">
<table border="<?php echo $cfg['Border']; ?>" cellpadding="5"> <table border="<?php echo $cfg['Border']; ?>" cellpadding="5">
<tr> <tr>
<td bgcolor="<?php echo $cfg['ThBgcolor']; ?>"> <td bgcolor="<?php echo $cfg['ThBgcolor']; ?>">
@@ -1605,7 +1582,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
echo "\n"; echo "\n";
?> ?>
</table> </table>
</div><br /> </div><br />
<?php <?php
} // end of the 'PMA_showMessage()' function } // end of the 'PMA_showMessage()' function
@@ -1908,7 +1885,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
} }
} }
if ($found_error) { if ($found_error) {
include('./libraries/header_meta_style.inc.php'); require_once('./libraries/header_meta_style.inc.php');
echo '</head><body><p>' . $error_message . '</p></body></html>'; echo '</head><body><p>' . $error_message . '</p></body></html>';
if ($die) { if ($die) {
exit(); exit();
@@ -1921,7 +1898,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
if (@function_exists('mb_convert_encoding') if (@function_exists('mb_convert_encoding')
&& strpos(' ' . $lang, 'ja-') && strpos(' ' . $lang, 'ja-')
&& file_exists('./libraries/kanji-encoding.lib.php')) { && file_exists('./libraries/kanji-encoding.lib.php')) {
include('./libraries/kanji-encoding.lib.php'); require_once('./libraries/kanji-encoding.lib.php');
define('PMA_MULTIBYTE_ENCODING', 1); define('PMA_MULTIBYTE_ENCODING', 1);
} // end if } // end if
@@ -1936,16 +1913,21 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* @author Michal Cihar (nijel@users.sourceforge.net) * @author Michal Cihar (nijel@users.sourceforge.net)
*/ */
function PMA_checkFileExtensions($file, $extension) { function PMA_checkFileExtensions($file, $extension) {
if (substr($file, -1 * strlen($extension)) == $extension) return TRUE; if (substr($file, -1 * strlen($extension)) == $extension) {
return TRUE;
}
if ($GLOBALS['cfg']['GZipDump'] && @function_exists('gzopen')) { if ($GLOBALS['cfg']['GZipDump'] && @function_exists('gzopen')) {
if (substr($file, -3 - strlen($extension)) == $extension . '.gz') return TRUE; if (substr($file, -3 - strlen($extension)) == $extension . '.gz') {
return TRUE;
}
} }
if ($GLOBALS['cfg']['BZipDump'] && @function_exists('bzdecompress')) { if ($GLOBALS['cfg']['BZipDump'] && @function_exists('bzdecompress')) {
if (substr($file, -4 - strlen($extension)) == $extension . '.bz2') return TRUE; if (substr($file, -4 - strlen($extension)) == $extension . '.bz2') {
return TRUE;
}
} }
return FALSE; return FALSE;
} // end function } // end function
} // end if: minimal common.lib needed? } // end if: minimal common.lib needed?
} // $__PMA_COMMON_LIB__
?> ?>

File diff suppressed because it is too large Load Diff

View File

@@ -8,10 +8,7 @@
* May 19, 2002 * May 19, 2002
*/ */
if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) { /**
define('PMA_DB_CONFIG_LIB_INCLUDED', 1);
/**
* Converts attributes of an object to xml code * Converts attributes of an object to xml code
* *
* Original obj2xml() function by <jgettys@gnuvox.com> * Original obj2xml() function by <jgettys@gnuvox.com>
@@ -23,7 +20,7 @@ if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
* *
* @access public * @access public
*/ */
function obj2xml($v, $indent = '') { function obj2xml($v, $indent = '') {
$attr = ''; $attr = '';
foreach($v AS $key => $val) { foreach($v AS $key => $val) {
if (is_string($key) && ($key == '__attr')) { if (is_string($key) && ($key == '__attr')) {
@@ -54,10 +51,10 @@ if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
} }
} }
} // end while } // end while
} // end of the "obj2xml()" function } // end of the "obj2xml()" function
$cfg['DBConfig']['AllowUserOverride'] = array( $cfg['DBConfig']['AllowUserOverride'] = array(
'Servers/*/bookmarkdb', 'Servers/*/bookmarkdb',
'Servers/*/bookmarktable', 'Servers/*/bookmarktable',
'Servers/*/relation', 'Servers/*/relation',
@@ -90,6 +87,6 @@ if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
'ModifyDeleteAtRight', 'ModifyDeleteAtRight',
'DefaultDisplay', 'DefaultDisplay',
'RepeatCells' 'RepeatCells'
); );
} // $__PMA_DB_CONFIG_LIB__ ?>

View File

@@ -16,7 +16,7 @@ if (!isset($is_db) || !$is_db) {
if (!isset($is_transformation_wrapper)) { if (!isset($is_transformation_wrapper)) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
} }
exit(); exit;
} }
} // end if (ensures db exists) } // end if (ensures db exists)
if (!isset($is_table) || !$is_table) { if (!isset($is_table) || !$is_table) {
@@ -29,7 +29,7 @@ if (!isset($is_table) || !$is_table) {
if (!isset($is_transformation_wrapper)) { if (!isset($is_transformation_wrapper)) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
} }
exit(); exit;
} else if (isset($is_table)) { } else if (isset($is_table)) {
mysql_free_result($is_table); mysql_free_result($is_table);
} }

View File

@@ -2,10 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_DBG_PROFILING_INCLUDED')) { if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
define('PMA_DBG_PROFILING_INCLUDED', 1);
if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
&& isset($GLOBALS['cfg']['DBG']['profile']['enable']) && isset($GLOBALS['cfg']['DBG']['profile']['enable'])
&& $GLOBALS['cfg']['DBG']['profile']['enable']) { && $GLOBALS['cfg']['DBG']['profile']['enable']) {
@@ -83,7 +80,6 @@ if (!defined('PMA_DBG_PROFILING_INCLUDED')) {
} }
echo "</tbody></table>"; echo "</tbody></table>";
} }
}
} }
?> ?>

View File

@@ -2,10 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_DBG_SETUP_INCLUDED')) { if (isset($GLOBALS['cfg']['DBG']['enable']) && $GLOBALS['cfg']['DBG']['enable']) {
define('PMA_DBG_SETUP_INCLUDED', 1);
if (isset($GLOBALS['cfg']['DBG']['enable']) && $GLOBALS['cfg']['DBG']['enable']) {
/** /**
* Loads the DBG extension if needed * Loads the DBG extension if needed
*/ */
@@ -15,10 +12,9 @@ if (!defined('PMA_DBG_SETUP_INCLUDED')) {
if (!@extension_loaded('dbg')) { if (!@extension_loaded('dbg')) {
echo sprintf($strCantLoad, 'DBG') . '<br />' . "\n" echo sprintf($strCantLoad, 'DBG') . '<br />' . "\n"
. '<a href="./Documentation.html#faqdbg" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n"; . '<a href="./Documentation.html#faqdbg" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n";
exit(); require_once('./footer.inc.php');
} }
$GLOBALS['DBG'] = true; $GLOBALS['DBG'] = true;
}
} }
?> ?>

View File

@@ -5,54 +5,137 @@
/** /**
* DEFINES VARIABLES & CONSTANTS * DEFINES VARIABLES & CONSTANTS
* Overview: * Overview:
* PMA_MYSQL_INT_VERSION (int) - eg: 32339 instead of 3.23.39 * PMA_VERSION (string) - phpMyAdmin version string
* PMA_PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
* 40006 instead of 4.0.6RC3
* PMA_MYSQL_CLIENT_API (int) - the version number of the MySQL client
* API which php is built against.
* PMA_IS_WINDOWS (bool) - mark if phpMyAdmin running on windows
* server
* PMA_IS_GD2 (bool) - true is GD2 is present
* PMA_USR_OS (string) - the plateform (os) of the user * PMA_USR_OS (string) - the plateform (os) of the user
* PMA_USR_BROWSER_AGENT (string) - the browser of the user * PMA_USR_BROWSER_AGENT (string) - the browser of the user
* PMA_USR_BROWSER_VER (double) - the version of this browser * PMA_USR_BROWSER_VER (double) - the version of this browser
*/ */
// phpMyAdmin release
if (!defined('PMA_VERSION')) {
define('PMA_VERSION', '2.5.5-dev');
}
// MySQL Version // php version
if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) { if (!defined('PMA_PHP_INT_VERSION')) {
if (!empty($server)) { if (!preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match)) {
$result = PMA_mysql_query('SELECT VERSION() AS version'); $result = preg_match('@([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match);
if ($result != FALSE && @mysql_num_rows($result) > 0) {
$row = PMA_mysql_fetch_array($result);
$match = explode('.', $row['version']);
} else {
$result = @PMA_mysql_query('SHOW VARIABLES LIKE \'version\'');
if ($result != FALSE && @mysql_num_rows($result) > 0){
$row = PMA_mysql_fetch_row($result);
$match = explode('.', $row[1]);
}
}
} // end server id is defined case
if (!isset($match) || !isset($match[0])) {
$match[0] = 3;
}
if (!isset($match[1])) {
$match[1] = 21;
} }
if (isset($match) && !empty($match[1])) {
if (!isset($match[2])) { if (!isset($match[2])) {
$match[2] = 0; $match[2] = 0;
} }
if (!isset($match[3])) {
if(!isset($row)) { $match[3] = 0;
$row['version'] = '3.21.0';
} }
define('PMA_PHP_INT_VERSION', (int)sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
define('PMA_MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
define('PMA_MYSQL_STR_VERSION', $row['version']);
unset($match); unset($match);
} else {
define('PMA_PHP_INT_VERSION', 0);
}
define('PMA_PHP_STR_VERSION', phpversion());
} }
// MySQL client API
if (!defined('PMA_MYSQL_CLIENT_API')) {
$client_api = explode('.', mysql_get_client_info());
define('PMA_MYSQL_CLIENT_API', (int)sprintf('%d%02d%02d', $client_api[0], $client_api[1], intval($client_api[2])));
unset($client_api);
}
// Whether the os php is running on is windows or not
if (!defined('PMA_IS_WINDOWS')) {
if (defined('PHP_OS') && stristr(PHP_OS, 'win')) {
define('PMA_IS_WINDOWS', 1);
} else {
define('PMA_IS_WINDOWS', 0);
}
}
function PMA_dl($module) {
if (!isset($GLOBALS['PMA_dl_allowed'])) {
if (!@ini_get('safe_mode') && @ini_get('enable_dl') && @function_exists('dl')) {
ob_start();
phpinfo(INFO_GENERAL); /* Only general info */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@Thread Safety[[:space:]]*enabled@', $a)) {
if (preg_match('@Server API[[:space:]]*\(CGI\|CLI\)@', $a)) {
$GLOBALS['PMA_dl_allowed'] = TRUE;
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = TRUE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
}
if (PMA_IS_WINDOWS) {
$suffix = '.dll';
} else {
$suffix = '.so';
}
if ($GLOBALS['PMA_dl_allowed']) {
return @dl($module . $suffix);
} else {
return FALSE;
}
}
// Whether GD2 is present
if (!defined('PMA_IS_GD2')) {
if ($cfg['GD2Available'] == 'yes') {
define('PMA_IS_GD2', 1);
} elseif ($cfg['GD2Available'] == 'no') {
define('PMA_IS_GD2', 0);
} else {
if (!@extension_loaded('gd')) {
PMA_dl('gd');
}
if (!@function_exists('imagecreatetruecolor')) {
define('PMA_IS_GD2', 0);
} else {
if (@function_exists('gd_info')) {
$gd_nfo = gd_info();
if (strstr($gd_nfo["GD Version"], '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
/* We must do hard way... */
ob_start();
phpinfo(INFO_MODULES); /* Only modules */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@GD Version[[:space:]]*\(.*\)@', $a, $v)) {
if (strstr($v, '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
define('PMA_IS_GD2', 0);
}
}
}
}
}
// Determines platform (OS), browser and version of the user // Determines platform (OS), browser and version of the user
// Based on a phpBuilder article: // Based on a phpBuilder article:
// see http://www.phpbuilder.net/columns/tim20000821.php // see http://www.phpbuilder.net/columns/tim20000821.php
if (!defined('PMA_USR_OS')) { if (!defined('PMA_USR_OS')) {
// loic1 - 2001/25/11: use the new globals arrays defined with
// php 4.1+
if (!empty($_SERVER['HTTP_USER_AGENT'])) { if (!empty($_SERVER['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
} else if (!isset($HTTP_USER_AGENT)) { } else if (!isset($HTTP_USER_AGENT)) {
@@ -103,5 +186,6 @@ if (!defined('PMA_USR_OS')) {
define('PMA_USR_BROWSER_VER', 0); define('PMA_USR_BROWSER_VER', 0);
define('PMA_USR_BROWSER_AGENT', 'OTHER'); define('PMA_USR_BROWSER_AGENT', 'OTHER');
} }
} // $__PMA_DEFINES_LIB__ }
?> ?>

View File

@@ -0,0 +1,40 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* DEFINES MYSQL RELATED VARIABLES & CONSTANTS
* Overview:
* PMA_MYSQL_INT_VERSION (int) - eg: 32339 instead of 3.23.39
*/
if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) {
if (!empty($server)) {
$result = PMA_mysql_query('SELECT VERSION() AS version', $userlink);
if ($result != FALSE && @mysql_num_rows($result) > 0) {
$row = PMA_mysql_fetch_array($result);
$match = explode('.', $row['version']);
mysql_free_result($result);
}
} // end server id is defined case
if (!isset($match) || !isset($match[0])) {
$match[0] = 3;
}
if (!isset($match[1])) {
$match[1] = 23;
}
if (!isset($match[2])) {
$match[2] = 32;
}
if(!isset($row)) {
$row['version'] = '3.23.32';
}
define('PMA_MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
define('PMA_MYSQL_STR_VERSION', $row['version']);
unset($result, $row, $match);
}
?>

View File

@@ -1,132 +0,0 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* DEFINES VARIABLES & CONSTANTS
* Overview:
* PMA_VERSION (string) - phpMyAdmin version string
* PMA_PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
* 40006 instead of 4.0.6RC3
* PMA_MYSQL_CLIENT_API (int) - the version number of the MySQL client
* API which php is built against.
* PMA_IS_WINDOWS (bool) - mark if phpMyAdmin running on windows
* server
* PMA_IS_GD2 (bool) - true is GD2 is present
*/
// phpMyAdmin release
if (!defined('PMA_VERSION')) {
define('PMA_VERSION', '2.5.5-dev');
}
// php version
if (!defined('PMA_PHP_INT_VERSION')) {
if (!preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match)) {
$result = preg_match('@([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match);
}
if (isset($match) && !empty($match[1])) {
if (!isset($match[2])) {
$match[2] = 0;
}
if (!isset($match[3])) {
$match[3] = 0;
}
define('PMA_PHP_INT_VERSION', (int)sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
unset($match);
} else {
define('PMA_PHP_INT_VERSION', 0);
}
define('PMA_PHP_STR_VERSION', phpversion());
}
// MySQL client API
if (!defined('PMA_MYSQL_CLIENT_API')) {
$client_api = explode('.', mysql_get_client_info());
define('PMA_MYSQL_CLIENT_API', (int)sprintf('%d%02d%02d', $client_api[0], $client_api[1], intval($client_api[2])));
unset($client_api);
}
// Whether the os php is running on is windows or not
if (!defined('PMA_IS_WINDOWS')) {
if (defined('PHP_OS') && stristr(PHP_OS, 'win')) {
define('PMA_IS_WINDOWS', 1);
} else {
define('PMA_IS_WINDOWS', 0);
}
}
function PMA_dl($module) {
if (!isset($GLOBALS['PMA_dl_allowed'])) {
if (!@ini_get('safe_mode') && @ini_get('enable_dl') && @function_exists('dl')) {
ob_start();
phpinfo(INFO_GENERAL); /* Only general info */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@Thread Safety[[:space:]]*enabled@', $a)) {
if (preg_match('@Server API[[:space:]]*\(CGI\|CLI\)@', $a)) {
$GLOBALS['PMA_dl_allowed'] = TRUE;
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = TRUE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
}
if (PMA_IS_WINDOWS) {
$suffix = '.dll';
} else {
$suffix = '.so';
}
if ($GLOBALS['PMA_dl_allowed']) {
return @dl($module . $suffix);
} else {
return FALSE;
}
}
// Whether GD2 is present
if (!defined('PMA_IS_GD2')) {
if ($cfg['GD2Available'] == 'yes') {
define('PMA_IS_GD2', 1);
} elseif ($cfg['GD2Available'] == 'no') {
define('PMA_IS_GD2', 0);
} else {
if (!@extension_loaded('gd')) {
PMA_dl('gd');
}
if (!@function_exists('imagecreatetruecolor')) {
define('PMA_IS_GD2', 0);
} else {
if (@function_exists('gd_info')) {
$gd_nfo = gd_info();
if (strstr($gd_nfo["GD Version"], '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
/* We must do hard way... */
ob_start();
phpinfo(INFO_MODULES); /* Only modules */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@GD Version[[:space:]]*\(.*\)@', $a, $v)) {
if (strstr($v, '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
define('PMA_IS_GD2', 0);
}
}
}
}
}
// $__PMA_DEFINES_PHP_LIB__
?>

View File

@@ -3,7 +3,7 @@
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
// Get relations & co. status // Get relations & co. status
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
function PMA_exportCheckboxCheck($str) { function PMA_exportCheckboxCheck($str) {

View File

@@ -6,10 +6,7 @@
* Set of functions used to display the records returned by a sql query * Set of functions used to display the records returned by a sql query
*/ */
if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { /**
define('PMA_DISPLAY_TBL_LIB_INCLUDED', 1);
/**
* Defines the display mode to use for the results of a sql query * Defines the display mode to use for the results of a sql query
* *
* It uses a synthetic string that contains all the required informations. * It uses a synthetic string that contains all the required informations.
@@ -48,8 +45,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
* *
* @see PMA_displayTable() * @see PMA_displayTable()
*/ */
function PMA_setDisplayMode(&$the_disp_mode, &$the_total) function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
{ {
global $db, $table; global $db, $table;
global $unlim_num_rows, $fields_meta; global $unlim_num_rows, $fields_meta;
global $err_url; global $err_url;
@@ -170,10 +167,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
$the_disp_mode = join('', $do_display); $the_disp_mode = join('', $do_display);
return $do_display; return $do_display;
} // end of the 'PMA_setDisplayMode()' function } // end of the 'PMA_setDisplayMode()' function
/** /**
* Displays a navigation bar to browse among the results of a sql query * Displays a navigation bar to browse among the results of a sql query
* *
* @param integer the offset for the "next" page * @param integer the offset for the "next" page
@@ -201,8 +198,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
* *
* @see PMA_displayTable() * @see PMA_displayTable()
*/ */
function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query) function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query)
{ {
global $lang, $convcharset, $server, $db, $table; global $lang, $convcharset, $server, $db, $table;
global $goto; global $goto;
global $num_rows, $unlim_num_rows, $pos, $session_max_rows; global $num_rows, $unlim_num_rows, $pos, $session_max_rows;
@@ -229,7 +226,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
$title2 = ''; $title2 = '';
} // end if... else... } // end if... else...
?> ?>
<td> <td>
<form action="sql.php" method="post"> <form action="sql.php" method="post">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
@@ -241,8 +238,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> /> <input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
</form> </form>
</td> </td>
<td> <td>
<form action="sql.php" method="post"> <form action="sql.php" method="post">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
@@ -254,15 +251,15 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> /> <input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
</form> </form>
</td> </td>
<?php <?php
} // end move back } // end move back
echo "\n"; echo "\n";
?> ?>
<td> <td>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</td> </td>
<td align="center"> <td align="center">
<form action="sql.php" method="post" <form action="sql.php" method="post"
onsubmit="return (checkFormElementInRange(this, 'session_max_rows', 1) && checkFormElementInRange(this, 'pos', 0, <?php echo $unlim_num_rows - 1; ?>))"> onsubmit="return (checkFormElementInRange(this, 'session_max_rows', 1) && checkFormElementInRange(this, 'pos', 0, <?php echo $unlim_num_rows - 1; ?>))">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
@@ -287,10 +284,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n"; echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
?> ?>
</form> </form>
</td> </td>
<td> <td>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</td> </td>
<?php <?php
// Move to the next page or to the last one // Move to the next page or to the last one
if (($pos + $session_max_rows < $unlim_num_rows) && $num_rows >= $session_max_rows if (($pos + $session_max_rows < $unlim_num_rows) && $num_rows >= $session_max_rows
@@ -309,7 +306,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
} // end if... else... } // end if... else...
echo "\n"; echo "\n";
?> ?>
<td> <td>
<form action="sql.php" method="post"> <form action="sql.php" method="post">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
@@ -321,8 +318,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> /> <input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
</form> </form>
</td> </td>
<td> <td>
<form action="sql.php" method="post" <form action="sql.php" method="post"
onsubmit="return <?php echo (($pos + $session_max_rows < $unlim_num_rows && $num_rows >= $session_max_rows) ? 'true' : 'false'); ?>"> onsubmit="return <?php echo (($pos + $session_max_rows < $unlim_num_rows && $num_rows >= $session_max_rows) ? 'true' : 'false'); ?>">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
@@ -335,7 +332,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> /> <input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> />
</form> </form>
</td> </td>
<?php <?php
} // end move toward } // end move toward
@@ -385,10 +382,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) { if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) {
echo "\n"; echo "\n";
?> ?>
<td> <td>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</td> </td>
<td> <td>
<form action="sql.php" method="post"> <form action="sql.php" method="post">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
@@ -400,7 +397,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" /> <input type="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" />
</form> </form>
</td> </td>
<?php <?php
} // end show all } // end show all
echo "\n"; echo "\n";
@@ -409,10 +406,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
</table> </table>
<?php <?php
} // end of the 'PMA_displayTableNavigation()' function } // end of the 'PMA_displayTableNavigation()' function
/** /**
* Displays the headers of the results table * Displays the headers of the results table
* *
* @param array which elements to display * @param array which elements to display
@@ -443,8 +440,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
* *
* @see PMA_displayTable() * @see PMA_displayTable()
*/ */
function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $analyzed_sql = '') function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $analyzed_sql = '')
{ {
global $lang, $convcharset, $server, $db, $table; global $lang, $convcharset, $server, $db, $table;
global $goto; global $goto;
global $sql_query, $num_rows, $pos, $session_max_rows; global $sql_query, $num_rows, $pos, $session_max_rows;
@@ -533,7 +530,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
?> ?>
<tr> <tr>
<td colspan="<?php echo $span; ?>" align="center"> <td colspan="<?php echo $span; ?>" align="center">
<?php <?php
echo '<form action="sql.php" method="POST">' . "\n"; echo '<form action="sql.php" method="POST">' . "\n";
echo PMA_generate_common_hidden_inputs($db, $table, 5); echo PMA_generate_common_hidden_inputs($db, $table, 5);
@@ -569,7 +566,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
echo '</form>'; echo '</form>';
echo "\n"; echo "\n";
?> ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
@@ -628,10 +625,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0; $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
?> ?>
<td colspan="<?php echo $fields_cnt; ?>" align="center"> <td colspan="<?php echo $fields_cnt; ?>" align="center">
<a href="<?php echo $text_url; ?>"> <a href="<?php echo $text_url; ?>">
<img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a> <img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -641,10 +638,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td colspan="<?php echo $num_rows + floor($num_rows/$repeat_cells) + 1; ?>" align="center"> <td colspan="<?php echo $num_rows + floor($num_rows/$repeat_cells) + 1; ?>" align="center">
<a href="<?php echo $text_url; ?>"> <a href="<?php echo $text_url; ?>">
<img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a> <img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a>
</td> </td>
</tr> </tr>
<?php <?php
} // end vertical mode } // end vertical mode
@@ -657,10 +654,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n"; echo "\n";
?> ?>
<td<?php echo $colspan; ?> align="center"> <td<?php echo $colspan; ?> align="center">
<a href="<?php echo $text_url; ?>"> <a href="<?php echo $text_url; ?>">
<img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a> <img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a>
</td> </td>
<?php <?php
} // end horizontal/horizontalflipped mode } // end horizontal/horizontalflipped mode
else { else {
@@ -678,7 +675,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n"; echo "\n";
?> ?>
<td<?php echo $colspan; ?>></td> <td<?php echo $colspan; ?>></td>
<?php <?php
echo "\n"; echo "\n";
} // end horizontal/horizontalfipped mode } // end horizontal/horizontalfipped mode
@@ -700,7 +697,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
} }
if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) { if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$GLOBALS['mime_map'] = PMA_getMIME($db, $table); $GLOBALS['mime_map'] = PMA_getMIME($db, $table);
} }
@@ -816,12 +813,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n"; echo "\n";
?> ?>
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?>> <th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?>>
<?php echo $comments_table_wrap_pre; ?> <?php echo $comments_table_wrap_pre; ?>
<a href="sql.php?<?php echo $url_query; ?>" <?php echo (($disp_direction == 'horizontalflipped' AND $GLOBALS['cfg']['HeaderFlipType'] == 'css') ? 'style="direction: ltr; writing-mode: tb-rl;"' : '') . ' title="' . $GLOBALS['strSort'] . '"'; ?>> <a href="sql.php?<?php echo $url_query; ?>" <?php echo (($disp_direction == 'horizontalflipped' AND $GLOBALS['cfg']['HeaderFlipType'] == 'css') ? 'style="direction: ltr; writing-mode: tb-rl;"' : '') . ' title="' . $GLOBALS['strSort'] . '"'; ?>>
<?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake' ? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)); ?> </a><?php echo $order_img . "\n"; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake' ? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)); ?> </a><?php echo $order_img . "\n"; ?>
<?php echo $comments_table_wrap_post; ?> <?php echo $comments_table_wrap_post; ?>
</th> </th>
<?php <?php
} }
$vertical_display['desc'][] = ' <th ' . $column_style . '>' . "\n" $vertical_display['desc'][] = ' <th ' . $column_style . '>' . "\n"
@@ -837,11 +834,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n"; echo "\n";
?> ?>
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'css' ? 'style="direction: ltr; writing-mode: tb-rl;"' : ''); ?>> <th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'css' ? 'style="direction: ltr; writing-mode: tb-rl;"' : ''); ?>>
<?php echo $comments_table_wrap_pre; ?> <?php echo $comments_table_wrap_pre; ?>
<?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?>
<?php echo $comments_table_wrap_post; ?> <?php echo $comments_table_wrap_post; ?>
</th> </th>
<?php <?php
} }
$vertical_display['desc'][] = ' <th ' . $column_style . '>' . "\n" $vertical_display['desc'][] = ' <th ' . $column_style . '>' . "\n"
@@ -861,10 +858,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n"; echo "\n";
?> ?>
<td<?php echo $colspan; ?> align="center"> <td<?php echo $colspan; ?> align="center">
<a href="<?php echo $text_url; ?>"> <a href="<?php echo $text_url; ?>">
<img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a> <img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" title="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a>
</td> </td>
<?php <?php
} // end horizontal/horizontalflipped mode } // end horizontal/horizontalflipped mode
else { else {
@@ -884,7 +881,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n"; echo "\n";
?> ?>
<td<?php echo $colspan; ?>></td> <td<?php echo $colspan; ?>></td>
<?php <?php
} // end horizontal/horizontalflipped mode } // end horizontal/horizontalflipped mode
else { else {
@@ -901,11 +898,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
echo "\n"; echo "\n";
return TRUE; return TRUE;
} // end of the 'PMA_displayTableHeaders()' function } // end of the 'PMA_displayTableHeaders()' function
/** /**
* Displays the body of the results table * Displays the body of the results table
* *
* @param integer the link id associated to the query which results have * @param integer the link id associated to the query which results have
@@ -938,8 +935,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
* *
* @see PMA_displayTable() * @see PMA_displayTable()
*/ */
function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
{ {
global $lang, $convcharset, $server, $db, $table; global $lang, $convcharset, $server, $db, $table;
global $goto; global $goto;
global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt; global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt;
@@ -1208,7 +1205,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
// 1.3 Displays the links at left if required // 1.3 Displays the links at left if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) { && ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
include('./libraries/display_tbl_links.lib.php'); require('./libraries/display_tbl_links.lib.php');
} // end if (1.3) } // end if (1.3)
echo (($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') ? "\n" : ''); echo (($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') ? "\n" : '');
} // end if (1) } // end if (1)
@@ -1242,7 +1239,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if (file_exists('./libraries/transformations/' . $include_file)) { if (file_exists('./libraries/transformations/' . $include_file)) {
$transformfunction_name = preg_replace('@(\.inc\.php3?)$@i', '', $GLOBALS['mime_map'][$meta->name]['transformation']); $transformfunction_name = preg_replace('@(\.inc\.php3?)$@i', '', $GLOBALS['mime_map'][$meta->name]['transformation']);
include('./libraries/transformations/' . $include_file); require_once('./libraries/transformations/' . $include_file);
if (defined('PMA_TRANSFORMATION_' . strtoupper($transformfunction_name)) && function_exists('PMA_transformation_' . $transformfunction_name)) { if (defined('PMA_TRANSFORMATION_' . strtoupper($transformfunction_name)) && function_exists('PMA_transformation_' . $transformfunction_name)) {
$transform_function = 'PMA_transformation_' . $transformfunction_name; $transform_function = 'PMA_transformation_' . $transformfunction_name;
@@ -1470,7 +1467,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
// 3. Displays the modify/delete links on the right if required // 3. Displays the modify/delete links on the right if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight'] if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) { && ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
include('./libraries/display_tbl_links.lib.php'); require('./libraries/display_tbl_links.lib.php');
} // end if (3) } // end if (3)
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
@@ -1523,10 +1520,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
} }
return TRUE; return TRUE;
} // end of the 'PMA_displayTableBody()' function } // end of the 'PMA_displayTableBody()' function
/** /**
* Do display the result table with the vertical direction mode. * Do display the result table with the vertical direction mode.
* Credits for this feature goes to Garvin Hicking <hicking@faktor-e.de>. * Credits for this feature goes to Garvin Hicking <hicking@faktor-e.de>.
* *
@@ -1539,8 +1536,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
* *
* @see PMA_displayTable() * @see PMA_displayTable()
*/ */
function PMA_displayVerticalTable() function PMA_displayVerticalTable()
{ {
global $vertical_display, $repeat_cells; global $vertical_display, $repeat_cells;
// Displays "multi row delete" link at top if required // Displays "multi row delete" link at top if required
@@ -1686,10 +1683,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
} }
return TRUE; return TRUE;
} // end of the 'PMA_displayVerticalTable' function } // end of the 'PMA_displayVerticalTable' function
/** /**
* Displays a table of results returned by a sql query. * Displays a table of results returned by a sql query.
* This function is called by the "sql.php" script. * This function is called by the "sql.php" script.
* *
@@ -1726,8 +1723,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
* PMA_displayTableNavigation(), PMA_displayTableHeaders(), * PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody() * PMA_displayTableBody()
*/ */
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
{ {
global $lang, $server, $cfg, $db, $table; global $lang, $server, $cfg, $db, $table;
global $goto; global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt; global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
@@ -1890,14 +1887,13 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
} else if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { } else if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
echo "\n" . '<br /><br />' . "\n"; echo "\n" . '<br /><br />' . "\n";
} }
} // end of the 'PMA_displayTable()' function } // end of the 'PMA_displayTable()' function
function default_function($buffer) { function default_function($buffer) {
$buffer = htmlspecialchars($buffer); $buffer = htmlspecialchars($buffer);
$buffer = str_replace("\011", ' &nbsp;&nbsp;&nbsp;', str_replace(' ', ' &nbsp;', $buffer)); $buffer = str_replace("\011", ' &nbsp;&nbsp;&nbsp;', str_replace(' ', ' &nbsp;', $buffer));
$buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '<br />', $buffer); $buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '<br />', $buffer);
return $buffer; return $buffer;
} }
} // $__PMA_DISPLAY_TBL_LIB__
?> ?>

View File

@@ -2,20 +2,20 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!empty($del_url)) { if (!empty($del_url)) {
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"; echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
echo ' <input type="checkbox" name="rows_to_delete[]" value="' . $del_query . '" />' . "\n"; . ' <input type="checkbox" name="rows_to_delete[]" value="' . $del_query . '" />' . "\n"
echo ' </td>' . "\n"; . ' </td>' . "\n";
} }
if (!empty($edit_url)) { if (!empty($edit_url)) {
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"; echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
echo PMA_linkOrButton($edit_url, $edit_str, ''); . PMA_linkOrButton($edit_url, $edit_str, '')
echo $bookmark_go; . $bookmark_go
echo ' </td>' . "\n"; . ' </td>' . "\n";
} }
if (!empty($del_url)) { if (!empty($del_url)) {
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"; echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : '')); . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''))
echo ' </td>' . "\n"; . ' </td>' . "\n";
} }
?> ?>

View File

@@ -8,14 +8,11 @@
* Thanks to <markus@noga.de> * Thanks to <markus@noga.de>
*/ */
// lem9
//if (!defined('PMA_GET_FOREIGN_LIB_INCLUDED')) {
// define('PMA_GET_FOREIGN_LIB_INCLUDED', 1);
// lem9: we always show the foreign field in the drop-down; if a display // lem9: we always show the foreign field in the drop-down; if a display
// field is defined, we show it besides the foreign field // field is defined, we show it besides the foreign field
$foreign_link = false; $foreign_link = false;
if ($foreigners && isset($foreigners[$field])) { if ($foreigners && isset($foreigners[$field])) {
$foreigner = $foreigners[$field]; $foreigner = $foreigners[$field];
$foreign_db = $foreigner['foreign_db']; $foreign_db = $foreigner['foreign_db'];
$foreign_table = $foreigner['foreign_table']; $foreign_table = $foreigner['foreign_table'];
@@ -45,7 +42,6 @@
unset($disp); unset($disp);
$foreign_link = true; $foreign_link = true;
} }
} // end if $foreigners } // end if $foreigners
//} // $__PMA_GET_FOREIGN_LIB_INCLUDED__
?> ?>

View File

@@ -5,15 +5,14 @@
/** /**
* This library grabs the names and values of the variables sent or posted to a * This library grabs the names and values of the variables sent or posted to a
* script in the '$HTTP_*_VARS' / $_* arrays and sets simple globals variables * script in the $_* arrays and sets simple globals variables from them. It does
* from them. It does the same work for the $PHP_SELF variable. * the same work for the $PHP_SELF, $HTTP_ACCEPT_LANGUAGE and
* $HTTP_AUTHORIZATION variables.
* *
* loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+ * loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
*/ */
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
define('PMA_GRAB_GLOBALS_INCLUDED', 1);
function PMA_gpc_extract($array, &$target) { function PMA_gpc_extract($array, &$target) {
if (!is_array($array)) { if (!is_array($array)) {
return FALSE; return FALSE;
} }
@@ -32,39 +31,38 @@ if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
} }
} }
return TRUE; return TRUE;
} }
if (!empty($_GET)) { if (!empty($_GET)) {
PMA_gpc_extract($_GET, $GLOBALS); PMA_gpc_extract($_GET, $GLOBALS);
} // end if } // end if
if (!empty($_POST)) { if (!empty($_POST)) {
PMA_gpc_extract($_POST, $GLOBALS); PMA_gpc_extract($_POST, $GLOBALS);
} // end if } // end if
if (!empty($_FILES)) { if (!empty($_FILES)) {
foreach($_FILES AS $name => $value) { foreach($_FILES AS $name => $value) {
$$name = $value['tmp_name']; $$name = $value['tmp_name'];
${$name . '_name'} = $value['name']; ${$name . '_name'} = $value['name'];
} }
} // end if } // end if
if (!empty($_SERVER)) { if (!empty($_SERVER)) {
if (isset($_SERVER['PHP_SELF'])) { $server_vars = array('PHP_SELF', 'HTTP_ACCEPT_LANGUAGE', 'HTTP_AUTHORIZATION');
$PHP_SELF = $_SERVER['PHP_SELF']; foreach ($server_vars as $current) {
if (isset($_SERVER[$current])) {
$$current = $_SERVER[$current];
} elseif (!isset($$current)) {
$$current = '';
} }
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
} }
if (isset($_SERVER['HTTP_AUTHORIZATION'])) { unset($server_vars, $current);
$HTTP_AUTHORIZATION = $_SERVER['HTTP_AUTHORIZATION']; } // end if
}
} // end if
// Security fix: disallow accessing serious server files via "?goto=" // Security fix: disallow accessing serious server files via "?goto="
if (isset($goto) && strpos(' ' . $goto, '/') > 0 && substr($goto, 0, 2) != './') { if (isset($goto) && strpos(' ' . $goto, '/') > 0 && substr($goto, 0, 2) != './') {
unset($goto); unset($goto);
} // end if } // end if
} // $__PMA_GRAB_GLOBALS_LIB__
?> ?>

View File

@@ -8,18 +8,15 @@
*/ */
if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) { /**
define('PMA_ALLOW_DENY_LIB_INCLUDED', 1);
/**
* Gets the "true" IP address of the current user * Gets the "true" IP address of the current user
* *
* @return string the ip of the user * @return string the ip of the user
* *
* @access private * @access private
*/ */
function PMA_getIp() function PMA_getIp()
{ {
global $REMOTE_ADDR; global $REMOTE_ADDR;
global $HTTP_X_FORWARDED_FOR, $HTTP_X_FORWARDED, $HTTP_FORWARDED_FOR, $HTTP_FORWARDED; global $HTTP_X_FORWARDED_FOR, $HTTP_X_FORWARDED, $HTTP_FORWARDED_FOR, $HTTP_FORWARDED;
global $HTTP_VIA, $HTTP_X_COMING_FROM, $HTTP_COMING_FROM; global $HTTP_VIA, $HTTP_X_COMING_FROM, $HTTP_COMING_FROM;
@@ -152,10 +149,10 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
return FALSE; return FALSE;
} }
} // end if... else... } // end if... else...
} // end of the 'PMA_getIp()' function } // end of the 'PMA_getIp()' function
/** /**
* Based on IP Pattern Matcher * Based on IP Pattern Matcher
* Originally by J.Adams <jna@retina.net> * Originally by J.Adams <jna@retina.net>
* Found on <http://www.php.net/manual/en/function.ip2long.php> * Found on <http://www.php.net/manual/en/function.ip2long.php>
@@ -176,8 +173,8 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_ipMaskTest($testRange, $ipToTest) function PMA_ipMaskTest($testRange, $ipToTest)
{ {
$result = TRUE; $result = TRUE;
if (preg_match('|([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/([0-9]+)|', $testRange, $regs)) { if (preg_match('|([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/([0-9]+)|', $testRange, $regs)) {
@@ -219,10 +216,10 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
} //end if/else } //end if/else
return $result; return $result;
} // end of the "PMA_IPMaskTest()" function } // end of the "PMA_IPMaskTest()" function
/** /**
* Runs through IP Allow/Deny rules the use of it below for more information * Runs through IP Allow/Deny rules the use of it below for more information
* *
* @param string 'allow' | 'deny' type of rule to match * @param string 'allow' | 'deny' type of rule to match
@@ -233,8 +230,8 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
* *
* @see PMA_getIp() * @see PMA_getIp()
*/ */
function PMA_allowDeny($type) function PMA_allowDeny($type)
{ {
global $cfg; global $cfg;
// Grabs true IP of the user and returns if it can't be found // Grabs true IP of the user and returns if it can't be found
@@ -292,7 +289,6 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
} // end while } // end while
return FALSE; return FALSE;
} // end of the "PMA_AllowDeny()" function } // end of the "PMA_AllowDeny()" function
} // $__PMA_ALLOW_DENY_LIB__
?> ?>

View File

@@ -12,10 +12,8 @@
* *
* 2002/2/22 - by Yukihiro Kawada <kawada@den.fujifilm.co.jp> * 2002/2/22 - by Yukihiro Kawada <kawada@den.fujifilm.co.jp>
*/ */
if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
define('PMA_ENCODING_LIB_INCLUDED', 1);
/** /**
* Gets the php internal encoding codes and sets the available encoding * Gets the php internal encoding codes and sets the available encoding
* codes list * codes list
* 2002/1/4 by Y.Kawada * 2002/1/4 by Y.Kawada
@@ -25,7 +23,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
* *
* @return boolean always true * @return boolean always true
*/ */
function PMA_internal_enc_check() { function PMA_internal_enc_check() {
global $internal_enc, $enc_list; global $internal_enc, $enc_list;
$internal_enc = mb_internal_encoding(); $internal_enc = mb_internal_encoding();
@@ -36,10 +34,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
} }
return TRUE; return TRUE;
} // end of the 'PMA_internal_enc_check' function } // end of the 'PMA_internal_enc_check' function
/** /**
* Reverses SJIS & EUC-JP position in the encoding codes list * Reverses SJIS & EUC-JP position in the encoding codes list
* 2002/1/4 by Y.Kawada * 2002/1/4 by Y.Kawada
* *
@@ -47,7 +45,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
* *
* @return boolean always true * @return boolean always true
*/ */
function PMA_change_enc_order() { function PMA_change_enc_order() {
global $enc_list; global $enc_list;
$p = explode(',', $enc_list); $p = explode(',', $enc_list);
@@ -58,10 +56,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
} }
return TRUE; return TRUE;
} // end of the 'PMA_change_enc_order' function } // end of the 'PMA_change_enc_order' function
/** /**
* Kanji string encoding convert * Kanji string encoding convert
* 2002/1/4 by Y.Kawada * 2002/1/4 by Y.Kawada
* *
@@ -73,7 +71,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
* *
* @return string the converted string * @return string the converted string
*/ */
function PMA_kanji_str_conv($str, $enc, $kana) { function PMA_kanji_str_conv($str, $enc, $kana) {
global $enc_list; global $enc_list;
if ($enc == '' && $kana == '') { if ($enc == '' && $kana == '') {
@@ -91,10 +89,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
$dist = $str; $dist = $str;
} }
return $dist; return $dist;
} // end of the 'PMA_kanji_str_conv' function } // end of the 'PMA_kanji_str_conv' function
/** /**
* Kanji file encoding convert * Kanji file encoding convert
* 2002/1/4 by Y.Kawada * 2002/1/4 by Y.Kawada
* *
@@ -104,7 +102,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
* *
* @return string the name of the converted file * @return string the name of the converted file
*/ */
function PMA_kanji_file_conv($file, $enc, $kana) { function PMA_kanji_file_conv($file, $enc, $kana) {
if ($enc == '' && $kana == '') { if ($enc == '' && $kana == '') {
return $file; return $file;
} }
@@ -124,10 +122,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
unlink($file); unlink($file);
return $tmpfname; return $tmpfname;
} // end of the 'PMA_kanji_file_conv' function } // end of the 'PMA_kanji_file_conv' function
/** /**
* Defines radio form fields to switch between encoding modes * Defines radio form fields to switch between encoding modes
* 2002/1/4 by Y.Kawada * 2002/1/4 by Y.Kawada
* *
@@ -135,7 +133,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
* *
* @return string xhtml code for the radio controls * @return string xhtml code for the radio controls
*/ */
function PMA_set_enc_form($spaces) { function PMA_set_enc_form($spaces) {
return "\n" return "\n"
. $spaces . '<input type="radio" name="knjenc" value="" checked="checked" />non' . "\n" . $spaces . '<input type="radio" name="knjenc" value="" checked="checked" />non' . "\n"
. $spaces . '<input type="radio" name="knjenc" value="EUC-JP" />EUC' . "\n" . $spaces . '<input type="radio" name="knjenc" value="EUC-JP" />EUC' . "\n"
@@ -143,10 +141,9 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
. $spaces . '&nbsp;' . $GLOBALS['strEncto'] . '<br />' . "\n" . $spaces . '&nbsp;' . $GLOBALS['strEncto'] . '<br />' . "\n"
. $spaces . '<input type="checkbox" name="xkana" value="kana" />' . "\n" . $spaces . '<input type="checkbox" name="xkana" value="kana" />' . "\n"
. $spaces . '&nbsp;' . $GLOBALS['strXkana'] . '<br />' . "\n"; . $spaces . '&nbsp;' . $GLOBALS['strXkana'] . '<br />' . "\n";
} // end of the 'PMA_set_enc_form' function } // end of the 'PMA_set_enc_form' function
PMA_internal_enc_check(); PMA_internal_enc_check();
} // $__PMA_ENCODING_LIB_INCLUDED
?> ?>

View File

@@ -2,8 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){ if (PMA_MYSQL_INT_VERSION >= 40100){
define('PMA_MYSQL_CHARSETS_LIB_INCLUDED', 1);
$res = PMA_mysql_query('SHOW CHARACTER SET;', $userlink) $res = PMA_mysql_query('SHOW CHARACTER SET;', $userlink)
or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW CHARACTER SET;'); or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW CHARACTER SET;');
@@ -15,8 +14,7 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
$mysql_charsets_descriptions[$row['Charset']] = $row['Description']; $mysql_charsets_descriptions[$row['Charset']] = $row['Description'];
} }
@mysql_free_result($res); @mysql_free_result($res);
unset($res); unset($res, $row);
unset($row);
$res = PMA_mysql_query('SHOW COLLATION;', $userlink) $res = PMA_mysql_query('SHOW COLLATION;', $userlink)
or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW COLLATION;'); or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW COLLATION;');
@@ -44,8 +42,7 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
} }
@mysql_free_result($res); @mysql_free_result($res);
unset($res); unset($res, $row);
unset($row);
function PMA_getCollationDescr($collation) { function PMA_getCollationDescr($collation) {
if ($collation == 'binary') { if ($collation == 'binary') {
@@ -205,6 +202,6 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
return $descr; return $descr;
} }
} // $__PMA_MYSQL_CHARSETS_LIB__ }
?> ?>

View File

@@ -9,19 +9,15 @@
*/ */
function PMA_mysql_dbname($result, $row, $field = FALSE) {
if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
define('PMA_MYSQL_WRAPPERS_LIB_INCLUDED', 1);
function PMA_mysql_dbname($result, $row, $field = FALSE) {
if ($field != FALSE) { if ($field != FALSE) {
return PMA_convert_display_charset(mysql_dbname($result, $row, $field)); return PMA_convert_display_charset(mysql_dbname($result, $row, $field));
} else { } else {
return PMA_convert_display_charset(mysql_dbname($result, $row)); return PMA_convert_display_charset(mysql_dbname($result, $row));
} }
} }
function PMA_mysql_error($id = FALSE) { function PMA_mysql_error($id = FALSE) {
if ($id != FALSE) { if ($id != FALSE) {
if (mysql_errno($id) != 0) { if (mysql_errno($id) != 0) {
return PMA_convert_display_charset('#' . mysql_errno($id) . ' - ' . mysql_error($id)); return PMA_convert_display_charset('#' . mysql_errno($id) . ' - ' . mysql_error($id));
@@ -31,9 +27,9 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
} }
return FALSE; return FALSE;
} }
function PMA_mysql_fetch_array($result, $type = FALSE) { function PMA_mysql_fetch_array($result, $type = FALSE) {
global $cfg, $allow_recoding, $charset, $convcharset; global $cfg, $allow_recoding, $charset, $convcharset;
if ($type != FALSE) { if ($type != FALSE) {
@@ -68,36 +64,36 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
} }
return $ret; return $ret;
} }
} }
function PMA_mysql_fetch_field($result , $field_offset = FALSE) { function PMA_mysql_fetch_field($result , $field_offset = FALSE) {
if ($field_offset != FALSE) { if ($field_offset != FALSE) {
return PMA_convert_display_charset(mysql_fetch_field($result, $field_offset)); return PMA_convert_display_charset(mysql_fetch_field($result, $field_offset));
} else { } else {
return PMA_convert_display_charset(mysql_fetch_field($result)); return PMA_convert_display_charset(mysql_fetch_field($result));
} }
} }
function PMA_mysql_fetch_row($result) { function PMA_mysql_fetch_row($result) {
/* nijel: This is not optimal, but keeps us from duplicating code, if /* nijel: This is not optimal, but keeps us from duplicating code, if
* speed really matters, duplicate here code from PMA_mysql_fetch_array * speed really matters, duplicate here code from PMA_mysql_fetch_array
* with removing rows working with associative array. */ * with removing rows working with associative array. */
return PMA_mysql_fetch_array($result, MYSQL_NUM); return PMA_mysql_fetch_array($result, MYSQL_NUM);
} }
function PMA_mysql_field_flags($result, $field_offset) { function PMA_mysql_field_flags($result, $field_offset) {
return PMA_convert_display_charset(mysql_field_flags($result, $field_offset)); return PMA_convert_display_charset(mysql_field_flags($result, $field_offset));
} }
function PMA_mysql_field_name($result, $field_index) { function PMA_mysql_field_name($result, $field_index) {
return PMA_convert_display_charset(mysql_field_name($result, $field_index)); return PMA_convert_display_charset(mysql_field_name($result, $field_index));
} }
function PMA_mysql_field_type($result, $field_index) { function PMA_mysql_field_type($result, $field_index) {
return PMA_convert_display_charset(mysql_field_type($result, $field_index)); return PMA_convert_display_charset(mysql_field_type($result, $field_index));
} }
function PMA_mysql_query($query, $link_identifier = FALSE, $result_mode = FALSE) { function PMA_mysql_query($query, $link_identifier = FALSE, $result_mode = FALSE) {
if ($link_identifier != FALSE) { if ($link_identifier != FALSE) {
if ($result_mode != FALSE) { if ($result_mode != FALSE) {
return mysql_query(PMA_convert_charset($query), $link_identifier, $result_mode); return mysql_query(PMA_convert_charset($query), $link_identifier, $result_mode);
@@ -107,18 +103,18 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
} else { } else {
return mysql_query(PMA_convert_charset($query)); return mysql_query(PMA_convert_charset($query));
} }
} }
// mysql_list_tables() is deprecated, also we got report about weird results // mysql_list_tables() is deprecated, also we got report about weird results
// under some circumstances // under some circumstances
function PMA_mysql_list_tables($database_name, $link_identifier = FALSE) { function PMA_mysql_list_tables($database_name, $link_identifier = FALSE) {
if ($link_identifier != FALSE) { if ($link_identifier != FALSE) {
return PMA_mysql_query('SHOW TABLES FROM ' . PMA_backquote(PMA_convert_charset($database_name)), $link_identifier); return PMA_mysql_query('SHOW TABLES FROM ' . PMA_backquote(PMA_convert_charset($database_name)), $link_identifier);
} else { } else {
return PMA_mysql_query('SHOW TABLES FROM ' . PMA_backquote(PMA_convert_charset($database_name))); return PMA_mysql_query('SHOW TABLES FROM ' . PMA_backquote(PMA_convert_charset($database_name)));
} }
} }
// mysql_list_fields() is deprecated, also we got report about weird results // mysql_list_fields() is deprecated, also we got report about weird results
// under some circumstances // under some circumstances
@@ -126,7 +122,7 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
// using SELECT * FROM db.table // using SELECT * FROM db.table
// lets us use functions like mysql_field_name() on the result set // lets us use functions like mysql_field_name() on the result set
function PMA_mysql_list_fields_alternate($database_name, $table_name, $link_identifier = FALSE) { function PMA_mysql_list_fields_alternate($database_name, $table_name, $link_identifier = FALSE) {
if ($link_identifier != FALSE) { if ($link_identifier != FALSE) {
$result = PMA_mysql_query('SHOW FIELDS FROM ' $result = PMA_mysql_query('SHOW FIELDS FROM '
. PMA_backquote(PMA_convert_charset($database_name)) . '.' . PMA_backquote(PMA_convert_charset($database_name)) . '.'
@@ -143,36 +139,34 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
} }
return $fields; return $fields;
} }
function PMA_mysql_list_fields($database_name, $table_name, $link_identifier = FALSE) { function PMA_mysql_list_fields($database_name, $table_name, $link_identifier = FALSE) {
if ($link_identifier != FALSE) { if ($link_identifier != FALSE) {
return mysql_list_fields(PMA_convert_charset($database_name), PMA_convert_charset($table_name), $link_identifier); return mysql_list_fields(PMA_convert_charset($database_name), PMA_convert_charset($table_name), $link_identifier);
} else { } else {
return mysql_list_fields(PMA_convert_charset($database_name), PMA_convert_charset($table_name)); return mysql_list_fields(PMA_convert_charset($database_name), PMA_convert_charset($table_name));
} }
} }
function PMA_mysql_result($result, $row, $field = FALSE) { function PMA_mysql_result($result, $row, $field = FALSE) {
if ($field != FALSE) { if ($field != FALSE) {
return PMA_convert_display_charset(mysql_result($result, $row, PMA_convert_charset($field))); return PMA_convert_display_charset(mysql_result($result, $row, PMA_convert_charset($field)));
} else { } else {
return PMA_convert_display_charset(mysql_result($result, $row)); return PMA_convert_display_charset(mysql_result($result, $row));
} }
} }
function PMA_mysql_select_db($database_name, $link_identifier = FALSE) { function PMA_mysql_select_db($database_name, $link_identifier = FALSE) {
if ($link_identifier != FALSE) { if ($link_identifier != FALSE) {
return mysql_select_db(PMA_convert_charset($database_name), $link_identifier); return mysql_select_db(PMA_convert_charset($database_name), $link_identifier);
} else { } else {
return mysql_select_db(PMA_convert_charset($database_name)); return mysql_select_db(PMA_convert_charset($database_name));
} }
} }
function PMA_mysql_tablename($result, $i) { function PMA_mysql_tablename($result, $i) {
return PMA_convert_display_charset(mysql_tablename($result, $i)); return PMA_convert_display_charset(mysql_tablename($result, $i));
} }
} // PMA_MYSQL_WRAPPERS_LIB_INCLUDED
?> ?>

View File

@@ -3,26 +3,25 @@
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_OB_LIB_INCLUDED')) { /**
define('PMA_OB_LIB_INCLUDED', 1); * Output buffer functions for phpMyAdmin
*
* Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
* http://www.jeremybrand.com/Jeremy/Brand/Jeremy_Brand.html
*
* Check for all the needed functions for output buffering
* Make some wrappers for the top and bottoms of our files.
*/
# Output buffer functions for phpMyAdmin /**
#
# Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
# http://www.jeremybrand.com/Jeremy/Brand/Jeremy_Brand.html
#
# Check for all the needed functions for output buffering
# Make some wrappers for the top and bottoms of our files.
/**
* This function be used eventually to support more modes. It is needed * This function be used eventually to support more modes. It is needed
* because both header and footer functions must know what each other is * because both header and footer functions must know what each other is
* doing. * doing.
* *
* @return integer the output buffer mode * @return integer the output buffer mode
*/ */
function PMA_outBufferModeGet() function PMA_outBufferModeGet()
{ {
if (@function_exists('ob_start')) { if (@function_exists('ob_start')) {
$mode = 1; $mode = 1;
} else { } else {
@@ -62,10 +61,10 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
header('X-ob_mode: ' . $mode); header('X-ob_mode: ' . $mode);
return $mode; return $mode;
} // end of the 'PMA_outBufferModeGet()' function } // end of the 'PMA_outBufferModeGet()' function
/** /**
* This function will need to run at the top of all pages if output * This function will need to run at the top of all pages if output
* output buffering is turned on. It also needs to be passed $mode from * output buffering is turned on. It also needs to be passed $mode from
* the PMA_outBufferModeGet() function or it will be useless. * the PMA_outBufferModeGet() function or it will be useless.
@@ -74,8 +73,8 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
* *
* @return boolean whether output buffering is enabled or not * @return boolean whether output buffering is enabled or not
*/ */
function PMA_outBufferPre($mode) function PMA_outBufferPre($mode)
{ {
switch($mode) switch($mode)
{ {
case 1: case 1:
@@ -94,10 +93,10 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
} // end switch } // end switch
return $retval; return $retval;
} // end of the 'PMA_outBufferPre()' function } // end of the 'PMA_outBufferPre()' function
/** /**
* This function will need to run at the bottom of all pages if output * This function will need to run at the bottom of all pages if output
* buffering is turned on. It also needs to be passed $mode from the * buffering is turned on. It also needs to be passed $mode from the
* PMA_outBufferModeGet() function or it will be useless. * PMA_outBufferModeGet() function or it will be useless.
@@ -106,8 +105,8 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
* *
* @return boolean whether data has been send from the buffer or not * @return boolean whether data has been send from the buffer or not
*/ */
function PMA_outBufferPost($mode) function PMA_outBufferPost($mode)
{ {
switch($mode) switch($mode)
{ {
case 1: case 1:
@@ -126,8 +125,6 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
} // end switch } // end switch
return $retval; return $retval;
} // end of the 'PMA_outBufferPost()' function } // end of the 'PMA_outBufferPost()' function
} // $__PMA_OB_LIB__
?> ?>

View File

@@ -2,10 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_READ_DUMP_INCLUDED')) { /**
define('PMA_READ_DUMP_INCLUDED', 1);
/**
* Removes comment lines and splits up large sql files into individual queries * Removes comment lines and splits up large sql files into individual queries
* *
* Last revision: September 23, 2001 - gandon * Last revision: September 23, 2001 - gandon
@@ -19,8 +16,8 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
* *
* @access public * @access public
*/ */
function PMA_splitSqlFile(&$ret, $sql, $release) function PMA_splitSqlFile(&$ret, $sql, $release)
{ {
$sql = trim($sql); $sql = trim($sql);
$sql_len = strlen($sql); $sql_len = strlen($sql);
$char = ''; $char = '';
@@ -138,10 +135,10 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
} }
return TRUE; return TRUE;
} // end of the 'PMA_splitSqlFile()' function } // end of the 'PMA_splitSqlFile()' function
/** /**
* Reads (and decompresses) a (compressed) file into a string * Reads (and decompresses) a (compressed) file into a string
* *
* @param string the path to the file * @param string the path to the file
@@ -152,7 +149,7 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
* @return string the content of the file or * @return string the content of the file or
* boolean FALSE in case of an error. * boolean FALSE in case of an error.
*/ */
function PMA_readFile($path, $mime = '') { function PMA_readFile($path, $mime = '') {
global $cfg; global $cfg;
if (!file_exists($path)) { if (!file_exists($path)) {
@@ -209,7 +206,6 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
return FALSE; return FALSE;
} }
return $content; return $content;
} }
} // $__PMA_READ_DUMP_LIB__
?> ?>

View File

@@ -7,10 +7,7 @@
*/ */
if (!defined('PMA_RELATION_LIB_INCLUDED')){ /**
define('PMA_RELATION_LIB_INCLUDED', 1);
/**
* Executes a query as controluser if possible, otherwise as normal user * Executes a query as controluser if possible, otherwise as normal user
* *
* @param string the query to execute * @param string the query to execute
@@ -54,7 +51,7 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
} // end of the "PMA_query_as_cu()" function } // end of the "PMA_query_as_cu()" function
/** /**
* Defines the relation parameters for the current user * Defines the relation parameters for the current user
* just a copy of the functions used for relations ;-) * just a copy of the functions used for relations ;-)
* but added some stuff to check what will work * but added some stuff to check what will work
@@ -74,8 +71,8 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
* *
* @author Mike Beck <mikebeck@users.sourceforge.net> * @author Mike Beck <mikebeck@users.sourceforge.net>
*/ */
function PMA_getRelationsParam($verbose = FALSE) function PMA_getRelationsParam($verbose = FALSE)
{ {
global $cfg, $server, $err_url_0, $db, $table; global $cfg, $server, $err_url_0, $db, $table;
global $cfgRelation; global $cfgRelation;
@@ -260,10 +257,10 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
} // end if ($verbose == TRUE) { } // end if ($verbose == TRUE) {
return $cfgRelation; return $cfgRelation;
} // end of the 'PMA_getRelationsParam()' function } // end of the 'PMA_getRelationsParam()' function
/** /**
* Gets all Relations to foreign tables for a given table or * Gets all Relations to foreign tables for a given table or
* optionally a given column in a table * optionally a given column in a table
* *
@@ -281,7 +278,7 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
* *
* @author Mike Beck <mikebeck@users.sourceforge.net> and Marc Delisle * @author Mike Beck <mikebeck@users.sourceforge.net> and Marc Delisle
*/ */
function PMA_getForeigners($db, $table, $column = '', $source = 'both') { function PMA_getForeigners($db, $table, $column = '', $source = 'both') {
global $cfgRelation, $err_url_0; global $cfgRelation, $err_url_0;
if ($cfgRelation['relwork'] && ($source == 'both' || $source == 'internal')) { if ($cfgRelation['relwork'] && ($source == 'both' || $source == 'internal')) {
@@ -345,10 +342,10 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
} else { } else {
return FALSE; return FALSE;
} }
} // end of the 'PMA_getForeigners()' function } // end of the 'PMA_getForeigners()' function
/** /**
* Gets the display field of a table * Gets the display field of a table
* *
* @param string the name of the db to check for * @param string the name of the db to check for
@@ -362,7 +359,7 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
* *
* @author Mike Beck <mikebeck@users.sourceforge.net> * @author Mike Beck <mikebeck@users.sourceforge.net>
*/ */
function PMA_getDisplayField($db, $table) { function PMA_getDisplayField($db, $table) {
global $cfgRelation; global $cfgRelation;
$disp_query = 'SELECT display_field FROM ' . PMA_backquote($cfgRelation['table_info']) $disp_query = 'SELECT display_field FROM ' . PMA_backquote($cfgRelation['table_info'])
@@ -376,10 +373,10 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
} else { } else {
return FALSE; return FALSE;
} }
} // end of the 'PMA_getDisplayField()' function } // end of the 'PMA_getDisplayField()' function
/** /**
* Gets the comments for all rows of a table * Gets the comments for all rows of a table
* *
* @param string the name of the db to check for * @param string the name of the db to check for
@@ -393,7 +390,7 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
* *
* @author Mike Beck <mikebeck@users.sourceforge.net> * @author Mike Beck <mikebeck@users.sourceforge.net>
*/ */
function PMA_getComments($db, $table = '') { function PMA_getComments($db, $table = '') {
global $cfgRelation; global $cfgRelation;
if ($table != '') { if ($table != '') {
@@ -427,35 +424,35 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
} }
} // end of the 'PMA_getComments()' function } // end of the 'PMA_getComments()' function
/** /**
* Adds/removes slashes if required * Adds/removes slashes if required
* *
* @param string the string to slash * @param string the string to slash
* *
* @return string the slashed string * @return string the slashed string
* *
* @access public * @access public
*/ */
function PMA_handleSlashes($val) { function PMA_handleSlashes($val) {
return (get_magic_quotes_gpc() ? str_replace('\\"', '"', $val) : PMA_sqlAddslashes($val)); return (get_magic_quotes_gpc() ? str_replace('\\"', '"', $val) : PMA_sqlAddslashes($val));
} // end of the "PMA_handleSlashes()" function } // end of the "PMA_handleSlashes()" function
/** /**
* Set a single comment to a certain value. * Set a single comment to a certain value.
* *
* @param string the name of the db * @param string the name of the db
* @param string the name of the table * @param string the name of the table
* @param string the name of the column * @param string the name of the column
* @param string the value of the column * @param string the value of the column
* @param string (optional) if a column is renamed, this is the name of the former key which will get deleted * @param string (optional) if a column is renamed, this is the name of the former key which will get deleted
* *
* @return boolean true, if comment-query was made. * @return boolean true, if comment-query was made.
* *
* @global array the list of relations settings * @global array the list of relations settings
* *
* @access public * @access public
*/ */
function PMA_setComment($db, $table, $key, $value, $removekey = '') { function PMA_setComment($db, $table, $key, $value, $removekey = '') {
global $cfgRelation; global $cfgRelation;
if ($removekey != '' AND $removekey != $key) { if ($removekey != '' AND $removekey != $key) {
@@ -505,21 +502,21 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
} else { } else {
return false; return false;
} }
} // end of 'PMA_setComment()' function } // end of 'PMA_setComment()' function
/** /**
* Set a SQL history entry * Set a SQL history entry
* *
* @param string the name of the db * @param string the name of the db
* @param string the name of the table * @param string the name of the table
* @param string the username * @param string the username
* @param string the sql query * @param string the sql query
* *
* @return boolean true * @return boolean true
* *
* @access public * @access public
*/ */
function PMA_setHistory($db, $table, $username, $sqlquery) { function PMA_setHistory($db, $table, $username, $sqlquery) {
global $cfgRelation; global $cfgRelation;
$hist_rs = PMA_query_as_cu('INSERT INTO ' . PMA_backquote($cfgRelation['history']) . ' (' $hist_rs = PMA_query_as_cu('INSERT INTO ' . PMA_backquote($cfgRelation['history']) . ' ('
@@ -535,18 +532,18 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
. 'NOW(),' . 'NOW(),'
. '\'' . PMA_sqlAddslashes($sqlquery) . '\')'); . '\'' . PMA_sqlAddslashes($sqlquery) . '\')');
return true; return true;
} // end of 'PMA_setHistory()' function } // end of 'PMA_setHistory()' function
/** /**
* Gets a SQL history entry * Gets a SQL history entry
* *
* @param string the username * @param string the username
* *
* @return array list of history items * @return array list of history items
* *
* @access public * @access public
*/ */
function PMA_getHistory($username) { function PMA_getHistory($username) {
global $cfgRelation; global $cfgRelation;
$hist_rs = PMA_query_as_cu('SELECT ' $hist_rs = PMA_query_as_cu('SELECT '
@@ -563,21 +560,21 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
return $history; return $history;
} // end of 'PMA_getHistory()' function } // end of 'PMA_getHistory()' function
/** /**
* Set a SQL history entry * Set a SQL history entry
* *
* @param string the name of the db * @param string the name of the db
* @param string the name of the table * @param string the name of the table
* @param string the username * @param string the username
* @param string the sql query * @param string the sql query
* *
* @return boolean true * @return boolean true
* *
* @access public * @access public
*/ */
function PMA_purgeHistory($username) { function PMA_purgeHistory($username) {
global $cfgRelation, $cfg; global $cfgRelation, $cfg;
$purge_rs = PMA_query_as_cu('SELECT timevalue FROM ' . PMA_backquote($cfgRelation['history']) . ' WHERE username = \'' . PMA_sqlAddSlashes($username) . '\' ORDER BY timevalue DESC LIMIT ' . $cfg['QueryHistoryMax'] . ', 1'); $purge_rs = PMA_query_as_cu('SELECT timevalue FROM ' . PMA_backquote($cfgRelation['history']) . ' WHERE username = \'' . PMA_sqlAddSlashes($username) . '\' ORDER BY timevalue DESC LIMIT ' . $cfg['QueryHistoryMax'] . ', 1');
@@ -592,21 +589,21 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
} }
return true; return true;
} // end of 'PMA_purgeHistory()' function } // end of 'PMA_purgeHistory()' function
/** /**
* Outputs dropdown with values of foreign fields * Outputs dropdown with values of foreign fields
* *
* @param string the query of the foreign keys * @param string the query of the foreign keys
* @param string the foreign field * @param string the foreign field
* @param string the foreign field to display * @param string the foreign field to display
* @param string the current data of the dropdown * @param string the current data of the dropdown
* *
* @return string the <option value=""><option>s * @return string the <option value=""><option>s
* *
* @access public * @access public
*/ */
function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $max = 100) { function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $max = 100) {
global $cfg; global $cfg;
$ret = '<option value=""></option>' . "\n"; $ret = '<option value=""></option>' . "\n";
@@ -646,7 +643,6 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
$ret .= implode('', $reloptions['id-content']); $ret .= implode('', $reloptions['id-content']);
return $ret; return $ret;
} // end of 'PMA_foreignDropdown()' function } // end of 'PMA_foreignDropdown()' function
} // $__PMA_RELATION_LIB__
?> ?>

View File

@@ -7,13 +7,10 @@
*/ */
if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){ require_once('./libraries/relation.lib.php');
define('PMA_RELATION_CLEANUP_LIB_INCLUDED', 1); $cfgRelation = PMA_getRelationsParam();
include('./libraries/relation.lib.php'); function PMA_relationsCleanupColumn($db, $table, $column) {
$cfgRelation = PMA_getRelationsParam();
function PMA_relationsCleanupColumn($db, $table, $column) {
global $cfgRelation; global $cfgRelation;
if ($cfgRelation['commwork']) { if ($cfgRelation['commwork']) {
$remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['column_info']) $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['column_info'])
@@ -48,9 +45,9 @@ if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
$rmv_rs = PMA_query_as_cu($remove_query); $rmv_rs = PMA_query_as_cu($remove_query);
unset($rmv_query); unset($rmv_query);
} }
} }
function PMA_relationsCleanupTable($db, $table) { function PMA_relationsCleanupTable($db, $table) {
global $cfgRelation; global $cfgRelation;
if ($cfgRelation['commwork']) { if ($cfgRelation['commwork']) {
@@ -90,9 +87,9 @@ if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
$rmv_rs = PMA_query_as_cu($remove_query); $rmv_rs = PMA_query_as_cu($remove_query);
unset($rmv_query); unset($rmv_query);
} }
} }
function PMA_relationsCleanupDatabase($db) { function PMA_relationsCleanupDatabase($db) {
global $cfgRelation; global $cfgRelation;
if ($cfgRelation['commwork']) { if ($cfgRelation['commwork']) {
@@ -139,7 +136,6 @@ if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
$rmv_rs = PMA_query_as_cu($remove_query); $rmv_rs = PMA_query_as_cu($remove_query);
unset($rmv_query); unset($rmv_query);
} }
} }
} // $__PMA_RELATION_CLEANUP_LIB__
?> ?>

View File

@@ -8,18 +8,20 @@
*/ */
/**
* We need some elements of the superglobal $_SERVER array.
*/
require_once('./libraries/grab_globals.lib.php');
if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
define('PMA_SELECT_LANG_LIB_INCLUDED', 1);
/** /**
* Define the path to the translations directory and get some variables * Define the path to the translations directory and get some variables
* from system arrays if 'register_globals' is set to 'off' * from system arrays if 'register_globals' is set to 'off'
*/ */
$lang_path = 'lang/'; $lang_path = 'lang/';
/** /**
* All the supported languages have to be listed in the array below. * All the supported languages have to be listed in the array below.
* 1. The key must be the "official" ISO 639 language code and, if required, * 1. The key must be the "official" ISO 639 language code and, if required,
* the dialect code. It can also contain some informations about the * the dialect code. It can also contain some informations about the
@@ -49,7 +51,7 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
* For Russian, we put 1251 first, because MSIE does not accept 866 * For Russian, we put 1251 first, because MSIE does not accept 866
* and users would not see anything. * and users would not see anything.
*/ */
$available_languages = array( $available_languages = array(
'af-utf-8' => array('af|afrikaans', 'afrikaans-utf-8', 'af'), 'af-utf-8' => array('af|afrikaans', 'afrikaans-utf-8', 'af'),
'af-iso-8859-1'=> array('af|afrikaans', 'afrikaans-iso-8859-1', 'af'), 'af-iso-8859-1'=> array('af|afrikaans', 'afrikaans-iso-8859-1', 'af'),
'ar-utf-8' => array('ar([-_][[:alpha:]]{2})?|arabic', 'arabic-utf-8', 'ar'), 'ar-utf-8' => array('ar([-_][[:alpha:]]{2})?|arabic', 'arabic-utf-8', 'ar'),
@@ -148,13 +150,10 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
'zh-tw' => array('zh[-_]tw|chinese traditional', 'chinese_big5', 'zh-TW'), 'zh-tw' => array('zh[-_]tw|chinese traditional', 'chinese_big5', 'zh-TW'),
'zh-utf-8' => array('zh|chinese simplified', 'chinese_gb-utf-8', 'zh'), 'zh-utf-8' => array('zh|chinese simplified', 'chinese_gb-utf-8', 'zh'),
'zh' => array('zh|chinese simplified', 'chinese_gb', 'zh') 'zh' => array('zh|chinese simplified', 'chinese_gb', 'zh')
); );
if (!defined('PMA_IS_LANG_DETECT_FUNCTION')) { /**
define('PMA_IS_LANG_DETECT_FUNCTION', 1);
/**
* Analyzes some PHP environment variables to find the most probable language * Analyzes some PHP environment variables to find the most probable language
* that should be used * that should be used
* *
@@ -166,8 +165,8 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
* *
* @access private * @access private
*/ */
function PMA_langDetect($str = '', $envType = '') function PMA_langDetect($str = '', $envType = '')
{ {
global $available_languages; global $available_languages;
global $lang; global $lang;
@@ -180,24 +179,10 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
break; break;
} }
} }
} // end of the 'PMA_langDetect()' function } // end of the 'PMA_langDetect()' function
} // end if
/** if (!isset($lang)) {
* Get some global variables if 'register_globals' is set to 'off'
* loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
*/
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
if (!isset($lang)) {
if (isset($_GET) && !empty($_GET['lang'])) { if (isset($_GET) && !empty($_GET['lang'])) {
$lang = $_GET['lang']; $lang = $_GET['lang'];
} }
@@ -207,25 +192,25 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
else if (isset($_COOKIE) && !empty($_COOKIE['lang'])) { else if (isset($_COOKIE) && !empty($_COOKIE['lang'])) {
$lang = $_COOKIE['lang']; $lang = $_COOKIE['lang'];
} }
} }
/** /**
* Do the work! * Do the work!
*/ */
// compatibility with config.inc.php <= v1.80 // compatibility with config.inc.php <= v1.80
if (!isset($cfg['Lang']) && isset($cfgLang)) { if (!isset($cfg['Lang']) && isset($cfgLang)) {
$cfg['Lang'] = $cfgLang; $cfg['Lang'] = $cfgLang;
unset($cfgLang); unset($cfgLang);
} }
if (!isset($cfg['DefaultLang']) && isset($cfgDefaultLang)) { if (!isset($cfg['DefaultLang']) && isset($cfgDefaultLang)) {
$cfg['DefaultLang'] = $cfgDefaultLang; $cfg['DefaultLang'] = $cfgDefaultLang;
unset($cfgLang); unset($cfgLang);
} }
// Disable UTF-8 if $cfg['AllowAnywhereRecoding'] has been set to FALSE. // Disable UTF-8 if $cfg['AllowAnywhereRecoding'] has been set to FALSE.
if (!isset($cfg['AllowAnywhereRecoding']) || !$cfg['AllowAnywhereRecoding']) { if (!isset($cfg['AllowAnywhereRecoding']) || !$cfg['AllowAnywhereRecoding']) {
$available_language_files = $available_languages; $available_language_files = $available_languages;
$available_languages = array(); $available_languages = array();
foreach($available_language_files AS $tmp_lang => $tmp_lang_data) { foreach($available_language_files AS $tmp_lang => $tmp_lang_data) {
@@ -233,50 +218,47 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
$available_languages[$tmp_lang] = $tmp_lang_data; $available_languages[$tmp_lang] = $tmp_lang_data;
} }
} // end while } // end while
unset($tmp_lang); unset($tmp_lang, $tmp_lang_data, $available_language_files);
unset($tmp_lang_data); } // end if
unset($available_language_files);
} // end if
// Lang forced // Lang forced
if (!empty($cfg['Lang'])) { if (!empty($cfg['Lang'])) {
$lang = $cfg['Lang']; $lang = $cfg['Lang'];
} }
// If '$lang' is defined, ensure this is a valid translation // If '$lang' is defined, ensure this is a valid translation
if (!empty($lang) && empty($available_languages[$lang])) { if (!empty($lang) && empty($available_languages[$lang])) {
$lang = ''; $lang = '';
} }
// Language is not defined yet : // Language is not defined yet :
// 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE // 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE
// variable // variable
if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) { if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) {
$accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE);
$acceptedCnt = count($accepted); $acceptedCnt = count($accepted);
for ($i = 0; $i < $acceptedCnt && empty($lang); $i++) { for ($i = 0; $i < $acceptedCnt && empty($lang); $i++) {
PMA_langDetect($accepted[$i], 1); PMA_langDetect($accepted[$i], 1);
} }
} }
// 2. try to findout user's language by checking its HTTP_USER_AGENT variable // 2. try to findout user's language by checking its HTTP_USER_AGENT variable
if (empty($lang) && !empty($HTTP_USER_AGENT)) { if (empty($lang) && !empty($HTTP_USER_AGENT)) {
PMA_langDetect($HTTP_USER_AGENT, 2); PMA_langDetect($HTTP_USER_AGENT, 2);
} }
// 3. Didn't catch any valid lang : we use the default settings // 3. Didn't catch any valid lang : we use the default settings
if (empty($lang)) { if (empty($lang)) {
$lang = $cfg['DefaultLang']; $lang = $cfg['DefaultLang'];
} }
// 4. Checks whether charset recoding should be allowed or not // 4. Checks whether charset recoding should be allowed or not
$allow_recoding = FALSE; // Default fallback value $allow_recoding = FALSE; // Default fallback value
if (!isset($convcharset) || empty($convcharset)) { if (!isset($convcharset) || empty($convcharset)) {
$convcharset = $cfg['DefaultCharset']; $convcharset = $cfg['DefaultCharset'];
} }
// 5. Defines the associated filename and load the translation // 5. Defines the associated filename and load the translation
$lang_file = $lang_path . $available_languages[$lang][1] . '.inc.php'; $lang_file = $lang_path . $available_languages[$lang][1] . '.inc.php';
include('./' . $lang_file); require_once('./' . $lang_file);
} // $__PMA_SELECT_LANG_LIB__
?> ?>

View File

@@ -14,10 +14,7 @@
* (around 4.0.2) as well as the MySQL documentation. * (around 4.0.2) as well as the MySQL documentation.
*/ */
if (!defined('PMA_SQP_DATA_INCLUDED')) { $PMA_SQPdata_function_name = array (
define('PMA_SQP_DATA_INCLUDED', 1);
$PMA_SQPdata_function_name = array (
'ABS', 'ABS',
'ACOS', 'ACOS',
'ADDDATE', 'ADDDATE',
@@ -169,11 +166,11 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'WEEKDAY', 'WEEKDAY',
'YEAR', 'YEAR',
'YEARWEEK' 'YEARWEEK'
); );
//$PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name); //$PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
$PMA_SQPdata_function_name_cnt = 151; $PMA_SQPdata_function_name_cnt = 151;
$PMA_SQPdata_column_attrib = array ( $PMA_SQPdata_column_attrib = array (
'AUTO_INCREMENT', 'AUTO_INCREMENT',
'BDB', 'BDB',
'BERKELEYDB', 'BERKELEYDB',
@@ -189,11 +186,11 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'UNSIGNED', 'UNSIGNED',
'VARYING', 'VARYING',
'ZEROFILL' 'ZEROFILL'
); );
//$PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib); //$PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
$PMA_SQPdata_column_attrib_cnt = 15; $PMA_SQPdata_column_attrib_cnt = 15;
$PMA_SQPdata_reserved_word = array ( $PMA_SQPdata_reserved_word = array (
'ACTION', 'ACTION',
'ADD', 'ADD',
'AFTER', 'AFTER',
@@ -451,11 +448,11 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'WRITE', 'WRITE',
'XOR', 'XOR',
'YEAR_MONTH' 'YEAR_MONTH'
); );
//$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word); //$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
$PMA_SQPdata_reserved_word_cnt = 255; $PMA_SQPdata_reserved_word_cnt = 255;
$PMA_SQPdata_column_type = array ( $PMA_SQPdata_column_type = array (
'BIGINT', 'BIGINT',
'BIT', 'BIT',
'BLOB', 'BLOB',
@@ -499,9 +496,8 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
'VARBINARY', 'VARBINARY',
'VARCHAR', 'VARCHAR',
'YEAR' 'YEAR'
); );
//$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type); //$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
$PMA_SQPdata_column_type_cnt = 43; $PMA_SQPdata_column_type_cnt = 43;
} // $__PMA_SQP_DATA__
?> ?>

View File

@@ -31,31 +31,24 @@
*/ */
if (!defined('PMA_SQP_LIB_INCLUDED')) { /**
define('PMA_SQP_LIB_INCLUDED', 1);
/**
* Minimum inclusion? (i.e. for the stylesheet builder) * Minimum inclusion? (i.e. for the stylesheet builder)
*/ */
if (!isset($is_minimum_common)) { if (!isset($is_minimum_common)) {
$is_minimum_common = FALSE; $is_minimum_common = FALSE;
} }
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* Include the string library as we use it heavily * Include the string library as we use it heavily
*/ */
if (!defined('PMA_STR_LIB_INCLUDED')) { require_once('./libraries/string.lib.php');
include('./libraries/string.lib.php');
}
/** /**
* Include data for the SQL Parser * Include data for the SQL Parser
*/ */
if (!defined('PMA_SQP_DATA_INCLUDED')) { require_once('./libraries/sqlparser.data.php');
include('./libraries/sqlparser.data.php');
}
if (!defined('DEBUG_TIMING')) { if (!defined('DEBUG_TIMING')) {
function PMA_SQP_arrayAdd(&$arr, $type, $data, &$arrsize) function PMA_SQP_arrayAdd(&$arr, $type, $data, &$arrsize)
@@ -684,7 +677,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
// so we track wether we are in the EXTRACT() // so we track wether we are in the EXTRACT()
$in_extract = FALSE; $in_extract = FALSE;
/* Description of analyzer results /* Description of analyzer results
* *
* lem9: db, table, column, alias * lem9: db, table, column, alias
* ------------------------ * ------------------------
@@ -756,17 +749,17 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
// TODO: current logic checks for only one word, so I put only the // TODO: current logic checks for only one word, so I put only the
// first word of the reserved expressions that end a table ref; // first word of the reserved expressions that end a table ref;
// maybe this is not ok (the first word might mean something else) // maybe this is not ok (the first word might mean something else)
// $words_ending_table_ref = array( // $words_ending_table_ref = array(
// 'FOR UPDATE', // 'FOR UPDATE',
// 'GROUP BY', // 'GROUP BY',
// 'HAVING', // 'HAVING',
// 'LIMIT', // 'LIMIT',
// 'LOCK IN SHARE MODE', // 'LOCK IN SHARE MODE',
// 'ORDER BY', // 'ORDER BY',
// 'PROCEDURE', // 'PROCEDURE',
// 'UNION', // 'UNION',
// 'WHERE' // 'WHERE'
// ); // );
$words_ending_table_ref = array( $words_ending_table_ref = array(
'FOR', 'FOR',
'GROUP', 'GROUP',
@@ -815,7 +808,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
// loop #1 for each token: select_expr, table_ref for SELECT // loop #1 for each token: select_expr, table_ref for SELECT
for ($i = 0; $i < $size; $i++) { for ($i = 0; $i < $size; $i++) {
//echo "trace <b>" . $arr[$i]['data'] . "</b> (" . $arr[$i]['type'] . ")<br>"; //echo "trace <b>" . $arr[$i]['data'] . "</b> (" . $arr[$i]['type'] . ")<br>";
// High speed seek for locating the end of the current query // High speed seek for locating the end of the current query
if ($seek_queryend == TRUE) { if ($seek_queryend == TRUE) {
@@ -834,13 +827,13 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
continue; continue;
} // end if (type == punct_queryend) } // end if (type == punct_queryend)
// ============================================================== // ==============================================================
if ($arr[$i]['type'] == 'punct_bracket_open_round') { if ($arr[$i]['type'] == 'punct_bracket_open_round') {
if ($in_extract) { if ($in_extract) {
$number_of_brackets_in_extract++; $number_of_brackets_in_extract++;
} }
} }
// ============================================================== // ==============================================================
if ($arr[$i]['type'] == 'punct_bracket_close_round') { if ($arr[$i]['type'] == 'punct_bracket_close_round') {
if ($in_extract) { if ($in_extract) {
$number_of_brackets_in_extract--; $number_of_brackets_in_extract--;
@@ -849,7 +842,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
} }
} }
} }
// ============================================================== // ==============================================================
if ($arr[$i]['type'] == 'alpha_functionName') { if ($arr[$i]['type'] == 'alpha_functionName') {
$upper_data = strtoupper($arr[$i]['data']); $upper_data = strtoupper($arr[$i]['data']);
if ($upper_data =='EXTRACT') { if ($upper_data =='EXTRACT') {
@@ -858,7 +851,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
} }
} }
// ============================================================== // ==============================================================
if ($arr[$i]['type'] == 'alpha_reservedWord') { if ($arr[$i]['type'] == 'alpha_reservedWord') {
// We don't know what type of query yet, so run this // We don't know what type of query yet, so run this
if ($subresult['querytype'] == '') { if ($subresult['querytype'] == '') {
@@ -894,7 +887,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
// reserved words below // reserved words below
} // end if (type == alpha_reservedWord) } // end if (type == alpha_reservedWord)
// ============================== // ==============================
if (($arr[$i]['type'] == 'quote_backtick') if (($arr[$i]['type'] == 'quote_backtick')
|| ($arr[$i]['type'] == 'quote_double') || ($arr[$i]['type'] == 'quote_double')
|| ($arr[$i]['type'] == 'quote_single') || ($arr[$i]['type'] == 'quote_single')
@@ -949,7 +942,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
} // end if (querytype SELECT) } // end if (querytype SELECT)
} // end if ( quote_backtick or double quote or alpha_identifier) } // end if ( quote_backtick or double quote or alpha_identifier)
// =================================== // ===================================
if ($arr[$i]['type'] == 'punct_qualifier') { if ($arr[$i]['type'] == 'punct_qualifier') {
// to be able to detect an identifier following another // to be able to detect an identifier following another
$previous_was_identifier = FALSE; $previous_was_identifier = FALSE;
@@ -1193,7 +1186,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
$in_from = FALSE; $in_from = FALSE;
for ($i = 0; $i < $size; $i++) { for ($i = 0; $i < $size; $i++) {
//DEBUG echo "trace loop2 <b>" . $arr[$i]['data'] . "</b> (" . $arr[$i]['type'] . ")<br>"; //DEBUG echo "trace loop2 <b>" . $arr[$i]['data'] . "</b> (" . $arr[$i]['type'] . ")<br>";
// need_confirm // need_confirm
// //
@@ -1685,7 +1678,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
switch ($typearr[2]) { switch ($typearr[2]) {
case 'white_newline': case 'white_newline':
// $after = '<br />'; // $after = '<br />';
$before = ''; $before = '';
break; break;
case 'punct_bracket_open_round': case 'punct_bracket_open_round':
@@ -1904,12 +1897,12 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
break; break;
} // end switch ($typearr[2]) } // end switch ($typearr[2])
/* /*
if ($typearr[3] != 'punct_qualifier') { if ($typearr[3] != 'punct_qualifier') {
$after .= ' '; $after .= ' ';
} }
$after .= "\n"; $after .= "\n";
*/ */
$str .= $before . ($mode=='color' ? PMA_SQP_formatHTML_colorize($arr[$i]) : $arr[$i]['data']). $after; $str .= $before . ($mode=='color' ? PMA_SQP_formatHTML_colorize($arr[$i]) : $arr[$i]['data']). $after;
} // end for } // end for
if ($mode=='color') { if ($mode=='color') {
@@ -1918,9 +1911,9 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
return $str; return $str;
} // end of the "PMA_SQP_formatHtml()" function } // end of the "PMA_SQP_formatHtml()" function
} }
/** /**
* Builds a CSS rule used for html formatted SQL queries * Builds a CSS rule used for html formatted SQL queries
* *
* @param string The class name * @param string The class name
@@ -1933,8 +1926,8 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
* *
* @see PMA_SQP_buildCssData() * @see PMA_SQP_buildCssData()
*/ */
function PMA_SQP_buildCssRule($classname, $property, $value) function PMA_SQP_buildCssRule($classname, $property, $value)
{ {
$str = '.' . $classname . ' {'; $str = '.' . $classname . ' {';
if ($value != '') { if ($value != '') {
$str .= $property . ': ' . $value . ';'; $str .= $property . ': ' . $value . ';';
@@ -1942,10 +1935,10 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
$str .= '}' . "\n"; $str .= '}' . "\n";
return $str; return $str;
} // end of the "PMA_SQP_buildCssRule()" function } // end of the "PMA_SQP_buildCssRule()" function
/** /**
* Builds CSS rules used for html formatted SQL queries * Builds CSS rules used for html formatted SQL queries
* *
* @return string The CSS rules set * @return string The CSS rules set
@@ -1956,8 +1949,8 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
* *
* @see PMA_SQP_buildCssRule() * @see PMA_SQP_buildCssRule()
*/ */
function PMA_SQP_buildCssData() function PMA_SQP_buildCssData()
{ {
global $cfg; global $cfg;
$css_string = ''; $css_string = '';
@@ -1970,9 +1963,9 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
} }
return $css_string; return $css_string;
} // end of the "PMA_SQP_buildCssData()" function } // end of the "PMA_SQP_buildCssData()" function
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**
* Gets SQL queries with no format * Gets SQL queries with no format
* *
@@ -2007,6 +2000,6 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
*/ */
return PMA_SQP_formatNone($arr); return PMA_SQP_formatNone($arr);
} // end of the "PMA_SQP_formatText()" function } // end of the "PMA_SQP_formatText()" function
} // end if: minimal common.lib needed? } // end if: minimal common.lib needed?
} // $__PMA_SQP_LIB__
?> ?>

View File

@@ -30,14 +30,11 @@
* @version $Id$ * @version $Id$
*/ */
if (!defined('PMA_SQL_VALIDATOR_CLASS_INCLUDED')) { @include_once('SOAP/Client.php');
define('PMA_SQL_VALIDATOR_CLASS_INCLUDED', 1);
@include('SOAP/Client.php'); if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
$GLOBALS['sqlvalidator_error'] = TRUE; $GLOBALS['sqlvalidator_error'] = TRUE;
} else { } else {
// Ok, we have SOAP Support, so let's use it! // Ok, we have SOAP Support, so let's use it!
class PMA_SQLValidator { class PMA_SQLValidator {
@@ -409,8 +406,6 @@ if (!defined('PMA_SQL_VALIDATOR_CLASS_INCLUDED')) {
$GLOBALS['sqlvalidator_error'] = TRUE; $GLOBALS['sqlvalidator_error'] = TRUE;
} }
} // end else } // end else
} // $__PMA_SQL_VALIDATOR_CLASS__
?> ?>

View File

@@ -32,20 +32,15 @@
*/ */
if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) { // We need the PEAR libraries, so do a minimum version check first
define('PMA_SQL_VALIDATOR_INCLUDED', 1); // I'm not sure if PEAR was available before this point
// For now we actually use a configuration flag
// We need the PEAR libraries, so do a minimum version check first if ($cfg['SQLValidator']['use'] == TRUE) {
// I'm not sure if PEAR was available before this point require_once('./libraries/sqlvalidator.class.php');
// For now we actually use a configuration flag } // if ($cfg['SQLValidator']['use'] == TRUE)
if ($cfg['SQLValidator']['use'] == TRUE) {
// We cannot check && !defined(PMA_SQL_VALIDATOR_CLASS_INCLUDED))
// as it will produce a nasty warning message
include('./libraries/sqlvalidator.class.php');
} // if ($cfg['SQLValidator']['use'] == TRUE)
/** /**
* This function utilizes the Mimer SQL Validator service * This function utilizes the Mimer SQL Validator service
* to validate an SQL query * to validate an SQL query
* *
@@ -57,8 +52,8 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
* *
* @global array The PMA configuration array * @global array The PMA configuration array
*/ */
function PMA_validateSQL($sql) function PMA_validateSQL($sql)
{ {
global $cfg; global $cfg;
$str = ''; $str = '';
@@ -102,8 +97,6 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
// Gives string back to caller // Gives string back to caller
return $str; return $str;
} // end of the "PMA_validateSQL()" function } // end of the "PMA_validateSQL()" function
} // $__PMA_SQL_VALIDATOR__
?> ?>

View File

@@ -16,24 +16,21 @@
*/ */
if (!defined('PMA_STR_LIB_INCLUDED')) { // This is for handling input better
define('PMA_STR_LIB_INCLUDED', 1); if (defined('PMA_MULTIBYTE_ENCODING')) {
// This is for handling input better
if (defined('PMA_MULTIBYTE_ENCODING')) {
$GLOBALS['PMA_strlen'] = 'mb_strlen'; $GLOBALS['PMA_strlen'] = 'mb_strlen';
$GLOBALS['PMA_strpos'] = 'mb_strpos'; $GLOBALS['PMA_strpos'] = 'mb_strpos';
$GLOBALS['PMA_strrpos'] = 'mb_strrpos'; $GLOBALS['PMA_strrpos'] = 'mb_strrpos';
$GLOBALS['PMA_substr'] = 'mb_substr'; $GLOBALS['PMA_substr'] = 'mb_substr';
} else { } else {
$GLOBALS['PMA_strlen'] = 'strlen'; $GLOBALS['PMA_strlen'] = 'strlen';
$GLOBALS['PMA_strpos'] = 'strpos'; $GLOBALS['PMA_strpos'] = 'strpos';
$GLOBALS['PMA_strrpos'] = 'strrpos'; $GLOBALS['PMA_strrpos'] = 'strrpos';
$GLOBALS['PMA_substr'] = 'substr'; $GLOBALS['PMA_substr'] = 'substr';
} }
/** /**
* This checks if a string actually exists inside another string * This checks if a string actually exists inside another string
* We try to do it in a PHP3-portable way. * We try to do it in a PHP3-portable way.
* We don't care about the position it is in. * We don't care about the position it is in.
@@ -43,15 +40,15 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @return boolean whether the needle is in the haystack or not * @return boolean whether the needle is in the haystack or not
*/ */
function PMA_STR_strInStr($needle, $haystack) function PMA_STR_strInStr($needle, $haystack)
{ {
// $GLOBALS['PMA_strpos']($haystack, $needle) !== FALSE // $GLOBALS['PMA_strpos']($haystack, $needle) !== FALSE
// return (is_integer($GLOBALS['PMA_strpos']($haystack, $needle))); // return (is_integer($GLOBALS['PMA_strpos']($haystack, $needle)));
return $GLOBALS['PMA_strpos'](' ' . $haystack, $needle); return $GLOBALS['PMA_strpos'](' ' . $haystack, $needle);
} // end of the "PMA_STR_strInStr()" function } // end of the "PMA_STR_strInStr()" function
/** /**
* Checks if a given character position in the string is escaped or not * Checks if a given character position in the string is escaped or not
* *
* @param string string to check for * @param string string to check for
@@ -60,8 +57,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @return boolean whether the character is escaped or not * @return boolean whether the character is escaped or not
*/ */
function PMA_STR_charIsEscaped($string, $pos, $start = 0) function PMA_STR_charIsEscaped($string, $pos, $start = 0)
{ {
$len = $GLOBALS['PMA_strlen']($string); $len = $GLOBALS['PMA_strlen']($string);
// Base case: // Base case:
// Check for string length or invalid input or special case of input // Check for string length or invalid input or special case of input
@@ -82,10 +79,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
} }
return $escaped; return $escaped;
} // end of the "PMA_STR_charIsEscaped()" function } // end of the "PMA_STR_charIsEscaped()" function
/** /**
* Checks if a number is in a range * Checks if a number is in a range
* *
* @param integer number to check for * @param integer number to check for
@@ -94,13 +91,13 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @return boolean whether the number is in the range or not * @return boolean whether the number is in the range or not
*/ */
function PMA_STR_numberInRangeInclusive($num, $lower, $upper) function PMA_STR_numberInRangeInclusive($num, $lower, $upper)
{ {
return (($num >= $lower) && ($num <= $upper)); return (($num >= $lower) && ($num <= $upper));
} // end of the "PMA_STR_numberInRangeInclusive()" function } // end of the "PMA_STR_numberInRangeInclusive()" function
/** /**
* Checks if a character is a digit * Checks if a character is a digit
* *
* @param string character to check for * @param string character to check for
@@ -109,17 +106,17 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @see PMA_STR_numberInRangeInclusive() * @see PMA_STR_numberInRangeInclusive()
*/ */
function PMA_STR_isDigit($c) function PMA_STR_isDigit($c)
{ {
$ord_zero = 48; //ord('0'); $ord_zero = 48; //ord('0');
$ord_nine = 57; //ord('9'); $ord_nine = 57; //ord('9');
$ord_c = ord($c); $ord_c = ord($c);
return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_isDigit()" function } // end of the "PMA_STR_isDigit()" function
/** /**
* Checks if a character is an hexadecimal digit * Checks if a character is an hexadecimal digit
* *
* @param string character to check for * @param string character to check for
@@ -128,8 +125,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @see PMA_STR_numberInRangeInclusive() * @see PMA_STR_numberInRangeInclusive()
*/ */
function PMA_STR_isHexDigit($c) function PMA_STR_isHexDigit($c)
{ {
$ord_Aupper = 65; //ord('A'); $ord_Aupper = 65; //ord('A');
$ord_Fupper = 70; //ord('F'); $ord_Fupper = 70; //ord('F');
$ord_Alower = 97; //ord('a'); $ord_Alower = 97; //ord('a');
@@ -141,10 +138,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
return (PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine) return (PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine)
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_Aupper, $ord_Fupper) || PMA_STR_numberInRangeInclusive($ord_c, $ord_Aupper, $ord_Fupper)
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_Alower, $ord_Flower)); || PMA_STR_numberInRangeInclusive($ord_c, $ord_Alower, $ord_Flower));
} // end of the "PMA_STR_isHexDigit()" function } // end of the "PMA_STR_isHexDigit()" function
/** /**
* Checks if a character is an upper alphabetic one * Checks if a character is an upper alphabetic one
* *
* @param string character to check for * @param string character to check for
@@ -154,17 +151,17 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @see PMA_STR_numberInRangeInclusive() * @see PMA_STR_numberInRangeInclusive()
*/ */
function PMA_STR_isUpper($c) function PMA_STR_isUpper($c)
{ {
$ord_zero = 65; //ord('A'); $ord_zero = 65; //ord('A');
$ord_nine = 90; //ord('Z'); $ord_nine = 90; //ord('Z');
$ord_c = ord($c); $ord_c = ord($c);
return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_isUpper()" function } // end of the "PMA_STR_isUpper()" function
/** /**
* Checks if a character is a lower alphabetic one * Checks if a character is a lower alphabetic one
* *
* @param string character to check for * @param string character to check for
@@ -174,17 +171,17 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @see PMA_STR_numberInRangeInclusive() * @see PMA_STR_numberInRangeInclusive()
*/ */
function PMA_STR_isLower($c) function PMA_STR_isLower($c)
{ {
$ord_zero = 97; //ord('a'); $ord_zero = 97; //ord('a');
$ord_nine = 122; //ord('z'); $ord_nine = 122; //ord('z');
$ord_c = ord($c); $ord_c = ord($c);
return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine);
} // end of the "PMA_STR_isLower()" function } // end of the "PMA_STR_isLower()" function
/** /**
* Checks if a character is an alphabetic one * Checks if a character is an alphabetic one
* *
* @param string character to check for * @param string character to check for
@@ -194,13 +191,13 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* @see PMA_STR_isUpper() * @see PMA_STR_isUpper()
* @see PMA_STR_isLower() * @see PMA_STR_isLower()
*/ */
function PMA_STR_isAlpha($c) function PMA_STR_isAlpha($c)
{ {
return (PMA_STR_isUpper($c) || PMA_STR_isLower($c)); return (PMA_STR_isUpper($c) || PMA_STR_isLower($c));
} // end of the "PMA_STR_isAlpha()" function } // end of the "PMA_STR_isAlpha()" function
/** /**
* Checks if a character is an alphanumeric one * Checks if a character is an alphanumeric one
* *
* @param string character to check for * @param string character to check for
@@ -211,13 +208,13 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* @see PMA_STR_isLower() * @see PMA_STR_isLower()
* @see PMA_STR_isDigit() * @see PMA_STR_isDigit()
*/ */
function PMA_STR_isAlnum($c) function PMA_STR_isAlnum($c)
{ {
return (PMA_STR_isUpper($c) || PMA_STR_isLower($c) || PMA_STR_isDigit($c)); return (PMA_STR_isUpper($c) || PMA_STR_isLower($c) || PMA_STR_isDigit($c));
} // end of the "PMA_STR_isAlnum()" function } // end of the "PMA_STR_isAlnum()" function
/** /**
* Checks if a character is a space one * Checks if a character is a space one
* *
* @param string character to check for * @param string character to check for
@@ -226,8 +223,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @see PMA_STR_numberInRangeInclusive() * @see PMA_STR_numberInRangeInclusive()
*/ */
function PMA_STR_isSpace($c) function PMA_STR_isSpace($c)
{ {
$ord_space = 32; //ord(' ') $ord_space = 32; //ord(' ')
$ord_tab = 9; //ord('\t') $ord_tab = 9; //ord('\t')
$ord_CR = 13; //ord('\n') $ord_CR = 13; //ord('\n')
@@ -237,10 +234,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
return (($ord_c == $ord_space) return (($ord_c == $ord_space)
|| ($ord_c == $ord_NOBR) || ($ord_c == $ord_NOBR)
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_tab, $ord_CR)); || PMA_STR_numberInRangeInclusive($ord_c, $ord_tab, $ord_CR));
} // end of the "PMA_STR_isSpace()" function } // end of the "PMA_STR_isSpace()" function
/** /**
* Checks if a character is an accented character * Checks if a character is an accented character
* *
* @note Presently this only works for some character sets. More work * @note Presently this only works for some character sets. More work
@@ -253,8 +250,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @see PMA_STR_numberInRangeInclusive() * @see PMA_STR_numberInRangeInclusive()
*/ */
function PMA_STR_isAccented($c) function PMA_STR_isAccented($c)
{ {
$ord_min1 = 192; //ord('A'); $ord_min1 = 192; //ord('A');
$ord_max1 = 214; //ord('Z'); $ord_max1 = 214; //ord('Z');
$ord_min2 = 216; //ord('A'); $ord_min2 = 216; //ord('A');
@@ -267,10 +264,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
return PMA_STR_numberInRangeInclusive($ord_c, $ord_min1, $ord_max1) return PMA_STR_numberInRangeInclusive($ord_c, $ord_min1, $ord_max1)
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_min2, $ord_max2) || PMA_STR_numberInRangeInclusive($ord_c, $ord_min2, $ord_max2)
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_min2, $ord_max2); || PMA_STR_numberInRangeInclusive($ord_c, $ord_min2, $ord_max2);
} // end of the "PMA_STR_isAccented()" function } // end of the "PMA_STR_isAccented()" function
/** /**
* Checks if a character is an SQL identifier * Checks if a character is an SQL identifier
* *
* @param string character to check for * @param string character to check for
@@ -280,16 +277,16 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @see PMA_STR_isAlnum() * @see PMA_STR_isAlnum()
*/ */
function PMA_STR_isSqlIdentifier($c, $dot_is_valid = FALSE) function PMA_STR_isSqlIdentifier($c, $dot_is_valid = FALSE)
{ {
return (PMA_STR_isAlnum($c) return (PMA_STR_isAlnum($c)
|| PMA_STR_isAccented($c) || PMA_STR_isAccented($c)
|| ($c == '_') || ($c == '$') || ($c == '_') || ($c == '$')
|| (($dot_is_valid != FALSE) && ($c == '.'))); || (($dot_is_valid != FALSE) && ($c == '.')));
} // end of the "PMA_STR_isSqlIdentifier()" function } // end of the "PMA_STR_isSqlIdentifier()" function
/** /**
* Binary search of a value in a sorted array * Binary search of a value in a sorted array
* *
* @param string string to search for * @param string string to search for
@@ -298,8 +295,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
* *
* @return boolean whether the string has been found or not * @return boolean whether the string has been found or not
*/ */
function PMA_STR_binarySearchInArr($str, $arr, $arrsize) function PMA_STR_binarySearchInArr($str, $arr, $arrsize)
{ {
// $arr NUST be sorted, due to binary search // $arr NUST be sorted, due to binary search
$top = $arrsize - 1; $top = $arrsize - 1;
$bottom = 0; $bottom = 0;
@@ -318,8 +315,6 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
} // end while } // end while
return $found; return $found;
} // end of the "PMA_STR_binarySearchInArr()" function } // end of the "PMA_STR_binarySearchInArr()" function
} // $__PMA_STR_LIB__
?> ?>

View File

@@ -6,11 +6,7 @@
* Set of functions used with the relation and pdf feature * Set of functions used with the relation and pdf feature
*/ */
function PMA_transformation_getOptions($string) {
if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
define('PMA_TRANSFORMATION_LIB_INCLUDED', 1);
function PMA_transformation_getOptions($string) {
$transform_options = array(); $transform_options = array();
if ($string != '') { if ($string != '') {
@@ -22,9 +18,9 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
} }
return $transform_options; return $transform_options;
} }
/** /**
* Gets all available MIME-types * Gets all available MIME-types
* *
* @return array array[mimetype], array[transformation] * @return array array[mimetype], array[transformation]
@@ -33,7 +29,7 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
* *
* @author Garvin Hicking <me@supergarv.de> * @author Garvin Hicking <me@supergarv.de>
*/ */
function PMA_getAvailableMIMEtypes() { function PMA_getAvailableMIMEtypes() {
$handle = opendir('./libraries/transformations'); $handle = opendir('./libraries/transformations');
$stack = array(); $stack = array();
@@ -74,9 +70,9 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
} }
return $stack; return $stack;
} }
/** /**
* Gets the mimetypes for all rows of a table * Gets the mimetypes for all rows of a table
* *
* @param string the name of the db to check for * @param string the name of the db to check for
@@ -91,7 +87,7 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
* *
* @author Mike Beck <mikebeck@users.sourceforge.net> / Garvin Hicking <me@supergarv.de> * @author Mike Beck <mikebeck@users.sourceforge.net> / Garvin Hicking <me@supergarv.de>
*/ */
function PMA_getMIME($db, $table, $strict = false) { function PMA_getMIME($db, $table, $strict = false) {
global $cfgRelation; global $cfgRelation;
$com_qry = 'SELECT column_name, mimetype, transformation, transformation_options FROM ' . PMA_backquote($cfgRelation['column_info']) $com_qry = 'SELECT column_name, mimetype, transformation, transformation_options FROM ' . PMA_backquote($cfgRelation['column_info'])
@@ -114,24 +110,24 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
} }
} // end of the 'PMA_getMIME()' function } // end of the 'PMA_getMIME()' function
/** /**
* Set a single mimetype to a certain value. * Set a single mimetype to a certain value.
* *
* @param string the name of the db * @param string the name of the db
* @param string the name of the table * @param string the name of the table
* @param string the name of the column * @param string the name of the column
* @param string the mimetype of the column * @param string the mimetype of the column
* @param string the transformation of the column * @param string the transformation of the column
* @param string the transformation options of the column * @param string the transformation options of the column
* @param string (optional) force delete, will erase any existing comments for this column * @param string (optional) force delete, will erase any existing comments for this column
* *
* @return boolean true, if comment-query was made. * @return boolean true, if comment-query was made.
* *
* @global array the list of relations settings * @global array the list of relations settings
* *
* @access public * @access public
*/ */
function PMA_setMIME($db, $table, $key, $mimetype, $transformation, $transformation_options, $forcedelete = false) { function PMA_setMIME($db, $table, $key, $mimetype, $transformation, $transformation_options, $forcedelete = false) {
global $cfgRelation; global $cfgRelation;
$test_qry = 'SELECT mimetype, ' . PMA_backquote('comment') . ' FROM ' . PMA_backquote($cfgRelation['column_info']) $test_qry = 'SELECT mimetype, ' . PMA_backquote('comment') . ' FROM ' . PMA_backquote($cfgRelation['column_info'])
@@ -176,18 +172,18 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
} else { } else {
return false; return false;
} }
} // end of 'PMA_setMIME()' function } // end of 'PMA_setMIME()' function
/** /**
* Returns the real filename of a configured transformation * Returns the real filename of a configured transformation
* *
* @param string the current filename * @param string the current filename
* *
* @return string the new filename * @return string the new filename
* *
* @access public * @access public
*/ */
function PMA_sanitizeTransformationFile(&$filename) { function PMA_sanitizeTransformationFile(&$filename) {
// garvin: for security, never allow to break out from transformations directory // garvin: for security, never allow to break out from transformations directory
$include_file = preg_replace('@\.\.*@', '.', $filename); $include_file = preg_replace('@\.\.*@', '.', $filename);
@@ -200,6 +196,5 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
} }
return $include_file; return $include_file;
} // end of 'PMA_sanitizeTransformationFile()' function } // end of 'PMA_sanitizeTransformationFile()' function
} // $__PMA_TRANSFORMATION_LIB__
?> ?>

View File

@@ -8,14 +8,11 @@
* *
* For instructions, read the /Documentation.html file. * For instructions, read the /Documentation.html file.
* *
* The string ENTER_FILENAME_HERE shall be substituted with the filename without the '.inc.php' * The string [ENTER_FILENAME_HERE] shall be substituted with the filename without the '.inc.php'
* extension. For further information regarding naming conventions see the /Documentation.html file. * extension. For further information regarding naming conventions see the /Documentation.html file.
*/ */
if (!defined('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]')){ function PMA_transformation_[ENTER_FILENAME_HERE]($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]', 1);
function PMA_transformation_[enter_filename_here]($buffer, $options = array(), $meta = '') {
// possibly use a global transform and feed it with special options: // possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php'); // include('./libraries/transformations/global.inc.php');
@@ -26,5 +23,6 @@ if (!defined('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]')){
// $meta->mimetype contains the original MimeType of the field (i.e. 'text/plain', 'image/jpeg' etc.) // $meta->mimetype contains the original MimeType of the field (i.e. 'text/plain', 'image/jpeg' etc.)
return $buffer; return $buffer;
}
} }
?>

View File

@@ -10,4 +10,4 @@
* You can still use global or other mimetype's transforms with this mimetype. * You can still use global or other mimetype's transforms with this mimetype.
*/ */
?> ?>

View File

@@ -23,18 +23,15 @@
* *
*/ */
if (!defined('PMA_TRANSFORMATION_LIB_GLOBAL')){ function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_LIB_GLOBAL', 1);
function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
return htmlspecialchars($buffer); return htmlspecialchars($buffer);
} }
function PMA_transformation_global_html($buffer, $options = array(), $meta = '') { function PMA_transformation_global_html($buffer, $options = array(), $meta = '') {
return $buffer; return $buffer;
} }
function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '') { function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '') {
if (!isset($options['string'])) { if (!isset($options['string'])) {
$options['string'] = ''; $options['string'] = '';
} }
@@ -46,5 +43,6 @@ if (!defined('PMA_TRANSFORMATION_LIB_GLOBAL')){
// Replace occurences of [__BUFFER__] with actual text // Replace occurences of [__BUFFER__] with actual text
$return = str_replace("[__BUFFER__]", $buffer, $options['string']); $return = str_replace("[__BUFFER__]", $buffer, $options['string']);
return $return; return $return;
}
} }
?>

View File

@@ -2,10 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE')){ function PMA_transformation_image_jpeg__inline($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE', 1);
function PMA_transformation_image_jpeg__inline($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php'); include('./libraries/transformations/global.inc.php');
if (PMA_IS_GD2) { if (PMA_IS_GD2) {
@@ -16,5 +13,6 @@ if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE')){
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options); $buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
return $buffer; return $buffer;
}
} }
?>

View File

@@ -2,15 +2,13 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__LINK')){ function PMA_transformation_image_jpeg__link($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_IMAGE_JPEG__LINK', 1);
function PMA_transformation_image_jpeg__link($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php'); include('./libraries/transformations/global.inc.php');
$transform_options = array ('string' => '<a href="transformation_wrapper.php' . $options['wrapper_link'] . '" alt="[__BUFFER__]">[BLOB]</a>'); $transform_options = array ('string' => '<a href="transformation_wrapper.php' . $options['wrapper_link'] . '" alt="[__BUFFER__]">[BLOB]</a>');
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options); $buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
return $buffer; return $buffer;
}
} }
?>

View File

@@ -2,10 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_IMAGE_PNG__INLINE')){ function PMA_transformation_image_png__inline($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_IMAGE_PNG__INLINE', 1);
function PMA_transformation_image_png__inline($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php'); include('./libraries/transformations/global.inc.php');
if (PMA_IS_GD2) { if (PMA_IS_GD2) {
@@ -16,5 +13,6 @@ if (!defined('PMA_TRANSFORMATION_IMAGE_PNG__INLINE')){
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options); $buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
return $buffer; return $buffer;
}
} }
?>

View File

@@ -16,17 +16,11 @@ define('PMA_DISPLAY_HEADING', 0);
/** /**
* Gets some core libraries and displays a top message if required * Gets some core libraries and displays a top message if required
*/ */
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { require_once('./libraries/grab_globals.lib.php');
include('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php');
} require_once('./header.inc.php');
if (!defined('PMA_COMMON_LIB_INCLUDED')) { require_once('./libraries/relation.lib.php');
include('./libraries/common.lib.php'); require_once('./libraries/transformations.lib.php');
}
require('./header.inc.php');
require('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
$types = PMA_getAvailableMIMEtypes(); $types = PMA_getAvailableMIMEtypes();
@@ -78,5 +72,6 @@ foreach($types['transformation'] AS $key => $transform) {
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -2,10 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT')){ function PMA_transformation_text_plain__dateformat($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT', 1);
function PMA_transformation_text_plain__dateformat($buffer, $options = array(), $meta = '') {
// possibly use a global transform and feed it with special options: // possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php'); // include('./libraries/transformations/global.inc.php');
@@ -57,7 +54,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT')){
} }
return $buffer; return $buffer;
}
} }
?>
?>

View File

@@ -2,14 +2,11 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){ function PMA_EscapeShellArg($string, $prepend = '\'') {
define('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL', 1);
function PMA_EscapeShellArg($string, $prepend = '\'') {
return $prepend . ereg_replace("'", "'\\''", $string) . $prepend; return $prepend . ereg_replace("'", "'\\''", $string) . $prepend;
} }
function PMA_transformation_text_plain__external_nowrap($options = array()) { function PMA_transformation_text_plain__external_nowrap($options = array()) {
if (!isset($options[3]) || $options[3] == '') { if (!isset($options[3]) || $options[3] == '') {
$nowrap = true; $nowrap = true;
} elseif ($options[3] == '1' || $options[3] == 1) { } elseif ($options[3] == '1' || $options[3] == 1) {
@@ -19,9 +16,9 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){
} }
return $nowrap; return $nowrap;
} }
function PMA_transformation_text_plain__external($buffer, $options = array(), $meta = '') { function PMA_transformation_text_plain__external($buffer, $options = array(), $meta = '') {
// possibly use a global transform and feed it with special options: // possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php'); // include('./libraries/transformations/global.inc.php');
@@ -61,5 +58,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){
} }
return $retstring; return $retstring;
}
} }
?>

View File

@@ -2,10 +2,8 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__FORMATTED')){ function PMA_transformation_text_plain__formatted($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_TEXT_PLAIN__FORMATTED', 1);
function PMA_transformation_text_plain__formatted($buffer, $options = array(), $meta = '') {
return $buffer; return $buffer;
}
} }
?>

View File

@@ -2,14 +2,12 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__IMAGELINK')){ function PMA_transformation_text_plain__imagelink($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_TEXT_PLAIN__IMAGELINK', 1);
function PMA_transformation_text_plain__imagelink($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php'); include('./libraries/transformations/global.inc.php');
$transform_options = array ('string' => '<a href="' . (isset($options[0]) ? $options[0] : '') . $buffer . '" target="_blank"><img src="' . (isset($options[0]) ? $options[0] : '') . $buffer . '" border="0" width="' . (isset($options[1]) ? $options[1] : 100) . '" height="' . (isset($options[2]) ? $options[2] : 50) . '">' . $buffer . '</a>'); $transform_options = array ('string' => '<a href="' . (isset($options[0]) ? $options[0] : '') . $buffer . '" target="_blank"><img src="' . (isset($options[0]) ? $options[0] : '') . $buffer . '" border="0" width="' . (isset($options[1]) ? $options[1] : 100) . '" height="' . (isset($options[2]) ? $options[2] : 50) . '">' . $buffer . '</a>');
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options); $buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
return $buffer; return $buffer;
}
} }
?>

View File

@@ -2,11 +2,8 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__LINK')){ function PMA_transformation_text_plain__link($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_TEXT_PLAIN__LINK', 1); require_once('./libraries/transformations/global.inc.php');
function PMA_transformation_text_plain__link($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php');
// $transform_options = array ('string' => '<a href="' . (isset($options[0]) ? $options[0] : '') . '%1$s" title="' . (isset($options[1]) ? $options[1] : '%1$s') . '">' . (isset($options[1]) ? $options[1] : '%1$s') . '</a>'); // $transform_options = array ('string' => '<a href="' . (isset($options[0]) ? $options[0] : '') . '%1$s" title="' . (isset($options[1]) ? $options[1] : '%1$s') . '">' . (isset($options[1]) ? $options[1] : '%1$s') . '</a>');
@@ -16,5 +13,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__LINK')){
return $buffer; return $buffer;
}
} }
?>

View File

@@ -2,10 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR')){ function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
define('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR', 1);
function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
// possibly use a global transform and feed it with special options: // possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php'); // include('./libraries/transformations/global.inc.php');
@@ -42,5 +39,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR')){
} }
return $newtext; return $newtext;
}
} }
?>

View File

@@ -8,10 +8,7 @@
*/ */
if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){ /**
define('PMA_URL_GENERATION_LIB_INCLUDED', 1);
/**
* Generates text with hidden inputs. * Generates text with hidden inputs.
* *
* @param string optional database name * @param string optional database name
@@ -30,8 +27,8 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
* *
* @author nijel * @author nijel
*/ */
function PMA_generate_common_hidden_inputs ($db = '', $table = '', $indent = 0) function PMA_generate_common_hidden_inputs ($db = '', $table = '', $indent = 0)
{ {
global $lang, $convcharset, $server; global $lang, $convcharset, $server;
global $cfg, $allow_recoding; global $cfg, $allow_recoding;
@@ -49,9 +46,9 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
if (!empty($table)) if (!empty($table))
$result .= $spaces . '<input type="hidden" name="table" value="'.htmlspecialchars($table).'" />' . "\n"; $result .= $spaces . '<input type="hidden" name="table" value="'.htmlspecialchars($table).'" />' . "\n";
return $result; return $result;
} }
/** /**
* Generates text with URL parameters. * Generates text with URL parameters.
* *
* @param string optional database name * @param string optional database name
@@ -71,8 +68,8 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
* *
* @author nijel * @author nijel
*/ */
function PMA_generate_common_url ($db = '', $table = '', $amp = '&amp;') function PMA_generate_common_url ($db = '', $table = '', $amp = '&amp;')
{ {
global $lang, $convcharset, $server; global $lang, $convcharset, $server;
global $cfg, $allow_recoding; global $cfg, $allow_recoding;
@@ -85,6 +82,6 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
if (!empty($table)) if (!empty($table))
$result .= $amp . 'table='.urlencode($table); $result .= $amp . 'table='.urlencode($table);
return $result; return $result;
}
} }
?> ?>

View File

@@ -10,12 +10,8 @@ define('PMA_DISPLAY_HEADING', 0);
/** /**
* Gets some core libraries and displays a top message if required * Gets some core libraries and displays a top message if required
*/ */
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { require_once('./libraries/grab_globals.lib.php');
include('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php');
}
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
// Puts the language to use in a cookie that will expire in 30 days // Puts the language to use in a cookie that will expire in 30 days
if (!isset($pma_uri_parts)) { if (!isset($pma_uri_parts)) {
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']); $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
@@ -33,7 +29,7 @@ if (isset($table)) {
unset($table); unset($table);
} }
$show_query = '1'; $show_query = '1';
require('./header.inc.php'); require_once('./header.inc.php');
if (isset($message)) { if (isset($message)) {
PMA_showMessage($message); PMA_showMessage($message);
} }
@@ -254,8 +250,7 @@ if ($server > 0) {
} // end elseif } // end elseif
} // end if } // end if
} // end while } // end while
unset($show_grants_dbname); unset($show_grants_dbname, $show_grants_str);
unset($show_grants_str);
mysql_free_result($rs_usr); mysql_free_result($rs_usr);
} // end if } // end if
} // end elseif } // end elseif
@@ -550,8 +545,8 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
} else { } else {
$selected = ''; $selected = '';
} }
echo ' '; echo ' '
echo '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n"; . '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
} }
?> ?>
</select> </select>
@@ -634,20 +629,20 @@ if (PMA_PHP_INT_VERSION == 40203 && @extension_loaded('mbstring')) {
*/ */
if (PMA_PHP_INT_VERSION < 40100) { if (PMA_PHP_INT_VERSION < 40100) {
echo '<p class="warning">' . sprintf($strUpgrade, 'PHP', '4.1.x') . '</p>' . "\n"; echo '<p class="warning">' . sprintf($strUpgrade, 'PHP', '4.1.0') . '</p>' . "\n";
} }
/** /**
* Warning for old MySQL version * Warning for old MySQL version
*/ */
if (PMA_MYSQL_INT_VERSION < 32336) { if (PMA_MYSQL_INT_VERSION < 32332) {
echo '<p class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.36') . '</p>' . "\n"; echo '<p class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.32') . '</p>' . "\n";
} }
/** /**
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -19,8 +19,7 @@ if (!empty($submit_mult)
$what = 'drop_db'; $what = 'drop_db';
} else if (!empty($selected_tbl)) { } else if (!empty($selected_tbl)) {
if ($submit_mult == $strPrintView) { if ($submit_mult == $strPrintView) {
include('./tbl_printview.php'); require('./tbl_printview.php');
exit();
} else { } else {
$selected = $selected_tbl; $selected = $selected_tbl;
switch ($submit_mult) { switch ($submit_mult) {
@@ -60,8 +59,7 @@ if (!empty($submit_mult)
if ($submit_mult == $strDrop) { if ($submit_mult == $strDrop) {
$what = 'drop_fld'; $what = 'drop_fld';
} else { } else {
include('./tbl_alter.php'); require('./tbl_alter.php');
exit();
} }
} else { } else {
$what = 'row_delete'; $what = 'row_delete';
@@ -77,13 +75,13 @@ if (!empty($submit_mult) && !empty($what)) {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
unset($message); unset($message);
if (!empty($table)) { if (!empty($table)) {
include('./tbl_properties_common.php'); require('./tbl_properties_common.php');
$url_query .= '&amp;goto=tbl_properties.php&amp;back=tbl_properties.php'; $url_query .= '&amp;goto=tbl_properties.php&amp;back=tbl_properties.php';
include('./tbl_properties_table_info.php'); require('./tbl_properties_table_info.php');
} }
elseif (!empty($db)) { elseif (!empty($db)) {
include('./db_details_common.php'); require('./db_details_common.php');
include('./db_details_db_info.php'); require('./db_details_db_info.php');
} }
// Builds the query // Builds the query
$full_query = ''; $full_query = '';
@@ -168,8 +166,7 @@ if (!empty($submit_mult) && !empty($what)) {
<?php <?php
echo"\n"; echo"\n";
include('./footer.inc.php'); require_once('./footer.inc.php');
exit();
} // end if } // end if
@@ -179,7 +176,7 @@ if (!empty($submit_mult) && !empty($what)) {
else if ($mult_btn == $strYes) { else if ($mult_btn == $strYes) {
if ($query_type == 'drop_db' || $query_type == 'drop_tbl' || $query_type == 'drop_fld') { if ($query_type == 'drop_db' || $query_type == 'drop_tbl' || $query_type == 'drop_fld') {
include('./libraries/relation_cleanup.lib.php'); require_once('./libraries/relation_cleanup.lib.php');
} }
$sql_query = ''; $sql_query = '';
@@ -268,8 +265,7 @@ else if ($mult_btn == $strYes) {
|| $query_type == 'analyze_tbl' || $query_type == 'analyze_tbl'
|| $query_type == 'check_tbl' || $query_type == 'check_tbl'
|| $query_type == 'optimize_tbl') { || $query_type == 'optimize_tbl') {
include('./sql.php'); require('./sql.php');
exit();
} }
} }

View File

@@ -6,15 +6,15 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./db_details_common.php'); require_once('./db_details_common.php');
/** /**
* Settings for relation stuff * Settings for relation stuff
*/ */
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -29,13 +29,13 @@ $cfgRelation = PMA_getRelationsParam();
if (!$cfgRelation['relwork']) { if (!$cfgRelation['relwork']) {
echo sprintf($strNotSet, 'relation', 'config.inc.php') . '<br />' . "\n" echo sprintf($strNotSet, 'relation', 'config.inc.php') . '<br />' . "\n"
. '<a href="./Documentation.html#relation" target="documentation">' . $strDocu . '</a>' . "\n"; . '<a href="./Documentation.html#relation" target="documentation">' . $strDocu . '</a>' . "\n";
exit(); require_once('./footer.inc.php');
} }
if (!$cfgRelation['displaywork']) { if (!$cfgRelation['displaywork']) {
echo sprintf($strNotSet, 'table_info', 'config.inc.php') . '<br />' . "\n" echo sprintf($strNotSet, 'table_info', 'config.inc.php') . '<br />' . "\n"
. '<a href="./Documentation.html#table_info" target="documentation">' . $strDocu . '</a>' . "\n"; . '<a href="./Documentation.html#table_info" target="documentation">' . $strDocu . '</a>' . "\n";
exit(); require_once('./footer.inc.php');
} }
if (!isset($cfgRelation['table_coords'])){ if (!isset($cfgRelation['table_coords'])){
@@ -525,5 +525,5 @@ ToggleDragDrop('pdflayout');
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -11,15 +11,15 @@
/** /**
* Gets some core scripts * Gets some core scripts
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
/** /**
* Settings for relation stuff * Settings for relation stuff
*/ */
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -42,7 +42,7 @@ if (!$cfgRelation['pdfwork']) {
/** /**
* Gets the "fpdf" libraries and defines the pdf font path * Gets the "fpdf" libraries and defines the pdf font path
*/ */
require('./libraries/fpdf/fpdf.php'); require_once('./libraries/fpdf/fpdf.php');
$FPDF_font_path = './libraries/fpdf/font/'; $FPDF_font_path = './libraries/fpdf/font/';
@@ -267,7 +267,7 @@ class PMA_PDF extends FPDF
global $server, $lang, $convcharset, $db; global $server, $lang, $convcharset, $db;
global $charset, $text_dir, $strRunning, $strDatabase; global $charset, $text_dir, $strRunning, $strDatabase;
include('./header.inc.php'); require_once('./header.inc.php');
echo '<p><b>PDF - '. $GLOBALS['strError'] . '</b></p>' . "\n"; echo '<p><b>PDF - '. $GLOBALS['strError'] . '</b></p>' . "\n";
if (!empty($error_message)) { if (!empty($error_message)) {
@@ -281,8 +281,7 @@ class PMA_PDF extends FPDF
. '">' . $GLOBALS['strBack'] . '</a>'; . '">' . $GLOBALS['strBack'] . '</a>';
echo "\n"; echo "\n";
include('./footer.inc.php'); require_once('./footer.inc.php');
exit();
} // end of the "PMA_PDF_die()" function } // end of the "PMA_PDF_die()" function

View File

@@ -6,8 +6,8 @@
/** /**
* Gets core libraries and defines some variables * Gets core libraries and defines some variables
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
/** /**

View File

@@ -7,7 +7,7 @@
* Gets the variables sent to this script, retains the db name that may have * Gets the variables sent to this script, retains the db name that may have
* been defined as startup option and include a core library * been defined as startup option and include a core library
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
if (!empty($db)) { if (!empty($db)) {
$db_start = $db; $db_start = $db;
} }
@@ -16,8 +16,8 @@ if (!empty($db)) {
/** /**
* Gets a core script and starts output buffering work * Gets a core script and starts output buffering work
*/ */
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./libraries/ob.lib.php'); require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) { if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet(); $ob_mode = PMA_outBufferModeGet();
if ($ob_mode) { if ($ob_mode) {
@@ -29,7 +29,7 @@ if ($cfg['OBGzip']) {
// to a seperate file. It can now be included by header.inc.php, // to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php. // queryframe.php, querywindow.php.
include('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
/** /**
* Displays the frame * Displays the frame

View File

@@ -7,7 +7,7 @@
* Gets the variables sent to this script, retains the db name that may have * Gets the variables sent to this script, retains the db name that may have
* been defined as startup option and include a core library * been defined as startup option and include a core library
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
if (!empty($db)) { if (!empty($db)) {
$db_start = $db; $db_start = $db;
} }
@@ -16,8 +16,8 @@ if (!empty($db)) {
/** /**
* Gets a core script and starts output buffering work * Gets a core script and starts output buffering work
*/ */
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require('./libraries/ob.lib.php'); require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) { if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet(); $ob_mode = PMA_outBufferModeGet();
if ($ob_mode) { if ($ob_mode) {
@@ -25,7 +25,7 @@ if ($cfg['OBGzip']) {
} }
} }
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
/** /**
@@ -43,8 +43,8 @@ if ($server > 0) {
// to a seperate file. It can now be included by header.inc.php, // to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php. // queryframe.php, querywindow.php.
include('./libraries/header_http.inc.php'); require_once('./libraries/header_http.inc.php');
include('./libraries/header_meta_style.inc.php'); require_once('./libraries/header_meta_style.inc.php');
?> ?>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
@@ -219,7 +219,7 @@ if (!isset($goto)) {
$goto = ''; $goto = '';
} }
require './libraries/bookmark.lib.php'; require_once './libraries/bookmark.lib.php';
$is_inside_querywindow = TRUE; $is_inside_querywindow = TRUE;
require './tbl_query_box.php'; require './tbl_query_box.php';

View File

@@ -5,9 +5,9 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/read_dump.lib.php'); require_once('./libraries/read_dump.lib.php');
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
if (!isset($db)) { if (!isset($db)) {
$db = ''; $db = '';
@@ -49,7 +49,7 @@ if (!empty($sql_localfile) && !empty($cfg['UploadDir'])) {
* Bookmark Support: get a query back from bookmark if required * Bookmark Support: get a query back from bookmark if required
*/ */
if (!empty($id_bookmark)) { if (!empty($id_bookmark)) {
include('./libraries/bookmark.lib.php'); require_once('./libraries/bookmark.lib.php');
switch ($action_bookmark) { switch ($action_bookmark) {
case 0: // bookmarked query that have to be run case 0: // bookmarked query that have to be run
$sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark); $sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
@@ -150,7 +150,7 @@ if (!$cfg['AllowUserDropDatabase']
// loic1: optimized query // loic1: optimized query
$result = @PMA_mysql_query('USE mysql'); $result = @PMA_mysql_query('USE mysql');
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url); PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
} }
} }
@@ -160,7 +160,7 @@ define('PMA_CHK_DROP', 1);
* Store a query as a bookmark before executing it? * Store a query as a bookmark before executing it?
*/ */
if (isset($SQLbookmark) && $sql_query != '') { if (isset($SQLbookmark) && $sql_query != '') {
include('./libraries/bookmark.lib.php'); require_once('./libraries/bookmark.lib.php');
$bfields = array( $bfields = array(
'dbase' => $db, 'dbase' => $db,
'user' => $cfg['Bookmark']['user'], 'user' => $cfg['Bookmark']['user'],
@@ -239,8 +239,7 @@ if ($sql_query != '') {
if (preg_match('@^(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@i', $sql_query)) { if (preg_match('@^(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@i', $sql_query)) {
$reload = 1; $reload = 1;
} }
include('./sql.php'); require('./sql.php');
exit();
} }
// Runs multiple queries // Runs multiple queries
@@ -255,8 +254,7 @@ if ($sql_query != '') {
$complete_query = $sql_query; $complete_query = $sql_query;
$display_query = $sql_query; $display_query = $sql_query;
$sql_query = $a_sql_query; $sql_query = $a_sql_query;
include('./sql.php'); require('./sql.php');
exit();
} }
$result = PMA_mysql_query($a_sql_query); $result = PMA_mysql_query($a_sql_query);
@@ -320,7 +318,7 @@ if ($sql_query != '') {
*/ */
if (isset($my_die)) { if (isset($my_die)) {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php'); require_once('./header.inc.php');
if (is_array($my_die)) { if (is_array($my_die)) {
foreach($my_die AS $key => $die_string) { foreach($my_die AS $key => $die_string) {
PMA_mysqlDie('', $die_string, '', $err_url, FALSE); PMA_mysqlDie('', $die_string, '', $err_url, FALSE);
@@ -387,7 +385,7 @@ if ($goto == 'db_details.php' || $goto == 'tbl_properties.php') {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
} }
if ($goto != 'main.php') { if ($goto != 'main.php') {
include('./header.inc.php'); require_once('./header.inc.php');
} }
$active_page = $goto; $active_page = $goto;
require('./' . $goto); require('./' . $goto);

View File

@@ -64,7 +64,7 @@ cat <<END
Please ensure you have: Please ensure you have:
1. incremented rc count or version in CVS : 1. incremented rc count or version in CVS :
- in libraries/defines_php.lib.php the line - in libraries/defines.lib.php the line
" define('PMA_VERSION', '$1'); " " define('PMA_VERSION', '$1'); "
- in Documentation.html the 2 lines - in Documentation.html the 2 lines
" <title>phpMyAdmin $1 - Documentation</title> " " <title>phpMyAdmin $1 - Documentation</title> "
@@ -177,7 +177,7 @@ Todo now:
phpmyadmin-news@lists.sourceforge.net phpmyadmin-news@lists.sourceforge.net
phpmyadmin-users@lists.sourceforge.net phpmyadmin-users@lists.sourceforge.net
8. increment rc count or version in CVS : 8. increment rc count or version in CVS :
- in libraries/defines_php.lib.php the line - in libraries/defines.lib.php the line
" define('PHPMYADMIN_VERSION', '2.2.2-rc1'); " " define('PHPMYADMIN_VERSION', '2.2.2-rc1'); "
- in Documentation.html the 2 lines - in Documentation.html the 2 lines
" <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> " " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "

View File

@@ -28,15 +28,14 @@ echo '<h2>' . "\n"
*/ */
if (PMA_MYSQL_INT_VERSION < 40100) { if (PMA_MYSQL_INT_VERSION < 40100) {
// TODO: Some nice Message :-) // TODO: Some nice Message :-)
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
/** /**
* Includes the required charset library * Includes the required charset library
*/ */
require('./libraries/mysql_charsets.lib.php'); require_once('./libraries/mysql_charsets.lib.php');
/** /**
@@ -101,6 +100,6 @@ echo ' </table>' . "\n"
. ' </tr>' . "\n" . ' </tr>' . "\n"
. '</table>' . "\n"; . '</table>' . "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -5,22 +5,13 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { require_once('./libraries/grab_globals.lib.php');
include('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php');
}
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
/** /**
* Handles some variables that may have been sent by the calling script * Handles some variables that may have been sent by the calling script
*/ */
if (isset($db)) { unset($db, $table);
unset($db);
}
if (isset($table)) {
unset($table);
}
/** /**
* Set parameters for links * Set parameters for links
@@ -35,7 +26,7 @@ $err_url = 'main.php' . $url_query;
/** /**
* Displays the headers * Displays the headers
*/ */
require('./header.inc.php'); require_once('./header.inc.php');
/** /**
* Checks for superuser privileges * Checks for superuser privileges

View File

@@ -6,7 +6,7 @@
/** /**
* Checks if the left frame has to be reloaded * Checks if the left frame has to be reloaded
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
/** /**
@@ -74,7 +74,7 @@ if ((!empty($drop_selected_dbs) || isset($query_type)) && ($is_superuser || $cfg
$action = 'server_databases.php'; $action = 'server_databases.php';
$submit_mult = 'drop_db' ; $submit_mult = 'drop_db' ;
$err_url = 'server_databases.php?' . PMA_generate_common_url(); $err_url = 'server_databases.php?' . PMA_generate_common_url();
include('./mult_submits.inc.php'); require('./mult_submits.inc.php');
$message = sprintf($strDatabasesDropped, count($selected)); $message = sprintf($strDatabasesDropped, count($selected));
// we need to reload the database list now. // we need to reload the database list now.
PMA_availableDatabases(); PMA_availableDatabases();
@@ -102,8 +102,7 @@ echo '<h2>' . "\n"
*/ */
if (!empty($dbstats) && !$is_superuser) { if (!empty($dbstats) && !$is_superuser) {
echo $strNoPrivileges . "\n"; echo $strNoPrivileges . "\n";
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
@@ -373,6 +372,6 @@ if (count($statistics) > 0) {
/** /**
* Sends the footer * Sends the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -6,7 +6,7 @@
/** /**
* Checks if the left frame has to be reloaded * Checks if the left frame has to be reloaded
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
/** /**
@@ -62,11 +62,11 @@ $multi_values .= '<br />
<br /><br />'; <br /><br />';
$export_type = 'server'; $export_type = 'server';
require('./libraries/display_export.lib.php'); require_once('./libraries/display_export.lib.php');
/** /**
* Displays the footer * Displays the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -4,9 +4,7 @@
// Check parameters // Check parameters
if (!defined('PMA_COMMON_LIB_INCLUDED')) { require_once('./libraries/common.lib.php');
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('is_superuser', 'url_query')); PMA_checkParameters(array('is_superuser', 'url_query'));
/** /**

View File

@@ -27,13 +27,12 @@ if (!empty($pred_tablename)) {
* Checks if the user is allowed to do what he tries to... * Checks if the user is allowed to do what he tries to...
*/ */
if (!$is_superuser) { if (!$is_superuser) {
include('./server_links.inc.php'); require('./server_links.inc.php');
echo '<h2>' . "\n" echo '<h2>' . "\n"
. ' ' . $strPrivileges . "\n" . ' ' . $strPrivileges . "\n"
. '</h2>' . "\n" . '</h2>' . "\n"
. $strNoPrivileges . "\n"; . $strNoPrivileges . "\n";
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
@@ -1021,8 +1020,7 @@ if (empty($adduser) && empty($checkprivs)) {
$res = PMA_mysql_query('SELECT "foo" FROM `user` WHERE `User` = "' . PMA_sqlAddslashes($username) . '" AND `Host` = "' . $hostname . '";', $userlink); $res = PMA_mysql_query('SELECT "foo" FROM `user` WHERE `User` = "' . PMA_sqlAddslashes($username) . '" AND `Host` = "' . $hostname . '";', $userlink);
if (mysql_affected_rows($userlink) <= 0) { if (mysql_affected_rows($userlink) <= 0) {
echo $strUserNotFound; echo $strUserNotFound;
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
mysql_free_result($res); mysql_free_result($res);
unset($res); unset($res);
@@ -1427,6 +1425,6 @@ if (empty($adduser) && empty($checkprivs)) {
* Displays the footer * Displays the footer
*/ */
echo "\n\n"; echo "\n\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -6,7 +6,7 @@
/** /**
* Does the common work * Does the common work
*/ */
require('./server_common.inc.php'); require_once('./server_common.inc.php');
/** /**
@@ -94,6 +94,6 @@ foreach($serverProcesses AS $name => $value) {
/** /**
* Sends the footer * Sends the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -29,8 +29,7 @@ if (!empty($innodbstatus)) {
. htmlspecialchars($row[0]) . "\n" . htmlspecialchars($row[0]) . "\n"
. '</pre>' . "\n"; . '</pre>' . "\n";
mysql_free_result($res); mysql_free_result($res);
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
/** /**
@@ -46,8 +45,7 @@ echo '<h2>' . "\n"
*/ */
if (!$is_superuser && !$cfg['ShowMysqlInfo']) { if (!$is_superuser && !$cfg['ShowMysqlInfo']) {
echo $strNoPrivileges; echo $strNoPrivileges;
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
@@ -301,6 +299,6 @@ if ($res) {
/** /**
* Sends the footer * Sends the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -28,8 +28,7 @@ echo '<h2>' . "\n"
*/ */
if (!$is_superuser && !$cfg['ShowMysqlVars']) { if (!$is_superuser && !$cfg['ShowMysqlVars']) {
echo $strNoPrivileges; echo $strNoPrivileges;
include('./footer.inc.php'); require_once('./footer.inc.php');
exit;
} }
@@ -108,6 +107,6 @@ foreach ($serverVars as $name => $value) {
/** /**
* Sends the footer * Sends the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

38
sql.php
View File

@@ -5,8 +5,8 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
/** /**
@@ -61,7 +61,7 @@ if (!defined('PMA_CHK_DROP')
// loic1: optimized query // loic1: optimized query
$result = @PMA_mysql_query('USE mysql'); $result = @PMA_mysql_query('USE mysql');
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url); PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
} // end if } // end if
} // end if } // end if
@@ -71,7 +71,7 @@ if (!defined('PMA_CHK_DROP')
* Bookmark add * Bookmark add
*/ */
if (isset($store_bkm)) { if (isset($store_bkm)) {
include('./libraries/bookmark.lib.php'); require_once('./libraries/bookmark.lib.php');
PMA_addBookmarks($fields, $cfg['Bookmark'], (isset($bkm_all_users) && $bkm_all_users == 'true' ? true : false)); PMA_addBookmarks($fields, $cfg['Bookmark'], (isset($bkm_all_users) && $bkm_all_users == 'true' ? true : false));
header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto); header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto);
} // end if } // end if
@@ -151,7 +151,7 @@ if (isset($btnDrop) && $btnDrop == $strNo) {
unset($table); unset($table);
} }
$active_page = $goto; $active_page = $goto;
include('./' . preg_replace('@\.\.*@', '.', $goto)); require('./' . preg_replace('@\.\.*@', '.', $goto));
} else { } else {
header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto)); header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto));
} }
@@ -187,7 +187,7 @@ if (!$cfg['Confirm']
if ($do_confirm) { if ($do_confirm) {
$stripped_sql_query = $sql_query; $stripped_sql_query = $sql_query;
include('./header.inc.php'); require_once('./header.inc.php');
echo $strDoYouReally . '&nbsp;:<br />' . "\n"; echo $strDoYouReally . '&nbsp;:<br />' . "\n";
echo '<tt>' . htmlspecialchars($stripped_sql_query) . '</tt>&nbsp;?<br/>' . "\n"; echo '<tt>' . htmlspecialchars($stripped_sql_query) . '</tt>&nbsp;?<br/>' . "\n";
?> ?>
@@ -324,7 +324,7 @@ else {
// Displays an error message if required and stop parsing the script // Displays an error message if required and stop parsing the script
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
$error = PMA_mysql_error(); $error = PMA_mysql_error();
include('./header.inc.php'); require_once('./header.inc.php');
$full_err_url = (preg_match('@^(db_details|tbl_properties)@', $err_url)) $full_err_url = (preg_match('@^(db_details|tbl_properties)@', $err_url))
? $err_url . '&amp;show_query=1&amp;sql_query=' . urlencode($sql_query) ? $err_url . '&amp;show_query=1&amp;sql_query=' . urlencode($sql_query)
: $err_url; : $err_url;
@@ -498,7 +498,7 @@ else {
// garvin: if a table or database gets dropped, check column comments. // garvin: if a table or database gets dropped, check column comments.
if (isset($purge) && $purge == '1') { if (isset($purge) && $purge == '1') {
include('./libraries/relation_cleanup.lib.php'); require_once('./libraries/relation_cleanup.lib.php');
if (isset($table) && isset($db) && !empty($table) && !empty($db)) { if (isset($table) && isset($db) && !empty($table) && !empty($db)) {
PMA_relationsCleanupTable($db, $table); PMA_relationsCleanupTable($db, $table);
@@ -513,7 +513,7 @@ else {
if (isset($cpurge) && $cpurge == '1' && isset($purgekey) if (isset($cpurge) && $cpurge == '1' && isset($purgekey)
&& isset($db) && isset($table) && isset($db) && isset($table)
&& !empty($db) && !empty($table) && !empty($purgekey)) { && !empty($db) && !empty($table) && !empty($purgekey)) {
include('./libraries/relation_cleanup.lib.php'); require_once('./libraries/relation_cleanup.lib.php');
PMA_relationsCleanupColumn($db, $table, $purgekey); PMA_relationsCleanupColumn($db, $table, $purgekey);
} // end if column PMA_* purge } // end if column PMA_* purge
@@ -585,10 +585,10 @@ else {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
} }
if ($goto != 'main.php') { if ($goto != 'main.php') {
include('./header.inc.php'); require_once('./header.inc.php');
} }
$active_page = $goto; $active_page = $goto;
include('./' . $goto); require('./' . $goto);
} // end if file_exist } // end if file_exist
else { else {
header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto) . '&message=' . urlencode($message)); header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto) . '&message=' . urlencode($message));
@@ -603,22 +603,22 @@ else {
unset($show_query); unset($show_query);
} }
if (isset($printview) && $printview == '1') { if (isset($printview) && $printview == '1') {
include('./header_printview.inc.php'); require_once('./header_printview.inc.php');
} else { } else {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
unset($message); unset($message);
if (!empty($table)) { if (!empty($table)) {
include('./tbl_properties_common.php'); require('./tbl_properties_common.php');
$url_query .= '&amp;goto=tbl_properties.php&amp;back=tbl_properties.php'; $url_query .= '&amp;goto=tbl_properties.php&amp;back=tbl_properties.php';
include('./tbl_properties_table_info.php'); require('./tbl_properties_table_info.php');
} }
else { else {
include('./db_details_common.php'); require('./db_details_common.php');
include('./db_details_db_info.php'); require('./db_details_db_info.php');
} }
} }
include('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
// Gets the list of fields properties // Gets the list of fields properties
@@ -641,7 +641,7 @@ else {
} }
// Displays the results in a table // Displays the results in a table
include('./libraries/display_tbl.lib.php'); require_once('./libraries/display_tbl.lib.php');
if (empty($disp_mode)) { if (empty($disp_mode)) {
// see the "PMA_setDisplayMode()" function in // see the "PMA_setDisplayMode()" function in
// libraries/display_tbl.lib.php // libraries/display_tbl.lib.php
@@ -786,5 +786,5 @@ echo "\n\n";
/** /**
* Displays the footer * Displays the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -6,9 +6,9 @@
/** /**
* Get some core libraries * Get some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
require('./header.inc.php'); require_once('./header.inc.php');
// Check parameters // Check parameters
PMA_checkParameters(array('db', 'table')); PMA_checkParameters(array('db', 'table'));
@@ -183,8 +183,8 @@ if (isset($submit)) {
} // end if } // end if
// garvin: If comments were sent, enable relation stuff // garvin: If comments were sent, enable relation stuff
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -207,8 +207,7 @@ if (isset($submit)) {
unset($sql_query_cpy); unset($sql_query_cpy);
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered; $message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
$active_page = 'tbl_properties_structure.php'; $active_page = 'tbl_properties_structure.php';
include('./tbl_properties_structure.php'); require('./tbl_properties_structure.php');
exit();
} else { } else {
PMA_mysqlDie('', '', '', $err_url, FALSE); PMA_mysqlDie('', '', '', $err_url, FALSE);
// garvin: An error happened while inserting/updating a table definition. // garvin: An error happened while inserting/updating a table definition.
@@ -227,11 +226,11 @@ if (isset($submit)) {
*/ */
if ($abort == FALSE) { if ($abort == FALSE) {
$action = 'tbl_addfield.php'; $action = 'tbl_addfield.php';
include('./tbl_properties.inc.php'); require('./tbl_properties.inc.php');
// Diplays the footer // Diplays the footer
echo "\n"; echo "\n";
include('./footer.inc.php'); require_once('./footer.inc.php');
} }
?> ?>

View File

@@ -6,9 +6,9 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php'); require_once('./header.inc.php');
// Check parameters // Check parameters
PMA_checkParameters(array('db', 'table')); PMA_checkParameters(array('db', 'table'));
@@ -84,8 +84,8 @@ if (isset($submit)) {
$btnDrop = 'Fake'; $btnDrop = 'Fake';
// garvin: If comments were sent, enable relation stuff // garvin: If comments were sent, enable relation stuff
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -142,8 +142,7 @@ if (isset($submit)) {
} }
$active_page = 'tbl_properties_structure.php'; $active_page = 'tbl_properties_structure.php';
include('./tbl_properties_structure.php'); require('./tbl_properties_structure.php');
exit();
} else { } else {
PMA_mysqlDie('', '', '', $err_url, FALSE); PMA_mysqlDie('', '', '', $err_url, FALSE);
// garvin: An error happened while inserting/updating a table definition. // garvin: An error happened while inserting/updating a table definition.
@@ -184,12 +183,12 @@ if ($abort == FALSE) {
$num_fields = count($fields_meta); $num_fields = count($fields_meta);
$action = 'tbl_alter.php'; $action = 'tbl_alter.php';
include('./tbl_properties.inc.php'); require('./tbl_properties.inc.php');
} }
/** /**
* Displays the footer * Displays the footer
*/ */
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -6,10 +6,10 @@
/** /**
* Get the variables sent or posted to this script and displays the header * Get the variables sent or posted to this script and displays the header
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
$js_to_run = 'tbl_change.js'; $js_to_run = 'tbl_change.js';
require('./header.inc.php'); require_once('./header.inc.php');
require('./libraries/relation.lib.php'); // foreign keys require_once('./libraries/relation.lib.php'); // foreign keys
/** /**
@@ -453,7 +453,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
// The value column (depends on type) // The value column (depends on type)
// ---------------- // ----------------
include('./libraries/get_foreign.lib.php'); require('./libraries/get_foreign.lib.php');
if (isset($foreign_link) && $foreign_link == true) { if (isset($foreign_link) && $foreign_link == true) {
?> ?>
@@ -780,5 +780,5 @@ if (!empty($disp_message)) {
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -6,15 +6,13 @@
/** /**
* Get some core libraries * Get some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
require('./header.inc.php'); require_once('./header.inc.php');
// Check parameters // Check parameters
if (!defined('PMA_COMMON_LIB_INCLUDED')) { require_once('./libraries/common.lib.php');
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db', 'table')); PMA_checkParameters(array('db', 'table'));
@@ -185,8 +183,8 @@ if (isset($submit)) {
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated; $message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated;
// garvin: If comments were sent, enable relation stuff // garvin: If comments were sent, enable relation stuff
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -204,7 +202,7 @@ if (isset($submit)) {
} }
} }
include('./' . $cfg['DefaultTabTable']); require('./' . $cfg['DefaultTabTable']);
$abort = TRUE; $abort = TRUE;
exit(); exit();
} else { } else {
@@ -235,10 +233,10 @@ if ($abort == FALSE) {
// Table name and number of fields are valid -> show the form // Table name and number of fields are valid -> show the form
else { else {
$action = 'tbl_create.php'; $action = 'tbl_create.php';
include('./tbl_properties.inc.php'); require('./tbl_properties.inc.php');
// Diplays the footer // Diplays the footer
echo "\n"; echo "\n";
include('./footer.inc.php'); require_once('./footer.inc.php');
} }
} }

View File

@@ -6,12 +6,8 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { require_once('./libraries/grab_globals.lib.php');
include('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php');
}
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
/** /**
@@ -37,7 +33,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
} }
if (empty($db) || !$is_db) { if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit;
} }
// Not a valid table name -> back to the default db_details sub-page // Not a valid table name -> back to the default db_details sub-page
if (!empty($table)) { if (!empty($table)) {
@@ -46,14 +42,14 @@ if (!defined('PMA_IDX_INCLUDED')) {
if (empty($table) if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) { || !($is_table && @mysql_numrows($is_table))) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit;
} else if (isset($is_table)) { } else if (isset($is_table)) {
mysql_free_result($is_table); mysql_free_result($is_table);
} }
// Displays headers (if needed) // Displays headers (if needed)
$js_to_run = ((isset($index) && isset($do_save_data)) ? 'functions.js' : 'indexes.js'); $js_to_run = ((isset($index) && isset($do_save_data)) ? 'functions.js' : 'indexes.js');
include('./header.inc.php'); require_once('./header.inc.php');
} // end if } // end if
@@ -209,8 +205,7 @@ if (!defined('PMA_IDX_INCLUDED')
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered; $message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
$active_page = 'tbl_properties_structure.php'; $active_page = 'tbl_properties_structure.php';
include('./tbl_properties_structure.php'); require('./tbl_properties_structure.php');
exit();
} // end builds the new index } // end builds the new index
@@ -504,6 +499,6 @@ else if (!defined('PMA_IDX_INCLUDED')
echo "\n"; echo "\n";
if (!defined('PMA_IDX_INCLUDED')){ if (!defined('PMA_IDX_INCLUDED')){
include('./footer.inc.php'); require_once('./footer.inc.php');
} }
?> ?>

View File

@@ -4,11 +4,8 @@
// Check parameters // Check parameters
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db', 'table')); PMA_checkParameters(array('db', 'table'));
@@ -107,8 +104,8 @@ global $cfgRelation;
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
/** /**
@@ -150,7 +147,7 @@ if (isset($new_name) && trim($new_name) != '') {
// do not create the table if dataonly // do not create the table if dataonly
if ($what != 'dataonly') { if ($what != 'dataonly') {
include('./libraries/export/sql.php'); require('./libraries/export/sql.php');
$no_constraints_comments = true; $no_constraints_comments = true;
$sql_structure = PMA_getTableDef($db, $table, "\n", $err_url); $sql_structure = PMA_getTableDef($db, $table, "\n", $err_url);
@@ -174,7 +171,7 @@ if (isset($new_name) && trim($new_name) != '') {
$drop_query = 'DROP TABLE IF EXISTS ' . PMA_backquote($target_db) . '.' . PMA_backquote($new_name); $drop_query = 'DROP TABLE IF EXISTS ' . PMA_backquote($target_db) . '.' . PMA_backquote($new_name);
$result = @PMA_mysql_query($drop_query); $result = @PMA_mysql_query($drop_query);
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie('', $sql_structure, '', $err_url); PMA_mysqlDie('', $sql_structure, '', $err_url);
} }
@@ -191,7 +188,7 @@ if (isset($new_name) && trim($new_name) != '') {
$result = @PMA_mysql_query($sql_structure); $result = @PMA_mysql_query($sql_structure);
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie('', $sql_structure, '', $err_url); PMA_mysqlDie('', $sql_structure, '', $err_url);
} else if (isset($sql_query)) { } else if (isset($sql_query)) {
$sql_query .= "\n" . $sql_structure . ';'; $sql_query .= "\n" . $sql_structure . ';';
@@ -212,7 +209,7 @@ if (isset($new_name) && trim($new_name) != '') {
$sql_constraints = PMA_SQP_formatHtml($parsed_sql, 'query_only'); $sql_constraints = PMA_SQP_formatHtml($parsed_sql, 'query_only');
$result = @PMA_mysql_query($sql_constraints); $result = @PMA_mysql_query($sql_constraints);
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie('', $sql_structure, '', $err_url); PMA_mysqlDie('', $sql_structure, '', $err_url);
} else if (isset($sql_query)) { } else if (isset($sql_query)) {
$sql_query .= "\n" . $sql_constraints; $sql_query .= "\n" . $sql_constraints;
@@ -230,13 +227,13 @@ if (isset($new_name) && trim($new_name) != '') {
$sql_insert_data = 'INSERT INTO ' . $target . ' SELECT * FROM ' . $source; $sql_insert_data = 'INSERT INTO ' . $target . ' SELECT * FROM ' . $source;
$result = @PMA_mysql_query($sql_insert_data); $result = @PMA_mysql_query($sql_insert_data);
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie('', $sql_insert_data, '', $err_url); PMA_mysqlDie('', $sql_insert_data, '', $err_url);
} }
$sql_query .= "\n\n" . $sql_insert_data . ';'; $sql_query .= "\n\n" . $sql_insert_data . ';';
} }
include('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
// Drops old table if the user has requested to move it // Drops old table if the user has requested to move it
@@ -249,7 +246,7 @@ if (isset($new_name) && trim($new_name) != '') {
$sql_drop_table = 'DROP TABLE ' . $source; $sql_drop_table = 'DROP TABLE ' . $source;
$result = @PMA_mysql_query($sql_drop_table); $result = @PMA_mysql_query($sql_drop_table);
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie('', $sql_drop_table, '', $err_url); PMA_mysqlDie('', $sql_drop_table, '', $err_url);
} }
@@ -431,7 +428,7 @@ if (isset($new_name) && trim($new_name) != '') {
} }
} }
} }
include('./header.inc.php'); require_once('./header.inc.php');
} // end is target table name } // end is target table name
@@ -439,7 +436,7 @@ if (isset($new_name) && trim($new_name) != '') {
* No new name for the table! * No new name for the table!
*/ */
else { else {
include('./header.inc.php'); require_once('./header.inc.php');
PMA_mysqlDie($strTableEmpty, '', '', $err_url); PMA_mysqlDie($strTableEmpty, '', '', $err_url);
} }

View File

@@ -6,8 +6,8 @@
* Gets the variables sent or posted to this script, then displays headers * Gets the variables sent or posted to this script, then displays headers
*/ */
if (!isset($selected_tbl)) { if (!isset($selected_tbl)) {
include('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
include('./header.inc.php'); require_once('./header.inc.php');
} }
// Check parameters // Check parameters
@@ -19,8 +19,8 @@ if (!isset($the_tables) || !is_array($the_tables)) {
/** /**
* Gets the relations settings * Gets the relations settings
*/ */
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -632,5 +632,5 @@ function printPage()
<?php <?php
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" id="print" value="' . $strPrint . '" onclick="printPage()">' . "\n"; echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" id="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

View File

@@ -3,18 +3,12 @@
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
// Check parameters // Check parameters
require_once('./libraries/common.lib.php');
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
PMA_checkParameters(array('db','table','action','num_fields')); PMA_checkParameters(array('db','table','action','num_fields'));
// Get available character sets (MySQL >= 4.1) // Get available character sets
if (PMA_MYSQL_INT_VERSION >= 40100 && !defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')) { require_once('./libraries/mysql_charsets.lib.php');
include('./libraries/mysql_charsets.lib.php');
}
?> ?>
<?php if ($cfg['CtrlArrowsMoving']) { ?> <?php if ($cfg['CtrlArrowsMoving']) { ?>
@@ -98,8 +92,8 @@ $header_cells[] = $strNull;
$header_cells[] = $strDefault . '**'; $header_cells[] = $strDefault . '**';
$header_cells[] = $strExtra; $header_cells[] = $strExtra;
require('./libraries/relation.lib.php'); require_once('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php'); require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
$comments_map = array(); $comments_map = array();

View File

@@ -35,5 +35,5 @@ require('./tbl_query_box.php');
* Displays the footer * Displays the footer
*/ */
echo "\n"; echo "\n";
require('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>

Some files were not shown because too many files have changed in this diff Show More