diff --git a/server_privileges.php b/server_privileges.php index 60c2c485d9..f3bcc41824 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -46,6 +46,44 @@ foreach ($get_params as $one_get_param) { } } +/** + * Sets globals from $_POST + */ + +$post_params = array( + 'createdb-1', + 'createdb-2', + 'createdb-3', + 'grant_count', + 'hostname', + 'pma_pw', + 'pma_pw2', + 'pred_hostname', + 'pred_password', + 'pred_username', + 'username' +); +foreach ($post_params as $one_post_param) { + if (isset($_POST[$one_post_param])) { + $GLOBALS[$one_post_param] = $_POST[$one_post_param]; + } +} + +/** + * Sets globals from $_POST patterns, for privileges and max_* vars + */ + +$post_patterns = array( + '/_priv$/i', + '/^max_/i' +); +foreach (array_keys($_POST) as $post_key) { + foreach ($post_patterns as $one_post_pattern) { + if (preg_match($one_post_pattern, $post_key)) { + $GLOBALS[$post_key] = $_POST[$post_key]; + } + } +} /** * Messages are built using the message name @@ -2282,15 +2320,15 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs echo '
' . "\n" . '' . __('Database for user') . '' . "\n"; - PMA_display_html_checkbox('createdb-1', __('Create database with same name and grant all privileges'), false, false); - echo '
' . "\n"; - PMA_display_html_checkbox('createdb-2', __('Grant all privileges on wildcard name (username\\_%)'), false, false); - echo '
' . "\n"; + PMA_display_html_checkbox('createdb-1', __('Create database with same name and grant all privileges'), false, false); + echo '
' . "\n"; + PMA_display_html_checkbox('createdb-2', __('Grant all privileges on wildcard name (username\\_%)'), false, false); + echo '
' . "\n"; if (! empty($dbname) ) { - PMA_display_html_checkbox('createdb-3', sprintf(__('Grant all privileges on database "%s"'), htmlspecialchars($dbname)), true, false); + PMA_display_html_checkbox('createdb-3', sprintf(__('Grant all privileges on database "%s"'), htmlspecialchars($dbname)), true, false); echo '' . "\n"; - echo '
' . "\n"; + echo '
' . "\n"; } echo '
' . "\n";