account/profile/contacts export

This commit is contained in:
Friendika 2011-03-22 03:07:46 -07:00
parent cd2a0802e4
commit c4b292a4f1
9 changed files with 69 additions and 6 deletions

View file

@ -5,6 +5,7 @@ function settings_init(&$a) {
if(local_user()) { if(local_user()) {
profile_load($a,$a->user['nickname']); profile_load($a,$a->user['nickname']);
} }
} }
@ -341,9 +342,13 @@ function settings_content(&$a) {
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
$uexport = '<div id="uexport-link"><a href="uexport" >' . t('Export Personal Data') . '</a></div>';
$o .= replace_macros($stpl,array( $o .= replace_macros($stpl,array(
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$oidhtml' => $oidhtml, '$oidhtml' => $oidhtml,
'$uexport' => $uexport,
'$uid' => local_user(), '$uid' => local_user(),
'$username' => $username, '$username' => $username,
'$openid' => $openid, '$openid' => $openid,

48
mod/uexport.php Normal file
View file

@ -0,0 +1,48 @@
<?php
function uexport_init(&$a) {
if(! local_user())
killme();
$user = array();
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
local_user()
);
if(count($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$user[$k] = $v;
}
$contact = array();
$r = q("SELECT * FROM `contact` WHERE `uid` = %d ",
local_user()
);
if(count($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$contact[][$k] = $v;
}
$profile = array();
$r = q("SELECT * FROM `profile` WHERE `uid` = %d ",
local_user()
);
if(count($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$profile[][$k] = $v;
}
$output = array('user' => $user, 'contact' => $contact, 'profile' => $profile);
header("Content-type: text/json");
echo str_replace('\\/','/',json_encode($output));
killme();
}

View file

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Einstellungen</a></div> <div id="plugin-settings-link"><a href="settings/addon">Plugin Einstellungen</a></div>
$uexport
$nickname_block $nickname_block

View file

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div> <div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
$uexport
$nickname_block $nickname_block

View file

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div> <div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
$uexport
$nickname_block $nickname_block

View file

@ -2,6 +2,7 @@
<div id="plugin-settings-link"><a href="settings/addon">Impostazioni Plugin</a></div> <div id="plugin-settings-link"><a href="settings/addon">Impostazioni Plugin</a></div>
$uexport
$nickname_block $nickname_block

View file

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div> <div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
$uexport
$nickname_block $nickname_block

View file

@ -372,6 +372,7 @@ input#dfrn-url {
} }
#settings-nick-wrapper { #settings-nick-wrapper {
margin-top: 20px;
margin-bottom: 30px; margin-bottom: 30px;
} }
@ -2044,8 +2045,8 @@ a.mail-list-link {
} }
#plugin-settings-link, #account-settings-link { #plugin-settings-link, #account-settings-link, #uexport-link {
margin-bottom: 25px; margin-bottom: 10px;
} }
/* end from defautlt */ /* end from defautlt */

View file

@ -505,7 +505,7 @@ input#dfrn-url {
} }
#settings-nick-wrapper { #settings-nick-wrapper {
margin-bottom: 30px; margin-bottom: 15px;
} }
#settings-expire-end { #settings-expire-end {
@ -608,7 +608,7 @@ input#dfrn-url {
} }
#settings-nick { #settings-nick {
margin-bottom: 50px; margin-bottom: 30px;
} }
#cropimage-wrapper, #cropimage-preview-wrapper { #cropimage-wrapper, #cropimage-preview-wrapper {
@ -2079,8 +2079,8 @@ a.mail-list-link {
} }
#plugin-settings-link, #account-settings-link { #plugin-settings-link, #account-settings-link, #uexport-link {
margin-bottom: 25px; margin-bottom: 10px;
} }