#728 Updated phpPgAdmin from 7.12 to 7.13

This commit is contained in:
cytopia 2020-11-07 15:52:05 +01:00
parent e2806d147a
commit bca2a37723
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
386 changed files with 11017 additions and 199 deletions

File diff suppressed because one or more lines are too long

View File

@ -79,7 +79,7 @@ Contributors
- Leonardo Augusto Sapiras (Improve phpPgAdmin ergonomy during the GSoC 2010, with ioguix as mentor)
- Julien Rouhaud, aka. rjuju (nested groups)
- Felipe Figueroa aka. amenadiel
- Jean-Michel Vourgère (nirgal)
Third Party Libraries
@ -97,5 +97,6 @@ Past Feature Sponsors:
- Google Summer of Code (http://code.google.com/soc/2006/pgsql/appinfo.html?csaid=DB096D908B948D89) - phpPgAdmin Improvements
- Google Summer of Code (http://code.google.com/soc/2007/postgres/appinfo.html?csaid=E89B3D5E2DC4170A) - Full Text Search in PostgreSQL GUI Tools
- Google Summer of Code (http://code.google.com/p/google-summer-of-code-2010-postgres/downloads/detail?name=Leonardo_Augusto_Sapiras.tar.gz) - Improve phpPgAdmin ergonomy
- Dalibo ( http://dalibo.com ) - sponsored development as Jehan-Guillaume (ioguix) de Rorthais employer
- OmniTI (https://omniti.com ) - sponsored development as Robert Treat employer
- Dalibo (http://dalibo.com) - sponsored development as Jehan-Guillaume (ioguix) de Rorthais employer
- OmniTI (https://omniti.com) - sponsored development as Robert Treat employer
- credativ (https://credativ.com) - sponsored php development / review

View File

@ -1,6 +1,45 @@
phpPgAdmin History
------------------
Version 7.13.0
--------------
Released: November 7th, 2020
Features:
* Add support for Postgres 13
* Add provisional support for Postgres 14
* Upgrade Jquery library to 3.4.1 (Nirgal)
* Allow users to see group owned databases when using "owned only"
Bugs:
* Fix bug where sorting on selects dumped you to the table screen (MichaMEG)
Incompatabilities:
* This release drops support for PHP 7.1
* This will be the last release to support PHP 7.2
Version 7.12.1
--------------
Released: December 10th, 2019
Features:
* Add support for granting USAGE on sequences
* Update French translation
Bugs:
* Fix issues with OID removal in Postgres 12+
* Remove broken tree branch from table/view browse option
* Properly escape identifiers when browsing tables/views/schemas
* Fix truncation of long multibyte strings
* Clean up a number of misspellings and typos from codespell report
Incompatabilities:
* Require mbstring module support in PHP
Version 7.12.0
--------------

View File

@ -24,26 +24,7 @@ phpPgAdmin Installation Guide
If you mess up the configuration file, you can recover it from the
config.inc.php-dist file.
3. If you run your PHP installation in safe mode, in order that the database
dump feature can work correctly, you need to set the 'safe_mode_allowed_env_vars'
php.ini variable to include the PGPASSWORD and PGUSER environmental variables
and the safe_mode_exec_dir to include /usr/bin (or wherever the pg_dump
binaries are found).
eg. safe_mode_allowed_env_vars = PHP_,PG
safe_mode_exec_dir = /usr/bin
Given that you usually don't want to allow everything in /usr/bin to
be executed, you might want to copy the pg_dump and pg_dumpall utilities
to a directory by themselves.
Also, you will need to ensure that your 'pg_dump' and 'pg_dumpall' utilities
are executable by the PHP process, if you want dump support in phpPgAdmin.
Lastly, if you run phpPgAdmin in safe mode, very long running imports,
exports and transactions may time out and be aborted.
4. Ensure the statistics collector is enabled in PostgreSQL. phpPgAdmin will
3. Ensure the statistics collector is enabled in PostgreSQL. phpPgAdmin will
display table, index performance, and usage statistics if you have enabled
the PostgreSQL statistics collector. While this is normally enabled by
default, to ensure it is running, make sure the following lines in your
@ -52,10 +33,10 @@ phpPgAdmin Installation Guide
track_activities
track_counts
5. Browse to the phpPgAdmin installation using a web browser. You might
4. Browse to the phpPgAdmin installation using a web browser. You might
need cookies enabled for phpPgAdmin to work.
6. IMPORTANT - SECURITY
5. IMPORTANT - SECURITY
PostgreSQL by default does not require you to use a password to log in.
We STRONGLY recommend that you enable md5 passwords for local connections

View File

@ -1,4 +1,4 @@
Copyright (c) 2002, 2003, 2004, 2005 The phpPgAdmin Project
Copyright (c) 2002 - 2019 The phpPgAdmin Project
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -120,7 +120,7 @@ Indexes
Types
-----
* Suppres psuedo-type options in type list for creating composite types. (done ?)
* Suppress pseudo-type options in type list for creating composite types. (done ?)
Operators
@ -190,7 +190,7 @@ Full Text Search (8.3)
Miscellaneous
-------------
* Audit for PHP 5.3.x compatability
* Audit for PHP 5.3.x compatibility
* Support 8.1 standard compliant strings (E'')
* Support per-database connection limits per 8.1
* Put a 'What's blocking this query' on Processes view

View File

@ -22,10 +22,10 @@ To Create a new translation:
3. Update the comment at the top of the file. Put yourself as the language
maintainer. Edit the 'applang' variable and put your language's name in it,
in your language.
Edit the 'applocale' and put your language code according to the standart:
Edit the 'applocale' and put your language code according to the standard:
http://www.ietf.org/rfc/rfc1766.txt
Basicaly, you just need to put your language code [1] and optionnaly country
Basically, you just need to put your language code [1] and optionally country
code [2] separated by a '-'. As instance for french canadian, it is: fr-CA
[1]: http://www.w3.org/WAI/ER/IG/ert/iso639.htm
[2]: http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm

View File

@ -185,7 +185,7 @@
while (!$templatedbs->EOF) {
$dbname = htmlspecialchars($templatedbs->fields['datname']);
if ($dbname != 'template1') {
// filter out for $conf[show_system] users so we dont get duplicates
// filter out for $conf[show_system] users so we don't get duplicates
echo "\t\t\t\t<option value=\"{$dbname}\"",
($dbname == $_POST['formTemplate']) ? ' selected="selected"' : '', ">{$dbname}</option>\n";
}
@ -303,19 +303,21 @@
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strformat']}</th><th class=\"data\">{$lang['stroptions']}</th></tr>\n";
// Data only
echo "<tr><th class=\"data left\" rowspan=\"2\">";
echo "<tr><th class=\"data left\" rowspan=\"". ($data->hasServerOids() ? 2 : 1) ."\">";
echo "<input type=\"radio\" id=\"what1\" name=\"what\" value=\"dataonly\" checked=\"checked\" /><label for=\"what1\">{$lang['strdataonly']}</label></th>\n";
echo "<td>{$lang['strformat']}\n";
echo "<select name=\"d_format\">\n";
echo "<option value=\"copy\">COPY</option>\n";
echo "<option value=\"sql\">SQL</option>\n";
echo "</select>\n</td>\n</tr>\n";
echo "<tr><td><input type=\"checkbox\" id=\"d_oids\" name=\"d_oids\" /><label for=\"d_oids\">{$lang['stroids']}</label></td>\n</tr>\n";
if ($data->hasServerOids()) {
echo "<tr><td><input type=\"checkbox\" id=\"d_oids\" name=\"d_oids\" /><label for=\"d_oids\">{$lang['stroids']}</label></td>\n</tr>\n";
}
// Structure only
echo "<tr><th class=\"data left\"><input type=\"radio\" id=\"what2\" name=\"what\" value=\"structureonly\" /><label for=\"what2\">{$lang['strstructureonly']}</label></th>\n";
echo "<td><input type=\"checkbox\" id=\"s_clean\" name=\"s_clean\" /><label for=\"s_clean\">{$lang['strdrop']}</label></td>\n</tr>\n";
// Structure and data
echo "<tr><th class=\"data left\" rowspan=\"3\">";
echo "<tr><th class=\"data left\" rowspan=\"". ($data->hasServerOids() ? 3 : 2) ."\">";
echo "<input type=\"radio\" id=\"what3\" name=\"what\" value=\"structureanddata\" /><label for=\"what3\">{$lang['strstructureanddata']}</label></th>\n";
echo "<td>{$lang['strformat']}\n";
echo "<select name=\"sd_format\">\n";
@ -323,7 +325,9 @@
echo "<option value=\"sql\">SQL</option>\n";
echo "</select>\n</td>\n</tr>\n";
echo "<tr><td><input type=\"checkbox\" id=\"sd_clean\" name=\"sd_clean\" /><label for=\"sd_clean\">{$lang['strdrop']}</label></td>\n</tr>\n";
echo "<tr><td><input type=\"checkbox\" id=\"sd_oids\" name=\"sd_oids\" /><label for=\"sd_oids\">{$lang['stroids']}</label></td>\n</tr>\n";
if ($data->hasServerOids()) {
echo "<tr><td><input type=\"checkbox\" id=\"sd_oids\" name=\"sd_oids\" /><label for=\"sd_oids\">{$lang['stroids']}</label></td>\n</tr>\n";
}
echo "</table>\n";
echo "<h3>{$lang['stroptions']}</h3>\n";

View File

@ -261,8 +261,8 @@
if (isset($params['clip']) && $params['clip'] === true) {
$maxlen = isset($params['cliplen']) && is_integer($params['cliplen']) ? $params['cliplen'] : $conf['max_chars'];
$ellipsis = isset($params['ellipsis']) ? $params['ellipsis'] : $lang['strellipsis'];
if (strlen($str) > $maxlen) {
$str = substr($str, 0, $maxlen-1) . $ellipsis;
if (mb_strlen($str, 'UTF-8') > $maxlen) {
$str = mb_substr($str, 0, $maxlen-1, 'UTF-8') . $ellipsis;
}
}
@ -545,7 +545,7 @@
echo "<link rel=\"icon\" type=\"image/png\" href=\"images/themes/{$conf['theme']}/Introduction.png\" />\n";
echo "<script type=\"text/javascript\" src=\"libraries/js/jquery.js\"></script>";
echo "<script type=\"text/javascript\">// <!-- \n";
echo "$(document).ready(function() { \n";
echo "$(function() { \n";
echo " if (window.parent.frames.length > 1)\n";
echo " $('#csstheme', window.parent.frames[0].document).attr('href','themes/{$conf['theme']}/global.css');\n";
echo "}); // --></script>\n";
@ -626,7 +626,7 @@
* ...
* ),
* 'content' => The link text
* 'fields' => (optionnal) the data from which content and attr's values are obtained
* 'fields' => (optional) the data from which content and attr's values are obtained
* );
* the special attribute 'href' might be a string or an array. If href is an array it
* will be generated by getActionUrl. See getActionUrl comment for array format.
@ -1023,7 +1023,6 @@
'url' => 'display.php',
'urlvars' => array ('subject' => 'table','table' => field('table')),
'return' => 'table',
'branch'=> true,
),
'select' => array(
'title' => $lang['strselect'],
@ -1129,7 +1128,6 @@
'subject' => 'view',
'view' => field('view')
),
'branch'=> true,
),
'select' => array(
'title' => $lang['strselect'],
@ -1338,7 +1336,7 @@
echo "<div class=\"topbar\"><table style=\"width: 100%\"><tr><td>";
if ($server_info && isset($server_info['platform']) && isset($server_info['username'])) {
/* top left informations when connected */
/* top left information when connected */
echo sprintf($lang['strtopbar'],
'<span class="platform">'.htmlspecialchars($server_info['platform']).'</span>',
'<span class="host">'.htmlspecialchars((empty($server_info['host'])) ? 'localhost':$server_info['host']).'</span>',
@ -1347,7 +1345,7 @@
echo "</td>";
/* top right informations when connected */
/* top right information when connected */
$toplinks = array (
'sql' => array (
@ -1418,17 +1416,17 @@
$history_window_id = htmlentities('history:'.$_REQUEST['server']);
echo "<script type=\"text/javascript\">
$('#toplink_sql').click(function() {
$('#toplink_sql').on('click', function() {
window.open($(this).attr('href'),'{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus();
return false;
});
$('#toplink_history').click(function() {
$('#toplink_history').on('click', function() {
window.open($(this).attr('href'),'{$history_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus();
return false;
});
$('#toplink_find').click(function() {
$('#toplink_find').on('click', function() {
window.open($(this).attr('href'),'{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus();
return false;
});
@ -1436,7 +1434,7 @@
if (isset($_SESSION['sharedUsername'])) {
printf("
$('#toplink_logout').click(function() {
$('#toplink_logout').on('click', function() {
return confirm('%s');
});", str_replace("'", "\'", $lang['strconfdropcred']));
}
@ -1670,7 +1668,7 @@
* @param $navlinks - An array with the the attributes and values that will be shown. See printLinksList for array format.
* @param $place - Place where the $navlinks are displayed. Like 'display-browse', where 'display' is the file (display.php)
* @param $env - Associative array of defined variables in the scope of the caller.
* Allows to give some environnement details to plugins.
* Allows to give some environment details to plugins.
* and 'browse' is the place inside that code (doBrowse).
*/
function printNavLinks($navlinks, $place, $env = array()) {
@ -1790,7 +1788,7 @@
}
/**
* Converts a PHP.INI size variable to bytes. Taken from publically available
* Converts a PHP.INI size variable to bytes. Taken from publicly available
* function by Chris DeRose, here: http://www.php.net/manual/en/configuration.directives.php#ini.file-uploads
* @param $strIniSize The PHP.INI variable
* @return size in bytes, false on failure
@ -1798,7 +1796,7 @@
function inisizeToBytes($strIniSize) {
// This function will take the string value of an ini 'size' parameter,
// and return a double (64-bit float) representing the number of bytes
// that the parameter represents. Or false if $strIniSize is unparseable.
// that the parameter represents. Or false if $strIniSize is unparsable.
$a_IniParts = array();
if (!is_string($strIniSize))
@ -2553,7 +2551,7 @@
/**
* returns an array representing FKs definition for a table, sorted by fields
* or by constraint.
* @param $table The table to retrieve FK contraints from
* @param $table The table to retrieve FK constraints from
* @returns the array of FK definition:
* array(
* 'byconstr' => array(

View File

@ -76,9 +76,11 @@ class Connection {
// Detect version and choose appropriate database driver
switch (substr($version,0,2)) {
case '10': return 'Postgres10';break;
case '14': return 'Postgres';break;
case '13': return 'Postgres13';break;
case '12': return 'Postgres12';break;
case '11': return 'Postgres11';break;
case '12': return 'Postgres';break;
case '10': return 'Postgres10';break;
}
switch (substr($version,0,3)) {

View File

@ -11,7 +11,7 @@ include_once('./classes/database/ADODB_base.php');
class Postgres extends ADODB_base {
var $major_version = 12;
var $major_version = 14;
// Max object name length
var $_maxNameLen = 63;
// Store the current schema
@ -109,7 +109,7 @@ class Postgres extends ADODB_base {
var $privlist = array(
'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
'view' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES'),
'sequence' => array('USAGE', 'SELECT', 'UPDATE', 'ALL PRIVILEGES'),
'database' => array('CREATE', 'TEMPORARY', 'CONNECT', 'ALL PRIVILEGES'),
'function' => array('EXECUTE', 'ALL PRIVILEGES'),
'language' => array('USAGE', 'ALL PRIVILEGES'),
@ -419,7 +419,7 @@ class Postgres extends ADODB_base {
}
function getHelpPages() {
include_once('./help/PostgresDoc95.php');
include_once('./help/PostgresDoc14.php');
return $this->help_page;
}
@ -450,7 +450,7 @@ class Postgres extends ADODB_base {
if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) {
$username = $server_info['username'];
$this->clean($username);
$clause = " AND pr.rolname='{$username}'";
$clause = " AND pg_has_role('{$username}'::name,pr.rolname,'USAGE')";
}
else $clause = '';
@ -519,10 +519,9 @@ class Postgres extends ADODB_base {
* @return default_with_oids setting
*/
function getDefaultWithOid() {
$sql = "SHOW default_with_oids";
return $this->selectField($sql, 'default_with_oids');
// OID support was removed in PG12
// But this function is referenced when browsing data
return false;
}
/**
@ -698,7 +697,7 @@ class Postgres extends ADODB_base {
if (!$conf['show_system']) {
// XXX: The mention of information_schema here is in the wrong place, but
// it's the quickest fix to exclude the info schema from 7.4
$where = " AND pn.nspname NOT LIKE \$_PATERN_\$pg\_%\$_PATERN_\$ AND pn.nspname != 'information_schema'";
$where = " AND pn.nspname NOT LIKE \$_PATTERN_\$pg\_%\$_PATTERN_\$ AND pn.nspname != 'information_schema'";
$lan_where = "AND pl.lanispl";
}
else {
@ -712,7 +711,7 @@ class Postgres extends ADODB_base {
$sql = "SELECT * FROM (";
}
$term = "\$_PATERN_\$%{$term}%\$_PATERN_\$";
$term = "\$_PATTERN_\$%{$term}%\$_PATTERN_\$";
$sql .= "
SELECT 'SCHEMA' AS type, oid, NULL AS schemaname, NULL AS relname, nspname AS name
@ -831,7 +830,7 @@ class Postgres extends ADODB_base {
return $this->selectSet($sql);
}
// Schema functons
// Schema functions
/**
* Return all schemas in the current database.
@ -1039,19 +1038,9 @@ class Postgres extends ADODB_base {
* @return null error
**/
function hasObjectID($table) {
$c_schema = $this->_schema;
$this->clean($c_schema);
$this->clean($table);
$sql = "SELECT relhasoids FROM pg_catalog.pg_class WHERE relname='{$table}'
AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname='{$c_schema}')";
$rs = $this->selectSet($sql);
if ($rs->recordCount() != 1) return null;
else {
$rs->fields['relhasoids'] = $this->phpBool($rs->fields['relhasoids']);
return $rs->fields['relhasoids'];
}
// OID support is gone since PG12
// But that function is required by table exports
return false;
}
/**
@ -1732,12 +1721,12 @@ class Postgres extends ADODB_base {
/**
* Creates a new table in the database copying attribs and other properties from another table
* @param $name The name of the table
* @param $like an array giving the schema ans the name of the table from which attribs are copying from:
* @param $like an array giving the schema and the name of the table from which attribs are copying from:
* array(
* 'table' => table name,
* 'schema' => the schema name,
* )
* @param $defaults if true, copy the defaults values as well
* @param $defaults if true, copy the default values as well
* @param $constraints if true, copy the constraints as well (CHECK on table & attr)
* @param $tablespace The tablespace name ('' means none/default)
*/
@ -2366,7 +2355,7 @@ class Postgres extends ADODB_base {
/**
* Returns all available autovacuum per table information.
* @param $table if given, return autovacuum info for the given table or return all informations for all table
* @param $table if given, return autovacuum info for the given table or return all information for all tables
*
* @return A recordset
*/
@ -2402,7 +2391,7 @@ class Postgres extends ADODB_base {
/* tmp var to parse the results */
$_autovacs = $this->selectSet($sql);
/* result aray to return as RS */
/* result array to return as RS */
$autovacs = array();
while (!$_autovacs->EOF) {
$_ = array(
@ -2928,7 +2917,7 @@ class Postgres extends ADODB_base {
* @param $restartvalue The sequence current value
* @param $cachevalue The sequence cache value
* @param $cycledvalue Sequence can cycle ?
* @param $startvalue The sequence start value when issueing a restart
* @param $startvalue The sequence start value when issuing a restart
* @return 0 success
*/
function alterSequenceProps($seqrs, $increment, $minvalue, $maxvalue,
@ -2967,7 +2956,7 @@ class Postgres extends ADODB_base {
* @param $restartvalue The starting value
* @param $cachevalue The cache value
* @param $cycledvalue True if cycled, false otherwise
* @param $startvalue The sequence start value when issueing a restart
* @param $startvalue The sequence start value when issuing a restart
* @return 0 success
* @return -3 rename error
* @return -4 comment error
@ -3033,7 +3022,7 @@ class Postgres extends ADODB_base {
* @param $restartvalue The starting value
* @param $cachevalue The cache value
* @param $cycledvalue True if cycled, false otherwise
* @param $startvalue The sequence start value when issueing a restart
* @param $startvalue The sequence start value when issuing a restart
* @return 0 success
* @return -1 transaction error
* @return -2 get existing sequence error
@ -3126,7 +3115,7 @@ class Postgres extends ADODB_base {
/**
* Updates a view.
* @param $viewname The name fo the view to update
* @param $viewname The name of the view to update
* @param $definition The new definition for the view
* @return 0 success
* @return -1 transaction error
@ -3557,7 +3546,7 @@ class Postgres extends ADODB_base {
// get the max number of col used in a constraint for the table
$sql = "SELECT DISTINCT
max(SUBSTRING(array_dims(c.conkey) FROM \$patern\$^\\[.*:(.*)\\]$\$patern\$)) as nb
max(SUBSTRING(array_dims(c.conkey) FROM \$pattern\$^\\[.*:(.*)\\]$\$pattern\$)) as nb
FROM pg_catalog.pg_constraint AS c
JOIN pg_catalog.pg_class AS r ON (c.conrelid=r.oid)
JOIN pg_catalog.pg_namespace AS ns ON (r.relnamespace=ns.oid)
@ -3746,7 +3735,7 @@ class Postgres extends ADODB_base {
* @param $del_action The action for deletes (eg. RESTRICT)
* @param $match The match type (eg. MATCH FULL)
* @param $deferrable The deferrability (eg. NOT DEFERRABLE)
* @param $intially The initial deferrability (eg. INITIALLY IMMEDIATE)
* @param $initially The initial deferrability (eg. INITIALLY IMMEDIATE)
* @param $name (optional) The name to give the key, otherwise default name is assigned
* @return 0 success
* @return -1 no fields given
@ -7004,7 +6993,7 @@ class Postgres extends ADODB_base {
}
/**
* Helper function that computes encypted PostgreSQL passwords
* Helper function that computes encrypted PostgreSQL passwords
* @param $username The username
* @param $password The password
*/
@ -8082,6 +8071,7 @@ class Postgres extends ADODB_base {
function hasConcurrentIndexBuild() { return true; }
function hasForceReindex() { return false; }
function hasByteaHexDefault() { return true; }
function hasServerOids() { return false; }
}
?>

View File

@ -47,7 +47,7 @@ class Postgres10 extends Postgres11 {
if (!$conf['show_system']) {
// XXX: The mention of information_schema here is in the wrong place, but
// it's the quickest fix to exclude the info schema from 7.4
$where = " AND pn.nspname NOT LIKE \$_PATERN_\$pg\_%\$_PATERN_\$ AND pn.nspname != 'information_schema'";
$where = " AND pn.nspname NOT LIKE \$_PATTERN_\$pg\_%\$_PATTERN_\$ AND pn.nspname != 'information_schema'";
$lan_where = "AND pl.lanispl";
}
else {
@ -61,7 +61,7 @@ class Postgres10 extends Postgres11 {
$sql = "SELECT * FROM (";
}
$term = "\$_PATERN_\$%{$term}%\$_PATERN_\$";
$term = "\$_PATTERN_\$%{$term}%\$_PATTERN_\$";
$sql .= "
SELECT 'SCHEMA' AS type, oid, NULL AS schemaname, NULL AS relname, nspname AS name

View File

@ -0,0 +1,68 @@
<?php
/**
* PostgreSQL 11 support
*
*/
include_once('./classes/database/Postgres.php');
class Postgres11 extends Postgres {
var $major_version = 11;
/**
* Constructor
* @param $conn The database connection
*/
function __construct($conn) {
parent::__construct($conn);
}
/**
* Returns the current default_with_oids setting
* @return default_with_oids setting
*/
function getDefaultWithOid() {
$sql = "SHOW default_with_oids";
return $this->selectField($sql, 'default_with_oids');
}
/**
* Checks to see whether or not a table has a unique id column
* @param $table The table name
* @return True if it has a unique id, false otherwise
* @return null error
**/
function hasObjectID($table) {
$c_schema = $this->_schema;
$this->clean($c_schema);
$this->clean($table);
$sql = "SELECT relhasoids FROM pg_catalog.pg_class WHERE relname='{$table}'
AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname='{$c_schema}')";
$rs = $this->selectSet($sql);
if ($rs->recordCount() != 1) return null;
else {
$rs->fields['relhasoids'] = $this->phpBool($rs->fields['relhasoids']);
return $rs->fields['relhasoids'];
}
}
// Help functions
function getHelpPages() {
include_once('./help/PostgresDoc11.php');
return $this->help_page;
}
// Capabilities
function hasServerOids() { return true; }
}
?>

View File

@ -0,0 +1,33 @@
<?php
/**
* PostgreSQL 12 support
*
*/
include_once('./classes/database/Postgres13.php');
class Postgres12 extends Postgres13 {
var $major_version = 12;
/**
* Constructor
* @param $conn The database connection
*/
function __construct($conn) {
parent::__construct($conn);
}
// Help functions
function getHelpPages() {
include_once('./help/PostgresDoc12.php');
return $this->help_page;
}
// Capabilities
}
?>

View File

@ -1,15 +1,15 @@
<?php
/**
* PostgreSQL 11 support
* PostgreSQL 13 support
*
*/
include_once('./classes/database/Postgres.php');
class Postgres11 extends Postgres {
class Postgres13 extends Postgres {
var $major_version = 11;
var $major_version = 13;
/**
* Constructor
@ -22,9 +22,12 @@ class Postgres11 extends Postgres {
// Help functions
function getHelpPages() {
include_once('./help/PostgresDoc11.php');
include_once('./help/PostgresDoc13.php');
return $this->help_page;
}
// Capabilities
}
?>

View File

@ -240,7 +240,7 @@ class Postgres80 extends Postgres81 {
* @param $restartvalue The starting value
* @param $cachevalue The cache value
* @param $cycledvalue True if cycled, false otherwise
* @param $startvalue The sequence start value when issueing a restart
* @param $startvalue The sequence start value when issuing a restart
* @return 0 success
* @return -3 rename error
* @return -4 comment error

View File

@ -17,7 +17,7 @@ class Postgres83 extends Postgres84 {
var $privlist = array(
'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
'view' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES'),
'sequence' => array('USAGE', 'SELECT', 'UPDATE', 'ALL PRIVILEGES'),
'database' => array('CREATE', 'TEMPORARY', 'CONNECT', 'ALL PRIVILEGES'),
'function' => array('EXECUTE', 'ALL PRIVILEGES'),
'language' => array('USAGE', 'ALL PRIVILEGES'),
@ -56,7 +56,7 @@ class Postgres83 extends Postgres84 {
return $this->help_page;
}
// Databse functions
// Database functions
/**
* Return all database available on the server
@ -278,7 +278,7 @@ class Postgres83 extends Postgres84 {
* @param $restartvalue The sequence current value
* @param $cachevalue The sequence cache value
* @param $cycledvalue Sequence can cycle ?
* @param $startvalue The sequence start value when issueing a restart (ignored)
* @param $startvalue The sequence start value when issuing a restart (ignored)
* @return 0 success
*/
function alterSequenceProps($seqrs, $increment, $minvalue, $maxvalue,

View File

@ -17,7 +17,7 @@ class Postgres84 extends Postgres90 {
var $privlist = array(
'table' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
'view' => array('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'REFERENCES', 'TRIGGER', 'ALL PRIVILEGES'),
'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES'),
'sequence' => array('USAGE', 'SELECT', 'UPDATE', 'ALL PRIVILEGES'),
'database' => array('CREATE', 'TEMPORARY', 'CONNECT', 'ALL PRIVILEGES'),
'function' => array('EXECUTE', 'ALL PRIVILEGES'),
'language' => array('USAGE', 'ALL PRIVILEGES'),
@ -98,7 +98,7 @@ class Postgres84 extends Postgres90 {
if (!$conf['show_system']) {
// XXX: The mention of information_schema here is in the wrong place, but
// it's the quickest fix to exclude the info schema from 7.4
$where = " AND pn.nspname NOT LIKE \$_PATERN_\$pg\_%\$_PATERN_\$ AND pn.nspname != 'information_schema'";
$where = " AND pn.nspname NOT LIKE \$_PATTERN_\$pg\_%\$_PATTERN_\$ AND pn.nspname != 'information_schema'";
$lan_where = "AND pl.lanispl";
}
else {
@ -112,7 +112,7 @@ class Postgres84 extends Postgres90 {
$sql = "SELECT * FROM (";
}
$term = "\$_PATERN_\$%{$term}%\$_PATERN_\$";
$term = "\$_PATTERN_\$%{$term}%\$_PATTERN_\$";
$sql .= "
SELECT 'SCHEMA' AS type, oid, NULL AS schemaname, NULL AS relname, nspname AS name

View File

@ -4,10 +4,11 @@
"type": "Application",
"license": "GPL-2.0+",
"require": {
"php": ">=5.0"
"php": ">=7.1",
"ext-pgsql": "*",
"ext-mbstring": "*"
},
"minimum-stability": "stable",
"autoload": {
}
}

View File

@ -1,5 +1,5 @@
<?php
#error_reporting(-1);
/**
* Central phpPgAdmin configuration. As a user you may modify the
* settings here for your particular configuration.
@ -66,7 +66,7 @@
*/
//$conf['srv_groups'][0]['desc'] = 'group one';
/* Add here servers indexes belonging to the group '0' seperated by comma */
/* Add here servers indexes belonging to the group '0' separated by comma */
//$conf['srv_groups'][0]['servers'] = '0,1,2';
/* A server can belong to multi groups. Here server 1 is referenced in both
@ -146,6 +146,7 @@
$conf['theme'] = 'default';
// Show OIDs when browsing tables?
// Only supported in versions <=11
$conf['show_oids'] = false;
// Max rows to show on a page when browsing record sets

View File

@ -53,7 +53,7 @@
*/
//$conf['srv_groups'][0]['desc'] = 'group one';
/* Add here servers indexes belonging to the group '0' seperated by comma */
/* Add here servers indexes belonging to the group '0' separated by comma */
//$conf['srv_groups'][0]['servers'] = '0,1,2';
/* A server can belong to multi groups. Here server 1 is referenced in both
@ -133,6 +133,7 @@
$conf['theme'] = 'default';
// Show OIDs when browsing tables?
// Only supported in versions <=11
$conf['show_oids'] = false;
// Max rows to show on a page when browsing record sets

View File

@ -55,7 +55,8 @@
if ($attrs->recordCount() > 0) {
while (!$attrs->EOF) {
$selColumns->add(new XHTML_Option($attrs->fields['attname']));
$XHTML_Option = new XHTML_Option($attrs->fields['attname']);
$selColumns->add($XHTML_Option);
$attrs->moveNext();
}
}
@ -158,7 +159,8 @@
if ($attrs->recordCount() > 0) {
while (!$attrs->EOF) {
$selColumns->add(new XHTML_Option($attrs->fields['attname']));
$XHTML_Option = new XHTML_Option($attrs->fields['attname']);
$selColumns->add($XHTML_Option);
$attrs->moveNext();
}
}
@ -251,7 +253,8 @@
if ($attrs->recordCount() > 0) {
while (!$attrs->EOF) {
$selColumns->add(new XHTML_Option($attrs->fields['attname']));
$XHTML_Option = new XHTML_Option($attrs->fields['attname']);
$selColumns->add($XHTML_Option);
$attrs->moveNext();
}
}

View File

@ -313,19 +313,21 @@
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strformat']}</th><th class=\"data\" colspan=\"2\">{$lang['stroptions']}</th></tr>\n";
// Data only
echo "<tr><th class=\"data left\" rowspan=\"2\">";
echo "<tr><th class=\"data left\" rowspan=\"". ($data->hasServerOids() ? 2 : 1) ."\">";
echo "<input type=\"radio\" id=\"what1\" name=\"what\" value=\"dataonly\" checked=\"checked\" /><label for=\"what1\">{$lang['strdataonly']}</label></th>\n";
echo "<td>{$lang['strformat']}</td>\n";
echo "<td><select name=\"d_format\">\n";
echo "<option value=\"copy\">COPY</option>\n";
echo "<option value=\"sql\">SQL</option>\n";
echo "</select>\n</td>\n</tr>\n";
echo "<tr><td><label for=\"d_oids\">{$lang['stroids']}</label></td><td><input type=\"checkbox\" id=\"d_oids\" name=\"d_oids\" /></td>\n</tr>\n";
if ($data->hasServerOids()) {
echo "<tr><td><label for=\"d_oids\">{$lang['stroids']}</label></td><td><input type=\"checkbox\" id=\"d_oids\" name=\"d_oids\" /></td>\n</tr>\n";
}
// Structure only
echo "<tr><th class=\"data left\"><input type=\"radio\" id=\"what2\" name=\"what\" value=\"structureonly\" /><label for=\"what2\">{$lang['strstructureonly']}</label></th>\n";
echo "<td><label for=\"s_clean\">{$lang['strdrop']}</label></td><td><input type=\"checkbox\" id=\"s_clean\" name=\"s_clean\" /></td>\n</tr>\n";
// Structure and data
echo "<tr><th class=\"data left\" rowspan=\"3\">";
echo "<tr><th class=\"data left\" rowspan=\"". ($data->hasServerOids() ? 3 : 2) ."\">";
echo "<input type=\"radio\" id=\"what3\" name=\"what\" value=\"structureanddata\" /><label for=\"what3\">{$lang['strstructureanddata']}</label></th>\n";
echo "<td>{$lang['strformat']}</td>\n";
echo "<td><select name=\"sd_format\">\n";
@ -333,7 +335,9 @@
echo "<option value=\"sql\">SQL</option>\n";
echo "</select>\n</td>\n</tr>\n";
echo "<tr><td><label for=\"sd_clean\">{$lang['strdrop']}</label></td><td><input type=\"checkbox\" id=\"sd_clean\" name=\"sd_clean\" /></td>\n</tr>\n";
echo "<tr><td><label for=\"sd_oids\">{$lang['stroids']}</label></td><td><input type=\"checkbox\" id=\"sd_oids\" name=\"sd_oids\" /></td>\n</tr>\n";
if ($data->hasServerOids()) {
echo "<tr><td><label for=\"sd_oids\">{$lang['stroids']}</label></td><td><input type=\"checkbox\" id=\"sd_oids\" name=\"sd_oids\" /></td>\n</tr>\n";
}
echo "</table>\n";
echo "<h3>{$lang['stroptions']}</h3>\n";

View File

@ -92,7 +92,7 @@
$f_object = $_REQUEST[$_REQUEST['subject']];
$data->fieldClean($f_object);
// Starting in 8.2, -n and -t are orthagonal, so we now schema qualify
// Starting in 8.2, -n and -t are orthogonal, so we now schema qualify
// the table name in the -t argument and quote both identifiers
if ( ((float) $version[1]) >= 8.2 ) {
$cmd .= " -t " . $misc->escapeShellArg("\"{$f_schema}\".\"{$f_object}\"");

View File

@ -320,7 +320,7 @@
$sortLink = http_build_query($args);
echo "<th class=\"data\"><a href=\"?{$sortLink}\">"
echo "<th class=\"data\"><a href=\"display.php?{$sortLink}\">"
, $misc->printVal($finfo->name);
if($_REQUEST['sortkey'] == ($j + 1)) {
if($_REQUEST['sortdir'] == 'asc')
@ -402,8 +402,8 @@
if (is_object($rs) && $rs->recordCount() > 0) {
/* we are browsing a referenced table here
* we should show OID if show_oids is true
* so we give true to withOid in functions bellow
* as 3rd paramter */
* so we give true to withOid in functions below
* as 3rd parameter */
echo "<table><tr>";
printTableHeaderCells($rs, false, true);
@ -529,11 +529,11 @@
if (isset($_REQUEST['query'])) {
$query = $_REQUEST['query'];
} else {
$query = "SELECT * FROM {$_REQUEST['schema']}";
$query = "SELECT * FROM ".pg_escape_identifier($_REQUEST['schema']);
if ($_REQUEST['subject'] == 'view') {
$query = "{$query}.{$_REQUEST['view']};";
$query = "{$query}.".pg_escape_identifier($_REQUEST['view']).";";
} else {
$query = "{$query}.{$_REQUEST['table']};";
$query = "{$query}.".pg_escape_identifier($_REQUEST['table']).";";
}
}
//$query = isset($_REQUEST['query'])? $_REQUEST['query'] : "select * from {$_REQUEST['schema']}.{$_REQUEST['table']};";

View File

@ -279,7 +279,7 @@
}
/**
* Display a form to permit editing FTS configuration properies.
* Display a form to permit editing FTS configuration properties.
*/
function doAlterConfig($msg = '') {
global $data, $misc, $lang;
@ -689,7 +689,7 @@
}
/**
* Display a form to permit editing FTS dictionary properies.
* Display a form to permit editing FTS dictionary properties.
*/
function doAlterDict($msg = '') {
global $data, $misc, $lang;

View File

@ -528,7 +528,7 @@
if($types->fields['typname'] == $_POST['formReturns']) {
$szSelected = " selected=\"selected\"";
}
/* this variable is include in the JS code bellow, so we need to ENT_QUOTES */
/* this variable is include in the JS code below, so we need to ENT_QUOTES */
$szTypes .= "<option value=\"". htmlspecialchars($types->fields['typname'], ENT_QUOTES) ."\"{$szSelected}>";
$szTypes .= htmlspecialchars($types->fields['typname'], ENT_QUOTES) ."</option>";
$types->moveNext();

View File

@ -0,0 +1,13 @@
<?php
/**
* Help links for PostgreSQL 9.5 documentation
*
* $Id: PostgresDoc84.php,v 1.3 2008/11/18 21:35:48 ioguix Exp $
*/
include('./help/PostgresDoc12.php');
$this->help_base = sprintf($GLOBALS['conf']['help_base'], '13');
?>

View File

@ -0,0 +1,13 @@
<?php
/**
* Help links for PostgreSQL 9.5 documentation
*
* $Id: PostgresDoc84.php,v 1.3 2008/11/18 21:35:48 ioguix Exp $
*/
include('./help/PostgresDoc13.php');
$this->help_base = sprintf($GLOBALS['conf']['help_base'], 'devel');
?>

Some files were not shown because too many files have changed in this diff Show More