From 51cd7cd7325d42cee2ccefa6c3a0c1aa40bf440f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?=
Date: Tue, 18 Dec 2001 12:07:13 +0000
Subject: [PATCH] * the number of rows to return, display direction and table
headers frequencies weren't passed between scripts; * codding standards; *
little bugs with vertical/horizontal display directions.
---
ChangeLog | 22 +-
Documentation.html | 161 ++++-----
config.inc.php3 | 7 +-
libraries/display_tbl.lib.php3 | 587 +++++++++++++++++----------------
sql.php3 | 40 ++-
tbl_change.php3 | 7 +-
tbl_replace.php3 | 20 +-
7 files changed, 458 insertions(+), 386 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0cd88a84c..638e69040 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,13 +5,25 @@ phpMyAdmin - Changelog
$Id$
$Source$
+2001-12-18 Loïc Chapeaux
+ * sql.php3; tbl_change.php3; tbl_replace.php3;
+ libraries/display_tbl.lib.php3: the number of rows to return, display
+ direction and table headers "frequencies" weren't passed between scripts.
+ * config.inc.php3; Documentation.html; libraries/display_tbl.lib.php3:
+ - codding standards;
+ - little bugs with vertical/horizontal display direction.
+
+2001-12-16 Loïc Chapeaux
+ * footer.inc.php3: back to previous version (it does not fix the bug
+ #493200 but creates a new one).
+
2001-12-16 Marc Delisle
* merge and adapt Vertical/horizontal browsing patch #492470
- thanks to Garvin Hicking (hicking at faktor-e.de)
- - config.inc.php3
- - libraries/display_tbl.lib.php3
- - lang/*
- - Documentation.html
+ thanks to Garvin Hicking (hicking at faktor-e.de)
+ - config.inc.php3
+ - libraries/display_tbl.lib.php3
+ - lang/*
+ - Documentation.html
2001-12-15 Loïc Chapeaux
* libraries/common.lib.php3:
diff --git a/Documentation.html b/Documentation.html
index 13087c401..457943d73 100755
--- a/Documentation.html
+++ b/Documentation.html
@@ -146,10 +146,10 @@
Introduction
- phpMyAdmin can manager a whole MySQL-server (needs a super-user)
+ phpMyAdmin can manager a whole MySQL-server (needs a super-user)
but also a single database. To accomplish the latter you'll need
a properly set up MySQL-user who can read/write only the desired
- database. It's up to you to look up the appropriate part in the
+ database. It's up to you to look up the appropriate part in the
MySQL manual. Currently phpMyAdmin can:
@@ -218,10 +218,10 @@
Have a look at
Configuration section for an
explanation of all values.
-
It is recommended that you protect the directory in which
- you installed phpMyAdmin (unless it's on a closed intranet, or you
- wish to use http or cookie authentication), for example with
- HTTP-AUTH (in a .htaccess file). See the
+
It is recommended that you protect the directory in which you
+ installed phpMyAdmin (unless it's on a closed intranet, or you wish to
+ use http or cookie authentication), for example with HTTP-AUTH (in a
+ .htaccess file). See the
FAQ section for additional
information.
Open the file
@@ -241,64 +241,67 @@
Using authentication modes:
-
Http and cookie authentication modes are recommended in a multi-user
+
Http and cookie authentication modes are recommended in a multi-user
environment where you want to give users access to their own database
and don't want them to play around with others.
-
Http and cookie authentication modes are secure: the MySQL password does
- not need to be set in the phpMyAdmin configuration file. (except for the
- "standard user" -see the Configuration section-).
+
Http and cookie authentication modes are secure: the MySQL password
+ does not need to be set in the phpMyAdmin configuration file. (except
+ for the "standard user" -see the Configuration section-).
+
In cookie mode, we send the password in a temporary cookie, so most
browsers should not store the password in their cookie file.
-
For 'http' and 'cookie' modes, phpMyAdmin needs a stduser that
- has only the SELECT
- privilege on the mysql.user (all columns except
- "Password"), mysql.db (all columns) &
- mysql.tables_priv (all columns except "Grantor" &
- "Timestamp") tables.
- You must specify the details for the stduser in the config.inc.php3
- file under the $cfgServers[n]['stduser'] &
- $cfgServers[n]['stdpass'] settings.
- To create the control account (<stduser> and
- <stdpass> have to be replaced by your own values, of course):
-
-
-
-
- GRANT USAGE ON mysql.* TO '<stduser>'@'localhost' IDENTIFIED BY '<stdpass>';
- GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) ON mysql.user TO '<stduser>'@'localhost';
- GRANT SELECT ON mysql.db TO '<stduser>'@'localhost';
- GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO '<stduser>'@'localhost';
-
-
-
-
- ... and if you want to use the bookmark feature:
-
-
-
-
-
- GRANT SELECT, INSERT, DELETE ON <bookmark_db>.<bookmark_table> TO '<stduser>'@'localhost';
-
-
-
-
-
-
- Then each of the true users should be granted of a set of
- privileges on a set of perticular databases but shouldn't have any global
- privileges. For example, to grant the user real_user with all
- privileges on the database user_base:
- GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';
-
- What the user may now do is controlled entirely by the MySQL user management
- system.
- With http or cookie auth mode, you don't need to fill the user/password
- fields inside the $cfgServers array.
-
+
+ For 'http' and 'cookie' modes, phpMyAdmin needs a stduser that has
+ only the SELECT privilege on the mysql.user (all
+ columns except "Password"), mysql.db (all columns)
+ & mysql.tables_priv (all columns except "Grantor"
+ & "Timestamp") tables.
+ You must specify the details for the stduser in the
+ config.inc.php3 file under the
+ $cfgServers[n]['stduser'] &
+ $cfgServers[n]['stdpass'] settings.
+ To create the control account (<stduser> and
+ <stdpass> have to be replaced by your own values, of
+ course):
+
+
+
+
+ GRANT USAGE ON mysql.* TO '<stduser>'@'localhost' IDENTIFIED BY '<stdpass>';
+ GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) ON mysql.user TO '<stduser>'@'localhost';
+ GRANT SELECT ON mysql.db TO '<stduser>'@'localhost';
+ GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO '<stduser>'@'localhost';
+
+
+
+
+ ... and if you want to use the bookmark feature:
+
+
+
+
+
+ GRANT SELECT, INSERT, DELETE ON <bookmark_db>.<bookmark_table> TO '<stduser>'@'localhost';
+
+
+
+
+
+
+ Then each of the true users should be granted of a set of
+ privileges on a set of perticular databases but shouldn't have any
+ global privileges. For example, to grant the user real_user with
+ all privileges on the database user_base:
+ GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';
+
+ What the user may now do is controlled entirely by the MySQL user
+ management system.
+ With http or cookie auth mode, you don't need to fill the user/password
+ fields inside the $cfgServers array.
+
'http' authentication mode:
@@ -308,6 +311,7 @@
allows you to login as any valid MySQL user.
Is only supported with PHP running as an Apache module, not with cgi.
+
'cookie' authentication mode:
You can use this method as a replacement for the http
@@ -325,8 +329,8 @@
fields.
But usually you don't need to setup a "standard user" here:
using the $cfgServers[n]['only_db'] might be enough.
- In the ISP FAQ section, there is an entry explaining how to
- protect your configuration file.
+ In the ISP FAQ section, there is an entry explaining how to protect
+ your configuration file.
@@ -438,8 +442,9 @@
- 'config' authentication ($auth_type = 'config')
- is the plain old way: username and password are stored in
+ 'config' authentication
+ ($auth_type = 'config') is the plain old
+ way: username and password are stored in
config.inc.php3.
@@ -453,7 +458,7 @@
'http' authentication (was called 'advanced' in older versions)
($auth_type = 'http') as introduced in 1.3.0
- allows you to log in as any valid MySQL user via HTTP-Auth.
+ allows you to log in as any valid MySQL user via HTTP-Auth.
@@ -724,21 +729,6 @@
-
-
$cfgDefaultDisplay string
-
- There are 2 display modes: horizontal and vertical. Define which one
- is displayed by default.
-
-
-
-
-
$cfgRepeatCells integer
-
- Repeat the headers every X cells, or 0 to deactivate.
-
-
-
$cfgLeftBgColor string [HTML color] $cfgRightBgColor string [HTML color]
@@ -811,6 +801,21 @@
Defines the place where modify and delete links would be put when
tables contents are displayed (you may have them displayed both at the
left and at the right).
+ "Left" and "right" are parsed as "top"
+ and "bottom" with vertical display mode.
+
+
+
+
$cfgDefaultDisplay string
+
+ There are 2 display modes: horizontal and vertical. Define which one is
+ displayed by default.
+
+
+
+
$cfgRepeatCells integer
+
+ Repeat the headers every X cells, or 0 to deactivate.
@@ -1168,7 +1173,7 @@
Testing needs to be done for Konqueror 2.2.2.
-
+
I refresh (reload) my browser, and come back to the welcome page.
Some browsers support right-clicking into the frame you want to refresh,
diff --git a/config.inc.php3 b/config.inc.php3
index bdfed8b2c..d145985eb 100755
--- a/config.inc.php3
+++ b/config.inc.php3
@@ -173,9 +173,12 @@ $cfgTextareaCols = 40; // textarea size (columns) in edit mode
$cfgTextareaRows = 7; // textarea size (rows) in edit mode
$cfgLimitChars = 50; // max field data length in browse mode
$cfgModifyDeleteAtLeft = TRUE; // show edit/delete links on left side of browse
+ // (or at the top with vertical browse)
$cfgModifyDeleteAtRight = FALSE; // show edit/delete links on right side of browse
-$cfgDefaultDisplay = 'horizontal'; // default display mode (horizontal|vertical)
-$cfgRepeatCells = 100; // repeat header names every X cells? (0 = deactivate)
+ // (or at the bottom with vertical browse)
+$cfgDefaultDisplay = 'horizontal'; // default display direction (horizontal|vertical)
+$cfgRepeatCells = 100; // repeat header names every X cells? (0 = deactivate)
+
/**
* MySQL settings
diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3
index dbef39088..77bd92f03 100644
--- a/libraries/display_tbl.lib.php3
+++ b/libraries/display_tbl.lib.php3
@@ -181,6 +181,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* without any programmatically appended "LIMIT" clause
* @global integer the current position in results
* @global mixed the maximum number of rows per page ('all' = no limit)
+ * @global string the display mode (horizontal/vertical)
+ * @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of
* text type fields or not
*
@@ -192,7 +194,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
{
global $lang, $server, $db, $table;
global $goto;
- global $num_rows, $unlim_num_rows, $pos, $session_max_rows, $displaymode, $repeatcells;
+ global $num_rows, $unlim_num_rows, $pos, $session_max_rows;
+ global $disp_direction, $repeat_cells;
global $dontlimitchars;
?>
@@ -224,6 +227,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
+
+
/>
@@ -238,6 +243,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
+
+
/>
@@ -250,7 +257,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
-
+
@@ -322,6 +315,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
+
+
/>
@@ -337,6 +332,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
+
+
/>
@@ -361,6 +358,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
+
+
@@ -397,6 +396,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @global integer the total number of rows returned by the sql query
* @global integer the current position in results
* @global integer the maximum number of rows per page
+ * @global array informations used with vertical display mode
+ * @global string the display mode (horizontal/vertical)
+ * @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of
* text type fields or not
*
@@ -409,20 +411,20 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
global $lang, $server, $db, $table;
global $goto;
global $sql_query, $num_rows, $pos, $session_max_rows;
+ global $verticaldisplay, $disp_direction, $repeat_cells;
global $dontlimitchars;
- global $verticaldisplay, $displaymode, $repeatcells;
- if (!($displaymode) or ($displaymode=="horizontal")) {
- ?>
+ if ($disp_direction == 'horizontal') {
+ ?>
' . "\n";
- if (!($displaymode) or ($displaymode=="horizontal")) echo "\n";
+ echo "\n";
$foo++;
} // end while
- return true;
+ return TRUE;
} // end of the 'PMA_displayTableBody()' function
@@ -996,6 +1018,9 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
* displayed
* @global array the list of fields properties
* @global integer the total number of fields returned by the sql query
+ * @global array informations used with vertical display mode
+ * @global string the display mode (horizontal/vertical)
+ * @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of
* text type fields or not
*
@@ -1010,8 +1035,8 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
global $lang, $server, $db, $table;
global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
+ global $verticaldisplay, $disp_direction, $repeat_cells;
global $dontlimitchars;
- global $verticaldisplay, $displaymode, $repeatcells;
// 1. ----- Prepares the work -----
@@ -1078,119 +1103,117 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
}
// 3. ----- Displays the results table -----
+ // lem9: horizontal output?
+ if ($disp_direction == 'horizontal') {
+ ?>
+
+
+
+
+
+
+
+
+
-
-
-
+ if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($verticaldisplay['edit'])) {
+ echo '