getParam('db')); if ($this->dbi->getLowerCaseNames() === 1) { $db = DatabaseName::from(mb_strtolower($db->getName())); } } catch (InvalidDatabaseName $exception) { $this->response->addHTML(Message::error($exception->getMessage())->getDisplay()); return; } $checkUserPrivileges = new CheckUserPrivileges($this->dbi); $checkUserPrivileges->getPrivileges(); $this->addScriptFiles(['server/privileges.js', 'vendor/zxcvbn-ts.js']); /** * Checks if the user is allowed to do what they try to... */ $isGrantUser = $this->dbi->isGrantUser(); $isCreateUser = $this->dbi->isCreateUser(); if (! $this->dbi->isSuperUser() && ! $isGrantUser && ! $isCreateUser) { $this->render('server/sub_page_header', ['type' => 'privileges', 'is_image' => false]); $this->response->addHTML( Message::error(__('No Privileges')) ->getDisplay(), ); return; } if (! $isGrantUser && ! $isCreateUser) { $this->response->addHTML(Message::notice( __('You do not have the privileges to administrate the users!'), )->getDisplay()); } $scriptName = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'); $privileges = []; if ($this->dbi->isSuperUser()) { $privileges = $this->privileges->getAllPrivileges($db); } $this->render('database/privileges/index', [ 'is_superuser' => $this->dbi->isSuperUser(), 'db' => $db->getName(), 'database_url' => $scriptName, 'text_dir' => $GLOBALS['text_dir'], 'is_createuser' => $this->dbi->isCreateUser(), 'is_grantuser' => $this->dbi->isGrantUser(), 'privileges' => $privileges, ]); $this->render('export_modal'); } }