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:
authorFelipe Figueroa <amenadiel@gmail.com>2018-05-22 17:04:40 +0300
committerFelipe Figueroa <amenadiel@gmail.com>2018-05-22 17:04:40 +0300
commitec17a24e74cc12632274738652e707c1b231e03f (patch)
tree526c82fc7c55bed312918b84733a5662e39aeacf /src/controllers/PrivilegesController.php
parentf1eb3c80f7d44d7f2fafd4ab4a07351fa3f80860 (diff)
uses coalesceArr
Diffstat (limited to 'src/controllers/PrivilegesController.php')
-rw-r--r--src/controllers/PrivilegesController.php30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/controllers/PrivilegesController.php b/src/controllers/PrivilegesController.php
index e5269135..2a712052 100644
--- a/src/controllers/PrivilegesController.php
+++ b/src/controllers/PrivilegesController.php
@@ -74,8 +74,8 @@ class PrivilegesController extends BaseController
$this->printMsg($msg);
// Determine whether object should be ref'd by name or oid.
- if (isset($_REQUEST[$_REQUEST['subject'].'_oid'])) {
- $object = $_REQUEST[$_REQUEST['subject'].'_oid'];
+ if (isset($_REQUEST[$_REQUEST['subject'] . '_oid'])) {
+ $object = $_REQUEST[$_REQUEST['subject'] . '_oid'];
} else {
$object = $_REQUEST[$_REQUEST['subject']];
}
@@ -180,7 +180,7 @@ class PrivilegesController extends BaseController
$object = $_REQUEST[$_REQUEST['subject']];
if ('function' == $_REQUEST['subject']) {
- $objectoid = $_REQUEST[$_REQUEST['subject'].'_oid'];
+ $objectoid = $_REQUEST[$_REQUEST['subject'] . '_oid'];
$urlvars = [
'action' => 'alter',
'server' => $_REQUEST['server'],
@@ -271,17 +271,11 @@ class PrivilegesController extends BaseController
{
$data = $this->misc->getDatabaseAccessor();
- if (!isset($_REQUEST['username'])) {
- $_REQUEST['username'] = [];
- }
+ $this->coalesceArr($_REQUEST, 'username', []);
- if (!isset($_REQUEST['groupname'])) {
- $_REQUEST['groupname'] = [];
- }
+ $this->coalesceArr($_REQUEST, 'groupname', []);
- if (!isset($_REQUEST['privilege'])) {
- $_REQUEST['privilege'] = [];
- }
+ $this->coalesceArr($_REQUEST, 'privilege', []);
if ($confirm) {
// Get users from the database
@@ -303,7 +297,7 @@ class PrivilegesController extends BaseController
}
$this->printMsg($msg);
- echo '<form action="'.\SUBFOLDER."/src/views/privileges\" method=\"post\">\n";
+ echo '<form action="' . \SUBFOLDER . "/src/views/privileges\" method=\"post\">\n";
echo "<table>\n";
echo "<tr><th class=\"data left\">{$this->lang['strusers']}</th>\n";
echo '<td class="data1"><select name="username[]" multiple="multiple" size="', min(6, $users->recordCount()), "\">\n";
@@ -357,9 +351,9 @@ class PrivilegesController extends BaseController
echo "<p><input type=\"hidden\" name=\"action\" value=\"save\" />\n";
echo '<input type="hidden" name="mode" value="', htmlspecialchars($mode), "\" />\n";
echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), "\" />\n";
- if (isset($_REQUEST[$_REQUEST['subject'].'_oid'])) {
- echo '<input type="hidden" name="', htmlspecialchars($_REQUEST['subject'].'_oid'),
- '" value="', htmlspecialchars($_REQUEST[$_REQUEST['subject'].'_oid']), "\" />\n";
+ if (isset($_REQUEST[$_REQUEST['subject'] . '_oid'])) {
+ echo '<input type="hidden" name="', htmlspecialchars($_REQUEST['subject'] . '_oid'),
+ '" value="', htmlspecialchars($_REQUEST[$_REQUEST['subject'] . '_oid']), "\" />\n";
}
echo '<input type="hidden" name="', htmlspecialchars($_REQUEST['subject']),
@@ -380,8 +374,8 @@ class PrivilegesController extends BaseController
echo "</form>\n";
} else {
// Determine whether object should be ref'd by name or oid.
- if (isset($_REQUEST[$_REQUEST['subject'].'_oid'])) {
- $object = $_REQUEST[$_REQUEST['subject'].'_oid'];
+ if (isset($_REQUEST[$_REQUEST['subject'] . '_oid'])) {
+ $object = $_REQUEST[$_REQUEST['subject'] . '_oid'];
} else {
$object = $_REQUEST[$_REQUEST['subject']];
}