summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpengbo2017-11-12 12:18:15 +0000
committerpengbo2017-11-12 12:18:15 +0000
commite778655169388c457da4fe46baa25babdbc3e92f (patch)
treeb6550df3fe03677e673fca8211d1d2cf475a6edc
parent36e90d65c218e9ee3ce9061784305c7c9d287e6c (diff)
If $_SESSION[SESSION_IS_SUPER_USER] exists, get the is_superuser information from $_SESSION.
-rw-r--r--nodeStatus.php3
-rw-r--r--status.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/nodeStatus.php b/nodeStatus.php
index 3a3e7fd..0ce77e5 100644
--- a/nodeStatus.php
+++ b/nodeStatus.php
@@ -127,7 +127,8 @@ $tpl->assign('msgStopPgpool', $message['msgStopPgpool']);
$tpl->assign('nodeCount', $nodeCount);
$tpl->assign('has_not_loaded_node', $has_not_loaded_node);
$tpl->assign('pgpoolIsRunning', $is_pgpool_running);
-$tpl->assign('is_superuser', isSuperUser($_SESSION[SESSION_LOGIN_USER]));
+$tpl->assign('is_superuser', (isset($_SESSION[SESSION_IS_SUPER_USER])) ?
+ $_SESSION[SESSION_IS_SUPER_USER] : isSuperUser($_SESSION[SESSION_LOGIN_USER]));
// Set params
$configValue = readConfigParams('recovery_1st_stage');
diff --git a/status.php b/status.php
index 33ccf79..2d8fb38 100644
--- a/status.php
+++ b/status.php
@@ -59,7 +59,8 @@ $tpl->assign('useSyslog', useSyslog());
$tpl->assign('pipe', (isPipe(_PGPOOL2_LOG_FILE)) ? 1 : 0);
$tpl->assign('msgStopPgpool', $message['msgStopPgpool']);
$tpl->assign('login_user', $_SESSION[SESSION_LOGIN_USER]);
-$tpl->assign('is_superuser', isSuperUser($_SESSION[SESSION_LOGIN_USER]));
+$tpl->assign('is_superuser', (isset($_SESSION[SESSION_IS_SUPER_USER])) ?
+ $_SESSION[SESSION_IS_SUPER_USER] : isSuperUser($_SESSION[SESSION_LOGIN_USER]));
// Set params
$configValue = readConfigParams();