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:
authorMarc Delisle <marc@infomarc.info>2005-02-13 23:36:58 +0300
committerMarc Delisle <marc@infomarc.info>2005-02-13 23:36:58 +0300
commit812c3122d5f615a25b411951164e59703d338af2 (patch)
treeda86c632b02912f0b521d09e7402c32e2715d842 /server_privileges.php
parent90173b07f950ffd9054a303e14520a3f842c77e8 (diff)
bug #1118137, host not changing when editing user
Diffstat (limited to 'server_privileges.php')
-rw-r--r--server_privileges.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/server_privileges.php b/server_privileges.php
index 42a6d8a819..1268ea6d7f 100644
--- a/server_privileges.php
+++ b/server_privileges.php
@@ -490,6 +490,22 @@ function PMA_displayLoginInformationFields($mode = 'new', $indent = 0)
. (empty($thishost) ? '' : 'else if (this.value == \'thishost\') { hostname.value = \'' . addslashes(htmlspecialchars($thishost)) . '\'; } ')
. 'else if (this.value == \'hosttable\') { hostname.value = \'\'; } else if (this.value == \'userdefined\') { hostname.focus(); hostname.select(); }">' . "\n";
unset($row);
+
+ // when we start editing a user, $GLOBALS['pred_hostname'] is not defined
+ if (!isset($GLOBALS['pred_hostname']) && isset($GLOBALS['hostname'])) {
+ switch (strtolower($GLOBALS['hostname'])) {
+ case 'localhost':
+ case '127.0.0.1':
+ $GLOBALS['pred_hostname'] = 'localhost';
+ break;
+ case '%':
+ $GLOBALS['pred_hostname'] = 'any';
+ break;
+ default:
+ $GLOBALS['pred_hostname'] = 'userdefined';
+ break;
+ }
+ }
echo $spaces . ' <option value="any"' . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'any') ? ' selected="selected"' : '') . '>' . $GLOBALS['strAnyHost'] . '</option>' . "\n"
. $spaces . ' <option value="localhost"' . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'localhost') ? ' selected="selected"' : '') . '>' . $GLOBALS['strLocalhost'] . '</option>' . "\n";
if (!empty($thishost)) {