diff options
author | Mario <mario@mariovavti.com> | 2021-05-26 19:02:13 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-05-26 19:02:13 +0000 |
commit | 1c8000d02679e2465b0e86be673f68375703db4a (patch) | |
tree | ed4db6faf83da410744fa963fd03ef3b81681de9 /include | |
parent | ff34a787c34c757b8959bbe51a485890e2345902 (diff) | |
download | volse-hubzilla-1c8000d02679e2465b0e86be673f68375703db4a.tar.gz volse-hubzilla-1c8000d02679e2465b0e86be673f68375703db4a.tar.bz2 volse-hubzilla-1c8000d02679e2465b0e86be673f68375703db4a.zip |
remove more legacy zot quirks
Diffstat (limited to 'include')
-rw-r--r-- | include/api_auth.php | 11 | ||||
-rw-r--r-- | include/channel.php | 11 | ||||
-rw-r--r-- | include/security.php | 3 |
3 files changed, 9 insertions, 16 deletions
diff --git a/include/api_auth.php b/include/api_auth.php index 9235bd28c..4928e6a85 100644 --- a/include/api_auth.php +++ b/include/api_auth.php @@ -27,7 +27,7 @@ function api_login(&$a){ if ($server->verifyResourceRequest($request)) { $token = $server->getAccessTokenData($request); $uid = $token['user_id']; - $r = q("SELECT * FROM channel WHERE channel_id = %d LIMIT 1", + $r = q("SELECT * FROM channel WHERE channel_id = %d LIMIT 1", intval($uid) ); if (count($r)) { @@ -41,7 +41,7 @@ function api_login(&$a){ $_SESSION['uid'] = $record['channel_id']; $_SESSION['addr'] = $_SERVER['REMOTE_ADDR']; - $x = q("select * from account where account_id = %d LIMIT 1", + $x = q("select * from account where account_id = %d LIMIT 1", intval($record['channel_account_id']) ); if ($x) { @@ -102,9 +102,6 @@ function api_login(&$a){ ); if($r) { $c = channelx_by_hash($r[0]['hubloc_hash']); - if (! $c) { - $c = channelx_by_portid($r[0]['hubloc_hash']); - } if($c) { $a = q("select * from account where account_id = %d limit 1", intval($c['channel_account_id']) @@ -116,7 +113,7 @@ function api_login(&$a){ } } - if($record) { + if($record) { $verified = \Zotlabs\Web\HTTPSig::verify('',$record['channel']['channel_pubkey']); if(! ($verified && $verified['header_signed'] && $verified['header_valid'])) { $record = null; @@ -164,4 +161,4 @@ function retry_basic_auth($method = 'Basic') { header('HTTP/1.0 401 Unauthorized'); echo('This api requires login'); killme(); -}
\ No newline at end of file +} diff --git a/include/channel.php b/include/channel.php index 085aa5ea5..f051ded58 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2794,15 +2794,12 @@ function channel_remove($channel_id, $local = true, $unset_session = false) { logger('deleting hublocs',LOGGER_DEBUG); - $r = q("UPDATE hubloc SET hubloc_deleted = 1 WHERE hubloc_hash = '%s' OR hubloc_hash = '%s'", - dbesc($channel['channel_hash']), - dbesc($channel['channel_portable_id']) - + $r = q("UPDATE hubloc SET hubloc_deleted = 1 WHERE hubloc_hash = '%s'", + dbesc($channel['channel_hash']) ); - $r = q("UPDATE xchan SET xchan_deleted = 1 WHERE xchan_hash = '%s' OR xchan_hash = '%s'", - dbesc($channel['channel_hash']), - dbesc($channel['channel_portable_id']) + $r = q("UPDATE xchan SET xchan_deleted = 1 WHERE xchan_hash = '%s'", + dbesc($channel['channel_hash']) ); Master::Summon(array('Notifier','purge_all',$channel_id)); diff --git a/include/security.php b/include/security.php index f433f8094..b6c0f1511 100644 --- a/include/security.php +++ b/include/security.php @@ -681,12 +681,11 @@ function get_security_ids($channel_id, $ob_hash) { ]; if ($channel_id) { - $ch = q("select channel_hash, channel_portable_id from channel where channel_id = %d", + $ch = q("select channel_hash from channel where channel_id = %d", intval($channel_id) ); if ($ch) { $ret['channel_id'][] = $ch[0]['channel_hash']; - $ret['channel_id'][] = $ch[0]['channel_portable_id']; } } |