From 2da3c58b4435a83cc28fb4b34cd45fb5e7484f05 Mon Sep 17 00:00:00 2001 From: Spun Nakandala Date: Tue, 25 Jun 2013 19:00:33 +0530 Subject: [PATCH] Undefined index: is_superuser corrected --- libraries/sql.lib.php | 5 +++-- sql.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index 2da464bedc..0c845f01c4 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -812,17 +812,18 @@ function PMA_isDeleteTransformationInfo($analyzed_sql_results) * @param array $analyzed_sql_results the analyzed query and other varibles set * after analyzing the query * @param boolean $allowUserDropDatabase whether the user is allowed to drop db + * @param boolean $is_superuser whether this user is a superuser * * @return boolean */ function PMA_hasNoRightsToDropDatabase($analyzed_sql_results, - $allowUserDropDatabase + $allowUserDropDatabase, $is_superuser ) { if (! defined('PMA_CHK_DROP') && ! $allowUserDropDatabase && isset ($analyzed_sql_results['drop_database']) && $analyzed_sql_results['drop_database'] == 1 - && ! $analyzed_sql_results['is_superuser'] + && ! $is_superuser ) { return true; } else { diff --git a/sql.php b/sql.php index e20c77afd1..a86b76e53a 100644 --- a/sql.php +++ b/sql.php @@ -213,7 +213,7 @@ require_once 'libraries/parse_analyze.inc.php'; * into account this case. */ if (PMA_hasNoRightsToDropDatabase( - $analyzed_sql_results, $cfg['AllowUserDropDatabase']) + $analyzed_sql_results, $cfg['AllowUserDropDatabase'], $is_superuser) ) { PMA_Util::mysqlDie( __('"DROP DATABASE" statements are disabled.'),