diff options
author | Mario <mario@mariovavti.com> | 2021-12-17 19:48:09 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-12-17 19:48:09 +0100 |
commit | bfd3da43ac9226e53188a03ff1414a18422e91b4 (patch) | |
tree | b183e7c1c76aa8d39310fd702985bff7945e7053 /include/channel.php | |
parent | 32a9eaf3b6a68626580078a3302f8dd8e85eb165 (diff) | |
download | volse-hubzilla-bfd3da43ac9226e53188a03ff1414a18422e91b4.tar.gz volse-hubzilla-bfd3da43ac9226e53188a03ff1414a18422e91b4.tar.bz2 volse-hubzilla-bfd3da43ac9226e53188a03ff1414a18422e91b4.zip |
access token refactor
Diffstat (limited to 'include/channel.php')
-rw-r--r-- | include/channel.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/channel.php b/include/channel.php index 00d973738..c80a35385 100644 --- a/include/channel.php +++ b/include/channel.php @@ -21,6 +21,7 @@ require_once('include/crypto.php'); require_once('include/menu.php'); require_once('include/perm_upgrade.php'); require_once('include/photo/photo_driver.php'); +require_once('include/security.php'); /** * @brief Called when creating a new channel. @@ -878,6 +879,14 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals } if(in_array('connections',$sections)) { + $r = q("select * from atoken where atoken_uid = %d", + intval($channel_id) + ); + + if ($r) { + $ret['atoken'] = $r; + } + $xchans = array(); $r = q("select * from abook where abook_channel = %d ", intval($channel_id) @@ -1963,11 +1972,24 @@ function zat_init() { ); if($r) { $xchan = atoken_xchan($r[0]); - atoken_create_xchan($xchan); + //atoken_create_xchan($xchan); atoken_login($xchan); } } +function atoken_delete_and_sync($channel_id, $atoken_guid) { + $r = q("select * from atoken where atoken_guid = '%s' and atoken_uid = %d", + dbesc($atoken_guid), + intval($channel_id) + ); + + if ($r) { + $atok = $r[0]; + $atok['deleted'] = true; + atoken_delete($atok['atoken_id']); + Libsync::build_sync_packet($channel_id, ['atoken' => [ $atok ]]); + } +} /** * @brief Used from within PCSS themes to set theme parameters. |