Merged patch #455484 ("Smart" order) thanks to Jakub Wilk

This commit is contained in:
Loïc Chapeaux
2001-08-27 16:24:52 +00:00
parent b1c32efa70
commit 4e5b85c29b
3 changed files with 39 additions and 31 deletions

View File

@@ -279,9 +279,10 @@
<dt><b>$cfgServers[n]['connect_type']</b> string</dt> <dt><b>$cfgServers[n]['connect_type']</b> string</dt>
<dd> <dd>
What type connection to use with the MySQL server. Your options are 'socket' &amp; What type connection to use with the MySQL server. Your options are
'tcp'. It defaults to 'tcp' as that is nearly guarenteed to be available on all MySQL 'socket' &amp; 'tcp'. It defaults to 'tcp' as that is nearly guarenteed
servers, while sockets are not supported on some platforms. to be available on all MySQL servers, while sockets are not supported
on some platforms.
<br /><br /> <br /><br />
</dd> </dd>
@@ -314,7 +315,8 @@
</ul> </ul>
Advanced authentication is secure as the standard user needs just Advanced authentication is secure as the standard user needs just
read-only-access to the mysql database.<br /><br /> read-only-access to the mysql database.
<br /><br />
All you have to provide in config.inc is a standard user which can All you have to provide in config.inc is a standard user which can
connect to MySQL and read the mysql user/db table connect to MySQL and read the mysql user/db table
@@ -470,11 +472,12 @@
<br /><br /> <br /><br />
</dd> </dd>
<dt><b>$cfgOrder </b>string [<tt>"DESC"</tt>|<tt>"ASC"</tt>]</dt> <dt><b>$cfgOrder </b>string [<tt>DESC</tt>|<tt>ASC</tt>|<tt>SMART</tt>]</dt>
<dd> <dd>
Defines whether fields are displayed in ascending (<tt>"ASC"</tt>) Defines whether fields are displayed in ascending (<tt>ASC</tt>) order,
order or in descending (<tt>"DESC"</tt>) order when you click on the in descending (<tt>DESC</tt>) order or in a "smart" (<tt>SMART</tt>)
field-name. order -ie descending order for fields of type TIME, DATE, DATETIME &
TIMESTAMP, ascending order else- by default.
<br /><br /> <br /><br />
</dd> </dd>
@@ -746,8 +749,8 @@
If you're running a server which cannot be accessed by other people, it's If you're running a server which cannot be accessed by other people, it's
sufficient to use the directory protection bundled with your webserver sufficient to use the directory protection bundled with your webserver
(with Apache you can use <i>.htaccess</i> files, for example).<br /> (with Apache you can use <i>.htaccess</i> files, for example).<br />
If other people have telnet access to your server, If other people have telnet access to your server, you should use
you should use phpMyAdmin's advanced authentication feature. phpMyAdmin's advanced authentication feature.
<br /><br /> <br /><br />
Suggestions: Suggestions:
</p> </p>
@@ -886,17 +889,16 @@
<b>I have found a bug. How do I inform developpers?</b> <b>I have found a bug. How do I inform developpers?</b>
<br /> <br />
Our Bug Tracker is located at <a href="http://sourceforge.net/projects/phpmyadmin"> Our Bug Tracker is located at <a href="http://sourceforge.net/projects/phpmyadmin">
http://sourceforge.net/projects/phpmyadmin</a> http://sourceforge.net/projects/phpmyadmin</a> under the Bugs section.
under the Bugs section. <br /><br />
<br />
<br />
But please first discuss your bug with other users: But please first discuss your bug with other users:
<br /> <br />
<a href="http://sourceforge.net/projects/phpmyadmin"> <a href="http://sourceforge.net/projects/phpmyadmin">
http://sourceforge.net/projects/phpmyadmin</a> (and choose Forums) http://sourceforge.net/projects/phpmyadmin</a> (and choose Forums)
<br /> <br />
<a href="http://www.phpwizard.net/projects/phpMyAdmin"> <a href="http://www.phpwizard.net/projects/phpMyAdmin">
http://www.phpwizard.net/projects/phpMyAdmin</a> (and choose Support Forum) http://www.phpwizard.net/projects/phpMyAdmin</a> (and choose Support
Forum)
</p> </p>

View File

@@ -97,14 +97,18 @@ unset($cfgServers[0]);
$cfgConfirm = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE' $cfgConfirm = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE'
$cfgPersistentConnections = FALSE; // use persistent connections to MySQL database $cfgPersistentConnections = FALSE; // use persistent connections to MySQL database
$cfgShowBlob = FALSE; // display blob field contents in browse mode $cfgShowBlob = FALSE; // display blob field contents in browse mode
$cfgProtectBlob = TRUE; // disallow editing of blob fields in edit mode $cfgProtectBlob = TRUE; // disallow editing of blob fields in edit mode
$cfgAllowUserDropDatabase = FALSE; // disallow users to delete their own database $cfgAllowUserDropDatabase = FALSE; // disallow users to delete their own database
$cfgShowSQL = TRUE; // show SQL queries as run $cfgShowSQL = TRUE; // show SQL queries as run
$cfgSkipLockedTables = FALSE; // mark used tables, make possible to show $cfgSkipLockedTables = FALSE; // mark used tables, make possible to show
// locked tables (since MySQL 3.23.30) // locked tables (since MySQL 3.23.30)
$cfgMaxRows = 30; // maximum number of rows to display in browse mode $cfgMaxRows = 30; // maximum number of rows to display in browse mode
$cfgOrder = 'ASC'; // default for 'ORDER BY' clause $cfgOrder = 'ASC'; // default for 'ORDER BY' clause (valid
$cfgOBGzip = TRUE; // GZIP output buffering // values are 'ASC', 'DESC' or 'SMART' -ie
// descending order for fields of type
// TIME, DATE, DATETIME & TIMESTAMP,
// ascending order else-)
$cfgOBGzip = TRUE; // GZIP output buffering
$cfgGZipDump = TRUE; // Allow the use of gzip/bzip compression $cfgGZipDump = TRUE; // Allow the use of gzip/bzip compression
$cfgBZipDump = TRUE; // for dump files $cfgBZipDump = TRUE; // for dump files

View File

@@ -146,25 +146,22 @@ if (!defined('__LIB_INC__')){
} }
echo '<b>'. $GLOBALS['strError'] . '</b>' . "\n"; echo '<b>'. $GLOBALS['strError'] . '</b>' . "\n";
if (!empty($the_query)) { // if the config password is wrong, or the MySQL server does not
// respond, do not show the query that would reveal the
// username/password
if (!empty($the_query) && !strstr($the_query, 'connect')) {
$query_base = htmlspecialchars($the_query); $query_base = htmlspecialchars($the_query);
$query_base = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $query_base); $query_base = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $query_base);
echo '<p>' . "\n"; echo '<p>' . "\n";
// if the config password is wrong, or the MySQL server does not respond,
// do not show the query that would reveal the username/password
if (!strstr($query_base,"connect")) {
echo ' ' . $GLOBALS['strSQLQuery'] . '&nbsp;:&nbsp;' . "\n"; echo ' ' . $GLOBALS['strSQLQuery'] . '&nbsp;:&nbsp;' . "\n";
if ($is_modify_link) { if ($is_modify_link) {
echo ' [' echo ' ['
. '<a href="db_details.php3?lang=' . $GLOBALS['lang'] . '&server=' . urlencode($GLOBALS['server']) . '&db=' . urlencode($GLOBALS['db']) . '&sql_query=' . urlencode($the_query) . '&show_query=y">' . $GLOBALS['strEdit'] . '</a>' . '<a href="db_details.php3?lang=' . $GLOBALS['lang'] . '&server=' . urlencode($GLOBALS['server']) . '&db=' . urlencode($GLOBALS['db']) . '&sql_query=' . urlencode($the_query) . '&show_query=y">' . $GLOBALS['strEdit'] . '</a>'
. ']' . "\n"; . ']' . "\n";
} } // end if
echo '<pre>' . "\n" . $query_base . "\n" . '</pre>' . "\n"; echo '<pre>' . "\n" . $query_base . "\n" . '</pre>' . "\n";
echo '</p>' . "\n"; echo '</p>' . "\n";
} } // end if
}
if (!empty($error_message)) { if (!empty($error_message)) {
$error_message = htmlspecialchars($error_message); $error_message = htmlspecialchars($error_message);
$error_message = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $error_message); $error_message = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $error_message);
@@ -1079,7 +1076,12 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
} }
// 3. Do define the sorting url // 3. Do define the sorting url
if (!$is_in_sort) { if (!$is_in_sort) {
$sort_order = ' ORDER BY ' . backquote($field->name) . ' ' . $GLOBALS['cfgOrder']; // loic1: patch #455484 ("Smart" order)
$cfgOrder = strtoupper($GLOBALS['cfgOrder']);
if ($cfgOrder == 'SMART') {
$cfgOrder = (eregi('time|date', $field->type)) ? 'DESC' : 'ASC';
}
$sort_order = ' ORDER BY ' . backquote($field->name) . ' ' . $cfgOrder;
$order_img = ''; $order_img = '';
} }
else if (substr($sql_order, -3) == 'ASC' && $is_in_sort) { else if (substr($sql_order, -3) == 'ASC' && $is_in_sort) {