Translated using Weblate (Interlingua)
[phpmyadmin.git] / server_user_groups.php
blob72f4ff2a9b15eaabf0c64d3e3fc5ffab0999a270
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\libraries\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(
28 PMA\libraries\Message::error(__('No Privileges'))
29 ->getDisplay()
31 exit;
34 $response->addHTML('<div>');
35 $response->addHTML(PMA_getHtmlForSubMenusOnUsersPage('server_user_groups.php'));
37 /**
38 * Delete user group
40 if (! empty($_REQUEST['deleteUserGroup'])) {
41 PMA_deleteUserGroup($_REQUEST['userGroup']);
44 /**
45 * Add a new user group
47 if (! empty($_REQUEST['addUserGroupSubmit'])) {
48 PMA_editUserGroup($_REQUEST['userGroup'], true);
51 /**
52 * Update a user group
54 if (! empty($_REQUEST['editUserGroupSubmit'])) {
55 PMA_editUserGroup($_REQUEST['userGroup']);
58 if (isset($_REQUEST['viewUsers'])) {
59 // Display users belonging to a user group
60 $response->addHTML(PMA_getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
63 if (isset($_REQUEST['addUserGroup'])) {
64 // Display add user group dialog
65 $response->addHTML(PMA_getHtmlToEditUserGroup());
66 } elseif (isset($_REQUEST['editUserGroup'])) {
67 // Display edit user group dialog
68 $response->addHTML(PMA_getHtmlToEditUserGroup($_REQUEST['userGroup']));
69 } else {
70 // Display user groups table
71 $response->addHTML(PMA_getHtmlForUserGroupsTable());
74 $response->addHTML('</div>');