2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Displays the 'User groups' sub page under 'Users' page.
8 use PMA\libraries\Response
;
10 require_once 'libraries/common.inc.php';
11 require_once 'libraries/server_users.lib.php';
12 require_once 'libraries/server_user_groups.lib.php';
14 PMA_getRelationsParam();
15 if (! $GLOBALS['cfgRelation']['menuswork']) {
19 $response = Response
::getInstance();
20 $header = $response->getHeader();
21 $scripts = $header->getScripts();
22 $scripts->addFile('server_user_groups.js');
25 * Only allowed to superuser
27 if (! $GLOBALS['is_superuser']) {
29 PMA\libraries\Message
::error(__('No Privileges'))
35 $response->addHTML('<div>');
36 $response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_user_groups.php'));
41 if (! empty($_REQUEST['deleteUserGroup'])) {
42 PMA_deleteUserGroup($_REQUEST['userGroup']);
46 * Add a new user group
48 if (! empty($_REQUEST['addUserGroupSubmit'])) {
49 PMA_editUserGroup($_REQUEST['userGroup'], true);
55 if (! empty($_REQUEST['editUserGroupSubmit'])) {
56 PMA_editUserGroup($_REQUEST['userGroup']);
59 if (isset($_REQUEST['viewUsers'])) {
60 // Display users belonging to a user group
61 $response->addHTML(PMA_getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
64 if (isset($_REQUEST['addUserGroup'])) {
65 // Display add user group dialog
66 $response->addHTML(PMA_getHtmlToEditUserGroup());
67 } elseif (isset($_REQUEST['editUserGroup'])) {
68 // Display edit user group dialog
69 $response->addHTML(PMA_getHtmlToEditUserGroup($_REQUEST['userGroup']));
71 // Display user groups table
72 $response->addHTML(PMA_getHtmlForUserGroupsTable());
75 $response->addHTML('</div>');