* Use language preferencies from browser (Markus Bertheau, Nicola Soranzo)
* Tablespace support for 7.5
* Support cancelling and killing backend processes in 7.5
+* Allow setting privileges on databases
Translations
* Arabic from Zaki
/**
* Manage databases within a server
*
- * $Id: all_db.php,v 1.27 2004/07/09 01:57:58 chriskl Exp $
+ * $Id: all_db.php,v 1.28 2004/07/10 08:51:01 chriskl Exp $
*/
// Include application functions
'url' => "{$PHP_SELF}?action=confirm_drop&",
'vars' => array('db' => 'datname'),
),
+ 'privileges' => array(
+ 'title' => $lang['strprivileges'],
+ 'url' => "privileges.php?type=database&",
+ 'vars' => array('object' => 'datname'),
+ )
);
if (!$data->hasTablespaces()) unset($columns['tablespace']);
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.230 2004/07/09 01:50:43 chriskl Exp $
+ * $Id: Postgres.php,v 1.231 2004/07/10 08:51:01 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
$this->fieldClean($object);
$sql .= " SCHEMA \"{$object}\"";
break;
+ case 'tablespace':
+ $this->fieldClean($object);
+ $sql .= " TABLESPACE \"{$object}\"";
+ break;
default:
return -1;
}
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres71.php,v 1.63 2004/07/08 17:57:31 xzilla Exp $
+ * $Id: Postgres71.php,v 1.64 2004/07/10 08:51:01 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
// Help sub pages (alphabetical order)
var $help_page = array(
+ 'add_column' => 'sql-altertable.html',
+ 'alter_column' => 'sql-altertable.html',
+ 'alter_table' => 'sql-altertable.html',
'create_table' => 'sql-createtable.html',
+ 'drop_column' => 'sql-altertable.html',
'drop_table' => 'sql-droptable.html',
'insert' => 'sql-insert.html',
'select' => 'sql-select.html',
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.124 2004/07/07 03:00:07 chriskl Exp $
+ * $Id: Postgres73.php,v 1.125 2004/07/10 08:51:01 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
case 'schema':
$sql = "SELECT nspacl AS acl FROM pg_catalog.pg_namespace WHERE nspname='{$object}'";
break;
+ case 'tablespace':
+ $sql = "SELECT spcacl AS acl FROM pg_catalog.pg_tablespace WHERE spcname='{$object}'";
+ break;
default:
return -1;
}
/**
* PostgreSQL 7.5 support
*
- * $Id: Postgres75.php,v 1.11 2004/07/09 01:57:58 chriskl Exp $
+ * $Id: Postgres75.php,v 1.12 2004/07/10 08:51:01 chriskl Exp $
*/
include_once('./classes/database/Postgres74.php');
class Postgres75 extends Postgres74 {
+ // List of all legal privileges that can be applied to different types
+ // of objects.
+ var $privlist = array(
+ 'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'RULE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
+ 'view' => array('SELECT', 'RULE', 'ALL PRIVILEGES'),
+ 'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES'),
+ 'database' => array('CREATE', 'TEMPORARY', 'ALL PRIVILEGES'),
+ 'function' => array('EXECUTE', 'ALL PRIVILEGES'),
+ 'language' => array('USAGE', 'ALL PRIVILEGES'),
+ 'schema' => array('CREATE', 'USAGE', 'ALL PRIVILEGES'),
+ 'tablespace' => array('CREATE', 'ALL PRIVILEGES')
+ );
+
// Last oid assigned to a system object
var $_lastSystemOID = 17137;
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.152 2004/07/08 03:23:02 chriskl Exp $
+ * $Id: english.php,v 1.153 2004/07/10 08:51:01 chriskl Exp $
*/
// Language and character set
$lang['strtablespacedroppedbad'] = 'Tablespace drop failed.';
$lang['strtablespacealtered'] = 'Tablespace altered.';
$lang['strtablespacealteredbad'] = 'Tablespace alteration failed.';
+ $lang['strshowalltablespaces'] = 'Show all tablespaces';
// Miscellaneous
$lang['strtopbar'] = '%s running on %s:%s -- You are logged in as user "%s", %s';
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.105 2004/07/08 03:23:02 chriskl Exp $
+ * $Id: english.php,v 1.106 2004/07/10 08:51:02 chriskl Exp $
*/
// Language and character set
$lang['strtablespacedroppedbad'] = 'Tablespace drop failed.';
$lang['strtablespacealtered'] = 'Tablespace altered.';
$lang['strtablespacealteredbad'] = 'Tablespace alteration failed.';
-
+ $lang['strshowalltablespaces'] = 'Show all tablespaces';
+
// Miscellaneous
$lang['strtopbar'] = '%s running on %s:%s -- You are logged in as user "%s", %s';
$lang['strtimefmt'] = 'jS M, Y g:iA';
/**
* Manage privileges in a database
*
- * $Id: privileges.php,v 1.24 2004/07/07 02:59:58 chriskl Exp $
+ * $Id: privileges.php,v 1.25 2004/07/10 08:51:01 chriskl Exp $
*/
// Include application functions
global $PHP_SELF, $lang;
switch ($_REQUEST['type']) {
- case 'database':
- $misc->printDatabaseNav();
- $name = $_REQUEST['object'];
- break;
case 'table':
$misc->printTableNav();
$name = $_REQUEST['object'];
echo "| <a class=\"navlink\" href=\"sequences.php?{$misc->href}\">{$lang['strshowallsequences']}</a></p>\n";
break;
case 'database':
- echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=alter&{$misc->href}&type={$_REQUEST['type']}&object=",
- urlencode($_REQUEST['object']), "\">{$lang['stralterprivs']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=alter&type={$_REQUEST['type']}&object=",
+ urlencode($_REQUEST['object']), "\">{$lang['stralterprivs']}</a>\n";
+ echo "| <a class=\"navlink\" href=\"all_db.php\">{$lang['strshowalldatabases']}</a></p>\n";
break;
case 'function':
echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=alter&{$misc->href}&type={$_REQUEST['type']}&object=",
echo "| <a class=\"navlink\" href=\"database.php?database=", urlencode($_REQUEST['database']),
"\">{$lang['strshowallschemas']}</a></p>\n";
break;
+ case 'tablespace':
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=alter&type={$_REQUEST['type']}&object=",
+ urlencode($_REQUEST['object']), "\">{$lang['stralterprivs']}</a>\n";
+ echo "| <a class=\"navlink\" href=\"tablespaces.php\">{$lang['strshowalltablespaces']}</a></p>\n";
+ break;
}
echo "</p>\n";
}
/**
* Manage tablespaces in a database cluster
*
- * $Id: tablespaces.php,v 1.2 2004/07/09 01:50:43 chriskl Exp $
+ * $Id: tablespaces.php,v 1.3 2004/07/10 08:51:01 chriskl Exp $
*/
// Include application functions
$misc->printMsg($msg);
$tablespaces = &$data->getTablespaces();
+
+ $columns = array(
+ 'database' => array(
+ 'title' => $lang['strname'],
+ 'field' => 'spcname'
+ ),
+ 'owner' => array(
+ 'title' => $lang['strowner'],
+ 'field' => 'spcowner'
+ ),
+ 'location' => array(
+ 'title' => $lang['strlocation'],
+ 'field' => 'spclocation'
+ ),
+ 'actions' => array(
+ 'title' => $lang['stractions']
+ )
+ );
- if ($tablespaces->recordCount() > 0) {
- echo "<table>\n";
- echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strowner']}</th><th class=\"data\">{$lang['strlocation']}</th>";
- echo "<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th></tr>\n";
- $i = 0;
- while (!$tablespaces->EOF) {
- $id = (($i % 2) == 0 ? '1' : '2');
- echo "<tr>\n\t<td class=\"data{$id}\">", $misc->printVal($tablespaces->f['spcname']), "</td>\n";
- echo "\t<td class=\"data{$id}\">", $misc->printVal($tablespaces->f['spcowner']), "</td>\n";
- echo "\t<td class=\"data{$id}\">", $misc->printVal($tablespaces->f['spclocation']), "</td>\n";
- echo "\t<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=edit&spcname=",
- urlencode($tablespaces->f['spcname']), "\">{$lang['stralter']}</a></td>\n";
- echo "\t<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&spcname=",
- urlencode($tablespaces->f['spcname']), "\">{$lang['strdrop']}</a></td>\n";
- echo "</tr>\n";
- $tablespaces->moveNext();
- $i++;
- }
- echo "</table>\n";
- }
- else {
- echo "<p>{$lang['strnotablespaces']}</p>\n";
- }
+ $actions = array(
+ 'alter' => array(
+ 'title' => $lang['stralter'],
+ 'url' => "{$PHP_SELF}?action=edit&",
+ 'vars' => array('spcname' => 'spcname')
+ ),
+ 'drop' => array(
+ 'title' => $lang['strdrop'],
+ 'url' => "{$PHP_SELF}?action=confirm_drop&",
+ 'vars' => array('spcname' => 'spcname')
+ ),
+ 'privileges' => array(
+ 'title' => $lang['strprivileges'],
+ 'url' => "privileges.php?type=tablespace&",
+ 'vars' => array('object' => 'spcname')
+ )
+ );
+
+ $misc->printTable($tablespaces, $columns, $actions, $lang['strnotablespaces']);
echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create\">{$lang['strcreatetablespace']}</a></p>\n";
/**
* List tables in a database
*
- * $Id: tblproperties.php,v 1.52 2004/07/07 02:59:59 chriskl Exp $
+ * $Id: tblproperties.php,v 1.53 2004/07/10 08:51:01 chriskl Exp $
*/
// Include application functions
global $data, $misc;
global $PHP_SELF, $lang;
- echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['stralter']}</h2>\n";
+ $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['stralter']), 'alter_table');
$misc->printMsg($msg);
// Fetch table info
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
echo "<table>\n";
- echo "<tr><th class=\"data required\">{$lang['strname']}</th>\n";
+ echo "<tr><th class=\"data left required\">{$lang['strname']}</th>\n";
echo "<td class=\"data1\">";
echo "<input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_POST['name']), "\" /></td></tr>\n";
if ($data->hasAlterTableOwner() && $data->isSuperUser($_SESSION['webdbUsername'])) {
- echo "<tr><th class=\"data required\">{$lang['strowner']}</th>\n";
+ echo "<tr><th class=\"data left required\">{$lang['strowner']}</th>\n";
echo "<td class=\"data1\"><select name=\"owner\">";
while (!$users->EOF) {
$uname = $users->f['usename'];
}
echo "</select></td></tr>\n";
}
- echo "<tr><th class=\"data\">{$lang['strcomment']}</th>\n";
+ echo "<tr><th class=\"data left\">{$lang['strcomment']}</th>\n";
echo "<td class=\"data1\">";
echo "<textarea rows=\"3\" cols=\"32\" name=\"comment\" wrap=\"virtual\">",
htmlspecialchars($_POST['comment']), "</textarea></td></tr>\n";
$hasID = $data->hasObjectID($_REQUEST['table']);
$misc->printTableNav();
- echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['strexport']}</h2>\n";
+ $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strexport']));
$misc->printMsg($msg);
echo "<form action=\"dataexport.php\" method=\"post\">\n";
global $PHP_SELF, $lang;
$misc->printTableNav();
- echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['strimport']}</h2>\n";
+ $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strimport']));
$misc->printMsg($msg);
// Check that file uploads are enabled
// Fetch all available types
$types = &$data->getTypes(true, false, true);
- echo "<h2>", $misc->printVal($_REQUEST['database']), ": ",
- $misc->printVal($_REQUEST['table']), ": {$lang['straddcolumn']}</h2>\n";
+ $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['straddcolumn']), 'add_column');
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
case 1:
global $lang;
- echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: {$lang['straltercolumn']}: ",
- $misc->printVal($_REQUEST['column']), "</h2>\n";
+ $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']),
+ $lang['straltercolumn'], $misc->printVal($_REQUEST['column'])), 'alter_column');
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
global $PHP_SELF, $lang;
if ($confirm) {
- echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ",
- $misc->printVal($_REQUEST['table']), ": " , $misc->printVal($_REQUEST['column']), ": {$lang['strdrop']}</h2>\n";
-
- echo "<p>", sprintf($lang['strconfdropcolumn'], $misc->printVal($_REQUEST['column']),
- $misc->printVal($_REQUEST['table'])), "</p>\n";
+ $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']),
+ $misc->printVal($_REQUEST['column']), $lang['strdrop']), 'drop_column');
+ echo "<p>", sprintf($lang['strconfdropcolumn'], $misc->printVal($_REQUEST['column']),
+ $misc->printVal($_REQUEST['table'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";