#412 fail with user with restricted access rights

5.0.2
open
Login (18)
5
2012-11-28
2011-06-30
No

If the logged-in user can't access all databases (i.e. CONNECT privilege not set on every single database), phppgadmin will fail. Each mouse click in the left tree will result in the login screen to appear on the right, even with databases this user surely has privileges on. Having read http://sourceforge.net/projects/phppgadmin/forums/forum/115884/topic/3911449, i concluded the problem could be Javascript trying to expand several subtrees, even ones without having any permission.
It seems that I was able to solve the problem at least partially by manually editing Postgres.php file, method getDatabases. I added

"AND has_database_privilege('{$username}', pdb.datname, 'CONNECT')"

to the WHERE clause of the select query, so that only databases appear the user is able to connect to - a feature I always wanted, like in phpmyadmin.

Perhaps these access problems should be solved in future releases(?)

Discussion

  • Robert Treat

    Robert Treat - 2012-11-28

    confirming that this is a problem, but I don't think I want to implement the proposed fix. most postgres clients allow users to list the databases regardless of connection privileges, I think I'd prefer to mimic that behavior in phppgadmin

     
  • Robert Treat

    Robert Treat - 2012-11-28
    • assigned_to: chriskl --> xzilla
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks