|
From: SourceForge.net <no...@so...> - 2005-02-18 20:28:18
|
Feature Requests item #1120432, was opened at 2005-02-11 00:04 Message generated for change (Comment added) made by conniboe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418983&aid=1120432&group_id=37132 Category: Interface Group: None Status: Open Priority: 5 Submitted By: Cornelia Boenigk (conniboe) Assigned to: Robert Treat (xzilla) Summary: restricting the list of displayed databases Initial Comment: I plan to use phppgadmin for customers who want to modify their database themselves. But I do not want them to see all databases on the server and all tables and definitions ... So I added an option in config.inc.php // string containing the databases the user is allowed // to see $conf['allowed_dbs'] = "('lantech', 'ecandb', 'pgsqli')"; and added the following lines in the function &getDatabases() { ... if (isset($conf['allowed_dbs']) && $conf['allowed_dbs']!='') { $allowed = " and pdb.datname in ".$conf['allowed_dbs']; } else { $allowed = ''; } $sql = "SELECT pdb.datname AS datname, pu.usename AS datowner, pg_encoding_to_char(encoding) AS datencoding, (SELECT description FROM pg_description pd WHERE pdb.oid=pd.objoid) AS datcomment FROM pg_database pdb, pg_user pu WHERE pdb.datdba = pu.usesysid {$allowed} {$where} {$clause} ORDER BY pdb.datname"; Regards Conni ---------------------------------------------------------------------- >Comment By: Cornelia Boenigk (conniboe) Date: 2005-02-18 21:28 Message: Logged In: YES user_id=338312 > I'm not even sure that's at all possible. I guess it's possible. Nearly everything is possible with PostgreSQL. > on thing I was wondering was why the "owned_only" > feature doesn't work for you? Should it? I used phpPgAdmin the first time. Regards Conni ---------------------------------------------------------------------- Comment By: Robert Treat (xzilla) Date: 2005-02-18 20:55 Message: Logged In: YES user_id=204589 Hey Conni, on thing I was wondering was why the "owned_only" feature doesn't work for you? ---------------------------------------------------------------------- Comment By: Markus Bertheau (ska-fan) Date: 2005-02-18 20:34 Message: Logged In: YES user_id=1080922 Not only that, I'm not even sure that's at all possible. It was just a question needed for my fight against loading more work on the user because the software behaves stupid. (i.e. preferences are just a poor excuse or a workaround, most often) ---------------------------------------------------------------------- Comment By: Cornelia Boenigk (conniboe) Date: 2005-02-18 20:26 Message: Logged In: YES user_id=338312 Of course, it would be good enough and much better than to show every user everything defined on that server. To show only the databases that the user has rights would require a more complex query in the system catalogs, is't it? My query adds only a and condition in the where clause which may be empty. Regards Conni ---------------------------------------------------------------------- Comment By: Markus Bertheau (ska-fan) Date: 2005-02-14 17:34 Message: Logged In: YES user_id=1080922 Would it be good enough to show only those databases, that the user has some rights on? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418983&aid=1120432&group_id=37132 |