Merge pull request #451 from scnakandala/gsoc_bug_fixing

Undefined index: is_superuser corrected
This commit is contained in:
Marc Delisle 2013-06-25 07:17:16 -07:00
commit bcc9a2e313
2 changed files with 4 additions and 3 deletions

View File

@ -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 {

View File

@ -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.'),