aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-08-04 04:40:45 -0700
committerfriendica <info@friendica.com>2014-08-04 04:40:45 -0700
commita0695fa04fdc73a20beb216060573e1204950df6 (patch)
treee388a241efed835ce507259e05632ce95031890d
parent18cb9a1f55c721d51575c821d59536c2f5f2e794 (diff)
downloadvolse-hubzilla-a0695fa04fdc73a20beb216060573e1204950df6.tar.gz
volse-hubzilla-a0695fa04fdc73a20beb216060573e1204950df6.tar.bz2
volse-hubzilla-a0695fa04fdc73a20beb216060573e1204950df6.zip
backend for profile export
-rw-r--r--mod/profiles.php27
-rw-r--r--version.inc2
2 files changed, 28 insertions, 1 deletions
diff --git a/mod/profiles.php b/mod/profiles.php
index 03e6801d2..c063599b4 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -126,6 +126,33 @@ function profiles_init(&$a) {
return; // NOTREACHED
}
+ if((argc() > 2) && (argv(1) === 'export')) {
+
+ $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
+ intval(local_user()),
+ intval(argv(2))
+ );
+ if(! $r1) {
+ notice( t('Profile unavailable to export.') . EOL);
+ $a->error = 404;
+ return;
+ }
+ header('content-type: application/octet_stream');
+ header('content-disposition: attachment; filename="' . $r1[0]['profile_name'] . '.json"' );
+
+ unset($r1[0]['id']);
+ unset($r1[0]['aid']);
+ unset($r1[0]['uid']);
+ unset($r1[0]['is_default']);
+ unset($r1[0]['publish']);
+ unset($r1[0]['profile_name']);
+ unset($r1[0]['profile_guid']);
+ echo json_encode($r1[0]);
+ killme();
+ }
+
+
+
// Run profile_load() here to make sure the theme is set before
// we start loading content
diff --git a/version.inc b/version.inc
index 91ef22530..f736d243e 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-08-03.756
+2014-08-04.757