Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilina Buddika <thilinaabeyrathna@gmail.com>2012-07-10 22:10:11 +0400
committerThilina Buddika <thilinaabeyrathna@gmail.com>2012-07-10 22:10:11 +0400
commitc1a8445bcf55e42ec4f685d8e417687beb6a540c (patch)
treea475f9a5e40c881b3ae2eda41db224fd4c6cf55c /server_privileges.php
parentef4d31e581f5430dcd1d2cc5d9e0afdcabc6d1bc (diff)
some changes to PMA_deleteUser and PMA_updatePrivileges
Diffstat (limited to 'server_privileges.php')
-rw-r--r--server_privileges.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/server_privileges.php b/server_privileges.php
index 1cfced6d3e..845570db21 100644
--- a/server_privileges.php
+++ b/server_privileges.php
@@ -460,7 +460,7 @@ if (isset($_REQUEST['change_copy'])) {
* Updates privileges
*/
if (! empty($update_privs)) {
- $message = PMA_updatePrivileges($dbname, $tablename, $username, $hostname);
+ list($sql_query, $message) = PMA_updatePrivileges($username, $hostname);
}
/**
@@ -488,8 +488,30 @@ if (isset($_REQUEST['change_pw'])) {
if (isset($_REQUEST['delete'])
|| (isset($_REQUEST['change_copy']) && $_REQUEST['mode'] < 4)
) {
- $message = PMA_deleteUser($queries);
-}
+ if (isset($_REQUEST['change_copy'])) {
+ $selected_usr = array($_REQUEST['old_username'] . '&amp;#27;' . $_REQUEST['old_hostname']);
+ } else {
+ $selected_usr = $_REQUEST['selected_usr'];
+ $queries = array();
+ }
+ foreach ($selected_usr as $each_user) {
+ list($this_user, $this_host) = explode('&amp;#27;', $each_user);
+ $queries[] = '# ' . sprintf(__('Deleting %s'), '\'' . $this_user . '\'@\'' . $this_host . '\'') . ' ...';
+ $queries[] = 'DROP USER \'' . $common_functions->sqlAddSlashes($this_user) . '\'@\'' . $common_functions->sqlAddSlashes($this_host) . '\';';
+
+ if (isset($_REQUEST['drop_users_db'])) {
+ $queries[] = 'DROP DATABASE IF EXISTS ' . $common_functions->backquote($this_user) . ';';
+ $GLOBALS['reload'] = true;
+
+ if ($GLOBALS['is_ajax_request'] != true) {
+ echo $common_functions->getReloadNavigationScript();
+ }
+ }
+ }
+ if (empty($_REQUEST['change_copy'])) {
+ list($sql_query, $message) = PMA_deleteUser($queries);
+ }
+}
/**
* Changes / copies a user, part V