patch #2505255 [privileges] Cleanup, thanks to Virsacer - virsacer
This commit is contained in:
@@ -23,6 +23,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
|||||||
thanks to Virsacer - virsacer
|
thanks to Virsacer - virsacer
|
||||||
+ patch #2506831 [privileges] Create user for existing database,
|
+ patch #2506831 [privileges] Create user for existing database,
|
||||||
thanks to Herman van Rink - helmo
|
thanks to Herman van Rink - helmo
|
||||||
|
+ patch #2505255 [privileges] Cleanup, thanks to Virsacer - virsacer
|
||||||
|
|
||||||
3.1.3.0 (not yet released)
|
3.1.3.0 (not yet released)
|
||||||
+ [lang] Turkish update, thanks to Burak Yavuz
|
+ [lang] Turkish update, thanks to Burak Yavuz
|
||||||
|
@@ -52,7 +52,7 @@ if (isset($dbname)) {
|
|||||||
$db_and_table = '*.*';
|
$db_and_table = '*.*';
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if given $dbanem is a wildcard or not
|
// check if given $dbname is a wildcard or not
|
||||||
if (isset($dbname)) {
|
if (isset($dbname)) {
|
||||||
//if (preg_match('/\\\\(?:_|%)/i', $dbname)) {
|
//if (preg_match('/\\\\(?:_|%)/i', $dbname)) {
|
||||||
if (preg_match('/(?<!\\\\)(?:_|%)/i', $dbname)) {
|
if (preg_match('/(?<!\\\\)(?:_|%)/i', $dbname)) {
|
||||||
@@ -1220,17 +1220,16 @@ if (isset($_REQUEST['change_pw'])) {
|
|||||||
* Deletes users
|
* Deletes users
|
||||||
* (Changes / copies a user, part IV)
|
* (Changes / copies a user, part IV)
|
||||||
*/
|
*/
|
||||||
$user_host_separator = chr(27);
|
|
||||||
|
|
||||||
if (isset($_REQUEST['delete']) || (isset($_REQUEST['change_copy']) && $_REQUEST['mode'] < 4)) {
|
if (isset($_REQUEST['delete']) || (isset($_REQUEST['change_copy']) && $_REQUEST['mode'] < 4)) {
|
||||||
if (isset($_REQUEST['change_copy'])) {
|
if (isset($_REQUEST['change_copy'])) {
|
||||||
$selected_usr = array($old_username . $user_host_separator . $old_hostname);
|
$selected_usr = array($old_username . chr(27) . $old_hostname);
|
||||||
} else {
|
} else {
|
||||||
$selected_usr = $_REQUEST['selected_usr'];
|
$selected_usr = $_REQUEST['selected_usr'];
|
||||||
$queries = array();
|
$queries = array();
|
||||||
}
|
}
|
||||||
foreach ($selected_usr as $each_user) {
|
foreach ($selected_usr as $each_user) {
|
||||||
list($this_user, $this_host) = explode($user_host_separator, $each_user);
|
list($this_user, $this_host) = explode('&#27;', $each_user);
|
||||||
$queries[] = '# ' . sprintf($GLOBALS['strDeleting'], '\'' . $this_user . '\'@\'' . $this_host . '\'') . ' ...';
|
$queries[] = '# ' . sprintf($GLOBALS['strDeleting'], '\'' . $this_user . '\'@\'' . $this_host . '\'') . ' ...';
|
||||||
$queries[] = 'DROP USER \'' . PMA_sqlAddslashes($this_user) . '\'@\'' . $this_host . '\';';
|
$queries[] = 'DROP USER \'' . PMA_sqlAddslashes($this_user) . '\'@\'' . $this_host . '\';';
|
||||||
|
|
||||||
@@ -1494,7 +1493,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
|||||||
echo ' <tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n"
|
echo ' <tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n"
|
||||||
. ' <td><input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_'
|
. ' <td><input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_'
|
||||||
. $index_checkbox . '" value="'
|
. $index_checkbox . '" value="'
|
||||||
. str_replace(chr(27), '', htmlspecialchars($host['User'] . $user_host_separator . $host['Host']))
|
. htmlspecialchars($host['User'] . '&#27;' . $host['Host'])
|
||||||
. '"'
|
. '"'
|
||||||
. (empty($GLOBALS['checkall']) ? '' : ' checked="checked"')
|
. (empty($GLOBALS['checkall']) ? '' : ' checked="checked"')
|
||||||
. ' /></td>' . "\n"
|
. ' /></td>' . "\n"
|
||||||
@@ -1591,21 +1590,19 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
|||||||
if (isset($dbname)) {
|
if (isset($dbname)) {
|
||||||
echo ' <i><a href="server_privileges.php?'
|
echo ' <i><a href="server_privileges.php?'
|
||||||
. $GLOBALS['url_query'] . '&username=' . urlencode($username)
|
. $GLOBALS['url_query'] . '&username=' . urlencode($username)
|
||||||
. '&hostname=' . urlencode($hostname) . '">\''
|
. '&hostname=' . urlencode($hostname) . '&dbname=&tablename=">\''
|
||||||
. htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname)
|
. htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname)
|
||||||
. '\'</a></i>' . "\n";
|
. '\'</a></i>' . "\n";
|
||||||
$url_dbname = urlencode(str_replace('\_', '_', $dbname));
|
$url_dbname = urlencode(str_replace(array('\_', '\%'), array('_', '%'), $dbname));
|
||||||
|
|
||||||
if (isset($dbname)) {
|
echo ' - ' . ($dbname_is_wildcard ? $GLOBALS['strDatabases'] : $GLOBALS['strDatabase'] );
|
||||||
if (isset($tablename)) {
|
if (isset($tablename)) {
|
||||||
echo ' - ' . ($dbname_is_wildcard ? $GLOBALS['strDatabases'] : $GLOBALS['strDatabase'] )
|
echo ' <i><a href="server_privileges.php?' . $GLOBALS['url_query']
|
||||||
. ' <i><a href="server_privileges.php?' . $GLOBALS['url_query']
|
|
||||||
. '&username=' . urlencode($username) . '&hostname=' . urlencode($hostname)
|
. '&username=' . urlencode($username) . '&hostname=' . urlencode($hostname)
|
||||||
. '&dbname=' . $url_dbname . '">' . htmlspecialchars($dbname) . '</a></i>';
|
. '&dbname=' . $url_dbname . '&tablename=">' . htmlspecialchars($dbname) . '</a></i>';
|
||||||
echo ' - ' . $GLOBALS['strTable'] . ' <i>' . htmlspecialchars($tablename) . '</i>';
|
echo ' - ' . $GLOBALS['strTable'] . ' <i>' . htmlspecialchars($tablename) . '</i>';
|
||||||
} else {
|
} else {
|
||||||
echo ' - ' . $GLOBALS['strDatabase'] . ' <i>' . htmlspecialchars($dbname) . '</i>';
|
echo ' <i>' . htmlspecialchars($dbname) . '</i>';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -1613,9 +1610,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
|||||||
. '\'</i>' . "\n";
|
. '\'</i>' . "\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
if (isset($dbname)) {
|
|
||||||
echo '</h2>' . "\n";
|
echo '</h2>' . "\n";
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT '1' FROM `mysql`.`user`"
|
$sql = "SELECT '1' FROM `mysql`.`user`"
|
||||||
@@ -1861,7 +1856,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
|||||||
|
|
||||||
if (! isset($dbname)) {
|
if (! isset($dbname)) {
|
||||||
|
|
||||||
// no database name was give, display select db
|
// no database name was given, display select db
|
||||||
|
|
||||||
if (! empty($found_rows)) {
|
if (! empty($found_rows)) {
|
||||||
$pred_db_array = array_diff(
|
$pred_db_array = array_diff(
|
||||||
@@ -1918,7 +1913,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Provide a line with links to the relevant database and table
|
// Provide a line with links to the relevant database and table
|
||||||
if (isset($dbname)) {
|
if (isset($dbname) && empty($dbname_is_wildcard)) {
|
||||||
echo '[ ' . $GLOBALS['strDatabase']
|
echo '[ ' . $GLOBALS['strDatabase']
|
||||||
. ' <a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?'
|
. ' <a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?'
|
||||||
. $GLOBALS['url_query'] . '&db=' . $url_dbname . '&reload=1">'
|
. $GLOBALS['url_query'] . '&db=' . $url_dbname . '&reload=1">'
|
||||||
|
Reference in New Issue
Block a user