aboutsummaryrefslogtreecommitdiffstats
path: root/mod/uexport.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-16 22:41:39 -0800
committerfriendica <info@friendica.com>2013-01-16 22:41:39 -0800
commit4734e2ea8731ce51e44aac4065430445d3146845 (patch)
treef4a18cbbb07413249b08b8d9db67ff5858edfe67 /mod/uexport.php
parent2ae2bb4191b41effcfa137cc4ef99aa1ded021bd (diff)
downloadvolse-hubzilla-4734e2ea8731ce51e44aac4065430445d3146845.tar.gz
volse-hubzilla-4734e2ea8731ce51e44aac4065430445d3146845.tar.bz2
volse-hubzilla-4734e2ea8731ce51e44aac4065430445d3146845.zip
export should always "save to file" by default
Diffstat (limited to 'mod/uexport.php')
-rw-r--r--mod/uexport.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/mod/uexport.php b/mod/uexport.php
index 3f7b30008..f3a2ce67c 100644
--- a/mod/uexport.php
+++ b/mod/uexport.php
@@ -4,12 +4,22 @@ function uexport_init(&$a) {
if(! local_user())
killme();
+ $channel = $a->get_channel();
+
require_once('include/identity.php');
- if(argc() > 1 && argv(1) === 'basic')
- json_return_and_die(identity_basic_export(local_user()));
+ header('content-type: application/octet_stream');
+ header('content-disposition: attachment; filename="' . $channel['channel_address'] . '.json"' );
+
- if(argc() > 1 && argv(1) === 'complete')
- json_return_and_die('not yet implemented');
+ if(argc() > 1 && argv(1) === 'basic') {
+ echo json_encode(identity_basic_export(local_user()));
+ killme();
+ }
+
+ if(argc() > 1 && argv(1) === 'complete') {
+ echo json_encode('not yet implemented');
+ killme();
+ }
} \ No newline at end of file