Sorry: Backup is currently not supported for your DBMS ('.$CONF['database_type'].').
'); $smarty->assign ('smarty_template', 'message'); $smarty->display ('index.tpl'); die; } if (safeget('download') == "") { flash_error('Warning: The backup module of PostfixAdmin is poorly maintained and might contain bugs.
Please use mysqldump to get a reliable backup of your database.
If you still trust this backup module, you can download the database dump now
'); $smarty->assign ('smarty_template', 'message'); $smarty->display ('index.tpl'); die; } # Still here? Then let's create the database dump... /* SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,adsrc AS def FROM pg_attribute,pg_class,pg_type,pg_attrdef WHERE pg_class.oid=attrelid AND pg_type.oid=atttypid AND attnum>0 AND pg_class.oid=adrelid AND adnum=attnum AND atthasdef='t' AND lower(relname)='admin' UNION SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,'' AS def FROM pg_attribute,pg_class,pg_type WHERE pg_class.oid=attrelid AND pg_type.oid=atttypid AND attnum>0 AND atthasdef='f' AND lower(relname)='admin' $db = $_GET['db']; $cmd = "pg_dump -c -D -f /tix/miner/miner.sql -F p -N -U postgres $db"; $res = `$cmd`; // Alternate: $res = shell_exec($cmd); echo $res; */ if ($_SERVER['REQUEST_METHOD'] == "GET") { umask (077); $path = (ini_get('upload_tmp_dir') != '') ? ini_get('upload_tmp_dir') : '/tmp'; date_default_timezone_set(@date_default_timezone_get()); # Suppress date.timezone warnings $filename = "postfixadmin-" . date ("Ymd") . "-" . getmypid() . ".sql"; $backup = $path . DIRECTORY_SEPARATOR . $filename; $header = "#\n# Postfix Admin $version\n# Date: " . date ("D M j G:i:s T Y") . "\n#\n"; if (!$fh = fopen ($backup, 'w')) { flash_error("