Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8a01924
Grammer fixes noticed during spelling fixes review
xzilla Oct 31, 2019
b8140fe
Refreshed French translation
nirgal Oct 20, 2019
412990f
codespell assisted typo cleaning
nirgal Nov 7, 2019
0e007df
Drop PHP safe mode howto
nirgal Nov 6, 2019
fa5119c
privilege - missing USAGE on sequence
soleuu Oct 24, 2019
f40fcaa
Disable OID handling on PG12
nirgal Nov 6, 2019
b7cf1b6
Clean up OID handling changes
xzilla Dec 8, 2019
46944bf
Update HISTORY and Bump version for 7.12.1
xzilla Dec 9, 2019
53f1bb2
Add support for Postgres 13,14dev
xzilla Oct 5, 2020
aecd9a8
Drop obsolete export-ignore
nirgal Dec 15, 2019
f28e894
Upgraded jquery to version 3.4.1
nirgal Oct 20, 2019
bf0572a
Adjustements for jquery update
nirgal Dec 23, 2019
1316faf
sorting goes to table names (through select)
MichaMEG Oct 1, 2015
a818cca
Clean up pass by ref warnings in constraints tab
xzilla Oct 7, 2020
b3b1b68
Remove php5 from tests
Oct 8, 2020
4b91497
Fix links to docs for pgsql 13 & 14
xzilla Oct 8, 2020
076f9f5
Consider group membership when testing owned_only
xzilla Oct 28, 2020
a9289b8
Bump min php ver to 7.2, set app ver to 7.13.0 for release
xzilla Nov 7, 2020
13f3f82
Update credits and history for 7.13.0 release
xzilla Nov 7, 2020
591b1a9
Fix typo
xzilla Nov 9, 2020
e2aa8f6
Fix national-encoding in CREDITS
nirgal Nov 9, 2020
f3171e9
Restore support for PgSQL 9.4 and below
sloanebernstein Feb 16, 2021
669bae7
Update login.php
tachtler Mar 5, 2021
b0a9372
Update lib.inc.php
tachtler Mar 5, 2021
1335573
Update english.php
tachtler Mar 5, 2021
c22a63e
Update german.php
tachtler Mar 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.build_tests.php export-ignore
16 changes: 8 additions & 8 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Translators
- Tadashi Jokagi (Japanese)
- Rafal Slubowski (Polish)
- Alexander Khodorisky (Russian)
- Martin Marqu�s (Spanish)
- Martin Marqués (Spanish)
- Andrej Misovic (Slovak)
- Devrim Gunduz (Turkish)
- Libor Vanek (Czech)
- Marek Cernock� (Czech)
- Marek Černocký (Czech)
- Stefan Malmqvist (Swedish)
- Nicola Soranzo (Italian)
- Petri Jooste (Afrikaans)
- Sulyok P�ter (Hungarian)
- Sulyok Péter (Hungarian)
- Zaki Almuallim (Arabic)
- Erdenemandal Bat-Erdene (Mongolian)
- Alex Rootoff (Ukrainian)
Expand All @@ -40,9 +40,8 @@ Translators
- Bernat Pegueroles (Catalan)
- Fernando Wendt (Brazilan Portuguese)
- Adamantios Diamantidis (Greek)
- Marek �ernock� (Czech)
- Alexey Baturin (Russian UTF8)
- Adri�n Chaves Fern�ndez (Galician)
- Adrián Chaves Fernández (Galician)

Look & Feel

Expand Down Expand Up @@ -79,7 +78,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

Expand All @@ -97,5 +96,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
27 changes: 27 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
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)

Incompatibilities:
* 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
Expand Down
25 changes: 3 additions & 22 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 8 additions & 4 deletions all_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,27 +303,31 @@ function doExport($msg = '') {
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";
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=\"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";
Expand Down
12 changes: 6 additions & 6 deletions classes/Misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ function printHeader($title = '', $script = null, $frameset = false) {
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";
Expand Down Expand Up @@ -1416,25 +1416,25 @@ function printTopbar() {
$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;
});
";

if (isset($_SESSION['sharedUsername'])) {
printf("
$('#toplink_logout').click(function() {
$('#toplink_logout').on('click', function() {
return confirm('%s');
});", str_replace("'", "\'", $lang['strconfdropcred']));
}
Expand Down Expand Up @@ -1796,7 +1796,7 @@ function setWindowName($name, $addServer = true) {
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))
Expand Down
6 changes: 4 additions & 2 deletions classes/database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ function getDriver(&$description) {

// 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)) {
Expand Down
46 changes: 18 additions & 28 deletions classes/database/Postgres.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Postgres extends ADODB_base {

var $major_version = 12;
var $major_version = 14;
// Max object name length
var $_maxNameLen = 63;
// Store the current schema
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -419,7 +419,7 @@ function getHelp($help) {
}

function getHelpPages() {
include_once('./help/PostgresDoc95.php');
include_once('./help/PostgresDoc14.php');
return $this->help_page;
}

Expand Down Expand Up @@ -450,7 +450,7 @@ function getDatabases($currentdatabase = NULL) {
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 = '';

Expand Down Expand Up @@ -519,10 +519,9 @@ function getDatabaseEncoding() {
* @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;
}

/**
Expand Down Expand Up @@ -698,7 +697,7 @@ function findObject($term, $filter) {
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 {
Expand All @@ -712,7 +711,7 @@ function findObject($term, $filter) {
$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
Expand Down Expand Up @@ -1039,19 +1038,9 @@ function getSearchPath() {
* @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;
}

/**
Expand Down Expand Up @@ -1737,7 +1726,7 @@ function createTable($name, $fields, $field, $type, $array, $length, $notnull,
* '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)
*/
Expand Down Expand Up @@ -2366,7 +2355,7 @@ function dumpRelation($relation, $oids) {

/**
* Returns all available autovacuum per table information.
* @param $table if given, return autovacuum info for the given table or return all information for all table
* @param $table if given, return autovacuum info for the given table or return all information for all tables
*
* @return A recordset
*/
Expand Down Expand Up @@ -3126,7 +3115,7 @@ function getViews() {

/**
* 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
Expand Down Expand Up @@ -3557,7 +3546,7 @@ function getConstraintsWithFields($table) {

// 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)
Expand Down Expand Up @@ -7004,7 +6993,7 @@ function setPrivileges($mode, $type, $object, $public, $usernames, $groupnames,
}

/**
* Helper function that computes encypted PostgreSQL passwords
* Helper function that computes encrypted PostgreSQL passwords
* @param $username The username
* @param $password The password
*/
Expand Down Expand Up @@ -8082,6 +8071,7 @@ function hasQueryKill() { return true; }
function hasConcurrentIndexBuild() { return true; }
function hasForceReindex() { return false; }
function hasByteaHexDefault() { return true; }
function hasServerOids() { return false; }

}
?>
4 changes: 2 additions & 2 deletions classes/database/Postgres10.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function findObject($term, $filter) {
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 {
Expand All @@ -61,7 +61,7 @@ function findObject($term, $filter) {
$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
Expand Down
Loading