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_users.lib.php';
11 require_once 'libraries/server_user_groups.lib.php';
13 PMA_getRelationsParam();
14 if (! $GLOBALS['cfgRelation']['menuswork']) {
18 $response = PMA_Response
::getInstance();
19 $header = $response->getHeader();
20 $scripts = $header->getScripts();
21 $scripts->addFile('server_user_groups.js');
23 $response->addHTML('<div>');
24 $response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_user_groups.php'));
29 if (! empty($_REQUEST['deleteUserGroup'])) {
30 PMA_deleteUserGroup($_REQUEST['userGroup']);
34 * Add a new user group
36 if (! empty($_REQUEST['addUserGroupSubmit'])) {
37 PMA_editUserGroup($_REQUEST['userGroup'], true);
43 if (! empty($_REQUEST['editUserGroupSubmit'])) {
44 PMA_editUserGroup($_REQUEST['userGroup']);
47 if (isset($_REQUEST['viewUsers'])) {
48 // Display users belonging to a user group
49 $response->addHTML(PMA_getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
52 if (isset($_REQUEST['addUserGroup'])) {
53 // Display add user group dialog
54 $response->addHTML(PMA_getHtmlToEditUserGroup());
55 } elseif (isset($_REQUEST['editUserGroup'])) {
56 // Display edit user group dialog
57 $response->addHTML(PMA_getHtmlToEditUserGroup($_REQUEST['userGroup']));
59 // Display user groups table
60 $response->addHTML(PMA_getHtmlForUserGroupsTable());
63 $response->addHTML('</div>');