backup.php:

- replace table_by_pos with table_by_key - script was totally broken
  while table_by_pos was used (only admin table backed up)
- changed Content-Type: header to text/plain - file is still offered
  for download, but can be opened in a text editor easier


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@406 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
Christian Boltz 17 years ago
parent d4bbf8faa1
commit 8f5f9a0df3

@ -88,7 +88,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
{
$result = db_query ("SHOW CREATE TABLE ".table_by_pos($i));
$result = db_query ("SHOW CREATE TABLE " . table_by_key($tables[$i]));
if ($result['rows'] > 0)
{
while ($row = db_array ($result['result']))
@ -100,7 +100,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
{
$result = db_query ("SELECT * FROM ".table_by_pos($i));
$result = db_query ("SELECT * FROM " . table_by_key($tables[$i]));
if ($result['rows'] > 0)
{
while ($row = db_assoc ($result['result']))
@ -118,7 +118,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
}
}
}
header ("Content-Type: application/octet-stream");
header ("Content-Type: text/plain");
header ("Content-Disposition: attachment; filename=\"$filename\"");
header ("Content-Transfer-Encoding: binary");
header ("Content-Length: " . filesize("$backup"));

Loading…
Cancel
Save