diff options
author | Paolo Tacconi <p.tacconi@giunti.it> | 2014-10-02 11:31:56 +0200 |
---|---|---|
committer | Paolo Tacconi <p.tacconi@giunti.it> | 2014-10-02 11:31:56 +0200 |
commit | 9cebe8ccf015b5fd7814bbaa56b48ed67926ae5a (patch) | |
tree | 3d97548aeb40d01d88ad2ee5abe76a6c0eb518cf /include/identity.php | |
parent | b39cd90e0786ac1956a52742555cd18011b4390d (diff) | |
parent | cc95f91c54181c92256968506eef15029b6bfbf1 (diff) | |
download | volse-hubzilla-9cebe8ccf015b5fd7814bbaa56b48ed67926ae5a.tar.gz volse-hubzilla-9cebe8ccf015b5fd7814bbaa56b48ed67926ae5a.tar.bz2 volse-hubzilla-9cebe8ccf015b5fd7814bbaa56b48ed67926ae5a.zip |
Merge from master
Diffstat (limited to 'include/identity.php')
-rw-r--r-- | include/identity.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/identity.php b/include/identity.php index bfdd02682..6b1286ff7 100644 --- a/include/identity.php +++ b/include/identity.php @@ -27,10 +27,13 @@ function identity_check_service_class($account_id) { intval(PAGE_REMOVED) ); if(! ($r && count($r))) { + $ret['total_identities'] = 0; $ret['message'] = t('Unable to obtain identity information from database'); return $ret; } + $ret['total_identities'] = intval($r[0]['total']); + if(! service_class_allows($account_id,'total_identities',$r[0]['total'])) { $result['message'] .= upgrade_message(); return $result; @@ -166,10 +169,12 @@ function create_identity($arr) { $ret['message'] = t('No account identifier'); return $ret; } - $ret=identity_check_service_class($arr['account_id']); + $ret = identity_check_service_class($arr['account_id']); if (!$ret['success']) { return $ret; } + // save this for auto_friending + $total_identities = $ret['total_identities']; $nick = mb_strtolower(trim($arr['nickname'])); if(! $nick) { @@ -389,6 +394,20 @@ function create_identity($arr) { } } + // auto-follow any of the hub's pre-configured channel choices. + // Only do this if it's the first channel for this account; + // otherwise it could get annoying. Don't make this list too big + // or it will impact registration time. + + $accts = get_config('system','auto_follow'); + if(($accts) && (! $total_identities)) { + if(! is_array($accts)) + $accts = array($accts); + foreach($accts as $acct) { + if(trim($acct)) + new_contact($newuid,trim($acct),$ret['channel'],false); + } + } call_hooks('register_account', $newuid); |