summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-mail/postfixadmin/files/postfixadmin-2.1.0-postgres-3.patch')
-rw-r--r--net-mail/postfixadmin/files/postfixadmin-2.1.0-postgres-3.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/net-mail/postfixadmin/files/postfixadmin-2.1.0-postgres-3.patch b/net-mail/postfixadmin/files/postfixadmin-2.1.0-postgres-3.patch
new file mode 100644
index 0000000..6766cf5
--- /dev/null
+++ b/net-mail/postfixadmin/files/postfixadmin-2.1.0-postgres-3.patch
@@ -0,0 +1,49 @@
+diff -aNru pfa/admin/backup.php postfixAdmin/admin/backup.php
+--- pfa/admin/backup.php 2006-02-08 19:00:47.478454000 +0100
++++ postfixAdmin/admin/backup.php 2006-02-22 15:16:43.677891000 +0100
+@@ -40,41 +40,11 @@
+ }
+ else
+ {
+- fwrite ($fh, $header);
+-
+- $tables = array('admin','alias','domain','domain_admins','log','mailbox','vacation');
+-
+- for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
+- {
+- $result = db_query ("SHOW CREATE TABLE $tables[$i]");
+- if ($result['rows'] > 0)
+- {
+- while ($row = db_array ($result['result']))
+- {
+- fwrite ($fh, "$row[1]\n\n");
+- }
+- }
+- }
+-
+- for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
+- {
+- $result = db_query ("SELECT * FROM $tables[$i]");
+- if ($result['rows'] > 0)
+- {
+- while ($row = db_assoc ($result['result']))
+- {
+- foreach ($row as $key=>$val)
+- {
+- $fields[] = $key;
+- $values[] = $val;
+- }
+-
+- fwrite ($fh, "INSERT INTO ". $tables[$i] . " (". implode (',',$fields) . ") VALUES ('" . implode ('\',\'',$values) . "')\n");
+- $fields = "";
+- $values = "";
+- }
+- }
++ exec('/usr/bin/pg_dump -U postgres postfix', $exec_dump);
++ foreach($exec_dump as $row) {
++ fwrite($fh, $row. "\r\n");
+ }
++ fclose($fh);
+ }
+ header ("Content-Type: application/octet-stream");
+ header ("Content-Disposition: attachment; filename=\"$filename\"");