From: Alexander M. <key...@us...> - 2004-04-23 08:53:44
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2004-04-23 08:53:38 UTC Modified files: dbbackup.php docs/CHANGELOG Log message: Author: Alexander Maassen <out...@ke...> Log message: Fixed bug #918640. (Added password functionality the dirty but working way Since postgres doesn't support passwords in pg_dump it won't work for them they have to manually perform the command on console or learn how to correctly setup host based auth. ---------------------- diff included ---------------------- Index: publicdnsadmin/dbbackup.php diff -u publicdnsadmin/dbbackup.php:1.7 publicdnsadmin/dbbackup.php:1.8 --- publicdnsadmin/dbbackup.php:1.7 Wed Aug 13 05:14:13 2003 +++ publicdnsadmin/dbbackup.php Fri Apr 23 01:53:28 2004 @@ -19,14 +19,27 @@ $filesmall = "lbdns-".$date.".sql.gz"; if (db_type() == "mysql") { - passthru("mysqldump --opt -h".$database_host." -u".$database_user." -r".$filename." ".$database_name); + if ($database_pass == "") { + passthru("mysqldump --opt -h".$database_host." -u".$database_user." -r".$filename." ".$database_name); + } else { + passthru("mysqldump --opt -h".$database_host." -u".$database_user." --password=".$database_pass." -r".$filename." ".$database_name); + } $zipline = "gzip -9 ".$filename.""; shell_exec($zipline); } else { - passthru("pg_dump -v -Z9 -h".$database_host." -U".$database_user." -f".$filename.".gz ".$database_name); + if ($database_pass == "") { + passthru("pg_dump -v -Z9 -h".$database_host." -U".$database_user." -f".$filename.".gz ".$database_name); + } else { + $error = "Sorry, but since you use a password it is not possible to dump the database like this. Please manually run:\n". + "pg_dump -v -Z9 -h".$database_host." -U".$database_user." -f".$filename.".gz ".$database_name." from the shell and enter the password"; + } } - echo "<p>". _BACKUPCREATED ." <a href=\"".$site_address."/data/".$filesmall."\">". _BACKUPDOWNLOAD .".</a></p>\n"; + if ($error) { + echo "<p>". $error ."</p>\n"; + } else { + echo "<p>". _BACKUPCREATED ." <a href=\"".$site_address."/data/".$filesmall."\">". _BACKUPDOWNLOAD .".</a></p>\n"; + } } include("lib/footer.php"); ?> Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.38 publicdnsadmin/docs/CHANGELOG:1.39 --- publicdnsadmin/docs/CHANGELOG:1.38 Fri Apr 23 00:52:38 2004 +++ publicdnsadmin/docs/CHANGELOG Fri Apr 23 01:53:28 2004 @@ -1,7 +1,13 @@ $Id: OUTsider <out...@ke...> - 23/04/2004 - Fixed an issue in language handler, we shall use english by default if no session is set. + + - Fixed bug #918640. (Added password functionality the dirty but working way + Since postgres doesn't support passwords in pg_dump it won't work for them + they have to manually perform the command on console or learn how to + correctly setup host based auth. SiRVulcaN <sir...@si...> - 21/09/2003 - Fixed a issue with 2 lines around the wrong way, caused ip addresses not to display with PTR records. + - Changed version to 1.4-dev. ----------------------- End of diff ----------------------- |