Permalink
Browse files

remove $username when calling $data->isSuperUser about current connec…

…tion role
  • Loading branch information...
1 parent 61b1c52 commit 472392bce278e39ebe70a4bda397f28f5792cbaa @ioguix ioguix committed Jun 1, 2011
View
@@ -30,9 +30,7 @@ function doAlter($confirm) {
echo "<input name=\"newname\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_REQUEST['alterdatabase']), "\" /></td></tr>\n";
- $server_info = $misc->getServerInfo();
-
- if ($data->hasAlterDatabaseOwner() && $data->isSuperUser($server_info['username'])) {
+ if ($data->hasAlterDatabaseOwner() && $data->isSuperUser()) {
// Fetch all users
$rs = $data->getDatabaseOwner($_REQUEST['alterdatabase']);
View
@@ -529,8 +529,7 @@ function getNavTabs($section) {
case 'server':
case 'report':
- $server_info = $this->getServerInfo();
- $hide_users = !$data->isSuperUser($server_info['username']);
+ $hide_users = !$data->isSuperUser();
$tmp = array (
'databases' => array (
'title' => $lang['strdatabases'],
@@ -454,7 +454,7 @@ function getDatabases($currentdatabase = NULL) {
$server_info = $misc->getServerInfo();
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) {
$username = $server_info['username'];
$this->clean($username);
$clause = " AND pr.rolname='{$username}'";
@@ -73,7 +73,7 @@ function getDatabases($currentdatabase = NULL) {
$server_info = $misc->getServerInfo();
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) {
$username = $server_info['username'];
$this->clean($username);
$clause = " AND pu.usename='{$username}'";
@@ -72,7 +72,7 @@ function getDatabases($currentdatabase = NULL) {
$server_info = $misc->getServerInfo();
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) {
$username = $server_info['username'];
$this->clean($username);
$clause = " AND pu.usename='{$username}'";
@@ -67,7 +67,7 @@ function getDatabases($currentdatabase = NULL) {
$server_info = $misc->getServerInfo();
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) {
$username = $server_info['username'];
$this->clean($username);
$clause = " AND pr.rolname='{$username}'";
@@ -69,7 +69,7 @@ function getDatabases($currentdatabase = NULL) {
$server_info = $misc->getServerInfo();
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) {
$username = $server_info['username'];
$this->clean($username);
$clause = " AND pr.rolname='{$username}'";
View
@@ -475,8 +475,7 @@ function doAlter($msg = '') {
echo "<input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_POST['name']), "\" /></td></tr>\n";
- $server_info = $misc->getServerInfo();
- if ($data->isSuperUser($server_info['username'])) {
+ if ($data->isSuperUser()) {
// Fetch all users
$users = $data->getUsers();
View
@@ -78,8 +78,7 @@ function doAlter($msg = '') {
echo "<input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_POST['name'], ENT_QUOTES), "\" /></td></tr>\n";
- $server_info = $misc->getServerInfo();
- if ($data->isSuperUser($server_info['username'])) {
+ if ($data->isSuperUser()) {
echo "<tr><th class=\"data left required\">{$lang['strowner']}</th>\n";
echo "<td class=\"data1\"><select name=\"owner\">";
while (!$users->EOF) {
View
@@ -258,8 +258,7 @@ function doAlter($confirm = false, $msg = '') {
echo "<input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_POST['name']), "\" /></td></tr>\n";
- $server_info = $misc->getServerInfo();
- if ($data->isSuperUser($server_info['username'])) {
+ if ($data->isSuperUser()) {
// Fetch all users
$users = $data->getUsers();

0 comments on commit 472392b

Please sign in to comment.