Use env vars where possible to make windows work in more cases
authorchriskl <chriskl>
Tue, 12 Apr 2005 01:52:16 +0000 (01:52 +0000)
committerchriskl <chriskl>
Tue, 12 Apr 2005 01:52:16 +0000 (01:52 +0000)
INSTALL
dbexport.php
lang/english.php
lang/recoded/english.php

diff --git a/INSTALL b/INSTALL
index d2db06e627965ca322bc119a99a822e7a6d3c89b..800708458baad05764d3687251e332c81c29583d 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -24,7 +24,7 @@ phpPgAdmin Installation Guide
    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
index 7483166f14f14c2bb972932a496f37e052a3d06e..b4c9662f132ec6667243e837caf0406090d65c29 100644 (file)
@@ -3,7 +3,7 @@
         * 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);
        }
index 7946eb15a5988a1704306d995ea1d861ad278b4b..bb03a945526258dbad1dcc714bacf1d1b8c18d31 100755 (executable)
@@ -4,7 +4,7 @@
         * 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';
index b038bfac4d1dbad9c2c55ac0b57eac41d869d524..a01a3317fcaaeb983e55801981929dcfc9a5e1bf 100644 (file)
@@ -4,7 +4,7 @@
         * 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.';