From: SourceForge.net <no...@so...> - 2008-07-12 14:35:52
|
Feature Requests item #2016476, was opened at 2008-07-12 06:05 Message generated for change (Comment added) made by ioguix You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418983&aid=2016476&group_id=37132 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Permissions Group: None Status: Open Priority: 5 Private: No Submitted By: Andrew Schmadeke (focus-sis) Assigned to: Christopher Kings-Lynne (chriskl) Summary: owned_only -- improvement for cpanel Initial Comment: When phpPGAdmin is installed in cPanel, it's pretty much useless because of the way that cPanel assigns database/table ownership. For instance, if a cPanel user has a username "cpuser,"databases created by cpanel will be owned by cpuser. Then, when you create a database user called "newuser", that user will be called cpuser_newuser. Now, when an application installs tables, those tables will be owned by cpuser_newuser. This might not make sense to anyone not using cPanel. But, it has stymied me for years. The only solution is to set owned_only = false. But, that means that phpPGAdmin users will see every database on the server. And, it's usually impossible to change the phpPGAdmin config.inc.php file on a shared server. However, if we change owned_only to display databases owned by the logged in user and the prefix of the logged in user (cpuser_newuser and cpuser), we can effectively solve this annoyance. In version 4.2, change /classes/database/Postgres.php line 446 from $clause = " AND pu.usename='{$username}'"; to $clause = " AND (pu.usename='{$username}'"; if($underscorepos = strpos($username,'_')) $clause .= " OR pu.username='".substr($username,0,$underscorepos)."')"; else $clause .= ")"; Make the same change in Postgres71 and Postgres80. In /classes/database/Postgres81.php change line 86 to: $clause = " AND (pr.rolname='{$username}'"; if($underscorepos = strpos($username,'_')) $clause .= " OR pu.rolname='".substr($username,0,$underscorepos)."')"; else $clause .= ")"; Make the same change in Postgres82 I've made this change on my dedicated servers, but I'm sure that this would make the day of every postgreSQL / cPanel user. This might be related to: https://sourceforge.net/tracker/index.php?func=detail&aid=1608622&group_id=37132&atid=418983 ---------------------------------------------------------------------- >Comment By: Guillaume `ioguix` de Rorthais (ioguix) Date: 2008-07-12 16:36 Message: Logged In: YES user_id=1489394 Originator: NO Hello, I'm not really incline to add code for 3rd party applications into phpPgAdmin. Whatever it is that simple or not. However, I encourage you to maintain a patch (or a package) with every usefull add-on or tuning for cpanel user and make it available from the cpanel website (if possible). Cheers ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418983&aid=2016476&group_id=37132 |