Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/databasetraits/PrivilegesTrait.php')
-rw-r--r--src/database/databasetraits/PrivilegesTrait.php34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/database/databasetraits/PrivilegesTrait.php b/src/database/databasetraits/PrivilegesTrait.php
index fee33a74..a9f6aa45 100644
--- a/src/database/databasetraits/PrivilegesTrait.php
+++ b/src/database/databasetraits/PrivilegesTrait.php
@@ -176,16 +176,14 @@ trait PrivilegesTrait
if (\in_array('ALL PRIVILEGES', $privileges, true)) {
$sql .= ' ALL PRIVILEGES';
+ } elseif ('column' === $type) {
+ $this->fieldClean($object);
+ $sql .= ' ' . \implode(\sprintf(
+ ' ("%s"), ',
+ $object
+ ), $privileges);
} else {
- if ('column' === $type) {
- $this->fieldClean($object);
- $sql .= ' ' . \implode(\sprintf(
- ' ("%s"), ',
- $object
- ), $privileges);
- } else {
- $sql .= ' ' . \implode(', ', $privileges);
- }
+ $sql .= ' ' . \implode(', ', $privileges);
}
switch ($type) {
@@ -388,18 +386,14 @@ trait PrivilegesTrait
// Figure out type of ACE (public, user or group)
if (0 === \mb_strpos($v, '=')) {
$atype = 'public';
+ } elseif ($this->hasRoles()) {
+ $atype = 'role';
+ } elseif (0 === \mb_strpos($v, 'group ')) {
+ $atype = 'group';
+ // Tear off 'group' prefix
+ $v = \mb_substr($v, 6);
} else {
- if ($this->hasRoles()) {
- $atype = 'role';
- } else {
- if (0 === \mb_strpos($v, 'group ')) {
- $atype = 'group';
- // Tear off 'group' prefix
- $v = \mb_substr($v, 6);
- } else {
- $atype = 'user';
- }
- }
+ $atype = 'user';
}
// Break on unquoted equals sign...