aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-03-23 18:12:32 -0700
committerfriendica <info@friendica.com>2014-03-23 18:12:32 -0700
commit944d051e459aa86559734ea1794ec6c87129d98d (patch)
tree322e870330d20f9b69f7fbb3c4217eb959fdf1a2 /include
parent02af02118d1b55e9fcd7cd60a23fa5799335d075 (diff)
downloadvolse-hubzilla-944d051e459aa86559734ea1794ec6c87129d98d.tar.gz
volse-hubzilla-944d051e459aa86559734ea1794ec6c87129d98d.tar.bz2
volse-hubzilla-944d051e459aa86559734ea1794ec6c87129d98d.zip
create_sys_channel during setup bypasses our check when creating the first account that there is a site keypair. Esnure that a site keypair is created before any sys channels are created.
Diffstat (limited to 'include')
-rw-r--r--include/identity.php9
-rw-r--r--include/zot.php2
2 files changed, 11 insertions, 0 deletions
diff --git a/include/identity.php b/include/identity.php
index efc0d7d87..78c4a4aed 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -80,6 +80,15 @@ function validate_channelname($name) {
function create_sys_channel() {
if(get_sys_channel())
return;
+
+ // 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_identity(array(
'account_id' => 'xxx', // This will create an identity with an (integer) account_id of 0, but account_id is required
'nickname' => 'sys',
diff --git a/include/zot.php b/include/zot.php
index 35b322b54..3c9731f05 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -943,6 +943,8 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED) {
$ret['hash'] = $xchan_hash;
}
+
+
logger('import_xchan: result: ' . print_r($ret,true), LOGGER_DATA);
return $ret;
}