From 2aef98f71d95ba5c2caae7637002daef0bce6de5 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 19 Sep 2011 01:17:12 -0700 Subject: cripple account when expired --- addon/facebook/facebook.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'addon') diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index fe348f689..3268cb254 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -139,6 +139,12 @@ function fb_get_self($uid) { function fb_get_friends($uid) { + $r = q("SELECT `id` FROM `user` WHERE `uid` = %d AND `account_expired` = 0 LIMIT 1", + intval($uid) + ); + if(! count($r)) + return; + $access_token = get_pconfig($uid,'facebook','access_token'); $no_linking = get_pconfig($uid,'facebook','no_linking'); @@ -808,8 +814,18 @@ function fb_consume_all($uid) { } function fb_consume_stream($uid,$j,$wall = false) { + $a = get_app(); + + $user = q("SELECT `nickname`, `blockwall` FROM `user` WHERE `uid` = %d AND `account_expired` = 0 LIMIT 1", + intval($uid) + ); + if(! count($user)) + return; + + $my_local_url = $a->get_baseurl() . '/profile/' . $user[0]['nickname']; + $no_linking = get_pconfig($uid,'facebook','no_linking'); if($no_linking) return; @@ -818,11 +834,6 @@ function fb_consume_stream($uid,$j,$wall = false) { intval($uid) ); - $user = q("SELECT `nickname`, `blockwall` FROM `user` WHERE `uid` = %d LIMIT 1", - intval($uid) - ); - if(count($user)) - $my_local_url = $a->get_baseurl() . '/profile/' . $user[0]['nickname']; $self_id = get_pconfig($uid,'facebook','self_id'); if(! count($j->data) || (! strlen($self_id))) -- cgit v1.2.3