Translated using Weblate (Portuguese (Brazil))
[phpmyadmin.git] / server_user_groups.php
blobc9e958952771cef459bf7dc9829a08ba23faf461
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Displays the 'User groups' sub page under 'Users' page.
6 * @package PhpMyAdmin
7 */
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']) {
15 exit;
18 $response = PMA_Response::getInstance();
19 $header = $response->getHeader();
20 $scripts = $header->getScripts();
21 $scripts->addFile('server_user_groups.js');
23 /**
24 * Only allowed to superuser
26 if (! $GLOBALS['is_superuser']) {
27 $response->addHTML(PMA_Message::error(__('No Privileges'))->getDisplay());
28 exit;
31 $response->addHTML('<div>');
32 $response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_user_groups.php'));
34 /**
35 * Delete user group
37 if (! empty($_REQUEST['deleteUserGroup'])) {
38 PMA_deleteUserGroup($_REQUEST['userGroup']);
41 /**
42 * Add a new user group
44 if (! empty($_REQUEST['addUserGroupSubmit'])) {
45 PMA_editUserGroup($_REQUEST['userGroup'], true);
48 /**
49 * Update a user group
51 if (! empty($_REQUEST['editUserGroupSubmit'])) {
52 PMA_editUserGroup($_REQUEST['userGroup']);
55 if (isset($_REQUEST['viewUsers'])) {
56 // Display users belonging to a user group
57 $response->addHTML(PMA_getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
60 if (isset($_REQUEST['addUserGroup'])) {
61 // Display add user group dialog
62 $response->addHTML(PMA_getHtmlToEditUserGroup());
63 } elseif (isset($_REQUEST['editUserGroup'])) {
64 // Display edit user group dialog
65 $response->addHTML(PMA_getHtmlToEditUserGroup($_REQUEST['userGroup']));
66 } else {
67 // Display user groups table
68 $response->addHTML(PMA_getHtmlForUserGroupsTable());
71 $response->addHTML('</div>');