You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to have a phpPgAdmin instance that automatically logs in with no credentials. (The phpPgAdmin installation is placed in a folder that is secured via .htaccess).
The automatic login feature does not seem to work.
I have set the following values in my conf/config.php:
When I try to open phpPgAdmin, the tree on the left side loads correctly. When I refresh the tree, then it just says "Tree Item" (the default tree text). When I click it, I get the PHP error message:
Warning: Undefined array key "desc" in /.../phpPgAdmin/login.php on line 23
It turns out that the method $misc->getServerInfo($_REQUEST['server']) returns an array with just two items:
Here is the problem: If I understand correctly, then these two lines should only be called if the login has been already done (i.e. the session variable already exists and contains the server data), and these two variables are supposed to be just added on top of it.
But here, the session variable was not initialized (because there was never a "real" login), and therefore the session variable was initialized by these two commands and hence the session just contained these two variables "platform" and "pgVersion" and the other stuff like "host" and "port" are not set. This is why getServerInfo will return invalid data until the session cookie is deleted.
I am not 100% sure how to correctly fix it. For now, I could fix the issue by placing the two lines in an "if" statement, but I am not sure if that is correct, since the two lines seem to never be executed now.
I am trying to have a phpPgAdmin instance that automatically logs in with no credentials. (The phpPgAdmin installation is placed in a folder that is secured via .htaccess).
The automatic login feature does not seem to work.
I have set the following values in my conf/config.php:
When I try to open phpPgAdmin, the tree on the left side loads correctly. When I refresh the tree, then it just says "Tree Item" (the default tree text). When I click it, I get the PHP error message:
It turns out that the method
$misc->getServerInfo($_REQUEST['server'])
returns an array with just two items:But there should be other stuff, such like "username", "host", "port", etc!!
Inspecting classes/Misc.php at method
getServerInfo
shows the weird array with just 2 items is retrieved from here:The session variable webdbLogin is set at
setServerInfo
, which is called atgetDatabaseAccessor()
:Here is the problem: If I understand correctly, then these two lines should only be called if the login has been already done (i.e. the session variable already exists and contains the server data), and these two variables are supposed to be just added on top of it.
But here, the session variable was not initialized (because there was never a "real" login), and therefore the session variable was initialized by these two commands and hence the session just contained these two variables "platform" and "pgVersion" and the other stuff like "host" and "port" are not set. This is why
getServerInfo
will return invalid data until the session cookie is deleted.I am not 100% sure how to correctly fix it. For now, I could fix the issue by placing the two lines in an "if" statement, but I am not sure if that is correct, since the two lines seem to never be executed now.
The text was updated successfully, but these errors were encountered: