. * */ OC_Util::checkAdminUser(); OC_Util::checkAppEnabled('admin_export'); define('DS', '/'); // Export? if (isset($_POST['admin_export'])) { // Create the export zip if( !$path = OC_Migrate::export( $_POST['export_type'] ) ){ // Error die('error'); } else { // Download it header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=" . basename($path)); header("Content-Length: " . filesize($path)); @ob_end_clean(); readfile( $path ); unlink( $path ); } // Import? } else if( isset($_POST['admin_import']) ){ // TODO // OC_Migrate::import( $pathtozipfile ); } else { // fill template $tmpl = new OC_Template('admin_export', 'settings'); return $tmpl->fetchPage(); }