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_,PGPASSWORD,PGUSER
+ 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
* Does an export of a database or a table (via pg_dump)
* to the screen or as a download.
*
- * $Id: dbexport.php,v 1.19 2005/03/04 02:27:38 chriskl Exp $
+ * $Id: dbexport.php,v 1.20 2005/04/12 01:52:16 chriskl Exp $
*/
// Prevent timeouts on large exports (non-safe mode only)
break;
}
- // Set environmental variable for user and password that pg_dump uses
+ // Set environmental variables that pg_dump uses
putenv('PGPASSWORD=' . $_SESSION['webdbPassword']);
putenv('PGUSER=' . $_SESSION['webdbUsername']);
-
- // Prepare command line arguments
$hostname = $conf['servers'][$_SESSION['webdbServerID']]['host'];
+ if ($hostname !== null && $hostname != '') {
+ putenv('PGHOST=' . $hostname);
+ }
$port = $conf['servers'][$_SESSION['webdbServerID']]['port'];
-
+ if ($port !== null && $port != '') {
+ putenv('PGPORT=' . $port);
+ }
+ if ($_REQUEST['mode'] == 'database') {
+ putenv('PGDATABASE=' . $_REQUEST['database']);
+ }
+
// Check if we're doing a cluster-wide dump or just a per-database dump
if ($_REQUEST['mode'] == 'database') {
// Get path of the pg_dump executable.
// Build command for executing pg_dump. '-i' means ignore version differences.
$cmd = $exe . " -i";
- if ($hostname !== null && $hostname != '') {
- $cmd .= " -h " . $misc->escapeShellArg($hostname);
- }
- if ($port !== null && $port != '') {
- $cmd .= " -p " . $misc->escapeShellArg($port);
- }
-
// Check for a table specified
if (isset($_REQUEST['table']) && $_REQUEST['mode'] == 'database') {
break;
}
- if ($_REQUEST['mode'] == 'database') {
- $cmd .= " " . $misc->escapeShellArg($_REQUEST['database']);
- }
-
// Execute command and return the output to the screen
passthru($cmd);
}
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.171 2005/04/11 15:15:45 chriskl Exp $
+ * $Id: english.php,v 1.172 2005/04/12 01:52:17 chriskl Exp $
*/
// Language and character set
$lang['strnouploads'] = 'File uploads are disabled.';
$lang['strimporterror'] = 'Import error.';
$lang['strimporterrorline'] = 'Import error on line %s.';
- $lang['strcannotdumponwindows'] = 'Dumping of complex database names on Windows is not supported. Please see the FAQ.';
+ $lang['strcannotdumponwindows'] = 'Dumping of complex table and schema names on Windows is not supported. Please see the FAQ.';
// Tables
$lang['strtable'] = 'Table';
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.123 2005/04/11 15:15:47 chriskl Exp $
+ * $Id: english.php,v 1.124 2005/04/12 01:52:17 chriskl Exp $
*/
// Language and character set
$lang['strnouploads'] = 'File uploads are disabled.';
$lang['strimporterror'] = 'Import error.';
$lang['strimporterrorline'] = 'Import error on line %s.';
- $lang['strcannotdumponwindows'] = 'Dumping of complex database, schema or table names on Windows is not supported. Please see the FAQ.';
+ $lang['strcannotdumponwindows'] = 'Dumping of complex table and schema names on Windows is not supported. Please see the FAQ.';
// Tables
$lang['strtable'] = 'Table';
$lang['strinsertrow'] = 'Insert row';
$lang['strrowinserted'] = 'Row inserted.';
$lang['strrowinsertedbad'] = 'Row insert failed.';
+ $lang['strrowduplicate'] = 'Row insert failed, attempted to do duplicate insert.';
$lang['streditrow'] = 'Edit row';
$lang['strrowupdated'] = 'Row updated.';
$lang['strrowupdatedbad'] = 'Row update failed.';