aboutsummaryrefslogtreecommitdiffstats
path: root/include/channel.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2017-01-31 17:36:42 -0500
committerAndrew Manning <tamanning@zoho.com>2017-01-31 17:36:42 -0500
commitd3d540a28b2dd0b4958d129cceeba162c271302b (patch)
tree172400257279ede716ce88983b8bb3b281aa8d84 /include/channel.php
parentfab103524ab2b171d36c6f3830da682b0768627f (diff)
parenta6cbebe03c4c1ca66b4b55c340ebb1d369d93c3a (diff)
downloadvolse-hubzilla-d3d540a28b2dd0b4958d129cceeba162c271302b.tar.gz
volse-hubzilla-d3d540a28b2dd0b4958d129cceeba162c271302b.tar.bz2
volse-hubzilla-d3d540a28b2dd0b4958d129cceeba162c271302b.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include/channel.php')
-rw-r--r--include/channel.php29
1 files changed, 15 insertions, 14 deletions
diff --git a/include/channel.php b/include/channel.php
index d2ef89cc8..10c38a5ac 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -291,20 +291,21 @@ function create_identity($arr) {
// Create a verified hub location pointing to this site.
- $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_primary,
- hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey, hubloc_network )
- values ( '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s' )",
- dbesc($guid),
- dbesc($sig),
- dbesc($hash),
- dbesc(channel_reddress($ret['channel'])),
- intval($primary),
- dbesc(z_root()),
- dbesc(base64url_encode(rsa_sign(z_root(),$ret['channel']['channel_prvkey']))),
- dbesc(App::get_hostname()),
- dbesc(z_root() . '/post'),
- dbesc(get_config('system','pubkey')),
- dbesc('zot')
+ $r = hubloc_store_lowlevel(
+ [
+ 'hubloc_guid' => $guid,
+ 'hubloc_guid_sig' => $sig,
+ 'hubloc_hash' => $hash,
+ 'hubloc_addr' => channel_reddress($ret['channel']),
+ 'hubloc_primary' => $primary,
+ 'hubloc_url' => z_root(),
+ 'hubloc_url_sig' => base64url_encode(rsa_sign(z_root(),$ret['channel']['channel_prvkey'])),
+ 'hubloc_host' => App::get_hostname(),
+ 'hubloc_callback' => z_root() . '/post',
+ 'hubloc_sitekey' => get_config('system','pubkey'),
+ 'hubloc_network' => 'zot',
+ 'hubloc_updated' => datetime_convert()
+ ]
);
if(! $r)
logger('create_identity: Unable to store hub location');