2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Displays the 'User groups' sub page under 'Users' page.
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/server_privileges.lib.php';
12 PMA_getRelationsParam();
13 if (! $GLOBALS['cfgRelation']['menuswork']) {
17 $response = PMA_Response
::getInstance();
18 $response->addHTML('<div>');
19 $response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_user_groups.php'));
24 if (! empty($_REQUEST['deleteUserGroup'])) {
25 PMA_deleteUserGroup($_REQUEST['userGroup']);
29 * Add a new user group
31 if (! empty($_REQUEST['addUserGroupSubmit'])) {
32 PMA_editUserGroup($_REQUEST['userGroup'], true);
38 if (! empty($_REQUEST['editUserGroupSubmit'])) {
39 PMA_editUserGroup($_REQUEST['userGroup']);
42 if (isset($_REQUEST['viewUsers'])) {
43 // Display users belonging to a user group
44 $response->addHTML(PMA_getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
47 if (isset($_REQUEST['addUserGroup'])) {
48 // Display add user group dialog
49 $response->addHTML(PMA_getHtmlToEditUserGroup());
50 } elseif (isset($_REQUEST['editUserGroup'])) {
51 // Display edit user group dialog
52 $response->addHTML(PMA_getHtmlToEditUserGroup($_REQUEST['userGroup']));
54 // Display user groups table
55 $response->addHTML(PMA_getHtmlForUserGroupsTable());
58 $response->addHTML('</div>');