From 72399045b89dfe130f5b1c977d6a579966db2201 Mon Sep 17 00:00:00 2001 From: pengbo Date: Fri, 19 Jan 2018 13:49:38 +0900 Subject: [PATCH] Fix pgpool stop mode doesn't work correctly. --- command.php | 1 - status.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/command.php b/command.php index dde45fb..a913c0f 100644 --- a/command.php +++ b/command.php @@ -132,7 +132,6 @@ function execPcp($command, $extra_args = array()) break; case 'PCP_STOP_PGPOOL': - $args .= " {$_POST['stop_mode']}"; $cmd = _PGPOOL2_PCP_DIR . '/pcp_stop_pgpool' . $args; $ret = exec($cmd, $output, $return_var); break; diff --git a/status.php b/status.php index 95ad302..b087da2 100644 --- a/status.php +++ b/status.php @@ -59,7 +59,7 @@ $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', (isset($_SESSION[SESSION_IS_SUPER_USER])) ? +$tpl->assign('is_superuser', (isset($_SESSION[SESSION_IS_SUPER_USER])) ? $_SESSION[SESSION_IS_SUPER_USER] : isSuperUser($_SESSION[SESSION_LOGIN_USER])); // Set params @@ -324,7 +324,7 @@ function _stopPgpool() $m = $_POST['stop_mode']; - $result = execPcp('PCP_STOP_PGPOOL', $m); + $result = execPcp('PCP_STOP_PGPOOL', array('m' => $m)); if (!array_key_exists('SUCCESS', $result)) { $errorCode = 'e1006'; $tpl->assign('errorCode', $errorCode); @@ -354,7 +354,7 @@ function _restartPgpool() // Stop pgpool $m = $_POST['stop_mode']; - $result = execPcp('PCP_STOP_PGPOOL', $m); + $result = execPcp('PCP_STOP_PGPOOL', array('m' => $m)); if (!array_key_exists('SUCCESS', $result)) { $errorCode = 'e1006'; $tpl->assign('errorCode', $errorCode); -- 2.39.5