Implemented some version checks to avoid bugs like #777785.
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2003-07-30 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||
* server_privileges.php3: Implemented some version checks to avoid bugs like
|
||||
#777785.
|
||||
|
||||
2003-07-29 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* serbian: big update,
|
||||
thanks to Branislav Jovanovi<76> <branej@users.sourceforge.net> and
|
||||
|
@@ -619,13 +619,14 @@ if (!empty($adduser_submit) || !empty($change_copy)) {
|
||||
}
|
||||
$sql_query = $real_sql_query;
|
||||
}
|
||||
if ((isset($Grant_priv) && $Grant_priv == 'Y') || isset($max_questions) || isset($max_connections) || isset($max_updates)) {
|
||||
if ((isset($Grant_priv) && $Grant_priv == 'Y') || (PMA_MYSQL_INT_VERSION >= 40002 && (isset($max_questions) || isset($max_connections) || isset($max_updates)))) {
|
||||
$real_sql_query .= 'WITH';
|
||||
$sql_query .= 'WITH';
|
||||
if (isset($Grant_priv) && $Grant_priv == 'Y') {
|
||||
$real_sql_query .= ' GRANT OPTION';
|
||||
$sql_query .= ' GRANT OPTION';
|
||||
}
|
||||
if (PMA_MYSQL_INT_VERSION >= 40002) {
|
||||
if (isset($max_questions)) {
|
||||
$real_sql_query .= ' MAX_QUERIES_PER_HOUR ' . (int)$max_questions;
|
||||
$sql_query .= ' MAX_QUERIES_PER_HOUR ' . (int)$max_questions;
|
||||
@@ -639,6 +640,7 @@ if (!empty($adduser_submit) || !empty($change_copy)) {
|
||||
$sql_query .= ' MAX_UPDATES_PER_HOUR ' . (int)$max_updates;
|
||||
}
|
||||
}
|
||||
}
|
||||
$real_sql_query .= ';';
|
||||
$sql_query .= ';';
|
||||
if (empty($change_copy)) {
|
||||
@@ -742,11 +744,12 @@ if (!empty($update_privs)) {
|
||||
$sql_query1 = 'REVOKE GRANT OPTION ON ' . $db_and_table . ' FROM "' . PMA_sqlAddslashes($username) . '"@"' . $hostname . '";';
|
||||
}
|
||||
$sql_query2 = 'GRANT ' . join(', ', PMA_extractPrivInfo()) . ' ON ' . $db_and_table . ' TO "' . PMA_sqlAddslashes($username) . '"@"' . $hostname . '"';
|
||||
if ((isset($Grant_priv) && $Grant_priv == 'Y') || (empty($dbname) && (isset($max_questions) || isset($max_connections) || isset($max_updates)))) {
|
||||
if ((isset($Grant_priv) && $Grant_priv == 'Y') || (empty($dbname) && PMA_INT_VERSION >= 40002 && (isset($max_questions) || isset($max_connections) || isset($max_updates)))) {
|
||||
$sql_query2 .= 'WITH';
|
||||
if (isset($Grant_priv) && $Grant_priv == 'Y') {
|
||||
$sql_query2 .= ' GRANT OPTION';
|
||||
}
|
||||
if (PMA_INT_VERSION >= 40002) {
|
||||
if (isset($max_questions)) {
|
||||
$sql_query2 .= ' MAX_QUERIES_PER_HOUR ' . (int)$max_questions;
|
||||
}
|
||||
@@ -757,6 +760,7 @@ if (!empty($update_privs)) {
|
||||
$sql_query2 .= ' MAX_UPDATES_PER_HOUR ' . (int)$max_updates;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql_query2 .= ';';
|
||||
PMA_mysql_query($sql_query0, $userlink); // this query may fail, but this does not matter :o)
|
||||
if (isset($sql_query1)) {
|
||||
|
Reference in New Issue
Block a user