basic diaspora discovery
This commit is contained in:
parent
25b4aacf3b
commit
c0b8e63a3f
7 changed files with 60 additions and 4 deletions
|
@ -198,9 +198,10 @@ function register_post(&$a) {
|
|||
$spkey = openssl_pkey_get_details($sres);
|
||||
$spubkey = $spkey["key"];
|
||||
|
||||
$r = q("INSERT INTO `user` ( `username`, `password`, `email`, `openid`, `nickname`,
|
||||
$r = q("INSERT INTO `user` ( `guid`, `username`, `password`, `email`, `openid`, `nickname`,
|
||||
`pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked` )
|
||||
VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
|
||||
VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
|
||||
dbesc(generate_guid()),
|
||||
dbesc($username),
|
||||
dbesc($new_password_encoded),
|
||||
dbesc($email),
|
||||
|
|
15
mod/xrd.php
15
mod/xrd.php
|
@ -27,6 +27,20 @@ function xrd_content(&$a) {
|
|||
header('Access-Control-Allow-Origin: *');
|
||||
header("Content-type: text/xml");
|
||||
|
||||
$dspr_enabled = get_config('system','diaspora_enabled');
|
||||
|
||||
if($dspr_enabled) {
|
||||
$tpl = file_get_contents('view/xrd_diaspora.tpl');
|
||||
$dspr = replace_macros($tpl,array(
|
||||
'$baseurl' => $a->get_baseurl(),
|
||||
'$dspr_guid' => $r[0]['guid'],
|
||||
'$dspr_key' => base64_encode($r[0]['pubkey'])
|
||||
));
|
||||
}
|
||||
else
|
||||
$dspr = '';
|
||||
|
||||
|
||||
$tpl = file_get_contents('view/xrd_person.tpl');
|
||||
|
||||
$o = replace_macros($tpl, array(
|
||||
|
@ -34,6 +48,7 @@ function xrd_content(&$a) {
|
|||
'$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'],
|
||||
'$atom' => $a->get_baseurl() . '/dfrn_poll/' . $r[0]['nickname'],
|
||||
'$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'] . '.jpg',
|
||||
'$dspr' => $dspr,
|
||||
'$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'],
|
||||
'$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention',
|
||||
'$modexp' => 'data:application/magic-public-key,' . $salmon_key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue