diff options
author | friendica <info@friendica.com> | 2012-10-31 16:55:19 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-10-31 16:55:19 -0700 |
commit | 62a8298b549c8985a7817be046d7e25cbaf17cb5 (patch) | |
tree | 1d2a3de819567e3121f2035a03db47fcc8ed6295 /include/identity.php | |
parent | fb173900a16938c3ab7f066e4909d50b9f764473 (diff) | |
download | volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.tar.gz volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.tar.bz2 volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.zip |
starting on pinging the basic elements of federation and communication
Diffstat (limited to 'include/identity.php')
-rw-r--r-- | include/identity.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/identity.php b/include/identity.php index 7b0b86ee4..e05aaba30 100644 --- a/include/identity.php +++ b/include/identity.php @@ -89,18 +89,27 @@ function create_identity($arr) { set_default_login_identity($arr['account_id'],$ret['channel']['channel_id'],false); + // Ensure that there is a host keypair. + + if((! get_config('system','pubkey')) && (! get_config('system','prvkey'))) { + $hostkey = new_keypair(4096); + set_config('system','pubkey',$hostkey['pubkey']); + set_config('system','prvkey',$hostkey['prvkey']); + } + // Create a verified hub location pointing to this site. $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_flags, - hubloc_url, hubloc_url_sig, hubloc_callback, hubloc_sitekey ) - values ( '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s' )", + hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey ) + values ( '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s' )", dbesc($guid), dbesc($sig), dbesc($hash), intval(($primary) ? HUBLOC_FLAGS_PRIMARY : 0), dbesc(z_root()), dbesc(base64url_encode(rsa_sign(z_root(),$ret['channel']['channel_prvkey']))), + dbesc(get_app()->get_hostname()), dbesc(z_root() . '/post'), dbesc(get_config('system','pubkey')) ); @@ -118,7 +127,7 @@ function create_identity($arr) { dbesc($a->get_baseurl() . "/photo/profile/l/{$newuid}"), dbesc($a->get_baseurl() . "/photo/profile/m/{$newuid}"), dbesc($a->get_baseurl() . "/photo/profile/s/{$newuid}"), - dbesc($ret['channel']['channel_address'] . '@' . $a->get_hostname()), + dbesc($ret['channel']['channel_address'] . '@' . get_app()->get_hostname()), dbesc(z_root() . '/channel/' . $ret['channel']['channel_address']), dbesc($ret['channel']['channel_name']), dbesc('zot'), |