Huge set of optimizations, please test!
This commit is contained in:
17
ChangeLog
17
ChangeLog
@@ -5,6 +5,23 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$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>
|
||||
* lang/check_lang.sh: Cleanup.
|
||||
* lang/sort_lang.sh: Cleanup.
|
||||
|
@@ -5,25 +5,23 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
PMA_checkParameters(array('db', 'table', 'field'));
|
||||
|
||||
require('./libraries/ob.lib.php');
|
||||
require_once('./libraries/ob.lib.php');
|
||||
if ($cfg['OBGzip']) {
|
||||
$ob_mode = PMA_outBufferModeGet();
|
||||
if ($ob_mode) {
|
||||
PMA_outBufferPre($ob_mode);
|
||||
}
|
||||
}
|
||||
include('./libraries/header_http.inc.php');
|
||||
require_once('./libraries/header_http.inc.php');
|
||||
$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">
|
||||
<?php
|
||||
$per_page = 200;
|
||||
require('./libraries/relation.lib.php'); // foreign keys
|
||||
require('./libraries/transformations.lib.php'); // Transformations
|
||||
require_once('./libraries/relation.lib.php'); // foreign keys
|
||||
require_once('./libraries/transformations.lib.php'); // Transformations
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE);
|
||||
|
||||
@@ -74,7 +72,7 @@ if (isset($foreign_navig) && $foreign_navig == $strShowAll) {
|
||||
unset($foreign_limit);
|
||||
}
|
||||
|
||||
include('./libraries/get_foreign.lib.php');
|
||||
require('./libraries/get_foreign.lib.php');
|
||||
?>
|
||||
|
||||
<form action="browse_foreigners.php" method="post">
|
||||
|
11
chk_rel.php
11
chk_rel.php
@@ -6,10 +6,10 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require('./db_details_common.php');
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./db_details_common.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
@@ -21,6 +21,5 @@ $cfgRelation = PMA_getRelationsParam(TRUE);
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -434,10 +434,6 @@ $cfg['AvailableCharsets'] = array(
|
||||
'SHIFT_JIS'
|
||||
);
|
||||
|
||||
// Loads language file
|
||||
require('./libraries/select_lang.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
* Customization & design
|
||||
*/
|
||||
|
@@ -4,8 +4,8 @@
|
||||
|
||||
chdir('..');
|
||||
$is_minimum_common = TRUE;
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
// Gets the default font sizes
|
||||
// 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();
|
||||
|
||||
$ctype = 'css';
|
||||
require('./libraries/header_http.inc.php');
|
||||
require_once('./libraries/header_http.inc.php');
|
||||
|
||||
if (!isset($js_frame)) {
|
||||
$js_frame = 'left';
|
||||
|
@@ -6,13 +6,11 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
$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'));
|
||||
|
||||
@@ -32,6 +30,6 @@ $result = PMA_mysql_query('CREATE DATABASE ' . PMA_backquote($db)) or PMA_m
|
||||
* Displays the result and calls default page
|
||||
*/
|
||||
$message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
|
||||
require('./' . $cfg['DefaultTabDatabase']);
|
||||
require_once('./' . $cfg['DefaultTabDatabase']);
|
||||
|
||||
?>
|
@@ -6,16 +6,16 @@
|
||||
* Gets the variables sent or posted to this script, then displays headers
|
||||
*/
|
||||
if (!isset($selected_tbl)) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
include('./header.inc.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./header.inc.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the relations settings
|
||||
*/
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
@@ -317,5 +317,5 @@ function printPage()
|
||||
<?php
|
||||
echo '<br /><br /> <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');
|
||||
?>
|
@@ -35,7 +35,7 @@ $sub_part = '';
|
||||
require('./db_details_db_info.php');
|
||||
if ($num_tables == 0 && empty($db_query_force)) {
|
||||
$is_info = TRUE;
|
||||
include('./db_details_structure.php');
|
||||
require('./db_details_structure.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -200,5 +200,5 @@ if (function_exists('PMA_set_enc_form')) {
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -5,15 +5,9 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
}
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
include('./libraries/bookmark.lib.php');
|
||||
}
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/bookmark.lib.php');
|
||||
|
||||
PMA_checkParameters(array('db'));
|
||||
|
||||
@@ -35,13 +29,13 @@ if (!isset($is_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');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
} // end if (ensures db exists)
|
||||
// Displays headers
|
||||
if (!isset($message)) {
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
// Reloads the navigation frame via JavaScript if required
|
||||
if (isset($reload) && $reload) {
|
||||
echo "\n";
|
||||
|
@@ -5,9 +5,7 @@
|
||||
|
||||
// Check parameters
|
||||
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
PMA_checkParameters(array('db'));
|
||||
|
||||
|
@@ -52,15 +52,14 @@ if ($num_tables > 1) {
|
||||
<br /><br />';
|
||||
} elseif ($num_tables == 0) {
|
||||
echo $strDatabaseNoTable;
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
} // end if
|
||||
|
||||
$export_type = 'database';
|
||||
require('./libraries/display_export.lib.php');
|
||||
require_once('./libraries/display_export.lib.php');
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -12,13 +12,13 @@
|
||||
* Get the values of the variables posted or sent to this script and display
|
||||
* the headers
|
||||
*/
|
||||
require('./libraries/read_dump.lib.php');
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./header.inc.php');
|
||||
require_once('./libraries/read_dump.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./header.inc.php');
|
||||
|
||||
//require common added for string importing - 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
|
||||
PMA_checkParameters(array('db'));
|
||||
@@ -148,7 +148,7 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
|
||||
}
|
||||
|
||||
// Get relation settings
|
||||
include('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// Gets the query from a file if required
|
||||
@@ -299,6 +299,6 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
@@ -7,9 +7,9 @@
|
||||
* Get the values of the variables posted or sent to this script and display
|
||||
* the headers
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.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';
|
||||
$zero_rows = htmlspecialchars($strSuccess);
|
||||
$sql_query = urldecode($encoded_sql_query);
|
||||
include('./sql.php');
|
||||
require('./sql.php');
|
||||
exit();
|
||||
} else {
|
||||
$sub_part = '_qbe';
|
||||
include('./db_details_common.php');
|
||||
require('./db_details_common.php');
|
||||
$url_query .= '&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)) {
|
||||
@@ -1076,5 +1076,5 @@ if (!empty($qry_orderby)) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -8,26 +8,22 @@
|
||||
* because there is no table in the database ($is_info is TRUE)
|
||||
*/
|
||||
if (empty($is_info)) {
|
||||
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
}
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
// Drops/deletes/etc. multiple tables if required
|
||||
if ((!empty($submit_mult) && isset($selected_tbl))
|
||||
|| isset($mult_btn)) {
|
||||
$action = 'db_details_structure.php';
|
||||
$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 .= '&goto=db_details_structure.php';
|
||||
|
||||
// Gets the database structure
|
||||
$sub_part = '_structure';
|
||||
include('./db_details_db_info.php');
|
||||
require('./db_details_db_info.php');
|
||||
echo "\n";
|
||||
|
||||
/**
|
||||
@@ -82,7 +78,7 @@ function pma_TableHeader($alternate = FALSE) {
|
||||
/**
|
||||
* Settings for relations stuff
|
||||
*/
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
@@ -251,7 +247,7 @@ else {
|
||||
</td>
|
||||
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
||||
<?php
|
||||
include('./libraries/bookmark.lib.php');
|
||||
require_once('./libraries/bookmark.lib.php');
|
||||
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
|
||||
|
||||
if (!empty($sts_data['Rows'])) {
|
||||
@@ -692,5 +688,5 @@ echo "\n" . '</ul>';
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
||||
|
@@ -6,14 +6,11 @@
|
||||
/**
|
||||
* Gets the variables sent or posted to this script, then displays headers
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./header.inc.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./header.inc.php');
|
||||
|
||||
// Check parameters
|
||||
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
PMA_checkParameters(array('db'));
|
||||
|
||||
@@ -25,7 +22,7 @@ $err_url = 'db_details.php?' . PMA_generate_common_url($db);
|
||||
/**
|
||||
* Settings for relations stuff
|
||||
*/
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
@@ -308,5 +305,5 @@ function printPage()
|
||||
<?php
|
||||
echo '<br /><br /> <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');
|
||||
?>
|
@@ -379,5 +379,5 @@ echo"\n";
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
43
export.php
43
export.php
@@ -5,9 +5,9 @@
|
||||
/**
|
||||
* Get the variables sent or posted to this script and a core script
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require('./libraries/zip.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/zip.lib.php');
|
||||
|
||||
PMA_checkParameters(array('what'));
|
||||
|
||||
@@ -263,16 +263,16 @@ if ($save_on_server) {
|
||||
}
|
||||
if (isset($message)) {
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
include('./server_export.php');
|
||||
require('./server_export.php');
|
||||
} elseif ($export_type == 'database') {
|
||||
$active_page = 'db_details_export.php';
|
||||
include('./db_details_export.php');
|
||||
require('./db_details_export.php');
|
||||
} else {
|
||||
$active_page = 'tbl_properties_export.php';
|
||||
include('./tbl_properties_export.php');
|
||||
require('./tbl_properties_export.php');
|
||||
}
|
||||
exit();
|
||||
}
|
||||
@@ -299,7 +299,7 @@ if (!$save_on_server) {
|
||||
} else {
|
||||
// HTML
|
||||
$backup_cfgServer = $cfg['Server'];
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
$cfg['Server'] = $backup_cfgServer;
|
||||
unset($backup_cfgServer);
|
||||
echo '<div align="' . $cell_align_left . '">' . "\n";
|
||||
@@ -314,16 +314,16 @@ if ($export_type == 'database') {
|
||||
if ($num_tables == 0) {
|
||||
$message = $strNoTablesFound;
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
include('./server_export.php');
|
||||
require('./server_export.php');
|
||||
} elseif ($export_type == 'database') {
|
||||
$active_page = 'db_details_export.php';
|
||||
include('./db_details_export.php');
|
||||
require('./db_details_export.php');
|
||||
} else {
|
||||
$active_page = 'tbl_properties_export.php';
|
||||
include('./tbl_properties_export.php');
|
||||
require('./tbl_properties_export.php');
|
||||
}
|
||||
exit();
|
||||
}
|
||||
@@ -337,11 +337,11 @@ $do_relation = isset($GLOBALS[$what . '_relation']);
|
||||
$do_comments = isset($GLOBALS[$what . '_comments']);
|
||||
$do_mime = isset($GLOBALS[$what . '_mime']);
|
||||
if ($do_relation || $do_comments || $do_mime) {
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
}
|
||||
if ($do_mime) {
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
}
|
||||
|
||||
// Include dates in export?
|
||||
@@ -455,10 +455,9 @@ if (!empty($asfile)) {
|
||||
if (@function_exists('bzcompress')) {
|
||||
$dump_buffer = bzcompress($dump_buffer);
|
||||
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>');
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -481,16 +480,16 @@ if (!empty($asfile)) {
|
||||
}
|
||||
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
include('./server_export.php');
|
||||
require_once('./server_export.php');
|
||||
} elseif ($export_type == 'database') {
|
||||
$active_page = 'db_details_export.php';
|
||||
include('./db_details_export.php');
|
||||
require_once('./db_details_export.php');
|
||||
} else {
|
||||
$active_page = 'tbl_properties_export.php';
|
||||
include('./tbl_properties_export.php');
|
||||
require_once('./tbl_properties_export.php');
|
||||
}
|
||||
exit();
|
||||
} else {
|
||||
@@ -507,6 +506,6 @@ else {
|
||||
echo ' </pre>' . "\n";
|
||||
echo '</div>' . "\n";
|
||||
echo "\n";
|
||||
include('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
} // end if
|
||||
?>
|
@@ -2,10 +2,15 @@
|
||||
/* $Id$ */
|
||||
// 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
|
||||
@@ -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 ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
<?php
|
||||
@@ -137,10 +143,10 @@ if (isset($GLOBALS['cfg']['DBG']['enable'])
|
||||
&& isset($GLOBALS['cfg']['DBG']['profile']['enable'])
|
||||
&& $GLOBALS['cfg']['DBG']['profile']['enable']) {
|
||||
//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 (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
|
||||
include('./libraries/dbg/profiling.php');
|
||||
require_once('./libraries/dbg/profiling.php');
|
||||
dbg_dump_profiling_results();
|
||||
}
|
||||
}
|
||||
@@ -153,4 +159,9 @@ if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
|
||||
PMA_outBufferPost($GLOBALS['ob_mode']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the script execution
|
||||
*/
|
||||
exit;
|
||||
|
||||
?>
|
183
header.inc.php
183
header.inc.php
@@ -2,135 +2,128 @@
|
||||
/* $Id$ */
|
||||
// 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
|
||||
*/
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
if (!defined('PMA_OB_LIB_INCLUDED')) {
|
||||
include('./libraries/ob.lib.php');
|
||||
}
|
||||
if ($GLOBALS['cfg']['OBGzip']) {
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/ob.lib.php');
|
||||
if ($GLOBALS['cfg']['OBGzip']) {
|
||||
$GLOBALS['ob_mode'] = PMA_outBufferModeGet();
|
||||
if ($GLOBALS['ob_mode']) {
|
||||
PMA_outBufferPre($GLOBALS['ob_mode']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// garvin: For re-usability, moved http-headers and stylesheets
|
||||
// to a seperate file. It can now be included by header.inc.php,
|
||||
// queryframe.php, querywindow.php.
|
||||
// garvin: For re-usability, moved http-headers and stylesheets
|
||||
// to a seperate file. It can now be included by header.inc.php,
|
||||
// queryframe.php, querywindow.php.
|
||||
|
||||
include('./libraries/header_http.inc.php');
|
||||
include('./libraries/header_meta_style.inc.php');
|
||||
require_once('./libraries/header_http.inc.php');
|
||||
require_once('./libraries/header_meta_style.inc.php');
|
||||
|
||||
$title = '';
|
||||
if (isset($GLOBALS['db'])) {
|
||||
$title = '';
|
||||
if (isset($GLOBALS['db'])) {
|
||||
$title .= str_replace('\'', '\\\'', $GLOBALS['db']);
|
||||
}
|
||||
if (isset($GLOBALS['table'])) {
|
||||
}
|
||||
if (isset($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 ' : ' ')
|
||||
. 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;
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
<!--
|
||||
// Updates the title of the frameset if possible (ns4 does not allow this)
|
||||
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
|
||||
}
|
||||
$title .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
<!--
|
||||
// Updates the title of the frameset if possible (ns4 does not allow this)
|
||||
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
|
||||
&& typeof(parent.document.title) == 'string') {
|
||||
parent.document.title = '<?php echo $title; ?>';
|
||||
}
|
||||
<?php
|
||||
// Add some javascript instructions if required
|
||||
if (isset($js_to_run) && $js_to_run == 'functions.js') {
|
||||
}
|
||||
<?php
|
||||
// Add some javascript instructions if required
|
||||
if (isset($js_to_run) && $js_to_run == 'functions.js') {
|
||||
echo "\n";
|
||||
?>
|
||||
// js form validation stuff
|
||||
var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
|
||||
var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
|
||||
var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
|
||||
var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
|
||||
var confirmMsg = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
|
||||
// js form validation stuff
|
||||
var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
|
||||
var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
|
||||
var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
|
||||
var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
|
||||
var confirmMsg = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
|
||||
<?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";
|
||||
?>
|
||||
// js form validation stuff
|
||||
var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
|
||||
var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
|
||||
var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
|
||||
var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
|
||||
// js form validation stuff
|
||||
var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
|
||||
var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
|
||||
var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
|
||||
var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
|
||||
<?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";
|
||||
?>
|
||||
// js form validation stuff
|
||||
var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
|
||||
var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
|
||||
var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
|
||||
var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
|
||||
// js form validation stuff
|
||||
var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
|
||||
var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
|
||||
var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
|
||||
var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
|
||||
<?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";
|
||||
?>
|
||||
// js index validation stuff
|
||||
var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
|
||||
var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
|
||||
var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
|
||||
// js index validation stuff
|
||||
var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
|
||||
var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
|
||||
var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
|
||||
<?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";
|
||||
?>
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
|
||||
//-->
|
||||
</script>
|
||||
<script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
|
||||
<?php
|
||||
} else {
|
||||
} else {
|
||||
echo "\n";
|
||||
?>
|
||||
//-->
|
||||
</script>
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
echo "\n";
|
||||
?>
|
||||
}
|
||||
echo "\n";
|
||||
?>
|
||||
<meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
|
||||
</head>
|
||||
</head>
|
||||
|
||||
|
||||
<?php
|
||||
if ($GLOBALS['cfg']['RightBgImage'] != '') {
|
||||
<?php
|
||||
if ($GLOBALS['cfg']['RightBgImage'] != '') {
|
||||
$bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
|
||||
} else {
|
||||
} else {
|
||||
$bkg_img = '';
|
||||
}
|
||||
?>
|
||||
<body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
|
||||
<?php
|
||||
if (!defined('PMA_DISPLAY_HEADING')) {
|
||||
}
|
||||
?>
|
||||
<body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
|
||||
<?php
|
||||
if (!defined('PMA_DISPLAY_HEADING')) {
|
||||
define('PMA_DISPLAY_HEADING', 1);
|
||||
}
|
||||
if (PMA_DISPLAY_HEADING) {
|
||||
}
|
||||
if (PMA_DISPLAY_HEADING) {
|
||||
$header_url_qry = '?' . PMA_generate_common_url();
|
||||
echo '<h1>' . "\n";
|
||||
$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 "\n" . '</h1>' . "\n";
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Sets a variable to remember headers have been sent
|
||||
*/
|
||||
$GLOBALS['is_header_sent'] = TRUE;
|
||||
} // PMA_HEADER_INC_INCLUDED
|
||||
$GLOBALS['is_header_sent'] = TRUE;
|
||||
|
||||
?>
|
@@ -5,8 +5,8 @@
|
||||
/**
|
||||
* Gets a core script and starts output buffering work
|
||||
*/
|
||||
require('./libraries/common.lib.php');
|
||||
require('./libraries/ob.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/ob.lib.php');
|
||||
if ($cfg['OBGzip']) {
|
||||
$ob_mode = PMA_outBufferModeGet();
|
||||
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,
|
||||
// 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
|
||||
|
@@ -6,8 +6,8 @@
|
||||
/**
|
||||
* Gets core libraries and defines some variables
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
// Gets the default font sizes
|
||||
PMA_setFontSizes();
|
||||
@@ -41,7 +41,7 @@ $url_query = PMA_generate_common_url(isset($db) ? $db : '');
|
||||
|
||||
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
|
||||
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
|
||||
|
@@ -18,8 +18,8 @@
|
||||
/**
|
||||
* Gets some core scripts
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
// Check parameters
|
||||
|
||||
@@ -80,9 +80,9 @@ if (isset($btnLDI) && isset($local_textfile) && $local_textfile != '') {
|
||||
*/
|
||||
if (isset($btnLDI) && empty($textfile)) {
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
$message = $strMustSelectFile;
|
||||
include('./ldi_table.php');
|
||||
require('./ldi_table.php');
|
||||
} elseif (isset($btnLDI) && ($textfile != 'none')) {
|
||||
if (!isset($replace)) {
|
||||
$replace = '';
|
||||
@@ -91,7 +91,7 @@ if (isset($btnLDI) && empty($textfile)) {
|
||||
// the error message does not correspond exactly to the error...
|
||||
if (!@chmod($textfile, 0644)) {
|
||||
echo $strFileCouldNotBeRead . ' ' . $textfile . '<br />';
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
// 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
|
||||
// if would be better to Browse the latest inserted data.
|
||||
include('./sql.php');
|
||||
require('./sql.php');
|
||||
if ($unlink_local_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
|
||||
*/
|
||||
else {
|
||||
include('./ldi_table.php');
|
||||
require('./ldi_table.php');
|
||||
}
|
||||
?>
|
@@ -7,12 +7,10 @@
|
||||
* 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
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/common.lib.php');
|
||||
PMA_checkParameters(array('db', 'table'));
|
||||
|
||||
|
||||
@@ -194,5 +192,5 @@ if (PMA_MYSQL_INT_VERSION > 40003) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
12
left.php
12
left.php
@@ -7,7 +7,7 @@
|
||||
* Gets the variables sent to this script, retains the db name that may have
|
||||
* 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)) {
|
||||
// no longer urlencoded because of html entities in the db name
|
||||
// $db = urldecode($lightm_db);
|
||||
@@ -22,8 +22,8 @@ if (!empty($db)) {
|
||||
/**
|
||||
* Gets a core script and starts output buffering work
|
||||
*/
|
||||
require('./libraries/common.lib.php');
|
||||
require('./libraries/ob.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/ob.lib.php');
|
||||
if ($cfg['OBGzip']) {
|
||||
$ob_mode = PMA_outBufferModeGet();
|
||||
if ($ob_mode) {
|
||||
@@ -33,8 +33,8 @@ if ($cfg['OBGzip']) {
|
||||
|
||||
PMA_checkParameters(array('hash'));
|
||||
|
||||
include('./libraries/bookmark.lib.php');
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/bookmark.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
function PMA_reduceNest($_table) {
|
||||
@@ -192,7 +192,7 @@ if ($server > 0) {
|
||||
// to a seperate file. It can now be included by header.inc.php,
|
||||
// queryframe.php, querywindow.php.
|
||||
|
||||
include('./libraries/header_http.inc.php');
|
||||
require_once('./libraries/header_http.inc.php');
|
||||
|
||||
/**
|
||||
* Displays the frame
|
||||
|
@@ -8,49 +8,46 @@
|
||||
// +--------------------------------------------------------------------------+
|
||||
|
||||
|
||||
if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
|
||||
define('PMA_CONFIG_AUTH_INCLUDED', 1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Displays authentication form
|
||||
*
|
||||
* @return boolean always true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth()
|
||||
{
|
||||
function PMA_auth()
|
||||
{
|
||||
return TRUE;
|
||||
} // end of the 'PMA_auth()' function
|
||||
} // end of the 'PMA_auth()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets advanced authentication settings
|
||||
*
|
||||
* @return boolean always true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_check()
|
||||
{
|
||||
function PMA_auth_check()
|
||||
{
|
||||
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
|
||||
*
|
||||
* @return boolean always true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_set_user()
|
||||
{
|
||||
function PMA_auth_set_user()
|
||||
{
|
||||
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
|
||||
*
|
||||
* @global string the MySQL error message PHP returns
|
||||
@@ -68,8 +65,8 @@ if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_fails()
|
||||
{
|
||||
function PMA_auth_fails()
|
||||
{
|
||||
global $php_errormsg;
|
||||
global $connect_func, $server_port, $server_socket, $cfg;
|
||||
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);
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
|
||||
} // $__PMA_CONFIG_AUTH_LIB__
|
||||
?>
|
@@ -10,23 +10,20 @@
|
||||
// +--------------------------------------------------------------------------+
|
||||
|
||||
|
||||
if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
define('PMA_COOKIE_AUTH_INCLUDED', 1);
|
||||
|
||||
if (!isset($coming_from_common)) {
|
||||
if (!isset($coming_from_common)) {
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
include('./libraries/blowfish.php');
|
||||
require_once('./libraries/blowfish.php');
|
||||
|
||||
// Gets the default font sizes
|
||||
PMA_setFontSizes();
|
||||
// Defines the cookie path and whether the server is using https or not
|
||||
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
|
||||
$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;
|
||||
// Gets the default font sizes
|
||||
PMA_setFontSizes();
|
||||
// Defines the cookie path and whether the server is using https or not
|
||||
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
|
||||
$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;
|
||||
|
||||
/**
|
||||
/**
|
||||
* String padding
|
||||
*
|
||||
* @param string input string
|
||||
@@ -38,7 +35,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
*
|
||||
* @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 = '';
|
||||
$length = $pad_length - strlen($input);
|
||||
if ($length > 0) { // str_repeat doesn't like negatives
|
||||
@@ -55,9 +52,9 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
$str = $input;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Encryption using blowfish algorithm
|
||||
*
|
||||
* @param string original data
|
||||
@@ -69,7 +66,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
*
|
||||
* @author lem9
|
||||
*/
|
||||
function PMA_blowfish_encrypt($data, $secret) {
|
||||
function PMA_blowfish_encrypt($data, $secret) {
|
||||
$pma_cipher = new Horde_Cipher_blowfish;
|
||||
$encrypt = '';
|
||||
for ($i=0; $i<strlen($data); $i+=8) {
|
||||
@@ -80,9 +77,9 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
$encrypt .= $pma_cipher->encryptBlock($block, $secret);
|
||||
}
|
||||
return $encrypt;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Decryption using blowfish algorithm
|
||||
*
|
||||
* @param string encrypted data
|
||||
@@ -94,16 +91,16 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
*
|
||||
* @author lem9
|
||||
*/
|
||||
function PMA_blowfish_decrypt($data, $secret) {
|
||||
function PMA_blowfish_decrypt($data, $secret) {
|
||||
$pma_cipher = new Horde_Cipher_blowfish;
|
||||
$decrypt = '';
|
||||
for ($i=0; $i<strlen($data); $i+=8) {
|
||||
$decrypt .= $pma_cipher->decryptBlock(substr($data, $i, 8), $secret);
|
||||
}
|
||||
return trim($decrypt);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Sorts available languages by their true names
|
||||
*
|
||||
* @param array the array to be sorted
|
||||
@@ -113,13 +110,13 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function PMA_cookie_cmp(&$a, $b)
|
||||
{
|
||||
function PMA_cookie_cmp(&$a, $b)
|
||||
{
|
||||
return (strcmp($a[1], $b[1]));
|
||||
} // end of the 'PMA_cmp()' function
|
||||
} // end of the 'PMA_cmp()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Displays authentication form
|
||||
*
|
||||
* @global string the font face to use
|
||||
@@ -137,8 +134,8 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth()
|
||||
{
|
||||
function PMA_auth()
|
||||
{
|
||||
global $right_font_family, $font_size, $font_bigger;
|
||||
global $cfg, $available_languages;
|
||||
global $lang, $server, $convcharset;
|
||||
@@ -340,8 +337,6 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
|
||||
<?php
|
||||
} // end if (server choice)
|
||||
echo "\n";
|
||||
?>
|
||||
<?php
|
||||
if (!empty($conn_error)) {
|
||||
echo '<tr><td colspan="2" align="center"><p class="warning">'. $conn_error . '</p></td></tr>' . "\n";
|
||||
}
|
||||
@@ -381,10 +376,10 @@ if (uname.value == '') {
|
||||
exit();
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_auth()' function
|
||||
} // end of the 'PMA_auth()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets advanced authentication settings
|
||||
*
|
||||
* @global string the username if register_globals is on
|
||||
@@ -402,8 +397,8 @@ if (uname.value == '') {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_check()
|
||||
{
|
||||
function PMA_auth_check()
|
||||
{
|
||||
global $PHP_AUTH_USER, $PHP_AUTH_PW, $pma_auth_server;
|
||||
global $pma_servername, $pma_username, $pma_password, $old_usr;
|
||||
global $from_cookie;
|
||||
@@ -483,10 +478,10 @@ if (uname.value == '') {
|
||||
// we don't need to strip here, it is done in grab_globals
|
||||
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
|
||||
*
|
||||
* @global array the valid servers settings
|
||||
@@ -501,8 +496,8 @@ if (uname.value == '') {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_set_user()
|
||||
{
|
||||
function PMA_auth_set_user()
|
||||
{
|
||||
global $cfg, $server;
|
||||
global $PHP_AUTH_USER, $PHP_AUTH_PW, $pma_auth_server;
|
||||
global $from_cookie;
|
||||
@@ -579,19 +574,19 @@ if (uname.value == '') {
|
||||
} // end if
|
||||
|
||||
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
|
||||
*
|
||||
* @return boolean always true (no return indeed)
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_fails()
|
||||
{
|
||||
global $conn_error;
|
||||
function PMA_auth_fails()
|
||||
{
|
||||
global $conn_error;
|
||||
|
||||
// Deletes password cookie and displays the login form
|
||||
setcookie('pma_cookie_password', base64_encode(''), 0, $GLOBALS['cookie_path'], '' , $GLOBALS['is_https']);
|
||||
@@ -607,7 +602,6 @@ if (uname.value == '') {
|
||||
PMA_auth();
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
|
||||
} // $__PMA_COOKIE_AUTH_LIB__
|
||||
?>
|
@@ -8,10 +8,7 @@
|
||||
// +--------------------------------------------------------------------------+
|
||||
|
||||
|
||||
if (!defined('PMA_HTTP_AUTH_INCLUDED')) {
|
||||
define('PMA_HTTP_AUTH_INCLUDED', 1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Displays authentication form
|
||||
*
|
||||
* @global string the font face to use in case of failure
|
||||
@@ -22,8 +19,8 @@ if (!defined('PMA_HTTP_AUTH_INCLUDED')) {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth()
|
||||
{
|
||||
function PMA_auth()
|
||||
{
|
||||
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']))) . '"');
|
||||
@@ -63,10 +60,10 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
|
||||
exit();
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_auth()' function
|
||||
} // end of the 'PMA_auth()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets advanced authentication settings
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function PMA_auth_check()
|
||||
{
|
||||
function PMA_auth_check()
|
||||
{
|
||||
global $PHP_AUTH_USER, $PHP_AUTH_PW;
|
||||
global $REMOTE_USER, $AUTH_USER, $REMOTE_PASSWORD, $AUTH_PASSWORD;
|
||||
global $HTTP_AUTHORIZATION;
|
||||
@@ -180,10 +177,10 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
|
||||
}
|
||||
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
|
||||
*
|
||||
* @global array the valid servers settings
|
||||
@@ -196,8 +193,8 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_set_user()
|
||||
{
|
||||
function PMA_auth_set_user()
|
||||
{
|
||||
global $cfg, $server;
|
||||
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;
|
||||
|
||||
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
|
||||
*
|
||||
* @return boolean always true (no return indeed)
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_auth_fails()
|
||||
{
|
||||
function PMA_auth_fails()
|
||||
{
|
||||
PMA_auth();
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
|
||||
} // $__PMA_HTTP_AUTH_LIB__
|
||||
?>
|
@@ -7,11 +7,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
define('PMA_BOOKMARK_LIB_INCLUDED', 1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Defines 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
|
||||
*/
|
||||
function PMA_getBookmarksParam()
|
||||
{
|
||||
function PMA_getBookmarksParam()
|
||||
{
|
||||
global $server;
|
||||
|
||||
$cfgBookmark = '';
|
||||
@@ -36,10 +32,10 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
$cfgBookmark['table'] = $GLOBALS['cfg']['Server']['bookmarktable'];
|
||||
|
||||
return $cfgBookmark;
|
||||
} // end of the 'PMA_getBookmarksParam()' function
|
||||
} // end of the 'PMA_getBookmarksParam()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets the list of bookmarks defined for the current database
|
||||
*
|
||||
* @param string the current database name
|
||||
@@ -49,8 +45,8 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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'])
|
||||
. ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\''
|
||||
@@ -74,10 +70,10 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
} // end of the 'PMA_listBookmarks()' function
|
||||
} // end of the 'PMA_listBookmarks()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets the sql command from a bookmark
|
||||
*
|
||||
* @param string the current database name
|
||||
@@ -89,8 +85,8 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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'])) {
|
||||
return '';
|
||||
@@ -109,10 +105,10 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
$bookmark_query = @PMA_mysql_result($result, 0, 'query') OR FALSE;
|
||||
|
||||
return $bookmark_query;
|
||||
} // end of the 'PMA_queryBookmarks()' function
|
||||
} // end of the 'PMA_queryBookmarks()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Adds a bookmark
|
||||
*
|
||||
* @param array the properties of the bookmark to add
|
||||
@@ -123,31 +119,31 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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'])
|
||||
. ' (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'])) {
|
||||
$result = PMA_mysql_query($query, $GLOBALS['dbh']);
|
||||
if (PMA_mysql_error($GLOBALS['dbh'])) {
|
||||
$error = PMA_mysql_error($GLOBALS['dbh']);
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie($error);
|
||||
}
|
||||
} else {
|
||||
$result = PMA_mysql_query($query);
|
||||
if (PMA_mysql_error()) {
|
||||
$error = PMA_mysql_error();
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie($error);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_addBookmarks()' function
|
||||
} // end of the 'PMA_addBookmarks()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Deletes a bookmark
|
||||
*
|
||||
* @param string the current database name
|
||||
@@ -156,8 +152,8 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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'])
|
||||
. ' WHERE (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\''
|
||||
. ' OR user = \'\')'
|
||||
@@ -167,14 +163,12 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
|
||||
} else {
|
||||
$result = PMA_mysql_query($query);
|
||||
}
|
||||
} // end of the 'PMA_deleteBookmarks()' function
|
||||
} // end of the 'PMA_deleteBookmarks()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Bookmark Support
|
||||
*/
|
||||
$cfg['Bookmark'] = PMA_getBookmarksParam();
|
||||
$cfg['Bookmark'] = PMA_getBookmarksParam();
|
||||
|
||||
|
||||
} // $__PMA_BOOKMARK_LIB__
|
||||
?>
|
@@ -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
|
||||
*/
|
||||
if (isset($cfg['AllowAnywhereRecoding'])
|
||||
if (isset($cfg['AllowAnywhereRecoding'])
|
||||
&& $cfg['AllowAnywhereRecoding']
|
||||
&& $allow_recoding) {
|
||||
|
||||
// Initializes configuration for default, if not set:
|
||||
if (!isset($cfg['RecodingEngine'])) {
|
||||
$cfg['RecodingEngine'] = 'auto';
|
||||
}
|
||||
|
||||
if ($cfg['RecodingEngine'] == 'recode') {
|
||||
if (!@extension_loaded('recode')) {
|
||||
PMA_dl('recode');
|
||||
if (!@extension_loaded('recode')) {
|
||||
echo $strCantLoadRecodeIconv;
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
$PMA_recoding_engine = 'recode';
|
||||
@@ -37,7 +29,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
PMA_dl('iconv');
|
||||
if (!@extension_loaded('iconv')) {
|
||||
echo $strCantLoadRecodeIconv;
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
$PMA_recoding_engine = 'iconv';
|
||||
@@ -52,7 +44,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
PMA_dl('recode');
|
||||
if (!@extension_loaded('recode')) {
|
||||
echo $strCantLoadRecodeIconv;
|
||||
exit();
|
||||
exit;
|
||||
} else {
|
||||
$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_ICONV', 1);
|
||||
define('PMA_CHARSET_LIBICONV', 2);
|
||||
define('PMA_CHARSET_RECODE', 3);
|
||||
define('PMA_CHARSET_NONE', 0);
|
||||
define('PMA_CHARSET_ICONV', 1);
|
||||
define('PMA_CHARSET_LIBICONV', 2);
|
||||
define('PMA_CHARSET_RECODE', 3);
|
||||
|
||||
if (!isset($cfg['IconvExtraParams'])) {
|
||||
if (!isset($cfg['IconvExtraParams'])) {
|
||||
$cfg['IconvExtraParams'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Finally detects which function will we use:
|
||||
if (isset($cfg['AllowAnywhereRecoding'])
|
||||
// Finally detects which function will we use:
|
||||
if (isset($cfg['AllowAnywhereRecoding'])
|
||||
&& $cfg['AllowAnywhereRecoding']
|
||||
&& $allow_recoding) {
|
||||
|
||||
@@ -92,7 +84,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
include('./header.inc.php');
|
||||
}
|
||||
echo $strCantUseRecodeIconv;
|
||||
include('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
exit();
|
||||
}
|
||||
} else if ($PMA_recoding_engine == 'recode') {
|
||||
@@ -101,12 +93,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
|
||||
if (!isset($GLOBALS['is_header_sent'])) {
|
||||
include('./header.inc.php');
|
||||
}
|
||||
require_once('./header.inc.php');
|
||||
echo $strCantUseRecodeIconv;
|
||||
include('./footer.inc.php');
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
if (@function_exists('iconv')) {
|
||||
@@ -118,20 +108,18 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
|
||||
if (!isset($GLOBALS['is_header_sent'])) {
|
||||
include('./header.inc.php');
|
||||
}
|
||||
require_once('./header.inc.php');
|
||||
echo $strCantUseRecodeIconv;
|
||||
include('./footer.inc.php');
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Converts encoding according to current settings.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function PMA_convert_display_charset($what) {
|
||||
function PMA_convert_display_charset($what) {
|
||||
global $cfg, $allow_recoding, $charset, $convcharset;
|
||||
|
||||
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
|
||||
@@ -172,13 +160,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
switch ($GLOBALS['PMA_recoding_engine']) {
|
||||
case PMA_CHARSET_RECODE:
|
||||
return recode_string($convcharset . '..' . $charset, $what);
|
||||
break;
|
||||
case PMA_CHARSET_ICONV:
|
||||
return iconv($convcharset, $charset . $cfg['IconvExtraParams'], $what);
|
||||
break;
|
||||
case PMA_CHARSET_LIBICONV:
|
||||
return libiconv($convcharset, $charset, $what);
|
||||
break;
|
||||
default:
|
||||
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...
|
||||
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.
|
||||
*
|
||||
* @param string what to convert
|
||||
@@ -219,7 +204,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
*
|
||||
* @author nijel
|
||||
*/
|
||||
function PMA_convert_charset($what) {
|
||||
function PMA_convert_charset($what) {
|
||||
global $cfg, $allow_recoding, $charset, $convcharset;
|
||||
|
||||
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
|
||||
@@ -228,20 +213,17 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
switch ($GLOBALS['PMA_recoding_engine']) {
|
||||
case PMA_CHARSET_RECODE:
|
||||
return recode_string($charset . '..' . $convcharset, $what);
|
||||
break;
|
||||
case PMA_CHARSET_ICONV:
|
||||
return iconv($charset, $convcharset . $cfg['IconvExtraParams'], $what);
|
||||
break;
|
||||
case PMA_CHARSET_LIBICONV:
|
||||
return libiconv($charset, $convcharset, $what);
|
||||
break;
|
||||
default:
|
||||
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
|
||||
* conversion function.
|
||||
*
|
||||
@@ -255,24 +237,21 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
*
|
||||
* @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']) {
|
||||
case PMA_CHARSET_RECODE:
|
||||
return recode_string($src_charset . '..' . $dest_charset, $what);
|
||||
break;
|
||||
case PMA_CHARSET_ICONV:
|
||||
return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
|
||||
break;
|
||||
case PMA_CHARSET_LIBICONV:
|
||||
return libiconv($src_charset, $dest_charset, $what);
|
||||
break;
|
||||
default:
|
||||
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
|
||||
* conversion function. The old file will be unlinked and new created and
|
||||
* its file name is returned.
|
||||
@@ -287,7 +266,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
*
|
||||
* @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']) {
|
||||
case PMA_CHARSET_RECODE:
|
||||
case PMA_CHARSET_ICONV:
|
||||
@@ -313,11 +292,9 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
|
||||
unlink($file);
|
||||
|
||||
return $tmpfname;
|
||||
break;
|
||||
default:
|
||||
return $file;
|
||||
}
|
||||
} // end of the "PMA_convert_file()" function
|
||||
} // end of the "PMA_convert_file()" function
|
||||
|
||||
} // $__PMA_CHARSET_CONVERSION_LIB__
|
||||
?>
|
@@ -7,22 +7,16 @@
|
||||
* 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:
|
||||
*
|
||||
* in PHP3, functions and constants must be physically defined
|
||||
* before they are referenced
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* - parsing of the configuration file
|
||||
* - first load of the libraries/defines_php.lib.php library (won't get the
|
||||
* MySQL release number)
|
||||
* - load of the libraries/defines.lib.php library
|
||||
* - load of mysql extension (if necessary)
|
||||
* - definition of PMA_sqlAddslashes()
|
||||
* - definition of PMA_format_sql()
|
||||
@@ -49,57 +42,57 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
* - loading of an authentication library
|
||||
* - db connection
|
||||
* - authentication work
|
||||
* - second load of the libraries/define.lib.php library to get the MySQL
|
||||
* release number)
|
||||
* - load of the libraries/defines_mysql.lib.php library to get the MySQL
|
||||
* release number
|
||||
* - other functions, respecting dependencies
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* Minimum inclusion? (i.e. for the stylesheet builder)
|
||||
*/
|
||||
|
||||
if (!isset($is_minimum_common)) {
|
||||
if (!isset($is_minimum_common)) {
|
||||
$is_minimum_common = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Avoids undefined variables
|
||||
*/
|
||||
if (!isset($use_backquotes)) {
|
||||
if (!isset($use_backquotes)) {
|
||||
$use_backquotes = 0;
|
||||
}
|
||||
if (!isset($pos)) {
|
||||
}
|
||||
if (!isset($pos)) {
|
||||
$pos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 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';
|
||||
} else {
|
||||
} else {
|
||||
$cfgfile_to_load = './config.inc.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Parses the configuration file and gets some constants used to define
|
||||
* versions of phpMyAdmin/php/mysql...
|
||||
*/
|
||||
$old_error_reporting = error_reporting(0);
|
||||
include($cfgfile_to_load);
|
||||
// Include failed
|
||||
if (!isset($cfgServers) && !isset($cfg['Servers'])) {
|
||||
$old_error_reporting = error_reporting(0);
|
||||
include_once($cfgfile_to_load);
|
||||
// Include failed
|
||||
if (!isset($cfgServers) && !isset($cfg['Servers'])) {
|
||||
// Creates fake settings
|
||||
$cfg = array('DefaultLang' => 'en-iso-8859-1',
|
||||
'AllowAnywhereRecoding' => FALSE);
|
||||
// Loads the language file
|
||||
include('./libraries/select_lang.lib.php');
|
||||
require_once('./libraries/select_lang.lib.php');
|
||||
// Sends the Content-Type header
|
||||
header('Content-Type: text/html; charset=' . $charset);
|
||||
// Displays the error message
|
||||
?>
|
||||
<!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; ?>">
|
||||
|
||||
<head>
|
||||
@@ -118,58 +111,55 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
<body bgcolor="#ffffff">
|
||||
<h1>phpMyAdmin - <?php echo $strError; ?></h1>
|
||||
<p>
|
||||
<?php echo $strConfigFileError; ?><br /><br />
|
||||
<a href="config.inc.php" target="_blank">config.inc.php</a>
|
||||
<?php echo $strConfigFileError; ?><br /><br />
|
||||
<a href="config.inc.php" target="_blank">config.inc.php</a>
|
||||
</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
error_reporting($old_error_reporting);
|
||||
unset($old_error_reporting);
|
||||
unset($cfgfile_to_load);
|
||||
}
|
||||
error_reporting($old_error_reporting);
|
||||
unset($old_error_reporting, $cfgfile_to_load);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Includes compatibility code for older config.inc.php revisions
|
||||
* if necessary
|
||||
*/
|
||||
if (isset($cfg['FileRevision'])) {
|
||||
if (isset($cfg['FileRevision'])) {
|
||||
// converting revision string into an array
|
||||
// e.g. "Revision: 2.0" becomes array(2, 0).
|
||||
$cfg['FileRevision'] = str_replace('$' . 'Revision: ', '', $cfg['FileRevision']);
|
||||
$cfg['FileRevision'] = str_replace(' $', '', $cfg['FileRevision']);
|
||||
$cfg['FileRevision'] = explode('.', $cfg['FileRevision']);
|
||||
} else {
|
||||
} else {
|
||||
$cfg['FileRevision'] = array(1, 1);
|
||||
}
|
||||
if ($cfg['FileRevision'][0] < 2) {
|
||||
include('./libraries/config_import.lib.php');
|
||||
}
|
||||
}
|
||||
if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 1)) {
|
||||
require_once('./libraries/config_import.lib.php');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Includes the language file if it hasn't been included yet
|
||||
*/
|
||||
if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
|
||||
include('./libraries/select_lang.lib.php');
|
||||
}
|
||||
require_once('./libraries/select_lang.lib.php');
|
||||
|
||||
if ($is_minimum_common == FALSE) {
|
||||
if ($is_minimum_common == FALSE) {
|
||||
/**
|
||||
* Include MySQL wrappers.
|
||||
*/
|
||||
include('./libraries/mysql_wrappers.lib.php');
|
||||
}
|
||||
require_once('./libraries/mysql_wrappers.lib.php');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets constants that defines the PHP 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.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
@@ -183,65 +173,56 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
/**
|
||||
* Charset conversion.
|
||||
*/
|
||||
include('./libraries/charset_conversion.lib.php');
|
||||
}
|
||||
require_once('./libraries/charset_conversion.lib.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
if ($is_minimum_common == FALSE) {
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
include('./libraries/sqlparser.data.php');
|
||||
}
|
||||
require_once('./libraries/sqlparser.data.php');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
include('./libraries/sqlvalidator.lib.php');
|
||||
}
|
||||
require_once('./libraries/sqlvalidator.lib.php');
|
||||
}
|
||||
|
||||
// If zlib output compression is set in the php configuration file, no
|
||||
// output buffering should be run
|
||||
if (@ini_get('zlib.output_compression')) {
|
||||
// If zlib output compression is set in the php configuration file, no
|
||||
// output buffering should be run
|
||||
if (@ini_get('zlib.output_compression')) {
|
||||
$cfg['OBGzip'] = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// disable output-buffering (if set to 'auto') for IE6, else enable it.
|
||||
if (strtolower($cfg['OBGzip']) == 'auto') {
|
||||
// disable output-buffering (if set to 'auto') for IE6, else enable it.
|
||||
if (strtolower($cfg['OBGzip']) == 'auto') {
|
||||
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER < 7) {
|
||||
$cfg['OBGzip'] = FALSE;
|
||||
} else {
|
||||
$cfg['OBGzip'] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_minimum_common == FALSE) {
|
||||
if ($is_minimum_common == FALSE) {
|
||||
/**
|
||||
* 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
|
||||
@@ -253,7 +234,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
// check whether mysql is available
|
||||
if (!@function_exists('mysql_connect')) {
|
||||
if (empty($is_header_sent)) {
|
||||
include('./libraries/header_http.inc.php');
|
||||
require_once('./libraries/header_http.inc.php');
|
||||
}
|
||||
echo $strCantLoadMySQL . '<br />' . "\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;
|
||||
|
||||
if (empty($GLOBALS['is_header_sent'])) {
|
||||
include('./header.inc.php');
|
||||
}
|
||||
require_once('./header.inc.php');
|
||||
|
||||
if (!$error_message) {
|
||||
$error_message = PMA_mysql_error();
|
||||
@@ -510,8 +489,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
echo "\n";
|
||||
|
||||
if ($exit) {
|
||||
include('./footer.inc.php');
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
} // 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;
|
||||
} // end of the 'PMA_isInto()' function
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get the complete list of Databases a user can access
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
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) {
|
||||
// ... 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
|
||||
|
||||
return $dblist;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Determines the font sizes to use depending on the os and browser of the
|
||||
* user.
|
||||
*
|
||||
@@ -702,8 +680,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
*
|
||||
* @version 1.1
|
||||
*/
|
||||
function PMA_setFontSizes()
|
||||
{
|
||||
function PMA_setFontSizes()
|
||||
{
|
||||
global $font_size, $font_biggest, $font_bigger, $font_smaller, $font_smallest;
|
||||
|
||||
// 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;
|
||||
} // 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
|
||||
* 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:)
|
||||
$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()) {
|
||||
PMA_auth();
|
||||
} 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)"
|
||||
// Robbat2 - May 10, 2002
|
||||
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
|
||||
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']
|
||||
. (empty($client_flags) ? '' : ', FALSE, ' . $client_flags)
|
||||
. ')';
|
||||
if (empty($GLOBALS['is_header_sent'])) {
|
||||
include('./header.inc.php');
|
||||
}
|
||||
require_once('./header.inc.php');
|
||||
//PMA_mysqlDie($conn_error, $local_query, FALSE);
|
||||
PMA_mysqlDie($conn_error, '', FALSE);
|
||||
} // end if
|
||||
@@ -1075,9 +1051,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
$dbh = $userlink;
|
||||
}
|
||||
|
||||
// Runs the "defines.lib.php" for the second time to get the mysql
|
||||
// release number
|
||||
include('./libraries/defines.lib.php');
|
||||
// Gets the mysql release number
|
||||
require_once('./libraries/defines_mysql.lib.php');
|
||||
|
||||
// if 'only_db' is set for the current user, there is no need to check for
|
||||
// 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);
|
||||
$showtable = PMA_mysql_fetch_array($result);
|
||||
$num = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
||||
if ($num < $cfg['MaxExactCount']) unset($num);
|
||||
if ($num < $cfg['MaxExactCount']) {
|
||||
unset($num);
|
||||
}
|
||||
mysql_free_result($result);
|
||||
|
||||
if (!isset($num)) {
|
||||
@@ -1357,14 +1334,14 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
echo "\n";
|
||||
$reload_url = './left.php?' . PMA_generate_common_url((isset($GLOBALS['db']) ? $GLOBALS['db'] : ''), '', '&')
|
||||
?>
|
||||
<script type="text/javascript" language="javascript1.2">
|
||||
<!--
|
||||
if (typeof(window.parent) != 'undefined'
|
||||
<script type="text/javascript" language="javascript1.2">
|
||||
<!--
|
||||
if (typeof(window.parent) != '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']) . "'"); ?>);
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
unset($GLOBALS['reload']);
|
||||
}
|
||||
@@ -1382,18 +1359,18 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
$md5_tbl = md5($GLOBALS['table']);
|
||||
echo "\n";
|
||||
?>
|
||||
<script type="text/javascript" language="javascript1.2">
|
||||
<!--
|
||||
if (typeof(document.getElementById) != 'undefined'
|
||||
<script type="text/javascript" language="javascript1.2">
|
||||
<!--
|
||||
if (typeof(document.getElementById) != 'undefined'
|
||||
&& typeof(window.parent.frames['nav']) != 'undefined'
|
||||
&& 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; ?>'))
|
||||
&& 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') {
|
||||
window.parent.frames['nav'].document.getElementById('<?php echo 'tbl_' . $md5_tbl; ?>').title = '<?php echo PMA_jsFormat($tooltip, FALSE); ?>';
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
} // end if
|
||||
} // end if... else if
|
||||
@@ -1416,7 +1393,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
|
||||
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">
|
||||
<tr>
|
||||
<td bgcolor="<?php echo $cfg['ThBgcolor']; ?>">
|
||||
@@ -1605,7 +1582,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
echo "\n";
|
||||
?>
|
||||
</table>
|
||||
</div><br />
|
||||
</div><br />
|
||||
<?php
|
||||
} // end of the 'PMA_showMessage()' function
|
||||
|
||||
@@ -1908,7 +1885,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
}
|
||||
}
|
||||
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>';
|
||||
if ($die) {
|
||||
exit();
|
||||
@@ -1921,7 +1898,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
if (@function_exists('mb_convert_encoding')
|
||||
&& strpos(' ' . $lang, 'ja-')
|
||||
&& 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);
|
||||
} // end if
|
||||
|
||||
@@ -1936,16 +1913,21 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
* @author Michal Cihar (nijel@users.sourceforge.net)
|
||||
*/
|
||||
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 (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 (substr($file, -4 - strlen($extension)) == $extension . '.bz2') return TRUE;
|
||||
if (substr($file, -4 - strlen($extension)) == $extension . '.bz2') {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
} // end function
|
||||
|
||||
} // end if: minimal common.lib needed?
|
||||
} // $__PMA_COMMON_LIB__
|
||||
} // end if: minimal common.lib needed?
|
||||
?>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -8,10 +8,7 @@
|
||||
* 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
|
||||
*
|
||||
* Original obj2xml() function by <jgettys@gnuvox.com>
|
||||
@@ -23,7 +20,7 @@ if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function obj2xml($v, $indent = '') {
|
||||
function obj2xml($v, $indent = '') {
|
||||
$attr = '';
|
||||
foreach($v AS $key => $val) {
|
||||
if (is_string($key) && ($key == '__attr')) {
|
||||
@@ -54,10 +51,10 @@ if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
|
||||
}
|
||||
}
|
||||
} // end while
|
||||
} // end of the "obj2xml()" function
|
||||
} // end of the "obj2xml()" function
|
||||
|
||||
|
||||
$cfg['DBConfig']['AllowUserOverride'] = array(
|
||||
$cfg['DBConfig']['AllowUserOverride'] = array(
|
||||
'Servers/*/bookmarkdb',
|
||||
'Servers/*/bookmarktable',
|
||||
'Servers/*/relation',
|
||||
@@ -90,6 +87,6 @@ if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
|
||||
'ModifyDeleteAtRight',
|
||||
'DefaultDisplay',
|
||||
'RepeatCells'
|
||||
);
|
||||
);
|
||||
|
||||
} // $__PMA_DB_CONFIG_LIB__
|
||||
?>
|
||||
|
@@ -16,7 +16,7 @@ if (!isset($is_db) || !$is_db) {
|
||||
if (!isset($is_transformation_wrapper)) {
|
||||
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
|
||||
}
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
} // end if (ensures db exists)
|
||||
if (!isset($is_table) || !$is_table) {
|
||||
@@ -29,7 +29,7 @@ if (!isset($is_table) || !$is_table) {
|
||||
if (!isset($is_transformation_wrapper)) {
|
||||
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)) {
|
||||
mysql_free_result($is_table);
|
||||
}
|
||||
|
@@ -2,10 +2,7 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_DBG_PROFILING_INCLUDED')) {
|
||||
define('PMA_DBG_PROFILING_INCLUDED', 1);
|
||||
|
||||
if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
|
||||
if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
|
||||
&& isset($GLOBALS['cfg']['DBG']['profile']['enable'])
|
||||
&& $GLOBALS['cfg']['DBG']['profile']['enable']) {
|
||||
|
||||
@@ -83,7 +80,6 @@ if (!defined('PMA_DBG_PROFILING_INCLUDED')) {
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -2,10 +2,7 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_DBG_SETUP_INCLUDED')) {
|
||||
define('PMA_DBG_SETUP_INCLUDED', 1);
|
||||
|
||||
if (isset($GLOBALS['cfg']['DBG']['enable']) && $GLOBALS['cfg']['DBG']['enable']) {
|
||||
if (isset($GLOBALS['cfg']['DBG']['enable']) && $GLOBALS['cfg']['DBG']['enable']) {
|
||||
/**
|
||||
* Loads the DBG extension if needed
|
||||
*/
|
||||
@@ -15,10 +12,9 @@ if (!defined('PMA_DBG_SETUP_INCLUDED')) {
|
||||
if (!@extension_loaded('dbg')) {
|
||||
echo sprintf($strCantLoad, 'DBG') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#faqdbg" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n";
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
$GLOBALS['DBG'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -5,54 +5,137 @@
|
||||
/**
|
||||
* DEFINES VARIABLES & CONSTANTS
|
||||
* 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_BROWSER_AGENT (string) - the browser of the user
|
||||
* 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
|
||||
if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) {
|
||||
if (!empty($server)) {
|
||||
$result = PMA_mysql_query('SELECT VERSION() AS version');
|
||||
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;
|
||||
// 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($row)) {
|
||||
$row['version'] = '3.21.0';
|
||||
if (!isset($match[3])) {
|
||||
$match[3] = 0;
|
||||
}
|
||||
|
||||
define('PMA_MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
|
||||
define('PMA_MYSQL_STR_VERSION', $row['version']);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Determines platform (OS), browser and version of the user
|
||||
// Based on a phpBuilder article:
|
||||
// see http://www.phpbuilder.net/columns/tim20000821.php
|
||||
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'])) {
|
||||
$HTTP_USER_AGENT = $_SERVER['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_AGENT', 'OTHER');
|
||||
}
|
||||
} // $__PMA_DEFINES_LIB__
|
||||
}
|
||||
|
||||
?>
|
40
libraries/defines_mysql.lib.php
Normal file
40
libraries/defines_mysql.lib.php
Normal 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);
|
||||
}
|
||||
|
||||
?>
|
@@ -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__
|
||||
?>
|
@@ -3,7 +3,7 @@
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
// Get relations & co. status
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
function PMA_exportCheckboxCheck($str) {
|
||||
|
@@ -6,10 +6,7 @@
|
||||
* 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
|
||||
*
|
||||
* 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()
|
||||
*/
|
||||
function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
||||
{
|
||||
function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
||||
{
|
||||
global $db, $table;
|
||||
global $unlim_num_rows, $fields_meta;
|
||||
global $err_url;
|
||||
@@ -170,10 +167,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
$the_disp_mode = join('', $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
|
||||
*
|
||||
* @param integer the offset for the "next" page
|
||||
@@ -201,8 +198,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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 $goto;
|
||||
global $num_rows, $unlim_num_rows, $pos, $session_max_rows;
|
||||
@@ -229,7 +226,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
$title2 = '';
|
||||
} // end if... else...
|
||||
?>
|
||||
<td>
|
||||
<td>
|
||||
<form action="sql.php" method="post">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<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="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<form action="sql.php" method="post">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<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="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
|
||||
</form>
|
||||
</td>
|
||||
</td>
|
||||
<?php
|
||||
} // end move back
|
||||
echo "\n";
|
||||
?>
|
||||
<td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="center">
|
||||
</td>
|
||||
<td align="center">
|
||||
<form action="sql.php" method="post"
|
||||
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); ?>
|
||||
@@ -287,10 +284,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
|
||||
?>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</td>
|
||||
<?php
|
||||
// Move to the next page or to the last one
|
||||
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...
|
||||
echo "\n";
|
||||
?>
|
||||
<td>
|
||||
<td>
|
||||
<form action="sql.php" method="post">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<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="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<form action="sql.php" method="post"
|
||||
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); ?>
|
||||
@@ -335,7 +332,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
|
||||
<input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> />
|
||||
</form>
|
||||
</td>
|
||||
</td>
|
||||
<?php
|
||||
} // end move toward
|
||||
|
||||
@@ -385,10 +382,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) {
|
||||
echo "\n";
|
||||
?>
|
||||
<td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<form action="sql.php" method="post">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<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="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" />
|
||||
</form>
|
||||
</td>
|
||||
</td>
|
||||
<?php
|
||||
} // end show all
|
||||
echo "\n";
|
||||
@@ -409,10 +406,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
</table>
|
||||
|
||||
<?php
|
||||
} // end of the 'PMA_displayTableNavigation()' function
|
||||
} // end of the 'PMA_displayTableNavigation()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Displays the headers of the results table
|
||||
*
|
||||
* @param array which elements to display
|
||||
@@ -443,8 +440,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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 $goto;
|
||||
global $sql_query, $num_rows, $pos, $session_max_rows;
|
||||
@@ -533,7 +530,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="<?php echo $span; ?>" align="center">
|
||||
<td colspan="<?php echo $span; ?>" align="center">
|
||||
<?php
|
||||
echo '<form action="sql.php" method="POST">' . "\n";
|
||||
echo PMA_generate_common_hidden_inputs($db, $table, 5);
|
||||
@@ -569,7 +566,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
echo '</form>';
|
||||
echo "\n";
|
||||
?>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<?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;
|
||||
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; ?>">
|
||||
<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>
|
||||
@@ -641,10 +638,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
echo "\n";
|
||||
?>
|
||||
<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; ?>">
|
||||
<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>
|
||||
<?php
|
||||
} // end vertical mode
|
||||
@@ -657,10 +654,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
||||
echo "\n";
|
||||
?>
|
||||
<td<?php echo $colspan; ?> align="center">
|
||||
<td<?php echo $colspan; ?> align="center">
|
||||
<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>
|
||||
</td>
|
||||
</td>
|
||||
<?php
|
||||
} // end horizontal/horizontalflipped mode
|
||||
else {
|
||||
@@ -678,7 +675,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
||||
echo "\n";
|
||||
?>
|
||||
<td<?php echo $colspan; ?>></td>
|
||||
<td<?php echo $colspan; ?>></td>
|
||||
<?php
|
||||
echo "\n";
|
||||
} // 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']) {
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
$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') {
|
||||
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; ?>
|
||||
<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 $comments_table_wrap_post; ?>
|
||||
</th>
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
$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') {
|
||||
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 ($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; ?>
|
||||
</th>
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
$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') {
|
||||
echo "\n";
|
||||
?>
|
||||
<td<?php echo $colspan; ?> align="center">
|
||||
<td<?php echo $colspan; ?> align="center">
|
||||
<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>
|
||||
</td>
|
||||
</td>
|
||||
<?php
|
||||
} // end horizontal/horizontalflipped mode
|
||||
else {
|
||||
@@ -884,7 +881,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
||||
echo "\n";
|
||||
?>
|
||||
<td<?php echo $colspan; ?>></td>
|
||||
<td<?php echo $colspan; ?>></td>
|
||||
<?php
|
||||
} // end horizontal/horizontalflipped mode
|
||||
else {
|
||||
@@ -901,11 +898,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
echo "\n";
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_displayTableHeaders()' function
|
||||
} // end of the 'PMA_displayTableHeaders()' function
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Displays the body of the results table
|
||||
*
|
||||
* @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()
|
||||
*/
|
||||
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 $goto;
|
||||
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
|
||||
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
|
||||
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
|
||||
include('./libraries/display_tbl_links.lib.php');
|
||||
require('./libraries/display_tbl_links.lib.php');
|
||||
} // end if (1.3)
|
||||
echo (($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') ? "\n" : '');
|
||||
} // end if (1)
|
||||
@@ -1242,7 +1239,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
if (file_exists('./libraries/transformations/' . $include_file)) {
|
||||
$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)) {
|
||||
$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
|
||||
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
|
||||
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
|
||||
include('./libraries/display_tbl_links.lib.php');
|
||||
require('./libraries/display_tbl_links.lib.php');
|
||||
} // end if (3)
|
||||
|
||||
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
||||
@@ -1523,10 +1520,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_displayTableBody()' function
|
||||
} // end of the 'PMA_displayTableBody()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Do display the result table with the vertical direction mode.
|
||||
* 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()
|
||||
*/
|
||||
function PMA_displayVerticalTable()
|
||||
{
|
||||
function PMA_displayVerticalTable()
|
||||
{
|
||||
global $vertical_display, $repeat_cells;
|
||||
|
||||
// Displays "multi row delete" link at top if required
|
||||
@@ -1686,10 +1683,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_displayVerticalTable' function
|
||||
} // end of the 'PMA_displayVerticalTable' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Displays a table of results returned by a sql query.
|
||||
* 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_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 $goto;
|
||||
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') {
|
||||
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 = str_replace("\011", ' ', str_replace(' ', ' ', $buffer));
|
||||
$buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '<br />', $buffer);
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
} // $__PMA_DISPLAY_TBL_LIB__
|
||||
}
|
||||
?>
|
@@ -2,20 +2,20 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!empty($del_url)) {
|
||||
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
|
||||
echo ' <input type="checkbox" name="rows_to_delete[]" value="' . $del_query . '" />' . "\n";
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
if (!empty($edit_url)) {
|
||||
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
|
||||
echo PMA_linkOrButton($edit_url, $edit_str, '');
|
||||
echo $bookmark_go;
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
if (!empty($del_url)) {
|
||||
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
|
||||
echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''));
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
if (!empty($del_url)) {
|
||||
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
|
||||
. ' <input type="checkbox" name="rows_to_delete[]" value="' . $del_query . '" />' . "\n"
|
||||
. ' </td>' . "\n";
|
||||
}
|
||||
if (!empty($edit_url)) {
|
||||
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
|
||||
. PMA_linkOrButton($edit_url, $edit_str, '')
|
||||
. $bookmark_go
|
||||
. ' </td>' . "\n";
|
||||
}
|
||||
if (!empty($del_url)) {
|
||||
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
|
||||
. PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''))
|
||||
. ' </td>' . "\n";
|
||||
}
|
||||
?>
|
@@ -8,14 +8,11 @@
|
||||
* 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
|
||||
// field is defined, we show it besides the foreign field
|
||||
$foreign_link = false;
|
||||
if ($foreigners && isset($foreigners[$field])) {
|
||||
// lem9: we always show the foreign field in the drop-down; if a display
|
||||
// field is defined, we show it besides the foreign field
|
||||
$foreign_link = false;
|
||||
if ($foreigners && isset($foreigners[$field])) {
|
||||
$foreigner = $foreigners[$field];
|
||||
$foreign_db = $foreigner['foreign_db'];
|
||||
$foreign_table = $foreigner['foreign_table'];
|
||||
@@ -45,7 +42,6 @@
|
||||
unset($disp);
|
||||
$foreign_link = true;
|
||||
}
|
||||
} // end if $foreigners
|
||||
} // end if $foreigners
|
||||
|
||||
//} // $__PMA_GET_FOREIGN_LIB_INCLUDED__
|
||||
?>
|
@@ -5,15 +5,14 @@
|
||||
|
||||
/**
|
||||
* 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
|
||||
* from them. It does the same work for the $PHP_SELF variable.
|
||||
* script in the $_* arrays and sets simple globals variables from them. It does
|
||||
* 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+
|
||||
*/
|
||||
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)) {
|
||||
return FALSE;
|
||||
}
|
||||
@@ -32,39 +31,38 @@ if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET)) {
|
||||
if (!empty($_GET)) {
|
||||
PMA_gpc_extract($_GET, $GLOBALS);
|
||||
} // end if
|
||||
} // end if
|
||||
|
||||
if (!empty($_POST)) {
|
||||
if (!empty($_POST)) {
|
||||
PMA_gpc_extract($_POST, $GLOBALS);
|
||||
} // end if
|
||||
} // end if
|
||||
|
||||
if (!empty($_FILES)) {
|
||||
if (!empty($_FILES)) {
|
||||
foreach($_FILES AS $name => $value) {
|
||||
$$name = $value['tmp_name'];
|
||||
${$name . '_name'} = $value['name'];
|
||||
}
|
||||
} // end if
|
||||
} // end if
|
||||
|
||||
if (!empty($_SERVER)) {
|
||||
if (isset($_SERVER['PHP_SELF'])) {
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
if (!empty($_SERVER)) {
|
||||
$server_vars = array('PHP_SELF', 'HTTP_ACCEPT_LANGUAGE', 'HTTP_AUTHORIZATION');
|
||||
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'])) {
|
||||
$HTTP_AUTHORIZATION = $_SERVER['HTTP_AUTHORIZATION'];
|
||||
}
|
||||
} // end if
|
||||
unset($server_vars, $current);
|
||||
} // end if
|
||||
|
||||
// Security fix: disallow accessing serious server files via "?goto="
|
||||
if (isset($goto) && strpos(' ' . $goto, '/') > 0 && substr($goto, 0, 2) != './') {
|
||||
// Security fix: disallow accessing serious server files via "?goto="
|
||||
if (isset($goto) && strpos(' ' . $goto, '/') > 0 && substr($goto, 0, 2) != './') {
|
||||
unset($goto);
|
||||
} // end if
|
||||
} // end if
|
||||
|
||||
} // $__PMA_GRAB_GLOBALS_LIB__
|
||||
?>
|
@@ -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
|
||||
*
|
||||
* @return string the ip of the user
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function PMA_getIp()
|
||||
{
|
||||
function PMA_getIp()
|
||||
{
|
||||
global $REMOTE_ADDR;
|
||||
global $HTTP_X_FORWARDED_FOR, $HTTP_X_FORWARDED, $HTTP_FORWARDED_FOR, $HTTP_FORWARDED;
|
||||
global $HTTP_VIA, $HTTP_X_COMING_FROM, $HTTP_COMING_FROM;
|
||||
@@ -152,10 +149,10 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
|
||||
return FALSE;
|
||||
}
|
||||
} // end if... else...
|
||||
} // end of the 'PMA_getIp()' function
|
||||
} // end of the 'PMA_getIp()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Based on IP Pattern Matcher
|
||||
* Originally by J.Adams <jna@retina.net>
|
||||
* Found on <http://www.php.net/manual/en/function.ip2long.php>
|
||||
@@ -176,8 +173,8 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_ipMaskTest($testRange, $ipToTest)
|
||||
{
|
||||
function PMA_ipMaskTest($testRange, $ipToTest)
|
||||
{
|
||||
$result = TRUE;
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
*
|
||||
* @param string 'allow' | 'deny' type of rule to match
|
||||
@@ -233,8 +230,8 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_getIp()
|
||||
*/
|
||||
function PMA_allowDeny($type)
|
||||
{
|
||||
function PMA_allowDeny($type)
|
||||
{
|
||||
global $cfg;
|
||||
|
||||
// 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
|
||||
|
||||
return FALSE;
|
||||
} // end of the "PMA_AllowDeny()" function
|
||||
} // end of the "PMA_AllowDeny()" function
|
||||
|
||||
} // $__PMA_ALLOW_DENY_LIB__
|
||||
?>
|
@@ -12,10 +12,8 @@
|
||||
*
|
||||
* 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
|
||||
* codes list
|
||||
* 2002/1/4 by Y.Kawada
|
||||
@@ -25,7 +23,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
*
|
||||
* @return boolean always true
|
||||
*/
|
||||
function PMA_internal_enc_check() {
|
||||
function PMA_internal_enc_check() {
|
||||
global $internal_enc, $enc_list;
|
||||
|
||||
$internal_enc = mb_internal_encoding();
|
||||
@@ -36,10 +34,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
}
|
||||
|
||||
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
|
||||
* 2002/1/4 by Y.Kawada
|
||||
*
|
||||
@@ -47,7 +45,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
*
|
||||
* @return boolean always true
|
||||
*/
|
||||
function PMA_change_enc_order() {
|
||||
function PMA_change_enc_order() {
|
||||
global $enc_list;
|
||||
|
||||
$p = explode(',', $enc_list);
|
||||
@@ -58,10 +56,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_change_enc_order' function
|
||||
} // end of the 'PMA_change_enc_order' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Kanji string encoding convert
|
||||
* 2002/1/4 by Y.Kawada
|
||||
*
|
||||
@@ -73,7 +71,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
*
|
||||
* @return string the converted string
|
||||
*/
|
||||
function PMA_kanji_str_conv($str, $enc, $kana) {
|
||||
function PMA_kanji_str_conv($str, $enc, $kana) {
|
||||
global $enc_list;
|
||||
|
||||
if ($enc == '' && $kana == '') {
|
||||
@@ -91,10 +89,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
$dist = $str;
|
||||
}
|
||||
return $dist;
|
||||
} // end of the 'PMA_kanji_str_conv' function
|
||||
} // end of the 'PMA_kanji_str_conv' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Kanji file encoding convert
|
||||
* 2002/1/4 by Y.Kawada
|
||||
*
|
||||
@@ -104,7 +102,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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 == '') {
|
||||
return $file;
|
||||
}
|
||||
@@ -124,10 +122,10 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
unlink($file);
|
||||
|
||||
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
|
||||
* 2002/1/4 by Y.Kawada
|
||||
*
|
||||
@@ -135,7 +133,7 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
*
|
||||
* @return string xhtml code for the radio controls
|
||||
*/
|
||||
function PMA_set_enc_form($spaces) {
|
||||
function PMA_set_enc_form($spaces) {
|
||||
return "\n"
|
||||
. $spaces . '<input type="radio" name="knjenc" value="" checked="checked" />non' . "\n"
|
||||
. $spaces . '<input type="radio" name="knjenc" value="EUC-JP" />EUC' . "\n"
|
||||
@@ -143,10 +141,9 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
|
||||
. $spaces . ' ' . $GLOBALS['strEncto'] . '<br />' . "\n"
|
||||
. $spaces . '<input type="checkbox" name="xkana" value="kana" />' . "\n"
|
||||
. $spaces . ' ' . $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
|
||||
?>
|
@@ -2,8 +2,7 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
|
||||
define('PMA_MYSQL_CHARSETS_LIB_INCLUDED', 1);
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100){
|
||||
|
||||
$res = PMA_mysql_query('SHOW CHARACTER SET;', $userlink)
|
||||
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_free_result($res);
|
||||
unset($res);
|
||||
unset($row);
|
||||
unset($res, $row);
|
||||
|
||||
$res = PMA_mysql_query('SHOW COLLATION;', $userlink)
|
||||
or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW COLLATION;');
|
||||
@@ -44,8 +42,7 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
|
||||
}
|
||||
|
||||
@mysql_free_result($res);
|
||||
unset($res);
|
||||
unset($row);
|
||||
unset($res, $row);
|
||||
|
||||
function PMA_getCollationDescr($collation) {
|
||||
if ($collation == 'binary') {
|
||||
@@ -205,6 +202,6 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
|
||||
return $descr;
|
||||
}
|
||||
|
||||
} // $__PMA_MYSQL_CHARSETS_LIB__
|
||||
}
|
||||
|
||||
?>
|
@@ -9,19 +9,15 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
|
||||
define('PMA_MYSQL_WRAPPERS_LIB_INCLUDED', 1);
|
||||
|
||||
function PMA_mysql_dbname($result, $row, $field = FALSE) {
|
||||
function PMA_mysql_dbname($result, $row, $field = FALSE) {
|
||||
if ($field != FALSE) {
|
||||
return PMA_convert_display_charset(mysql_dbname($result, $row, $field));
|
||||
} else {
|
||||
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 (mysql_errno($id) != 0) {
|
||||
return PMA_convert_display_charset('#' . mysql_errno($id) . ' - ' . mysql_error($id));
|
||||
@@ -31,9 +27,9 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
function PMA_mysql_fetch_array($result, $type = FALSE) {
|
||||
function PMA_mysql_fetch_array($result, $type = FALSE) {
|
||||
global $cfg, $allow_recoding, $charset, $convcharset;
|
||||
|
||||
if ($type != FALSE) {
|
||||
@@ -68,36 +64,36 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function PMA_mysql_fetch_field($result , $field_offset = FALSE) {
|
||||
function PMA_mysql_fetch_field($result , $field_offset = FALSE) {
|
||||
if ($field_offset != FALSE) {
|
||||
return PMA_convert_display_charset(mysql_fetch_field($result, $field_offset));
|
||||
} else {
|
||||
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
|
||||
* speed really matters, duplicate here code from PMA_mysql_fetch_array
|
||||
* with removing rows working with associative array. */
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
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 ($result_mode != FALSE) {
|
||||
return mysql_query(PMA_convert_charset($query), $link_identifier, $result_mode);
|
||||
@@ -107,18 +103,18 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
|
||||
} else {
|
||||
return mysql_query(PMA_convert_charset($query));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mysql_list_tables() is deprecated, also we got report about weird results
|
||||
// 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) {
|
||||
return PMA_mysql_query('SHOW TABLES FROM ' . PMA_backquote(PMA_convert_charset($database_name)), $link_identifier);
|
||||
} else {
|
||||
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
|
||||
// under some circumstances
|
||||
@@ -126,7 +122,7 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
|
||||
// using SELECT * FROM db.table
|
||||
// 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) {
|
||||
$result = PMA_mysql_query('SHOW FIELDS FROM '
|
||||
. PMA_backquote(PMA_convert_charset($database_name)) . '.'
|
||||
@@ -143,36 +139,34 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
|
||||
}
|
||||
|
||||
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) {
|
||||
return mysql_list_fields(PMA_convert_charset($database_name), PMA_convert_charset($table_name), $link_identifier);
|
||||
} else {
|
||||
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) {
|
||||
return PMA_convert_display_charset(mysql_result($result, $row, PMA_convert_charset($field)));
|
||||
} else {
|
||||
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) {
|
||||
return mysql_select_db(PMA_convert_charset($database_name), $link_identifier);
|
||||
} else {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // PMA_MYSQL_WRAPPERS_LIB_INCLUDED
|
||||
?>
|
@@ -3,26 +3,25 @@
|
||||
// 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
|
||||
* because both header and footer functions must know what each other is
|
||||
* doing.
|
||||
*
|
||||
* @return integer the output buffer mode
|
||||
*/
|
||||
function PMA_outBufferModeGet()
|
||||
{
|
||||
function PMA_outBufferModeGet()
|
||||
{
|
||||
if (@function_exists('ob_start')) {
|
||||
$mode = 1;
|
||||
} else {
|
||||
@@ -62,10 +61,10 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
|
||||
header('X-ob_mode: ' . $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
|
||||
* output buffering is turned on. It also needs to be passed $mode from
|
||||
* 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
|
||||
*/
|
||||
function PMA_outBufferPre($mode)
|
||||
{
|
||||
function PMA_outBufferPre($mode)
|
||||
{
|
||||
switch($mode)
|
||||
{
|
||||
case 1:
|
||||
@@ -94,10 +93,10 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
|
||||
} // end switch
|
||||
|
||||
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
|
||||
* buffering is turned on. It also needs to be passed $mode from the
|
||||
* 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
|
||||
*/
|
||||
function PMA_outBufferPost($mode)
|
||||
{
|
||||
function PMA_outBufferPost($mode)
|
||||
{
|
||||
switch($mode)
|
||||
{
|
||||
case 1:
|
||||
@@ -126,8 +125,6 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
|
||||
} // end switch
|
||||
|
||||
return $retval;
|
||||
} // end of the 'PMA_outBufferPost()' function
|
||||
|
||||
} // $__PMA_OB_LIB__
|
||||
} // end of the 'PMA_outBufferPost()' function
|
||||
|
||||
?>
|
@@ -2,10 +2,7 @@
|
||||
/* $Id$ */
|
||||
// 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
|
||||
*
|
||||
* Last revision: September 23, 2001 - gandon
|
||||
@@ -19,8 +16,8 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_splitSqlFile(&$ret, $sql, $release)
|
||||
{
|
||||
function PMA_splitSqlFile(&$ret, $sql, $release)
|
||||
{
|
||||
$sql = trim($sql);
|
||||
$sql_len = strlen($sql);
|
||||
$char = '';
|
||||
@@ -138,10 +135,10 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} // end of the 'PMA_splitSqlFile()' function
|
||||
} // end of the 'PMA_splitSqlFile()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Reads (and decompresses) a (compressed) file into a string
|
||||
*
|
||||
* @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
|
||||
* boolean FALSE in case of an error.
|
||||
*/
|
||||
function PMA_readFile($path, $mime = '') {
|
||||
function PMA_readFile($path, $mime = '') {
|
||||
global $cfg;
|
||||
|
||||
if (!file_exists($path)) {
|
||||
@@ -209,7 +206,6 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
|
||||
return FALSE;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
} // $__PMA_READ_DUMP_LIB__
|
||||
}
|
||||
|
||||
?>
|
@@ -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
|
||||
*
|
||||
* @param string the query to execute
|
||||
@@ -54,7 +51,7 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
} // end of the "PMA_query_as_cu()" function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Defines the relation parameters for the current user
|
||||
* just a copy of the functions used for relations ;-)
|
||||
* 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>
|
||||
*/
|
||||
function PMA_getRelationsParam($verbose = FALSE)
|
||||
{
|
||||
function PMA_getRelationsParam($verbose = FALSE)
|
||||
{
|
||||
global $cfg, $server, $err_url_0, $db, $table;
|
||||
global $cfgRelation;
|
||||
|
||||
@@ -260,10 +257,10 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
} // end if ($verbose == TRUE) {
|
||||
|
||||
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
|
||||
* 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
|
||||
*/
|
||||
function PMA_getForeigners($db, $table, $column = '', $source = 'both') {
|
||||
function PMA_getForeigners($db, $table, $column = '', $source = 'both') {
|
||||
global $cfgRelation, $err_url_0;
|
||||
|
||||
if ($cfgRelation['relwork'] && ($source == 'both' || $source == 'internal')) {
|
||||
@@ -345,10 +342,10 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
} // end of the 'PMA_getForeigners()' function
|
||||
} // end of the 'PMA_getForeigners()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets the display field of a table
|
||||
*
|
||||
* @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>
|
||||
*/
|
||||
function PMA_getDisplayField($db, $table) {
|
||||
function PMA_getDisplayField($db, $table) {
|
||||
global $cfgRelation;
|
||||
|
||||
$disp_query = 'SELECT display_field FROM ' . PMA_backquote($cfgRelation['table_info'])
|
||||
@@ -376,10 +373,10 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
} // end of the 'PMA_getDisplayField()' function
|
||||
} // end of the 'PMA_getDisplayField()' function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets the comments for all rows of a table
|
||||
*
|
||||
* @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>
|
||||
*/
|
||||
function PMA_getComments($db, $table = '') {
|
||||
function PMA_getComments($db, $table = '') {
|
||||
global $cfgRelation;
|
||||
|
||||
if ($table != '') {
|
||||
@@ -427,35 +424,35 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
}
|
||||
} // end of the 'PMA_getComments()' function
|
||||
|
||||
/**
|
||||
* Adds/removes slashes if required
|
||||
*
|
||||
* @param string the string to slash
|
||||
*
|
||||
* @return string the slashed string
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_handleSlashes($val) {
|
||||
/**
|
||||
* Adds/removes slashes if required
|
||||
*
|
||||
* @param string the string to slash
|
||||
*
|
||||
* @return string the slashed string
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_handleSlashes($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.
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the name 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
|
||||
*
|
||||
* @return boolean true, if comment-query was made.
|
||||
*
|
||||
* @global array the list of relations settings
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_setComment($db, $table, $key, $value, $removekey = '') {
|
||||
/**
|
||||
* Set a single comment to a certain value.
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the name 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
|
||||
*
|
||||
* @return boolean true, if comment-query was made.
|
||||
*
|
||||
* @global array the list of relations settings
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_setComment($db, $table, $key, $value, $removekey = '') {
|
||||
global $cfgRelation;
|
||||
|
||||
if ($removekey != '' AND $removekey != $key) {
|
||||
@@ -505,21 +502,21 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} // end of 'PMA_setComment()' function
|
||||
} // end of 'PMA_setComment()' function
|
||||
|
||||
/**
|
||||
* Set a SQL history entry
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the username
|
||||
* @param string the sql query
|
||||
*
|
||||
* @return boolean true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_setHistory($db, $table, $username, $sqlquery) {
|
||||
* Set a SQL history entry
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the username
|
||||
* @param string the sql query
|
||||
*
|
||||
* @return boolean true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_setHistory($db, $table, $username, $sqlquery) {
|
||||
global $cfgRelation;
|
||||
|
||||
$hist_rs = PMA_query_as_cu('INSERT INTO ' . PMA_backquote($cfgRelation['history']) . ' ('
|
||||
@@ -535,18 +532,18 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
. 'NOW(),'
|
||||
. '\'' . PMA_sqlAddslashes($sqlquery) . '\')');
|
||||
return true;
|
||||
} // end of 'PMA_setHistory()' function
|
||||
} // end of 'PMA_setHistory()' function
|
||||
|
||||
/**
|
||||
* Gets a SQL history entry
|
||||
*
|
||||
* @param string the username
|
||||
*
|
||||
* @return array list of history items
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_getHistory($username) {
|
||||
* Gets a SQL history entry
|
||||
*
|
||||
* @param string the username
|
||||
*
|
||||
* @return array list of history items
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_getHistory($username) {
|
||||
global $cfgRelation;
|
||||
|
||||
$hist_rs = PMA_query_as_cu('SELECT '
|
||||
@@ -563,21 +560,21 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
|
||||
return $history;
|
||||
|
||||
} // end of 'PMA_getHistory()' function
|
||||
} // end of 'PMA_getHistory()' function
|
||||
|
||||
/**
|
||||
* Set a SQL history entry
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the username
|
||||
* @param string the sql query
|
||||
*
|
||||
* @return boolean true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_purgeHistory($username) {
|
||||
/**
|
||||
* Set a SQL history entry
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the username
|
||||
* @param string the sql query
|
||||
*
|
||||
* @return boolean true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_purgeHistory($username) {
|
||||
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');
|
||||
@@ -592,21 +589,21 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
}
|
||||
|
||||
return true;
|
||||
} // end of 'PMA_purgeHistory()' function
|
||||
} // end of 'PMA_purgeHistory()' function
|
||||
|
||||
/**
|
||||
* Outputs dropdown with values of foreign fields
|
||||
*
|
||||
* @param string the query of the foreign keys
|
||||
* @param string the foreign field
|
||||
* @param string the foreign field to display
|
||||
* @param string the current data of the dropdown
|
||||
*
|
||||
* @return string the <option value=""><option>s
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $max = 100) {
|
||||
/**
|
||||
* Outputs dropdown with values of foreign fields
|
||||
*
|
||||
* @param string the query of the foreign keys
|
||||
* @param string the foreign field
|
||||
* @param string the foreign field to display
|
||||
* @param string the current data of the dropdown
|
||||
*
|
||||
* @return string the <option value=""><option>s
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $max = 100) {
|
||||
global $cfg;
|
||||
|
||||
$ret = '<option value=""></option>' . "\n";
|
||||
@@ -646,7 +643,6 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
$ret .= implode('', $reloptions['id-content']);
|
||||
|
||||
return $ret;
|
||||
} // end of 'PMA_foreignDropdown()' function
|
||||
} // end of 'PMA_foreignDropdown()' function
|
||||
|
||||
} // $__PMA_RELATION_LIB__
|
||||
?>
|
@@ -7,13 +7,10 @@
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
|
||||
define('PMA_RELATION_CLEANUP_LIB_INCLUDED', 1);
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
include('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
function PMA_relationsCleanupColumn($db, $table, $column) {
|
||||
function PMA_relationsCleanupColumn($db, $table, $column) {
|
||||
global $cfgRelation;
|
||||
if ($cfgRelation['commwork']) {
|
||||
$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);
|
||||
unset($rmv_query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function PMA_relationsCleanupTable($db, $table) {
|
||||
function PMA_relationsCleanupTable($db, $table) {
|
||||
global $cfgRelation;
|
||||
|
||||
if ($cfgRelation['commwork']) {
|
||||
@@ -90,9 +87,9 @@ if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
|
||||
$rmv_rs = PMA_query_as_cu($remove_query);
|
||||
unset($rmv_query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function PMA_relationsCleanupDatabase($db) {
|
||||
function PMA_relationsCleanupDatabase($db) {
|
||||
global $cfgRelation;
|
||||
|
||||
if ($cfgRelation['commwork']) {
|
||||
@@ -139,7 +136,6 @@ if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
|
||||
$rmv_rs = PMA_query_as_cu($remove_query);
|
||||
unset($rmv_query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // $__PMA_RELATION_CLEANUP_LIB__
|
||||
?>
|
@@ -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
|
||||
* 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.
|
||||
* 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
|
||||
@@ -49,7 +51,7 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
|
||||
* For Russian, we put 1251 first, because MSIE does not accept 866
|
||||
* and users would not see anything.
|
||||
*/
|
||||
$available_languages = array(
|
||||
$available_languages = array(
|
||||
'af-utf-8' => array('af|afrikaans', 'afrikaans-utf-8', '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'),
|
||||
@@ -148,13 +150,10 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
|
||||
'zh-tw' => array('zh[-_]tw|chinese traditional', 'chinese_big5', 'zh-TW'),
|
||||
'zh-utf-8' => array('zh|chinese simplified', 'chinese_gb-utf-8', '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
|
||||
* that should be used
|
||||
*
|
||||
@@ -166,8 +165,8 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function PMA_langDetect($str = '', $envType = '')
|
||||
{
|
||||
function PMA_langDetect($str = '', $envType = '')
|
||||
{
|
||||
global $available_languages;
|
||||
global $lang;
|
||||
|
||||
@@ -180,24 +179,10 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // end of the 'PMA_langDetect()' function
|
||||
|
||||
} // end if
|
||||
} // end of the 'PMA_langDetect()' function
|
||||
|
||||
|
||||
/**
|
||||
* 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($lang)) {
|
||||
if (isset($_GET) && !empty($_GET['lang'])) {
|
||||
$lang = $_GET['lang'];
|
||||
}
|
||||
@@ -207,25 +192,25 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
|
||||
else if (isset($_COOKIE) && !empty($_COOKIE['lang'])) {
|
||||
$lang = $_COOKIE['lang'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Do the work!
|
||||
*/
|
||||
|
||||
// compatibility with config.inc.php <= v1.80
|
||||
if (!isset($cfg['Lang']) && isset($cfgLang)) {
|
||||
// compatibility with config.inc.php <= v1.80
|
||||
if (!isset($cfg['Lang']) && isset($cfgLang)) {
|
||||
$cfg['Lang'] = $cfgLang;
|
||||
unset($cfgLang);
|
||||
}
|
||||
if (!isset($cfg['DefaultLang']) && isset($cfgDefaultLang)) {
|
||||
}
|
||||
if (!isset($cfg['DefaultLang']) && isset($cfgDefaultLang)) {
|
||||
$cfg['DefaultLang'] = $cfgDefaultLang;
|
||||
unset($cfgLang);
|
||||
}
|
||||
}
|
||||
|
||||
// Disable UTF-8 if $cfg['AllowAnywhereRecoding'] has been set to FALSE.
|
||||
if (!isset($cfg['AllowAnywhereRecoding']) || !$cfg['AllowAnywhereRecoding']) {
|
||||
// Disable UTF-8 if $cfg['AllowAnywhereRecoding'] has been set to FALSE.
|
||||
if (!isset($cfg['AllowAnywhereRecoding']) || !$cfg['AllowAnywhereRecoding']) {
|
||||
$available_language_files = $available_languages;
|
||||
$available_languages = array();
|
||||
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;
|
||||
}
|
||||
} // end while
|
||||
unset($tmp_lang);
|
||||
unset($tmp_lang_data);
|
||||
unset($available_language_files);
|
||||
} // end if
|
||||
unset($tmp_lang, $tmp_lang_data, $available_language_files);
|
||||
} // end if
|
||||
|
||||
// Lang forced
|
||||
if (!empty($cfg['Lang'])) {
|
||||
// Lang forced
|
||||
if (!empty($cfg['Lang'])) {
|
||||
$lang = $cfg['Lang'];
|
||||
}
|
||||
}
|
||||
|
||||
// If '$lang' is defined, ensure this is a valid translation
|
||||
if (!empty($lang) && empty($available_languages[$lang])) {
|
||||
// If '$lang' is defined, ensure this is a valid translation
|
||||
if (!empty($lang) && empty($available_languages[$lang])) {
|
||||
$lang = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Language is not defined yet :
|
||||
// 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE
|
||||
// variable
|
||||
if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) {
|
||||
// Language is not defined yet :
|
||||
// 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE
|
||||
// variable
|
||||
if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) {
|
||||
$accepted = explode(',', $HTTP_ACCEPT_LANGUAGE);
|
||||
$acceptedCnt = count($accepted);
|
||||
for ($i = 0; $i < $acceptedCnt && empty($lang); $i++) {
|
||||
PMA_langDetect($accepted[$i], 1);
|
||||
}
|
||||
}
|
||||
// 2. try to findout user's language by checking its HTTP_USER_AGENT variable
|
||||
if (empty($lang) && !empty($HTTP_USER_AGENT)) {
|
||||
}
|
||||
// 2. try to findout user's language by checking its HTTP_USER_AGENT variable
|
||||
if (empty($lang) && !empty($HTTP_USER_AGENT)) {
|
||||
PMA_langDetect($HTTP_USER_AGENT, 2);
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Didn't catch any valid lang : we use the default settings
|
||||
if (empty($lang)) {
|
||||
// 3. Didn't catch any valid lang : we use the default settings
|
||||
if (empty($lang)) {
|
||||
$lang = $cfg['DefaultLang'];
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Checks whether charset recoding should be allowed or not
|
||||
$allow_recoding = FALSE; // Default fallback value
|
||||
if (!isset($convcharset) || empty($convcharset)) {
|
||||
// 4. Checks whether charset recoding should be allowed or not
|
||||
$allow_recoding = FALSE; // Default fallback value
|
||||
if (!isset($convcharset) || empty($convcharset)) {
|
||||
$convcharset = $cfg['DefaultCharset'];
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Defines the associated filename and load the translation
|
||||
$lang_file = $lang_path . $available_languages[$lang][1] . '.inc.php';
|
||||
include('./' . $lang_file);
|
||||
// 5. Defines the associated filename and load the translation
|
||||
$lang_file = $lang_path . $available_languages[$lang][1] . '.inc.php';
|
||||
require_once('./' . $lang_file);
|
||||
|
||||
} // $__PMA_SELECT_LANG_LIB__
|
||||
?>
|
@@ -14,10 +14,7 @@
|
||||
* (around 4.0.2) as well as the MySQL documentation.
|
||||
*/
|
||||
|
||||
if (!defined('PMA_SQP_DATA_INCLUDED')) {
|
||||
define('PMA_SQP_DATA_INCLUDED', 1);
|
||||
|
||||
$PMA_SQPdata_function_name = array (
|
||||
$PMA_SQPdata_function_name = array (
|
||||
'ABS',
|
||||
'ACOS',
|
||||
'ADDDATE',
|
||||
@@ -169,11 +166,11 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
|
||||
'WEEKDAY',
|
||||
'YEAR',
|
||||
'YEARWEEK'
|
||||
);
|
||||
//$PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
|
||||
$PMA_SQPdata_function_name_cnt = 151;
|
||||
);
|
||||
//$PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
|
||||
$PMA_SQPdata_function_name_cnt = 151;
|
||||
|
||||
$PMA_SQPdata_column_attrib = array (
|
||||
$PMA_SQPdata_column_attrib = array (
|
||||
'AUTO_INCREMENT',
|
||||
'BDB',
|
||||
'BERKELEYDB',
|
||||
@@ -189,11 +186,11 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
|
||||
'UNSIGNED',
|
||||
'VARYING',
|
||||
'ZEROFILL'
|
||||
);
|
||||
//$PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
|
||||
$PMA_SQPdata_column_attrib_cnt = 15;
|
||||
);
|
||||
//$PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
|
||||
$PMA_SQPdata_column_attrib_cnt = 15;
|
||||
|
||||
$PMA_SQPdata_reserved_word = array (
|
||||
$PMA_SQPdata_reserved_word = array (
|
||||
'ACTION',
|
||||
'ADD',
|
||||
'AFTER',
|
||||
@@ -451,11 +448,11 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
|
||||
'WRITE',
|
||||
'XOR',
|
||||
'YEAR_MONTH'
|
||||
);
|
||||
//$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
|
||||
$PMA_SQPdata_reserved_word_cnt = 255;
|
||||
);
|
||||
//$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
|
||||
$PMA_SQPdata_reserved_word_cnt = 255;
|
||||
|
||||
$PMA_SQPdata_column_type = array (
|
||||
$PMA_SQPdata_column_type = array (
|
||||
'BIGINT',
|
||||
'BIT',
|
||||
'BLOB',
|
||||
@@ -499,9 +496,8 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
|
||||
'VARBINARY',
|
||||
'VARCHAR',
|
||||
'YEAR'
|
||||
);
|
||||
//$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
|
||||
$PMA_SQPdata_column_type_cnt = 43;
|
||||
);
|
||||
//$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
|
||||
$PMA_SQPdata_column_type_cnt = 43;
|
||||
|
||||
} // $__PMA_SQP_DATA__
|
||||
?>
|
@@ -31,31 +31,24 @@
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
define('PMA_SQP_LIB_INCLUDED', 1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Minimum inclusion? (i.e. for the stylesheet builder)
|
||||
*/
|
||||
|
||||
if (!isset($is_minimum_common)) {
|
||||
if (!isset($is_minimum_common)) {
|
||||
$is_minimum_common = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_minimum_common == FALSE) {
|
||||
if ($is_minimum_common == FALSE) {
|
||||
/**
|
||||
* Include the string library as we use it heavily
|
||||
*/
|
||||
if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
include('./libraries/string.lib.php');
|
||||
}
|
||||
require_once('./libraries/string.lib.php');
|
||||
|
||||
/**
|
||||
* Include data for the SQL Parser
|
||||
*/
|
||||
if (!defined('PMA_SQP_DATA_INCLUDED')) {
|
||||
include('./libraries/sqlparser.data.php');
|
||||
}
|
||||
require_once('./libraries/sqlparser.data.php');
|
||||
|
||||
if (!defined('DEBUG_TIMING')) {
|
||||
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()
|
||||
$in_extract = FALSE;
|
||||
|
||||
/* Description of analyzer results
|
||||
/* Description of analyzer results
|
||||
*
|
||||
* 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
|
||||
// first word of the reserved expressions that end a table ref;
|
||||
// maybe this is not ok (the first word might mean something else)
|
||||
// $words_ending_table_ref = array(
|
||||
// 'FOR UPDATE',
|
||||
// 'GROUP BY',
|
||||
// 'HAVING',
|
||||
// 'LIMIT',
|
||||
// 'LOCK IN SHARE MODE',
|
||||
// 'ORDER BY',
|
||||
// 'PROCEDURE',
|
||||
// 'UNION',
|
||||
// 'WHERE'
|
||||
// );
|
||||
// $words_ending_table_ref = array(
|
||||
// 'FOR UPDATE',
|
||||
// 'GROUP BY',
|
||||
// 'HAVING',
|
||||
// 'LIMIT',
|
||||
// 'LOCK IN SHARE MODE',
|
||||
// 'ORDER BY',
|
||||
// 'PROCEDURE',
|
||||
// 'UNION',
|
||||
// 'WHERE'
|
||||
// );
|
||||
$words_ending_table_ref = array(
|
||||
'FOR',
|
||||
'GROUP',
|
||||
@@ -815,7 +808,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
// loop #1 for each token: select_expr, table_ref for SELECT
|
||||
|
||||
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
|
||||
if ($seek_queryend == TRUE) {
|
||||
@@ -834,13 +827,13 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
continue;
|
||||
} // end if (type == punct_queryend)
|
||||
|
||||
// ==============================================================
|
||||
// ==============================================================
|
||||
if ($arr[$i]['type'] == 'punct_bracket_open_round') {
|
||||
if ($in_extract) {
|
||||
$number_of_brackets_in_extract++;
|
||||
}
|
||||
}
|
||||
// ==============================================================
|
||||
// ==============================================================
|
||||
if ($arr[$i]['type'] == 'punct_bracket_close_round') {
|
||||
if ($in_extract) {
|
||||
$number_of_brackets_in_extract--;
|
||||
@@ -849,7 +842,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// ==============================================================
|
||||
// ==============================================================
|
||||
if ($arr[$i]['type'] == 'alpha_functionName') {
|
||||
$upper_data = strtoupper($arr[$i]['data']);
|
||||
if ($upper_data =='EXTRACT') {
|
||||
@@ -858,7 +851,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
}
|
||||
}
|
||||
|
||||
// ==============================================================
|
||||
// ==============================================================
|
||||
if ($arr[$i]['type'] == 'alpha_reservedWord') {
|
||||
// We don't know what type of query yet, so run this
|
||||
if ($subresult['querytype'] == '') {
|
||||
@@ -894,7 +887,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
// reserved words below
|
||||
} // end if (type == alpha_reservedWord)
|
||||
|
||||
// ==============================
|
||||
// ==============================
|
||||
if (($arr[$i]['type'] == 'quote_backtick')
|
||||
|| ($arr[$i]['type'] == 'quote_double')
|
||||
|| ($arr[$i]['type'] == 'quote_single')
|
||||
@@ -949,7 +942,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
} // end if (querytype SELECT)
|
||||
} // end if ( quote_backtick or double quote or alpha_identifier)
|
||||
|
||||
// ===================================
|
||||
// ===================================
|
||||
if ($arr[$i]['type'] == 'punct_qualifier') {
|
||||
// to be able to detect an identifier following another
|
||||
$previous_was_identifier = FALSE;
|
||||
@@ -1193,7 +1186,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
$in_from = FALSE;
|
||||
|
||||
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
|
||||
//
|
||||
@@ -1685,7 +1678,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
|
||||
switch ($typearr[2]) {
|
||||
case 'white_newline':
|
||||
// $after = '<br />';
|
||||
// $after = '<br />';
|
||||
$before = '';
|
||||
break;
|
||||
case 'punct_bracket_open_round':
|
||||
@@ -1904,12 +1897,12 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
break;
|
||||
} // end switch ($typearr[2])
|
||||
|
||||
/*
|
||||
/*
|
||||
if ($typearr[3] != 'punct_qualifier') {
|
||||
$after .= ' ';
|
||||
}
|
||||
$after .= "\n";
|
||||
*/
|
||||
*/
|
||||
$str .= $before . ($mode=='color' ? PMA_SQP_formatHTML_colorize($arr[$i]) : $arr[$i]['data']). $after;
|
||||
} // end for
|
||||
if ($mode=='color') {
|
||||
@@ -1918,9 +1911,9 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
|
||||
return $str;
|
||||
} // end of the "PMA_SQP_formatHtml()" function
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Builds a CSS rule used for html formatted SQL queries
|
||||
*
|
||||
* @param string The class name
|
||||
@@ -1933,8 +1926,8 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_SQP_buildCssData()
|
||||
*/
|
||||
function PMA_SQP_buildCssRule($classname, $property, $value)
|
||||
{
|
||||
function PMA_SQP_buildCssRule($classname, $property, $value)
|
||||
{
|
||||
$str = '.' . $classname . ' {';
|
||||
if ($value != '') {
|
||||
$str .= $property . ': ' . $value . ';';
|
||||
@@ -1942,10 +1935,10 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
$str .= '}' . "\n";
|
||||
|
||||
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
|
||||
*
|
||||
* @return string The CSS rules set
|
||||
@@ -1956,8 +1949,8 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_SQP_buildCssRule()
|
||||
*/
|
||||
function PMA_SQP_buildCssData()
|
||||
{
|
||||
function PMA_SQP_buildCssData()
|
||||
{
|
||||
global $cfg;
|
||||
|
||||
$css_string = '';
|
||||
@@ -1970,9 +1963,9 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
}
|
||||
|
||||
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
|
||||
*
|
||||
@@ -2007,6 +2000,6 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
||||
*/
|
||||
return PMA_SQP_formatNone($arr);
|
||||
} // end of the "PMA_SQP_formatText()" function
|
||||
} // end if: minimal common.lib needed?
|
||||
} // $__PMA_SQP_LIB__
|
||||
} // end if: minimal common.lib needed?
|
||||
|
||||
?>
|
@@ -30,14 +30,11 @@
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
if (!defined('PMA_SQL_VALIDATOR_CLASS_INCLUDED')) {
|
||||
define('PMA_SQL_VALIDATOR_CLASS_INCLUDED', 1);
|
||||
@include_once('SOAP/Client.php');
|
||||
|
||||
@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;
|
||||
} else {
|
||||
} else {
|
||||
// Ok, we have SOAP Support, so let's use it!
|
||||
|
||||
class PMA_SQLValidator {
|
||||
@@ -409,8 +406,6 @@ if (!defined('PMA_SQL_VALIDATOR_CLASS_INCLUDED')) {
|
||||
$GLOBALS['sqlvalidator_error'] = TRUE;
|
||||
}
|
||||
|
||||
} // end else
|
||||
|
||||
} // $__PMA_SQL_VALIDATOR_CLASS__
|
||||
} // end else
|
||||
|
||||
?>
|
@@ -32,20 +32,15 @@
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
|
||||
define('PMA_SQL_VALIDATOR_INCLUDED', 1);
|
||||
|
||||
// We need the PEAR libraries, so do a minimum version check first
|
||||
// I'm not sure if PEAR was available before this point
|
||||
// For now we actually use a configuration flag
|
||||
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)
|
||||
// We need the PEAR libraries, so do a minimum version check first
|
||||
// I'm not sure if PEAR was available before this point
|
||||
// For now we actually use a configuration flag
|
||||
if ($cfg['SQLValidator']['use'] == TRUE) {
|
||||
require_once('./libraries/sqlvalidator.class.php');
|
||||
} // if ($cfg['SQLValidator']['use'] == TRUE)
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* This function utilizes the Mimer SQL Validator service
|
||||
* to validate an SQL query
|
||||
*
|
||||
@@ -57,8 +52,8 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
|
||||
*
|
||||
* @global array The PMA configuration array
|
||||
*/
|
||||
function PMA_validateSQL($sql)
|
||||
{
|
||||
function PMA_validateSQL($sql)
|
||||
{
|
||||
global $cfg;
|
||||
|
||||
$str = '';
|
||||
@@ -102,8 +97,6 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
|
||||
|
||||
// Gives string back to caller
|
||||
return $str;
|
||||
} // end of the "PMA_validateSQL()" function
|
||||
|
||||
} // $__PMA_SQL_VALIDATOR__
|
||||
} // end of the "PMA_validateSQL()" function
|
||||
|
||||
?>
|
@@ -16,24 +16,21 @@
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
define('PMA_STR_LIB_INCLUDED', 1);
|
||||
|
||||
// This is for handling input better
|
||||
if (defined('PMA_MULTIBYTE_ENCODING')) {
|
||||
// This is for handling input better
|
||||
if (defined('PMA_MULTIBYTE_ENCODING')) {
|
||||
$GLOBALS['PMA_strlen'] = 'mb_strlen';
|
||||
$GLOBALS['PMA_strpos'] = 'mb_strpos';
|
||||
$GLOBALS['PMA_strrpos'] = 'mb_strrpos';
|
||||
$GLOBALS['PMA_substr'] = 'mb_substr';
|
||||
} else {
|
||||
} else {
|
||||
$GLOBALS['PMA_strlen'] = 'strlen';
|
||||
$GLOBALS['PMA_strpos'] = 'strpos';
|
||||
$GLOBALS['PMA_strrpos'] = 'strrpos';
|
||||
$GLOBALS['PMA_substr'] = 'substr';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* This checks if a string actually exists inside another string
|
||||
* We try to do it in a PHP3-portable way.
|
||||
* 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
|
||||
*/
|
||||
function PMA_STR_strInStr($needle, $haystack)
|
||||
{
|
||||
function PMA_STR_strInStr($needle, $haystack)
|
||||
{
|
||||
// $GLOBALS['PMA_strpos']($haystack, $needle) !== FALSE
|
||||
// return (is_integer($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
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function PMA_STR_charIsEscaped($string, $pos, $start = 0)
|
||||
{
|
||||
function PMA_STR_charIsEscaped($string, $pos, $start = 0)
|
||||
{
|
||||
$len = $GLOBALS['PMA_strlen']($string);
|
||||
// Base case:
|
||||
// Check for string length or invalid input or special case of input
|
||||
@@ -82,10 +79,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
}
|
||||
|
||||
return $escaped;
|
||||
} // end of the "PMA_STR_charIsEscaped()" function
|
||||
} // end of the "PMA_STR_charIsEscaped()" function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Checks if a number is in a range
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function PMA_STR_numberInRangeInclusive($num, $lower, $upper)
|
||||
{
|
||||
function PMA_STR_numberInRangeInclusive($num, $lower, $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
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -109,17 +106,17 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_STR_numberInRangeInclusive()
|
||||
*/
|
||||
function PMA_STR_isDigit($c)
|
||||
{
|
||||
function PMA_STR_isDigit($c)
|
||||
{
|
||||
$ord_zero = 48; //ord('0');
|
||||
$ord_nine = 57; //ord('9');
|
||||
$ord_c = ord($c);
|
||||
|
||||
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
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -128,8 +125,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_STR_numberInRangeInclusive()
|
||||
*/
|
||||
function PMA_STR_isHexDigit($c)
|
||||
{
|
||||
function PMA_STR_isHexDigit($c)
|
||||
{
|
||||
$ord_Aupper = 65; //ord('A');
|
||||
$ord_Fupper = 70; //ord('F');
|
||||
$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)
|
||||
|| PMA_STR_numberInRangeInclusive($ord_c, $ord_Aupper, $ord_Fupper)
|
||||
|| 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
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -154,17 +151,17 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_STR_numberInRangeInclusive()
|
||||
*/
|
||||
function PMA_STR_isUpper($c)
|
||||
{
|
||||
function PMA_STR_isUpper($c)
|
||||
{
|
||||
$ord_zero = 65; //ord('A');
|
||||
$ord_nine = 90; //ord('Z');
|
||||
$ord_c = ord($c);
|
||||
|
||||
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
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -174,17 +171,17 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_STR_numberInRangeInclusive()
|
||||
*/
|
||||
function PMA_STR_isLower($c)
|
||||
{
|
||||
function PMA_STR_isLower($c)
|
||||
{
|
||||
$ord_zero = 97; //ord('a');
|
||||
$ord_nine = 122; //ord('z');
|
||||
$ord_c = ord($c);
|
||||
|
||||
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
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -194,13 +191,13 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
* @see PMA_STR_isUpper()
|
||||
* @see PMA_STR_isLower()
|
||||
*/
|
||||
function PMA_STR_isAlpha($c)
|
||||
{
|
||||
function PMA_STR_isAlpha($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
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -211,13 +208,13 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
* @see PMA_STR_isLower()
|
||||
* @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));
|
||||
} // end of the "PMA_STR_isAlnum()" function
|
||||
} // end of the "PMA_STR_isAlnum()" function
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Checks if a character is a space one
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -226,8 +223,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
*
|
||||
* @see PMA_STR_numberInRangeInclusive()
|
||||
*/
|
||||
function PMA_STR_isSpace($c)
|
||||
{
|
||||
function PMA_STR_isSpace($c)
|
||||
{
|
||||
$ord_space = 32; //ord(' ')
|
||||
$ord_tab = 9; //ord('\t')
|
||||
$ord_CR = 13; //ord('\n')
|
||||
@@ -237,10 +234,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
return (($ord_c == $ord_space)
|
||||
|| ($ord_c == $ord_NOBR)
|
||||
|| 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
|
||||
*
|
||||
* @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()
|
||||
*/
|
||||
function PMA_STR_isAccented($c)
|
||||
{
|
||||
function PMA_STR_isAccented($c)
|
||||
{
|
||||
$ord_min1 = 192; //ord('A');
|
||||
$ord_max1 = 214; //ord('Z');
|
||||
$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)
|
||||
|| 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
|
||||
*
|
||||
* @param string character to check for
|
||||
@@ -280,16 +277,16 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
*
|
||||
* @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)
|
||||
|| PMA_STR_isAccented($c)
|
||||
|| ($c == '_') || ($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
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function PMA_STR_binarySearchInArr($str, $arr, $arrsize)
|
||||
{
|
||||
function PMA_STR_binarySearchInArr($str, $arr, $arrsize)
|
||||
{
|
||||
// $arr NUST be sorted, due to binary search
|
||||
$top = $arrsize - 1;
|
||||
$bottom = 0;
|
||||
@@ -318,8 +315,6 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
|
||||
} // end while
|
||||
|
||||
return $found;
|
||||
} // end of the "PMA_STR_binarySearchInArr()" function
|
||||
|
||||
} // $__PMA_STR_LIB__
|
||||
} // end of the "PMA_STR_binarySearchInArr()" function
|
||||
|
||||
?>
|
@@ -6,11 +6,7 @@
|
||||
* Set of functions used with the relation and pdf feature
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
|
||||
define('PMA_TRANSFORMATION_LIB_INCLUDED', 1);
|
||||
|
||||
function PMA_transformation_getOptions($string) {
|
||||
function PMA_transformation_getOptions($string) {
|
||||
$transform_options = array();
|
||||
|
||||
if ($string != '') {
|
||||
@@ -22,9 +18,9 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
|
||||
}
|
||||
|
||||
return $transform_options;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets all available MIME-types
|
||||
*
|
||||
* @return array array[mimetype], array[transformation]
|
||||
@@ -33,7 +29,7 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
|
||||
*
|
||||
* @author Garvin Hicking <me@supergarv.de>
|
||||
*/
|
||||
function PMA_getAvailableMIMEtypes() {
|
||||
function PMA_getAvailableMIMEtypes() {
|
||||
$handle = opendir('./libraries/transformations');
|
||||
|
||||
$stack = array();
|
||||
@@ -74,9 +70,9 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
|
||||
}
|
||||
|
||||
return $stack;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets the mimetypes for all rows of a table
|
||||
*
|
||||
* @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>
|
||||
*/
|
||||
function PMA_getMIME($db, $table, $strict = false) {
|
||||
function PMA_getMIME($db, $table, $strict = false) {
|
||||
global $cfgRelation;
|
||||
|
||||
$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
|
||||
|
||||
/**
|
||||
* Set a single mimetype to a certain value.
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the name of the column
|
||||
* @param string the mimetype of the column
|
||||
* @param string the transformation of the column
|
||||
* @param string the transformation options of the column
|
||||
* @param string (optional) force delete, will erase any existing comments for this column
|
||||
*
|
||||
* @return boolean true, if comment-query was made.
|
||||
*
|
||||
* @global array the list of relations settings
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_setMIME($db, $table, $key, $mimetype, $transformation, $transformation_options, $forcedelete = false) {
|
||||
/**
|
||||
* Set a single mimetype to a certain value.
|
||||
*
|
||||
* @param string the name of the db
|
||||
* @param string the name of the table
|
||||
* @param string the name of the column
|
||||
* @param string the mimetype of the column
|
||||
* @param string the transformation of the column
|
||||
* @param string the transformation options of the column
|
||||
* @param string (optional) force delete, will erase any existing comments for this column
|
||||
*
|
||||
* @return boolean true, if comment-query was made.
|
||||
*
|
||||
* @global array the list of relations settings
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_setMIME($db, $table, $key, $mimetype, $transformation, $transformation_options, $forcedelete = false) {
|
||||
global $cfgRelation;
|
||||
|
||||
$test_qry = 'SELECT mimetype, ' . PMA_backquote('comment') . ' FROM ' . PMA_backquote($cfgRelation['column_info'])
|
||||
@@ -176,18 +172,18 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} // end of 'PMA_setMIME()' function
|
||||
} // end of 'PMA_setMIME()' function
|
||||
|
||||
/**
|
||||
* Returns the real filename of a configured transformation
|
||||
*
|
||||
* @param string the current filename
|
||||
*
|
||||
* @return string the new filename
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_sanitizeTransformationFile(&$filename) {
|
||||
/**
|
||||
* Returns the real filename of a configured transformation
|
||||
*
|
||||
* @param string the current filename
|
||||
*
|
||||
* @return string the new filename
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_sanitizeTransformationFile(&$filename) {
|
||||
// garvin: for security, never allow to break out from transformations directory
|
||||
|
||||
$include_file = preg_replace('@\.\.*@', '.', $filename);
|
||||
@@ -200,6 +196,5 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
|
||||
}
|
||||
|
||||
return $include_file;
|
||||
} // end of 'PMA_sanitizeTransformationFile()' function
|
||||
} // $__PMA_TRANSFORMATION_LIB__
|
||||
} // end of 'PMA_sanitizeTransformationFile()' function
|
||||
?>
|
@@ -8,14 +8,11 @@
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]')){
|
||||
define('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]', 1);
|
||||
|
||||
function PMA_transformation_[enter_filename_here]($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_[ENTER_FILENAME_HERE]($buffer, $options = array(), $meta = '') {
|
||||
// possibly use a global transform and feed it with special options:
|
||||
// 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.)
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -10,4 +10,4 @@
|
||||
* You can still use global or other mimetype's transforms with this mimetype.
|
||||
*/
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@@ -23,18 +23,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_LIB_GLOBAL')){
|
||||
define('PMA_TRANSFORMATION_LIB_GLOBAL', 1);
|
||||
|
||||
function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
|
||||
return htmlspecialchars($buffer);
|
||||
}
|
||||
}
|
||||
|
||||
function PMA_transformation_global_html($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_global_html($buffer, $options = array(), $meta = '') {
|
||||
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'])) {
|
||||
$options['string'] = '';
|
||||
}
|
||||
@@ -46,5 +43,6 @@ if (!defined('PMA_TRANSFORMATION_LIB_GLOBAL')){
|
||||
// Replace occurences of [__BUFFER__] with actual text
|
||||
$return = str_replace("[__BUFFER__]", $buffer, $options['string']);
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,10 +2,7 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE')){
|
||||
define('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE', 1);
|
||||
|
||||
function PMA_transformation_image_jpeg__inline($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_image_jpeg__inline($buffer, $options = array(), $meta = '') {
|
||||
include('./libraries/transformations/global.inc.php');
|
||||
|
||||
if (PMA_IS_GD2) {
|
||||
@@ -16,5 +13,6 @@ if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE')){
|
||||
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,15 +2,13 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__LINK')){
|
||||
define('PMA_TRANSFORMATION_IMAGE_JPEG__LINK', 1);
|
||||
|
||||
function PMA_transformation_image_jpeg__link($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_image_jpeg__link($buffer, $options = array(), $meta = '') {
|
||||
include('./libraries/transformations/global.inc.php');
|
||||
|
||||
$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);
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,10 +2,7 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_IMAGE_PNG__INLINE')){
|
||||
define('PMA_TRANSFORMATION_IMAGE_PNG__INLINE', 1);
|
||||
|
||||
function PMA_transformation_image_png__inline($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_image_png__inline($buffer, $options = array(), $meta = '') {
|
||||
include('./libraries/transformations/global.inc.php');
|
||||
|
||||
if (PMA_IS_GD2) {
|
||||
@@ -16,5 +13,6 @@ if (!defined('PMA_TRANSFORMATION_IMAGE_PNG__INLINE')){
|
||||
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -16,17 +16,11 @@ define('PMA_DISPLAY_HEADING', 0);
|
||||
/**
|
||||
* Gets some core libraries and displays a top message if required
|
||||
*/
|
||||
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
}
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
|
||||
require('./header.inc.php');
|
||||
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./header.inc.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
$types = PMA_getAvailableMIMEtypes();
|
||||
@@ -78,5 +72,6 @@ foreach($types['transformation'] AS $key => $transform) {
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
||||
|
@@ -2,10 +2,7 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT')){
|
||||
define('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT', 1);
|
||||
|
||||
function PMA_transformation_text_plain__dateformat($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_text_plain__dateformat($buffer, $options = array(), $meta = '') {
|
||||
// possibly use a global transform and feed it with special options:
|
||||
// include('./libraries/transformations/global.inc.php');
|
||||
|
||||
@@ -57,7 +54,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT')){
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
||||
|
@@ -2,14 +2,11 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){
|
||||
define('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL', 1);
|
||||
|
||||
function PMA_EscapeShellArg($string, $prepend = '\'') {
|
||||
function PMA_EscapeShellArg($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] == '') {
|
||||
$nowrap = true;
|
||||
} elseif ($options[3] == '1' || $options[3] == 1) {
|
||||
@@ -19,9 +16,9 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){
|
||||
}
|
||||
|
||||
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:
|
||||
// include('./libraries/transformations/global.inc.php');
|
||||
|
||||
@@ -61,5 +58,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){
|
||||
}
|
||||
|
||||
return $retstring;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,10 +2,8 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__FORMATTED')){
|
||||
define('PMA_TRANSFORMATION_TEXT_PLAIN__FORMATTED', 1);
|
||||
|
||||
function PMA_transformation_text_plain__formatted($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_text_plain__formatted($buffer, $options = array(), $meta = '') {
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,14 +2,12 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__IMAGELINK')){
|
||||
define('PMA_TRANSFORMATION_TEXT_PLAIN__IMAGELINK', 1);
|
||||
|
||||
function PMA_transformation_text_plain__imagelink($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_text_plain__imagelink($buffer, $options = array(), $meta = '') {
|
||||
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>');
|
||||
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,11 +2,8 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__LINK')){
|
||||
define('PMA_TRANSFORMATION_TEXT_PLAIN__LINK', 1);
|
||||
|
||||
function PMA_transformation_text_plain__link($buffer, $options = array(), $meta = '') {
|
||||
include('./libraries/transformations/global.inc.php');
|
||||
function PMA_transformation_text_plain__link($buffer, $options = array(), $meta = '') {
|
||||
require_once('./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>');
|
||||
|
||||
@@ -16,5 +13,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__LINK')){
|
||||
|
||||
return $buffer;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -2,10 +2,7 @@
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR')){
|
||||
define('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR', 1);
|
||||
|
||||
function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
|
||||
function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
|
||||
// possibly use a global transform and feed it with special options:
|
||||
// include('./libraries/transformations/global.inc.php');
|
||||
|
||||
@@ -42,5 +39,6 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR')){
|
||||
}
|
||||
|
||||
return $newtext;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -8,10 +8,7 @@
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
|
||||
define('PMA_URL_GENERATION_LIB_INCLUDED', 1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generates text with hidden inputs.
|
||||
*
|
||||
* @param string optional database name
|
||||
@@ -30,8 +27,8 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
|
||||
*
|
||||
* @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 $cfg, $allow_recoding;
|
||||
|
||||
@@ -49,9 +46,9 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
|
||||
if (!empty($table))
|
||||
$result .= $spaces . '<input type="hidden" name="table" value="'.htmlspecialchars($table).'" />' . "\n";
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generates text with URL parameters.
|
||||
*
|
||||
* @param string optional database name
|
||||
@@ -71,8 +68,8 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
|
||||
*
|
||||
* @author nijel
|
||||
*/
|
||||
function PMA_generate_common_url ($db = '', $table = '', $amp = '&')
|
||||
{
|
||||
function PMA_generate_common_url ($db = '', $table = '', $amp = '&')
|
||||
{
|
||||
global $lang, $convcharset, $server;
|
||||
global $cfg, $allow_recoding;
|
||||
|
||||
@@ -85,6 +82,6 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
|
||||
if (!empty($table))
|
||||
$result .= $amp . 'table='.urlencode($table);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
25
main.php
25
main.php
@@ -10,12 +10,8 @@ define('PMA_DISPLAY_HEADING', 0);
|
||||
/**
|
||||
* Gets some core libraries and displays a top message if required
|
||||
*/
|
||||
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
}
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
// Puts the language to use in a cookie that will expire in 30 days
|
||||
if (!isset($pma_uri_parts)) {
|
||||
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
|
||||
@@ -33,7 +29,7 @@ if (isset($table)) {
|
||||
unset($table);
|
||||
}
|
||||
$show_query = '1';
|
||||
require('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
if (isset($message)) {
|
||||
PMA_showMessage($message);
|
||||
}
|
||||
@@ -254,8 +250,7 @@ if ($server > 0) {
|
||||
} // end elseif
|
||||
} // end if
|
||||
} // end while
|
||||
unset($show_grants_dbname);
|
||||
unset($show_grants_str);
|
||||
unset($show_grants_dbname, $show_grants_str);
|
||||
mysql_free_result($rs_usr);
|
||||
} // end if
|
||||
} // end elseif
|
||||
@@ -550,8 +545,8 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
|
||||
} else {
|
||||
$selected = '';
|
||||
}
|
||||
echo ' ';
|
||||
echo '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
|
||||
echo ' '
|
||||
. '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -634,20 +629,20 @@ if (PMA_PHP_INT_VERSION == 40203 && @extension_loaded('mbstring')) {
|
||||
*/
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
if (PMA_MYSQL_INT_VERSION < 32336) {
|
||||
echo '<p class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.36') . '</p>' . "\n";
|
||||
if (PMA_MYSQL_INT_VERSION < 32332) {
|
||||
echo '<p class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.32') . '</p>' . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
||||
|
@@ -19,8 +19,7 @@ if (!empty($submit_mult)
|
||||
$what = 'drop_db';
|
||||
} else if (!empty($selected_tbl)) {
|
||||
if ($submit_mult == $strPrintView) {
|
||||
include('./tbl_printview.php');
|
||||
exit();
|
||||
require('./tbl_printview.php');
|
||||
} else {
|
||||
$selected = $selected_tbl;
|
||||
switch ($submit_mult) {
|
||||
@@ -60,8 +59,7 @@ if (!empty($submit_mult)
|
||||
if ($submit_mult == $strDrop) {
|
||||
$what = 'drop_fld';
|
||||
} else {
|
||||
include('./tbl_alter.php');
|
||||
exit();
|
||||
require('./tbl_alter.php');
|
||||
}
|
||||
} else {
|
||||
$what = 'row_delete';
|
||||
@@ -77,13 +75,13 @@ if (!empty($submit_mult) && !empty($what)) {
|
||||
$js_to_run = 'functions.js';
|
||||
unset($message);
|
||||
if (!empty($table)) {
|
||||
include('./tbl_properties_common.php');
|
||||
require('./tbl_properties_common.php');
|
||||
$url_query .= '&goto=tbl_properties.php&back=tbl_properties.php';
|
||||
include('./tbl_properties_table_info.php');
|
||||
require('./tbl_properties_table_info.php');
|
||||
}
|
||||
elseif (!empty($db)) {
|
||||
include('./db_details_common.php');
|
||||
include('./db_details_db_info.php');
|
||||
require('./db_details_common.php');
|
||||
require('./db_details_db_info.php');
|
||||
}
|
||||
// Builds the query
|
||||
$full_query = '';
|
||||
@@ -168,8 +166,7 @@ if (!empty($submit_mult) && !empty($what)) {
|
||||
<?php
|
||||
echo"\n";
|
||||
|
||||
include('./footer.inc.php');
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
} // end if
|
||||
|
||||
|
||||
@@ -179,7 +176,7 @@ if (!empty($submit_mult) && !empty($what)) {
|
||||
else if ($mult_btn == $strYes) {
|
||||
|
||||
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 = '';
|
||||
@@ -268,8 +265,7 @@ else if ($mult_btn == $strYes) {
|
||||
|| $query_type == 'analyze_tbl'
|
||||
|| $query_type == 'check_tbl'
|
||||
|| $query_type == 'optimize_tbl') {
|
||||
include('./sql.php');
|
||||
exit();
|
||||
require('./sql.php');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -6,15 +6,15 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require('./db_details_common.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./db_details_common.php');
|
||||
|
||||
|
||||
/**
|
||||
* Settings for relation stuff
|
||||
*/
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ $cfgRelation = PMA_getRelationsParam();
|
||||
if (!$cfgRelation['relwork']) {
|
||||
echo sprintf($strNotSet, 'relation', 'config.inc.php') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#relation" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
if (!$cfgRelation['displaywork']) {
|
||||
echo sprintf($strNotSet, 'table_info', 'config.inc.php') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#table_info" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
if (!isset($cfgRelation['table_coords'])){
|
||||
@@ -525,5 +525,5 @@ ToggleDragDrop('pdflayout');
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -11,15 +11,15 @@
|
||||
/**
|
||||
* Gets some core scripts
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
* Settings for relation stuff
|
||||
*/
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
@@ -42,7 +42,7 @@ if (!$cfgRelation['pdfwork']) {
|
||||
/**
|
||||
* 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/';
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ class PMA_PDF extends FPDF
|
||||
global $server, $lang, $convcharset, $db;
|
||||
global $charset, $text_dir, $strRunning, $strDatabase;
|
||||
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
|
||||
echo '<p><b>PDF - '. $GLOBALS['strError'] . '</b></p>' . "\n";
|
||||
if (!empty($error_message)) {
|
||||
@@ -281,8 +281,7 @@ class PMA_PDF extends FPDF
|
||||
. '">' . $GLOBALS['strBack'] . '</a>';
|
||||
echo "\n";
|
||||
|
||||
include('./footer.inc.php');
|
||||
exit();
|
||||
require_once('./footer.inc.php');
|
||||
} // end of the "PMA_PDF_die()" function
|
||||
|
||||
|
||||
|
@@ -6,8 +6,8 @@
|
||||
/**
|
||||
* Gets core libraries and defines some variables
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* Gets the variables sent to this script, retains the db name that may have
|
||||
* 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)) {
|
||||
$db_start = $db;
|
||||
}
|
||||
@@ -16,8 +16,8 @@ if (!empty($db)) {
|
||||
/**
|
||||
* Gets a core script and starts output buffering work
|
||||
*/
|
||||
require('./libraries/common.lib.php');
|
||||
require('./libraries/ob.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/ob.lib.php');
|
||||
if ($cfg['OBGzip']) {
|
||||
$ob_mode = PMA_outBufferModeGet();
|
||||
if ($ob_mode) {
|
||||
@@ -29,7 +29,7 @@ if ($cfg['OBGzip']) {
|
||||
// to a seperate file. It can now be included by header.inc.php,
|
||||
// queryframe.php, querywindow.php.
|
||||
|
||||
include('./libraries/header_http.inc.php');
|
||||
require_once('./libraries/header_http.inc.php');
|
||||
|
||||
/**
|
||||
* Displays the frame
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* Gets the variables sent to this script, retains the db name that may have
|
||||
* 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)) {
|
||||
$db_start = $db;
|
||||
}
|
||||
@@ -16,8 +16,8 @@ if (!empty($db)) {
|
||||
/**
|
||||
* Gets a core script and starts output buffering work
|
||||
*/
|
||||
require('./libraries/common.lib.php');
|
||||
require('./libraries/ob.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/ob.lib.php');
|
||||
if ($cfg['OBGzip']) {
|
||||
$ob_mode = PMA_outBufferModeGet();
|
||||
if ($ob_mode) {
|
||||
@@ -25,7 +25,7 @@ if ($cfg['OBGzip']) {
|
||||
}
|
||||
}
|
||||
|
||||
require('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
@@ -43,8 +43,8 @@ if ($server > 0) {
|
||||
// to a seperate file. It can now be included by header.inc.php,
|
||||
// queryframe.php, querywindow.php.
|
||||
|
||||
include('./libraries/header_http.inc.php');
|
||||
include('./libraries/header_meta_style.inc.php');
|
||||
require_once('./libraries/header_http.inc.php');
|
||||
require_once('./libraries/header_meta_style.inc.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
@@ -219,7 +219,7 @@ if (!isset($goto)) {
|
||||
$goto = '';
|
||||
}
|
||||
|
||||
require './libraries/bookmark.lib.php';
|
||||
require_once './libraries/bookmark.lib.php';
|
||||
$is_inside_querywindow = TRUE;
|
||||
require './tbl_query_box.php';
|
||||
|
||||
|
@@ -5,9 +5,9 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/read_dump.lib.php');
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/read_dump.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
if (!isset($db)) {
|
||||
$db = '';
|
||||
@@ -49,7 +49,7 @@ if (!empty($sql_localfile) && !empty($cfg['UploadDir'])) {
|
||||
* Bookmark Support: get a query back from bookmark if required
|
||||
*/
|
||||
if (!empty($id_bookmark)) {
|
||||
include('./libraries/bookmark.lib.php');
|
||||
require_once('./libraries/bookmark.lib.php');
|
||||
switch ($action_bookmark) {
|
||||
case 0: // bookmarked query that have to be run
|
||||
$sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
|
||||
@@ -150,7 +150,7 @@ if (!$cfg['AllowUserDropDatabase']
|
||||
// loic1: optimized query
|
||||
$result = @PMA_mysql_query('USE mysql');
|
||||
if (PMA_mysql_error()) {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ define('PMA_CHK_DROP', 1);
|
||||
* Store a query as a bookmark before executing it?
|
||||
*/
|
||||
if (isset($SQLbookmark) && $sql_query != '') {
|
||||
include('./libraries/bookmark.lib.php');
|
||||
require_once('./libraries/bookmark.lib.php');
|
||||
$bfields = array(
|
||||
'dbase' => $db,
|
||||
'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)) {
|
||||
$reload = 1;
|
||||
}
|
||||
include('./sql.php');
|
||||
exit();
|
||||
require('./sql.php');
|
||||
}
|
||||
|
||||
// Runs multiple queries
|
||||
@@ -255,8 +254,7 @@ if ($sql_query != '') {
|
||||
$complete_query = $sql_query;
|
||||
$display_query = $sql_query;
|
||||
$sql_query = $a_sql_query;
|
||||
include('./sql.php');
|
||||
exit();
|
||||
require('./sql.php');
|
||||
}
|
||||
|
||||
$result = PMA_mysql_query($a_sql_query);
|
||||
@@ -320,7 +318,7 @@ if ($sql_query != '') {
|
||||
*/
|
||||
if (isset($my_die)) {
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
if (is_array($my_die)) {
|
||||
foreach($my_die AS $key => $die_string) {
|
||||
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';
|
||||
}
|
||||
if ($goto != 'main.php') {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
}
|
||||
$active_page = $goto;
|
||||
require('./' . $goto);
|
||||
|
@@ -64,7 +64,7 @@ cat <<END
|
||||
|
||||
Please ensure you have:
|
||||
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'); "
|
||||
- in Documentation.html the 2 lines
|
||||
" <title>phpMyAdmin $1 - Documentation</title> "
|
||||
@@ -177,7 +177,7 @@ Todo now:
|
||||
phpmyadmin-news@lists.sourceforge.net
|
||||
phpmyadmin-users@lists.sourceforge.net
|
||||
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'); "
|
||||
- in Documentation.html the 2 lines
|
||||
" <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
|
||||
|
@@ -28,15 +28,14 @@ echo '<h2>' . "\n"
|
||||
*/
|
||||
if (PMA_MYSQL_INT_VERSION < 40100) {
|
||||
// TODO: Some nice Message :-)
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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"
|
||||
. '</table>' . "\n";
|
||||
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
@@ -5,22 +5,13 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
}
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
/**
|
||||
* Handles some variables that may have been sent by the calling script
|
||||
*/
|
||||
if (isset($db)) {
|
||||
unset($db);
|
||||
}
|
||||
if (isset($table)) {
|
||||
unset($table);
|
||||
}
|
||||
unset($db, $table);
|
||||
|
||||
/**
|
||||
* Set parameters for links
|
||||
@@ -35,7 +26,7 @@ $err_url = 'main.php' . $url_query;
|
||||
/**
|
||||
* Displays the headers
|
||||
*/
|
||||
require('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
|
||||
/**
|
||||
* Checks for superuser privileges
|
||||
|
@@ -6,7 +6,7 @@
|
||||
/**
|
||||
* 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';
|
||||
$submit_mult = 'drop_db' ;
|
||||
$err_url = 'server_databases.php?' . PMA_generate_common_url();
|
||||
include('./mult_submits.inc.php');
|
||||
require('./mult_submits.inc.php');
|
||||
$message = sprintf($strDatabasesDropped, count($selected));
|
||||
// we need to reload the database list now.
|
||||
PMA_availableDatabases();
|
||||
@@ -102,8 +102,7 @@ echo '<h2>' . "\n"
|
||||
*/
|
||||
if (!empty($dbstats) && !$is_superuser) {
|
||||
echo $strNoPrivileges . "\n";
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
|
||||
@@ -373,6 +372,6 @@ if (count($statistics) > 0) {
|
||||
/**
|
||||
* Sends the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
/**
|
||||
* 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 />';
|
||||
|
||||
$export_type = 'server';
|
||||
require('./libraries/display_export.lib.php');
|
||||
require_once('./libraries/display_export.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -4,9 +4,7 @@
|
||||
|
||||
// Check parameters
|
||||
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/common.lib.php');
|
||||
PMA_checkParameters(array('is_superuser', 'url_query'));
|
||||
|
||||
/**
|
||||
|
@@ -27,13 +27,12 @@ if (!empty($pred_tablename)) {
|
||||
* Checks if the user is allowed to do what he tries to...
|
||||
*/
|
||||
if (!$is_superuser) {
|
||||
include('./server_links.inc.php');
|
||||
require('./server_links.inc.php');
|
||||
echo '<h2>' . "\n"
|
||||
. ' ' . $strPrivileges . "\n"
|
||||
. '</h2>' . "\n"
|
||||
. $strNoPrivileges . "\n";
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
if (mysql_affected_rows($userlink) <= 0) {
|
||||
echo $strUserNotFound;
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
mysql_free_result($res);
|
||||
unset($res);
|
||||
@@ -1427,6 +1425,6 @@ if (empty($adduser) && empty($checkprivs)) {
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
||||
|
@@ -29,8 +29,7 @@ if (!empty($innodbstatus)) {
|
||||
. htmlspecialchars($row[0]) . "\n"
|
||||
. '</pre>' . "\n";
|
||||
mysql_free_result($res);
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,8 +45,7 @@ echo '<h2>' . "\n"
|
||||
*/
|
||||
if (!$is_superuser && !$cfg['ShowMysqlInfo']) {
|
||||
echo $strNoPrivileges;
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
|
||||
@@ -301,6 +299,6 @@ if ($res) {
|
||||
/**
|
||||
* Sends the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
||||
|
@@ -28,8 +28,7 @@ echo '<h2>' . "\n"
|
||||
*/
|
||||
if (!$is_superuser && !$cfg['ShowMysqlVars']) {
|
||||
echo $strNoPrivileges;
|
||||
include('./footer.inc.php');
|
||||
exit;
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +107,6 @@ foreach ($serverVars as $name => $value) {
|
||||
/**
|
||||
* Sends the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
|
||||
?>
|
||||
|
38
sql.php
38
sql.php
@@ -5,8 +5,8 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ if (!defined('PMA_CHK_DROP')
|
||||
// loic1: optimized query
|
||||
$result = @PMA_mysql_query('USE mysql');
|
||||
if (PMA_mysql_error()) {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
|
||||
} // end if
|
||||
} // end if
|
||||
@@ -71,7 +71,7 @@ if (!defined('PMA_CHK_DROP')
|
||||
* Bookmark add
|
||||
*/
|
||||
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));
|
||||
header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto);
|
||||
} // end if
|
||||
@@ -151,7 +151,7 @@ if (isset($btnDrop) && $btnDrop == $strNo) {
|
||||
unset($table);
|
||||
}
|
||||
$active_page = $goto;
|
||||
include('./' . preg_replace('@\.\.*@', '.', $goto));
|
||||
require('./' . preg_replace('@\.\.*@', '.', $goto));
|
||||
} else {
|
||||
header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto));
|
||||
}
|
||||
@@ -187,7 +187,7 @@ if (!$cfg['Confirm']
|
||||
|
||||
if ($do_confirm) {
|
||||
$stripped_sql_query = $sql_query;
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
echo $strDoYouReally . ' :<br />' . "\n";
|
||||
echo '<tt>' . htmlspecialchars($stripped_sql_query) . '</tt> ?<br/>' . "\n";
|
||||
?>
|
||||
@@ -324,7 +324,7 @@ else {
|
||||
// Displays an error message if required and stop parsing the script
|
||||
if (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))
|
||||
? $err_url . '&show_query=1&sql_query=' . urlencode($sql_query)
|
||||
: $err_url;
|
||||
@@ -498,7 +498,7 @@ else {
|
||||
|
||||
// garvin: if a table or database gets dropped, check column comments.
|
||||
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)) {
|
||||
PMA_relationsCleanupTable($db, $table);
|
||||
@@ -513,7 +513,7 @@ else {
|
||||
if (isset($cpurge) && $cpurge == '1' && isset($purgekey)
|
||||
&& isset($db) && isset($table)
|
||||
&& !empty($db) && !empty($table) && !empty($purgekey)) {
|
||||
include('./libraries/relation_cleanup.lib.php');
|
||||
require_once('./libraries/relation_cleanup.lib.php');
|
||||
PMA_relationsCleanupColumn($db, $table, $purgekey);
|
||||
|
||||
} // end if column PMA_* purge
|
||||
@@ -585,10 +585,10 @@ else {
|
||||
$js_to_run = 'functions.js';
|
||||
}
|
||||
if ($goto != 'main.php') {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
}
|
||||
$active_page = $goto;
|
||||
include('./' . $goto);
|
||||
require('./' . $goto);
|
||||
} // end if file_exist
|
||||
else {
|
||||
header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto) . '&message=' . urlencode($message));
|
||||
@@ -603,22 +603,22 @@ else {
|
||||
unset($show_query);
|
||||
}
|
||||
if (isset($printview) && $printview == '1') {
|
||||
include('./header_printview.inc.php');
|
||||
require_once('./header_printview.inc.php');
|
||||
} else {
|
||||
$js_to_run = 'functions.js';
|
||||
unset($message);
|
||||
if (!empty($table)) {
|
||||
include('./tbl_properties_common.php');
|
||||
require('./tbl_properties_common.php');
|
||||
$url_query .= '&goto=tbl_properties.php&back=tbl_properties.php';
|
||||
include('./tbl_properties_table_info.php');
|
||||
require('./tbl_properties_table_info.php');
|
||||
}
|
||||
else {
|
||||
include('./db_details_common.php');
|
||||
include('./db_details_db_info.php');
|
||||
require('./db_details_common.php');
|
||||
require('./db_details_db_info.php');
|
||||
}
|
||||
}
|
||||
|
||||
include('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// Gets the list of fields properties
|
||||
@@ -641,7 +641,7 @@ else {
|
||||
}
|
||||
|
||||
// Displays the results in a table
|
||||
include('./libraries/display_tbl.lib.php');
|
||||
require_once('./libraries/display_tbl.lib.php');
|
||||
if (empty($disp_mode)) {
|
||||
// see the "PMA_setDisplayMode()" function in
|
||||
// libraries/display_tbl.lib.php
|
||||
@@ -786,5 +786,5 @@ echo "\n\n";
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -6,9 +6,9 @@
|
||||
/**
|
||||
* Get some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
$js_to_run = 'functions.js';
|
||||
require('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
|
||||
// Check parameters
|
||||
PMA_checkParameters(array('db', 'table'));
|
||||
@@ -183,8 +183,8 @@ if (isset($submit)) {
|
||||
} // end if
|
||||
|
||||
// garvin: If comments were sent, enable relation stuff
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
@@ -207,8 +207,7 @@ if (isset($submit)) {
|
||||
unset($sql_query_cpy);
|
||||
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
|
||||
$active_page = 'tbl_properties_structure.php';
|
||||
include('./tbl_properties_structure.php');
|
||||
exit();
|
||||
require('./tbl_properties_structure.php');
|
||||
} else {
|
||||
PMA_mysqlDie('', '', '', $err_url, FALSE);
|
||||
// garvin: An error happened while inserting/updating a table definition.
|
||||
@@ -227,11 +226,11 @@ if (isset($submit)) {
|
||||
*/
|
||||
if ($abort == FALSE) {
|
||||
$action = 'tbl_addfield.php';
|
||||
include('./tbl_properties.inc.php');
|
||||
require('./tbl_properties.inc.php');
|
||||
|
||||
// Diplays the footer
|
||||
echo "\n";
|
||||
include('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
|
||||
?>
|
@@ -6,9 +6,9 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
|
||||
// Check parameters
|
||||
PMA_checkParameters(array('db', 'table'));
|
||||
@@ -84,8 +84,8 @@ if (isset($submit)) {
|
||||
$btnDrop = 'Fake';
|
||||
|
||||
// garvin: If comments were sent, enable relation stuff
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
@@ -142,8 +142,7 @@ if (isset($submit)) {
|
||||
}
|
||||
|
||||
$active_page = 'tbl_properties_structure.php';
|
||||
include('./tbl_properties_structure.php');
|
||||
exit();
|
||||
require('./tbl_properties_structure.php');
|
||||
} else {
|
||||
PMA_mysqlDie('', '', '', $err_url, FALSE);
|
||||
// garvin: An error happened while inserting/updating a table definition.
|
||||
@@ -184,12 +183,12 @@ if ($abort == FALSE) {
|
||||
|
||||
$num_fields = count($fields_meta);
|
||||
$action = 'tbl_alter.php';
|
||||
include('./tbl_properties.inc.php');
|
||||
require('./tbl_properties.inc.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
@@ -6,10 +6,10 @@
|
||||
/**
|
||||
* 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';
|
||||
require('./header.inc.php');
|
||||
require('./libraries/relation.lib.php'); // foreign keys
|
||||
require_once('./header.inc.php');
|
||||
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)
|
||||
// ----------------
|
||||
|
||||
include('./libraries/get_foreign.lib.php');
|
||||
require('./libraries/get_foreign.lib.php');
|
||||
|
||||
if (isset($foreign_link) && $foreign_link == true) {
|
||||
?>
|
||||
@@ -780,5 +780,5 @@ if (!empty($disp_message)) {
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
?>
|
||||
|
@@ -6,15 +6,13 @@
|
||||
/**
|
||||
* Get some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
$js_to_run = 'functions.js';
|
||||
require('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
|
||||
// Check parameters
|
||||
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
PMA_checkParameters(array('db', 'table'));
|
||||
|
||||
@@ -185,8 +183,8 @@ if (isset($submit)) {
|
||||
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated;
|
||||
|
||||
// garvin: If comments were sent, enable relation stuff
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
@@ -204,7 +202,7 @@ if (isset($submit)) {
|
||||
}
|
||||
}
|
||||
|
||||
include('./' . $cfg['DefaultTabTable']);
|
||||
require('./' . $cfg['DefaultTabTable']);
|
||||
$abort = TRUE;
|
||||
exit();
|
||||
} else {
|
||||
@@ -235,10 +233,10 @@ if ($abort == FALSE) {
|
||||
// Table name and number of fields are valid -> show the form
|
||||
else {
|
||||
$action = 'tbl_create.php';
|
||||
include('./tbl_properties.inc.php');
|
||||
require('./tbl_properties.inc.php');
|
||||
// Diplays the footer
|
||||
echo "\n";
|
||||
include('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,12 +6,8 @@
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
}
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
@@ -37,7 +33,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
|
||||
}
|
||||
if (empty($db) || !$is_db) {
|
||||
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
|
||||
if (!empty($table)) {
|
||||
@@ -46,14 +42,14 @@ if (!defined('PMA_IDX_INCLUDED')) {
|
||||
if (empty($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');
|
||||
exit();
|
||||
exit;
|
||||
} else if (isset($is_table)) {
|
||||
mysql_free_result($is_table);
|
||||
}
|
||||
|
||||
// Displays headers (if needed)
|
||||
$js_to_run = ((isset($index) && isset($do_save_data)) ? 'functions.js' : 'indexes.js');
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
} // end if
|
||||
|
||||
|
||||
@@ -209,8 +205,7 @@ if (!defined('PMA_IDX_INCLUDED')
|
||||
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
|
||||
|
||||
$active_page = 'tbl_properties_structure.php';
|
||||
include('./tbl_properties_structure.php');
|
||||
exit();
|
||||
require('./tbl_properties_structure.php');
|
||||
} // end builds the new index
|
||||
|
||||
|
||||
@@ -504,6 +499,6 @@ else if (!defined('PMA_IDX_INCLUDED')
|
||||
echo "\n";
|
||||
|
||||
if (!defined('PMA_IDX_INCLUDED')){
|
||||
include('./footer.inc.php');
|
||||
require_once('./footer.inc.php');
|
||||
}
|
||||
?>
|
||||
|
@@ -4,11 +4,8 @@
|
||||
|
||||
// Check parameters
|
||||
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./libraries/common.lib.php');
|
||||
|
||||
PMA_checkParameters(array('db', 'table'));
|
||||
|
||||
@@ -107,8 +104,8 @@ global $cfgRelation;
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php');
|
||||
require('./libraries/common.lib.php');
|
||||
require_once('./libraries/grab_globals.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
|
||||
if ($what != 'dataonly') {
|
||||
include('./libraries/export/sql.php');
|
||||
require('./libraries/export/sql.php');
|
||||
|
||||
$no_constraints_comments = true;
|
||||
$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);
|
||||
$result = @PMA_mysql_query($drop_query);
|
||||
if (PMA_mysql_error()) {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie('', $sql_structure, '', $err_url);
|
||||
}
|
||||
|
||||
@@ -191,7 +188,7 @@ if (isset($new_name) && trim($new_name) != '') {
|
||||
|
||||
$result = @PMA_mysql_query($sql_structure);
|
||||
if (PMA_mysql_error()) {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie('', $sql_structure, '', $err_url);
|
||||
} else if (isset($sql_query)) {
|
||||
$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');
|
||||
$result = @PMA_mysql_query($sql_constraints);
|
||||
if (PMA_mysql_error()) {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie('', $sql_structure, '', $err_url);
|
||||
} else if (isset($sql_query)) {
|
||||
$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;
|
||||
$result = @PMA_mysql_query($sql_insert_data);
|
||||
if (PMA_mysql_error()) {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie('', $sql_insert_data, '', $err_url);
|
||||
}
|
||||
$sql_query .= "\n\n" . $sql_insert_data . ';';
|
||||
}
|
||||
|
||||
include('./libraries/relation.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// 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;
|
||||
$result = @PMA_mysql_query($sql_drop_table);
|
||||
if (PMA_mysql_error()) {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
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
|
||||
|
||||
|
||||
@@ -439,7 +436,7 @@ if (isset($new_name) && trim($new_name) != '') {
|
||||
* No new name for the table!
|
||||
*/
|
||||
else {
|
||||
include('./header.inc.php');
|
||||
require_once('./header.inc.php');
|
||||
PMA_mysqlDie($strTableEmpty, '', '', $err_url);
|
||||
}
|
||||
|
||||
|
@@ -6,8 +6,8 @@
|
||||
* Gets the variables sent or posted to this script, then displays headers
|
||||
*/
|
||||
if (!isset($selected_tbl)) {
|
||||
include('./libraries/grab_globals.lib.php');
|
||||
include('./header.inc.php');
|
||||
require_once('./libraries/grab_globals.lib.php');
|
||||
require_once('./header.inc.php');
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
@@ -19,8 +19,8 @@ if (!isset($the_tables) || !is_array($the_tables)) {
|
||||
/**
|
||||
* Gets the relations settings
|
||||
*/
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
@@ -632,5 +632,5 @@ function printPage()
|
||||
<?php
|
||||
echo '<br /><br /> <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');
|
||||
?>
|
||||
|
@@ -3,18 +3,12 @@
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
// Check parameters
|
||||
|
||||
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
|
||||
include('./libraries/common.lib.php');
|
||||
}
|
||||
|
||||
require_once('./libraries/common.lib.php');
|
||||
PMA_checkParameters(array('db','table','action','num_fields'));
|
||||
|
||||
|
||||
// Get available character sets (MySQL >= 4.1)
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100 && !defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')) {
|
||||
include('./libraries/mysql_charsets.lib.php');
|
||||
}
|
||||
// Get available character sets
|
||||
require_once('./libraries/mysql_charsets.lib.php');
|
||||
|
||||
?>
|
||||
<?php if ($cfg['CtrlArrowsMoving']) { ?>
|
||||
@@ -98,8 +92,8 @@ $header_cells[] = $strNull;
|
||||
$header_cells[] = $strDefault . '**';
|
||||
$header_cells[] = $strExtra;
|
||||
|
||||
require('./libraries/relation.lib.php');
|
||||
require('./libraries/transformations.lib.php');
|
||||
require_once('./libraries/relation.lib.php');
|
||||
require_once('./libraries/transformations.lib.php');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
$comments_map = array();
|
||||
|
@@ -35,5 +35,5 @@ require('./tbl_query_box.php');
|
||||
* Displays the footer
|
||||
*/
|
||||
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
Reference in New Issue
Block a user