';
- $html_output .= $this->template->render('select_all', [
- 'pma_theme_image' => $GLOBALS['pmaThemeImage'],
- 'text_dir' => $GLOBALS['text_dir'],
- 'form_name' => "usersForm",
- ]);
- $html_output .= Util::getButtonOrImage(
- 'submit_mult',
- 'mult_submit',
- __('Export'),
- 'b_tblexport',
- 'export'
- );
-
- $html_output .= '';
- $html_output .= '';
- } else {
- $html_output .= $this->getHtmlForViewUsersError();
+ $tableBody = $this->getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db);
}
- // Offer to create a new user for the current database
- $html_output .= $this->getAddUserHtmlFieldset($db, $table);
- return $html_output;
+
+ return $this->template->render('server/privileges/table', [
+ 'db' => $db,
+ 'table' => $table,
+ 'is_superuser' => $this->dbi->isSuperuser(),
+ 'table_url' => $scriptName,
+ 'pma_theme_image' => $pmaThemeImage,
+ 'text_dir' => $text_dir,
+ 'table_body' => $tableBody,
+ 'is_createuser' => $is_createuser,
+ ]);
}
/**
@@ -1664,26 +1635,6 @@ class Privileges
}
}
- /**
- * Get HTML snippet for privileges table head
- *
- * @return string
- */
- public function getHtmlForPrivsTableHead()
- {
- return '
'
- . ''
- . ' | '
- . '' . __('User name') . ' | '
- . '' . __('Host name') . ' | '
- . '' . __('Type') . ' | '
- . '' . __('Privileges') . ' | '
- . '' . __('Grant') . ' | '
- . '' . __('Action') . ' | '
- . '
'
- . '';
- }
-
/**
* Get HTML error for View Users form
* For non superusers such as grant/create users
diff --git a/templates/server/privileges/table.twig b/templates/server/privileges/table.twig
new file mode 100644
index 0000000000..4c328cff3c
--- /dev/null
+++ b/templates/server/privileges/table.twig
@@ -0,0 +1,61 @@
+{% if is_superuser %}
+
+{% else %}
+ {{ 'Not enough privilege to view users.'|trans|error }}
+{% endif %}
+
+{% if is_createuser %}
+
+{% endif %}