Use common code for superuser detection.
This commit is contained in:
@@ -42,6 +42,7 @@ $Source$
|
|||||||
* tbl_properties_operations.php: Use strError instead of non existing
|
* tbl_properties_operations.php: Use strError instead of non existing
|
||||||
strFailure.
|
strFailure.
|
||||||
* lang/*: Remove unused messages.
|
* lang/*: Remove unused messages.
|
||||||
|
* sql.php: Use common code for superuser detection.
|
||||||
|
|
||||||
2005-10-07 Marc Delisle <lem9@users.sourceforge.net>
|
2005-10-07 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a
|
* libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a
|
||||||
|
9
sql.php
9
sql.php
@@ -8,6 +8,7 @@
|
|||||||
require_once('./libraries/grab_globals.lib.php');
|
require_once('./libraries/grab_globals.lib.php');
|
||||||
require_once('./libraries/common.lib.php');
|
require_once('./libraries/common.lib.php');
|
||||||
require_once('./libraries/tbl_indexes.lib.php');
|
require_once('./libraries/tbl_indexes.lib.php');
|
||||||
|
require_once('./libraries/check_user_privileges.lib.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the url to return to in case of error in a sql statement
|
* Defines the url to return to in case of error in a sql statement
|
||||||
@@ -57,14 +58,10 @@ $is_drop_database = preg_match('@DROP[[:space:]]+DATABASE[[:space:]]+@i', $sql_q
|
|||||||
*/
|
*/
|
||||||
if (!defined('PMA_CHK_DROP')
|
if (!defined('PMA_CHK_DROP')
|
||||||
&& !$cfg['AllowUserDropDatabase']
|
&& !$cfg['AllowUserDropDatabase']
|
||||||
&& $is_drop_database) {
|
&& $is_drop_database
|
||||||
// Checks if the user is a Superuser
|
&& !$is_superuser) {
|
||||||
// TODO: set a global variable with this information
|
|
||||||
// loic1: optimized query
|
|
||||||
if (!($result = PMA_DBI_select_db('mysql'))) {
|
|
||||||
require_once('./header.inc.php');
|
require_once('./header.inc.php');
|
||||||
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
|
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
|
||||||
} // end if
|
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user