* Display aggregates and operator classes
* Integration with the PostgreSQL statistics collector. See
table and index performance and usage information.
+* Display user session defaults for PostgreSQL >= 7.3
Bugs
* Object browser fixed for databases with no schemas
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.172 2004/01/03 07:19:29 chriskl Exp $
+ * $Id: Postgres.php,v 1.173 2004/01/03 19:15:44 soranzo Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
* @return All users
*/
function &getUsers() {
- $sql = "SELECT usename, usesuper, usecreatedb, valuntil FROM pg_user ORDER BY usename";
+ $sql = "SELECT usename, usesuper, usecreatedb, valuntil";
+ if ($this->hasUserSessionDefaults()) $sql .= ", useconfig";
+ $sql .= " FROM pg_user ORDER BY usename";
return $this->selectSet($sql);
}
function &getUser($username) {
$this->clean($username);
- $sql = "SELECT usename, usesuper, usecreatedb, valuntil FROM pg_user WHERE usename='{$username}'";
+ $sql = "SELECT usename, usesuper, usecreatedb, valuntil";
+ if ($this->hasUserSessionDefaults()) $sql .= ", useconfig";
+ $sql .= " FROM pg_user WHERE usename='{$username}'";
return $this->selectSet($sql);
}
function hasDropColumn() { return false; }
function hasSRFs() { return true; }
function hasOpClasses() { return true; }
+ function hasUserSessionDefaults() { return false; }
+
}
?>
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres71.php,v 1.50 2003/12/30 03:09:29 chriskl Exp $
+ * $Id: Postgres71.php,v 1.51 2004/01/03 19:15:44 soranzo Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
}
// Capabilities
- function hasTables() { return true; }
- function hasViews() { return true; }
- function hasSequences() { return true; }
- function hasFunctions() { return true; }
- function hasTriggers() { return true; }
- function hasOperators() { return true; }
- function hasTypes() { return true; }
- function hasAggregates() { return true; }
- function hasRules() { return true; }
- function hasSchemas() { return false; }
function hasAlterTableOwner() { return true; }
function hasFullSubqueries() { return true; }
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.85 2003/12/30 03:09:29 chriskl Exp $
+ * $Id: Postgres73.php,v 1.86 2004/01/03 19:15:44 soranzo Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
class Postgres73 extends Postgres72 {
+ var $uFields = array('uname' => 'usename', 'usuper' => 'usesuper', 'ucreatedb' => 'usecreatedb', 'uexpires' => 'valuntil', 'udefaults' => 'useconfig');
+
var $nspFields = array('nspname' => 'nspname', 'nspowner' => 'nspowner');
var $conFields = array('conname' => 'conname', 'conowner' => 'conowner');
function hasAlterTrigger() { return true; }
function hasCasts() { return true; }
function hasPrepare() { return true; }
+ function hasUserSessionDefaults() { return true; }
}
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.127 2004/01/02 12:53:36 chriskl Exp $
+ * $Id: english.php,v 1.128 2004/01/03 19:15:45 soranzo Exp $
*/
// Language and character set
$lang['strsuper'] = 'Superuser?';
$lang['strcreatedb'] = 'Create DB?';
$lang['strexpires'] = 'Expires';
+ $lang['strsessiondefaults'] = 'Session Defaults';
$lang['strnousers'] = 'No users found.';
$lang['struserupdated'] = 'User updated.';
$lang['struserupdatedbad'] = 'User update failed.';
* Italian language file, based on the english language file for phpPgAdmin.
*
- * $Id: italian.php,v 1.23 2003/12/31 15:44:27 soranzo Exp $
+ * $Id: italian.php,v 1.24 2004/01/03 19:15:45 soranzo Exp $
*/
// Language and character set - Lingua e set di caratteri
$lang['strsuper'] = 'Superuser?';
$lang['strcreatedb'] = 'Può creare DB?';
$lang['strexpires'] = 'Scadenza';
+ $lang['strsessiondefaults'] = 'Defaults della sessione';
$lang['strnousers'] = 'Nessun utente trovato';
$lang['struserupdated'] = 'Utente aggiornato.';
$lang['struserupdatedbad'] = 'Aggiornamento utente fallito.';
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.79 2004/01/02 12:53:36 chriskl Exp $
+ * $Id: english.php,v 1.80 2004/01/03 19:15:45 soranzo Exp $
*/
// Language and character set
$lang['strsuper'] = 'Superuser?';
$lang['strcreatedb'] = 'Create DB?';
$lang['strexpires'] = 'Expires';
+ $lang['strsessiondefaults'] = 'Session Defaults';
$lang['strnousers'] = 'No users found.';
$lang['struserupdated'] = 'User updated.';
$lang['struserupdatedbad'] = 'User update failed.';
* Italian language file, based on the english language file for phpPgAdmin.
*
- * $Id: italian.php,v 1.18 2003/12/31 15:44:27 soranzo Exp $
+ * $Id: italian.php,v 1.19 2004/01/03 19:15:45 soranzo Exp $
*/
// Language and character set - Lingua e set di caratteri
$lang['strsuper'] = 'Superuser?';
$lang['strcreatedb'] = 'Può creare DB?';
$lang['strexpires'] = 'Scadenza';
+ $lang['strsessiondefaults'] = 'Defaults della sessione';
$lang['strnousers'] = 'Nessun utente trovato';
$lang['struserupdated'] = 'Utente aggiornato.';
$lang['struserupdatedbad'] = 'Aggiornamento utente fallito.';
/**
* List tables in a database
*
- * $Id: tblproperties.php,v 1.34 2003/12/31 15:44:27 soranzo Exp $
+ * $Id: tblproperties.php,v 1.35 2004/01/03 19:15:44 soranzo Exp $
*/
// Include application functions
echo "<td class=\"data1\">";
echo "<input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_POST['name']), "\" /></td></tr>\n";
- if ($data->hasAlterTableOwner()) {
+ if ($data->hasAlterTableOwner() && $data->isSuperUser($_SESSION['webdbUsername'])) {
echo "<tr><th class=\"data required\">{$lang['strowner']}</th>\n";
echo "<td class=\"data1\"><select name=\"owner\">";
while (!$users->EOF) {
/**
* Manage users in a database cluster
*
- * $Id: users.php,v 1.21 2004/01/03 07:24:19 chriskl Exp $
+ * $Id: users.php,v 1.22 2004/01/03 19:15:44 soranzo Exp $
*/
// Include application functions
$userdata->f[$data->uFields['usuper']] = $data->phpBool($userdata->f[$data->uFields['usuper']]);
$userdata->f[$data->uFields['ucreatedb']] = $data->phpBool($userdata->f[$data->uFields['ucreatedb']]);
echo "<table>\n";
- echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strsuper']}</th><th class=\"data\">{$lang['strcreatedb']}</th><th class=\"data\">{$lang['strexpires']}</th></tr>\n";
- echo "<tr><td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uname']]), "</td>\n";
- echo "<td class=\"data1\">", (($userdata->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno']), "</td>\n";
- echo "<td class=\"data1\">", (($userdata->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno']), "</td>\n";
- echo "<td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uexpires']]), "</td></tr>\n";
- echo "</table>\n";
+ echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strsuper']}</th><th class=\"data\">{$lang['strcreatedb']}</th><th class=\"data\">{$lang['strexpires']}</th>";
+ if ($data->hasUserSessionDefaults()) echo "<th class=\"data\">{$lang['strsessiondefaults']}</th>";
+ echo "</tr>\n";
+ echo "<tr>\n\t<td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uname']]), "</td>\n";
+ echo "\t<td class=\"data1\">", (($userdata->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno']), "</td>\n";
+ echo "\t<td class=\"data1\">", (($userdata->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno']), "</td>\n";
+ echo "\t<td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uexpires']]), "</td>\n";
+ if ($data->hasUserSessionDefaults()) echo "\t<td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['udefaults']]), "</td>\n";
+ echo "</tr>\n</table>\n";
}
else echo "<p>{$lang['strnodata']}</p>\n";
if ($users->recordCount() > 0) {
echo "<table>\n";
- echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strsuper']}</th>";
- echo "<th class=\"data\">{$lang['strcreatedb']}</th><th class=\"data\">{$lang['strexpires']}</th><th colspan=\"2\" class=\"data\">{$lang['stractions']}</th></tr>\n";
+ echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strsuper']}</th><th class=\"data\">{$lang['strcreatedb']}</th><th class=\"data\">{$lang['strexpires']}</th>";
+ if ($data->hasUserSessionDefaults()) echo "<th class=\"data\">{$lang['strsessiondefaults']}</th>";
+ echo "<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th></tr>\n";
$i = 0;
while (!$users->EOF) {
$users->f[$data->uFields['usuper']] = $data->phpBool($users->f[$data->uFields['usuper']]);
$users->f[$data->uFields['ucreatedb']] = $data->phpBool($users->f[$data->uFields['ucreatedb']]);
$id = (($i % 2) == 0 ? '1' : '2');
- echo "<tr><td class=\"data{$id}\">", $misc->printVal($users->f[$data->uFields['uname']]), "</td>\n";
- echo "<td class=\"data{$id}\">", ($users->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno'], "</td>\n";
- echo "<td class=\"data{$id}\">", ($users->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno'], "</td>\n";
- echo "<td class=\"data{$id}\">", $misc->printVal($users->f[$data->uFields['uexpires']]), "</td>\n";
- echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=edit&username=",
+ echo "<tr>\n\t<td class=\"data{$id}\">", $misc->printVal($users->f[$data->uFields['uname']]), "</td>\n";
+ echo "\t<td class=\"data{$id}\">", ($users->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno'], "</td>\n";
+ echo "\t<td class=\"data{$id}\">", ($users->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno'], "</td>\n";
+ echo "\t<td class=\"data{$id}\">", $misc->printVal($users->f[$data->uFields['uexpires']]), "</td>\n";
+ if ($data->hasUserSessionDefaults()) echo "\t<td class=\"data{$id}\">", $misc->printVal($users->f[$data->uFields['udefaults']]), "</td>\n";
+ echo "\t<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=edit&username=",
urlencode($users->f[$data->uFields['uname']]), "\">{$lang['stralter']}</a></td>\n";
- echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&username=",
+ echo "\t<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&username=",
urlencode($users->f[$data->uFields['uname']]), "\">{$lang['strdrop']}</a></td>\n";
echo "</tr>\n";
$users->moveNext();