From: Tom Needham Date: Sat, 7 Apr 2012 17:23:25 +0000 (+0000) Subject: rename admin_export -> admin_migrate X-Git-Tag: v4.0.0beta~383 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=00449cdf3781e9cbd1e7ab6e42cbeebf1fdb2f35;p=nextcloud-server.git rename admin_export -> admin_migrate --- diff --git a/apps/admin_export/appinfo/app.php b/apps/admin_export/appinfo/app.php deleted file mode 100644 index 4e896abd6ac..00000000000 --- a/apps/admin_export/appinfo/app.php +++ /dev/null @@ -1,35 +0,0 @@ -. -* -*/ - - -OC_APP::registerAdmin('admin_export','settings'); - -// add settings page to navigation -$entry = array( - 'id' => "admin_export_settings", - 'order'=>1, - 'href' => OC_Helper::linkTo( "admin_export", "settings.php" ), - 'name' => 'Export' -); diff --git a/apps/admin_export/appinfo/info.xml b/apps/admin_export/appinfo/info.xml deleted file mode 100644 index e434705c9a6..00000000000 --- a/apps/admin_export/appinfo/info.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - admin_export - Import/Export - Import/Export your owncloud data - 0.1 - AGPL - Thomas Schmidt and Tom Needham - 2 - - diff --git a/apps/admin_export/settings.php b/apps/admin_export/settings.php deleted file mode 100644 index 719bedb66e8..00000000000 --- a/apps/admin_export/settings.php +++ /dev/null @@ -1,55 +0,0 @@ -. - * - */ -OC_Util::checkAdminUser(); -OC_Util::checkAppEnabled('admin_export'); - -// Export? -if (isset($_POST['admin_export'])) { - // Create the export zip - if( !$path = OC_Migrate::export( null, $_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']) ){ - $from = $_FILES['owncloud_import']['tmp_name']; - - if( !OC_Migrate::import( $from, 'instance' ) ){ - die('failed'); - } - -} else { -// fill template - $tmpl = new OC_Template('admin_export', 'settings'); - return $tmpl->fetchPage(); -} \ No newline at end of file diff --git a/apps/admin_export/templates/settings.php b/apps/admin_export/templates/settings.php deleted file mode 100644 index 36eec84d489..00000000000 --- a/apps/admin_export/templates/settings.php +++ /dev/null @@ -1,24 +0,0 @@ -
-
- t('Export this ownCloud instance');?> -

t('This will create a compressed file that contains the data of this owncloud instance. - Please choose the export type:');?> -

-

What would you like to export?

-

- ownCloud instance ( suitable for import )
- ownCloud system files
- Just user files
- -

-
-
-
- t('Import an ownCloud instance. THIS WILL DELETE ALL CURRENT OWNCLOUD DATA');?> -

t('All current ownCloud data will be replaced by the ownCloud instance that is uploaded.');?> -

-

-

- -
-
diff --git a/apps/admin_migrate/appinfo/app.php b/apps/admin_migrate/appinfo/app.php new file mode 100644 index 00000000000..e45d3f6a529 --- /dev/null +++ b/apps/admin_migrate/appinfo/app.php @@ -0,0 +1,33 @@ +. +* +*/ + + +OC_APP::registerAdmin('admin_migrate','settings'); + +// add settings page to navigation +$entry = array( + 'id' => "admin_migrate_settings", + 'order'=>1, + 'href' => OC_Helper::linkTo( "admin_migrate", "settings.php" ), + 'name' => 'Export' +); diff --git a/apps/admin_migrate/appinfo/info.xml b/apps/admin_migrate/appinfo/info.xml new file mode 100644 index 00000000000..67fc3f9c5a0 --- /dev/null +++ b/apps/admin_migrate/appinfo/info.xml @@ -0,0 +1,11 @@ + + + admin_migrate + ownCloud Instance Migration + Import/Export your owncloud instance + 0.1 + AGPL + Thomas Schmidt and Tom Needham + 2 + + diff --git a/apps/admin_migrate/settings.php b/apps/admin_migrate/settings.php new file mode 100644 index 00000000000..981d5f4ca63 --- /dev/null +++ b/apps/admin_migrate/settings.php @@ -0,0 +1,55 @@ +. + * + */ +OC_Util::checkAdminUser(); +OC_Util::checkAppEnabled('admin_migrate'); + +// Export? +if (isset($_POST['admin_export'])) { + // Create the export zip + if( !$path = OC_Migrate::export( null, $_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']) ){ + $from = $_FILES['owncloud_import']['tmp_name']; + + if( !OC_Migrate::import( $from, 'instance' ) ){ + die('failed'); + } + +} else { +// fill template + $tmpl = new OC_Template('admin_migrate', 'settings'); + return $tmpl->fetchPage(); +} \ No newline at end of file diff --git a/apps/admin_migrate/templates/settings.php b/apps/admin_migrate/templates/settings.php new file mode 100644 index 00000000000..36eec84d489 --- /dev/null +++ b/apps/admin_migrate/templates/settings.php @@ -0,0 +1,24 @@ +
+
+ t('Export this ownCloud instance');?> +

t('This will create a compressed file that contains the data of this owncloud instance. + Please choose the export type:');?> +

+

What would you like to export?

+

+ ownCloud instance ( suitable for import )
+ ownCloud system files
+ Just user files
+ +

+
+
+
+ t('Import an ownCloud instance. THIS WILL DELETE ALL CURRENT OWNCLOUD DATA');?> +

t('All current ownCloud data will be replaced by the ownCloud instance that is uploaded.');?> +

+

+

+ +
+