From 170abe1fc3ede84f1d5e785c5602938e92449071 Mon Sep 17 00:00:00 2001 From: Armel Fauveau Date: Tue, 31 Jul 2001 21:03:47 +0000 Subject: [PATCH] Bookmark Support now advanced auth --- ChangeLog | 3 ++ config.inc.php3 | 1 + lib.inc.php3 | 132 ++++++++++++++++++++++++++++-------------------- sql.php3 | 25 +++++---- 4 files changed, 94 insertions(+), 67 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7472751c..d206f3424 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-07-31 Armel Fauveau + * bookmark support now advanced auth + 2001-07-31 Marc Delisle * tbl_change.php3: extra characters were being inserted into blobs * db_details.php3: bad link, thanks Steve! diff --git a/config.inc.php3 b/config.inc.php3 index abbbaff41..13a1b7eb2 100755 --- a/config.inc.php3 +++ b/config.inc.php3 @@ -14,6 +14,7 @@ * CREATE TABLE bookmark ( * id int(11) DEFAULT '0' NOT NULL auto_increment, * dbase varchar(255) NOT NULL, + * user varchar(255) NOT NULL, * label varchar(255) NOT NULL, * query text NOT NULL, * PRIMARY KEY (id) diff --git a/lib.inc.php3 b/lib.inc.php3 index af0ad6b75..ca3b4bcea 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -1539,52 +1539,28 @@ var errorMsg2 = ' no bookmark table - $cfgBookmark = FALSE; - $cfgBookmark = ''; - - // No server selected -> no bookmark table if ($server == 0) { return ''; - } - - // Defines the hostname, database and table to use for bookmarks - $i = 1; - while ($i <= sizeof($cfgServers)) { - // Advanced authentification mode - if ($cfgServer['adv_auth']) { - if (($cfgServers[$i]['host'] == $cfgServer['host'] || $cfgServers[$i]['host'] == '') - && $cfgServers[$i]['adv_auth'] == TRUE && $cfgServers[$i]['stduser'] == $cfgServer['user'] && $cfgServers[$i]['stdpass'] == $cfgServer['password']) { - $cfgBookmark['db'] = $cfgServers[$i]['bookmarkdb']; - $cfgBookmark['table'] = $cfgServers[$i]['bookmarktable']; - break; - } - } // end advanced authentification - - // No authentification - else { - if (($cfgServers[$i]['host'] == $cfgServer['host'] || $cfgServers[$i]['host'] == '') - && $cfgServers[$i]['adv_auth'] == FALSE && $cfgServers[$i]['user'] == $cfgServer['user'] && $cfgServers[$i]['password'] == $cfgServer['password']) { - $cfgBookmark['db'] = $cfgServers[$i]['bookmarkdb']; - $cfgBookmark['table'] = $cfgServers[$i]['bookmarktable']; - break; - } - } // end no authentification - - $i++; - } // end while + } + + $cfgBookmark['user']=$cfgServer['user']; + $cfgBookmark['db']=$cfgServer['bookmarkdb']; + $cfgBookmark['table']=$cfgServer['bookmarktable']; return $cfgBookmark; } // end of the 'get_bookmarks_param()' function @@ -1595,27 +1571,37 @@ var errorMsg2 = ' store them - if ($result > 0 && mysql_num_rows($result) > 0) { + if($result>0 && mysql_num_rows($result)>0) + { $flag = 1; - while ($row = mysql_fetch_row($result)) { - $bookmark_list[$flag . ' - ' . $row[0]] = $row[1]; + while($row = mysql_fetch_row($result)) + { + $bookmark_list["$flag - ".$row[0]] = $row[1]; $flag++; - } // end while - return $bookmark_list; + } + + return $bookmark_list; } // No bookmarks for the current database else { - return FALSE; + return false; } } // end of the 'list_bookmarks()' function @@ -1626,19 +1612,47 @@ var errorMsg2 = ' diff --git a/sql.php3 b/sql.php3 index 4940f122f..e89ebd8bc 100755 --- a/sql.php3 +++ b/sql.php3 @@ -8,6 +8,13 @@ require('./grab_globals.inc.php3'); require('./lib.inc.php3'); +/** + * Bookmark Add + */ +if(isset($bookmarkthis)) { + add_bookmarks($fields, $cfgBookmark); + Header("Location: $goto"); +} /** * Gets the true sql query @@ -203,12 +210,13 @@ else { if ($cfgBookmark['db'] && $cfgBookmark['table'] && empty($id_bookmark)) { echo "\n"; echo '' . "\n"; - echo '
' . "\n"; + echo '' . "\n"; if ($display != 'bkmOnly') { echo ' ' . $strOr . '' . "\n"; } echo '

' . "\n"; echo ' ' . $strBookmarkLabel . ' :' . "\n"; + $goto = 'sql.php3' . '?lang=' . $lang . '&server=' . urlencode($server) @@ -218,17 +226,12 @@ else { . '&sql_query=' . urlencode($full_sql_query) . '&id_bookmark=1'; ?> - - - - - - - - - - + + + + " /> +