* Add owner everywhere
* Cancel/<Action> buttons everywhere
* pg_dump feature!!!
-
-
+* Add default_db_encoding support to lang files and create database
* Default database encoding for languages
* Lots of NULL value in table dump fixes (XML format changed slightly)
* Convert our images to PNG format
+* Allow creating tables WITHOUT OIDS
Version 3.0
-----------
Exotic
------
-* Support contrib/tsearch for easy full text indexes
+* Support contrib/tsearch2 for easy full text indexes
* -Search for object feature (chriskl, half done)
-* Pivot reports
+* Pivot reports (ADODB has a feature for this)
Principles
----------
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.130 2003/07/31 08:28:03 chriskl Exp $
+ * $Id: Postgres.php,v 1.131 2003/08/04 08:27:27 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function &getDatabases() {
global $conf;
- if (isset($conf['owned_only']) && $conf['owned_only']) {
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($_SESSION['webdbUsername'])) {
$username = $_SESSION['webdbUsername'];
$this->clean($username);
$clause = " AND pu.usename='{$username}'";
* @param $length An array of field lengths
* @param $notnull An array of not null
* @param $default An array of default values
+ * @param $withoutoids True if WITHOUT OIDS, false otherwise
* @return 0 success
* @return -1 no fields supplied
*/
- function createTable($name, $fields, $field, $type, $length, $notnull, $default) {
+ function createTable($name, $fields, $field, $type, $length, $notnull, $default, $withoutoids) {
// @@ NOTE: $default field not being cleaned - how on earth DO we clean it??
$this->fieldClean($name);
-
+
$found = false;
$sql = "CREATE TABLE \"{$name}\" (";
$sql .= ")";
+ // WITHOUT OIDS
+ if ($this->hasWithoutOIDs() && $withoutoids)
+ $sql .= ' WITHOUT OIDS';
+
return $this->execute($sql);
}
CAST('public' AS TEXT) AS schemaname,
CAST(NULL AS TEXT) AS relname,
relname AS name,
- relacl
+ NULL AS relacl
FROM
pg_class
WHERE
if (!is_object($acls)) return array();
// RETURN FORMAT:
- // ARRAY(type, schemaname, relname, name, ARRAY(privs), ARRAY(grantoptions))
+ // ARRAY(type, schemaname, relname, name, ARRAY(privs), grantor, ARRAY(grantoptions))
// Loop over the results and check to see if any of the ACLs apply to the user
$temp = array();
// If they own the table, then do an 'all privileges simulation'
if ($acls->f['relacl'] == null) {
$temp[] = array($acls->f['type'], $acls->f['schemaname'], $acls->f['relname'], $acls->f['name'],
- array(), array());
+ array(), $username, array());
}
else {
$privs = $this->_parseACL($acls->f['relacl']);
+
// Loop over all privs to see if we're in there
foreach ($privs as $v) {
// Skip non-user ACEs
if ($v[0] != 'user') continue;
// Skip entities that aren't us
- if ($v[1] != $usernmae) continue;
+ if ($v[1] != $username) continue;
+ echo "<pre>", var_dump($v), "</pre>";
// OK, so it's for us...
$temp[] = array($acls->f['type'], $acls->f['schemaname'], $acls->f['relname'], $acls->f['name'],
- $v[2], $v[4]);
+ $v[2], $v[3], $v[4]);
}
}
$acls->moveNext();
}
-
+echo "<pre>", var_dump($temp), "</pre>";
return $temp;
}
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres71.php,v 1.35 2003/05/20 05:43:46 chriskl Exp $
+ * $Id: Postgres71.php,v 1.36 2003/08/04 08:27:27 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function &getDatabases() {
global $conf;
- if (isset($conf['owned_only']) && $conf['owned_only']) {
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($_SESSION['webdbUsername'])) {
$username = $_SESSION['webdbUsername'];
$this->clean($username);
$clause = " AND pu.usename='{$username}'";
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres72.php,v 1.46 2003/06/01 11:53:47 chriskl Exp $
+ * $Id: Postgres72.php,v 1.47 2003/08/04 08:27:27 chriskl Exp $
*/
return $this->execute($sql);
}
+
+ // Capabilities
+ function hasWithoutOIDs() { return true; }
+
}
?>
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.55 2003/08/04 05:20:02 chriskl Exp $
+ * $Id: Postgres73.php,v 1.56 2003/08/04 08:27:27 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function hasDropColumn() { return true; }
function hasDomains() { return true; }
function hasAlterTrigger() { return true; }
- function hasWithoutOIDs() { return true; }
}
/**
* List tables in a database
*
- * $Id: tables.php,v 1.27 2003/07/25 08:39:25 chriskl Exp $
+ * $Id: tables.php,v 1.28 2003/08/04 08:27:27 chriskl Exp $
*/
// Include application functions
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
- echo "<table width=\"100%\">\n";
+ echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strname']}</th></tr>\n";
echo "<tr><td class=\"data1\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_REQUEST['name']), "\" /></td></tr>\n";
echo "<tr><th class=\"data\">{$lang['strnumfields']}</th></tr>\n";
echo "<tr><td class=\"data1\"><input name=\"fields\" size=\"5\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_REQUEST['fields']), "\" /></td></tr>\n";
+ if ($data->hasWithoutOIDs()) {
+ echo "<tr><th class=\"data\">{$lang['stroptions']}</th></tr>\n";
+ echo "<tr><td class=\"data1\"><input type=\"checkbox\" name=\"withoutoids\"",
+ (isset($_REQUEST['withoutoids']) ? ' checked="checked"' : ''), ">WITHOUT OIDS\n";
+ echo "</td></tr>\n";
+ }
echo "</table>\n";
- echo "<input type=\"hidden\" name=\"action\" value=\"create\" />\n";
+ echo "<p><input type=\"hidden\" name=\"action\" value=\"create\" />\n";
echo "<input type=\"hidden\" name=\"stage\" value=\"2\" />\n";
echo $misc->form;
echo "<input type=\"submit\" value=\"{$lang['strnext']}\" />\n";
- echo "<input type=\"reset\" value=\"{$lang['strreset']}\" />\n";
+ echo "<input type=\"reset\" value=\"{$lang['strreset']}\" /></p>\n";
echo "</form>\n";
break;
case 2:
echo $misc->form;
echo "<input type=\"hidden\" name=\"name\" value=\"", htmlspecialchars($_REQUEST['name']), "\" />\n";
echo "<input type=\"hidden\" name=\"fields\" value=\"", htmlspecialchars($_REQUEST['fields']), "\" />\n";
+ if (isset($_REQUEST['withoutoids'])) {
+ echo "<input type=\"hidden\" name=\"withoutoids\" value=\"on\" />\n";
+ }
echo "<input type=\"submit\" value=\"{$lang['strcreate']}\" />\n";
echo "<input type=\"reset\" value=\"{$lang['strreset']}\" /></p>\n";
echo "</form>\n";
}
$status = $localData->createTable($_REQUEST['name'], $_REQUEST['fields'], $_REQUEST['field'],
- $_REQUEST['type'], $_REQUEST['length'], $_REQUEST['notnull'], $_REQUEST['default']);
+ $_REQUEST['type'], $_REQUEST['length'], $_REQUEST['notnull'], $_REQUEST['default'],
+ isset($_REQUEST['withoutoids']));
if ($status == 0) {
$_reload_browser = true;
doDefault($lang['strtablecreated']);