Merge pull request #451 from scnakandala/gsoc_bug_fixing
Undefined index: is_superuser corrected
This commit is contained in:
commit
bcc9a2e313
@ -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 {
|
||||
|
||||
2
sql.php
2
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.'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user