aboutsummaryrefslogtreecommitdiffstats
path: root/mod/uexport.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-12-15 14:37:57 -0800
committerfriendica <info@friendica.com>2014-12-15 14:37:57 -0800
commit2e990743e757bea6712a3f3e9639a43c89b52901 (patch)
treecfc7da5c92a471de875bdd15dc491635fb987ee8 /mod/uexport.php
parentf28103d595c0e02dfd30d44b3115915994e9ecc0 (diff)
parent3b343f8f6c7936aba93ed4a0b09a19086f18ae0d (diff)
downloadvolse-hubzilla-2e990743e757bea6712a3f3e9639a43c89b52901.tar.gz
volse-hubzilla-2e990743e757bea6712a3f3e9639a43c89b52901.tar.bz2
volse-hubzilla-2e990743e757bea6712a3f3e9639a43c89b52901.zip
Merge https://github.com/friendica/red into pending_merge
Diffstat (limited to 'mod/uexport.php')
-rw-r--r--mod/uexport.php39
1 files changed, 27 insertions, 12 deletions
diff --git a/mod/uexport.php b/mod/uexport.php
index 6304115c8..4c1f6bee2 100644
--- a/mod/uexport.php
+++ b/mod/uexport.php
@@ -4,22 +4,37 @@ function uexport_init(&$a) {
if(! local_user())
killme();
- $channel = $a->get_channel();
+ if(argc() > 1) {
+ $channel = $a->get_channel();
- require_once('include/identity.php');
+ require_once('include/identity.php');
- header('content-type: application/octet_stream');
- header('content-disposition: attachment; filename="' . $channel['channel_address'] . '.json"' );
+ header('content-type: application/octet_stream');
+ header('content-disposition: attachment; filename="' . $channel['channel_address'] . '.json"' );
- if(argc() > 1 && argv(1) === 'basic') {
- echo json_encode(identity_basic_export(local_user()));
- killme();
- }
+ if(argc() > 1 && argv(1) === 'basic') {
+ echo json_encode(identity_basic_export(local_user()));
+ killme();
+ }
- if(argc() > 1 && argv(1) === 'complete') {
- echo json_encode(identity_basic_export(local_user(),true));
- killme();
+ // FIXME - this basically doesn't work in the wild with a channel more than a few months old due to memory and execution time limits.
+ // It probably needs to be built at the CLI and offered to download as a tarball. Maybe stored in the members dav.
+
+ if(argc() > 1 && argv(1) === 'complete') {
+ echo json_encode(identity_basic_export(local_user(),true));
+ killme();
+ }
}
+}
-} \ No newline at end of file
+function uexport_content(&$a) {
+ $o = replace_macros(get_markup_template('uexport.tpl'), array(
+ '$title' => t('Export Channel'),
+ '$basictitle' => t('Export Channel'),
+ '$basic' => t('Export your basic channel information to a small file. This acts as a backup of your connections, permissions, profile and basic data, which can be used to import your data to a new hub, but does not contain your content.'),
+ '$fulltitle' => t('Export Content'),
+ '$full' => t('Export your channel information and all the content to a JSON backup. This backs up all of your connections, permissions, profile data and all of your content, but is generally not suitable for importing a channel to a new site as this file may be VERY large. Please be patient - it may take several minutes for this download to begin.')
+ ));
+return $o;
+}