cripple account when expired
This commit is contained in:
parent
672ecc7f7d
commit
2aef98f71d
7 changed files with 28 additions and 15 deletions
|
@ -139,6 +139,12 @@ function fb_get_self($uid) {
|
||||||
|
|
||||||
function fb_get_friends($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');
|
$access_token = get_pconfig($uid,'facebook','access_token');
|
||||||
|
|
||||||
$no_linking = get_pconfig($uid,'facebook','no_linking');
|
$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) {
|
function fb_consume_stream($uid,$j,$wall = false) {
|
||||||
|
|
||||||
$a = get_app();
|
$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');
|
$no_linking = get_pconfig($uid,'facebook','no_linking');
|
||||||
if($no_linking)
|
if($no_linking)
|
||||||
return;
|
return;
|
||||||
|
@ -818,11 +834,6 @@ function fb_consume_stream($uid,$j,$wall = false) {
|
||||||
intval($uid)
|
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');
|
$self_id = get_pconfig($uid,'facebook','self_id');
|
||||||
if(! count($j->data) || (! strlen($self_id)))
|
if(! count($j->data) || (! strlen($self_id)))
|
||||||
|
|
|
@ -8,7 +8,7 @@ require_once('include/contact_selectors.php');
|
||||||
|
|
||||||
function diaspora_dispatch_public($msg) {
|
function diaspora_dispatch_public($msg) {
|
||||||
|
|
||||||
$r = q("SELECT `user`.* FROM `user` WHERE `user`.`uid` IN ( SELECT `contact`.`uid` FROM `contact` WHERE `contact`.`network` = '%s' AND `contact`.`addr` = '%s' ) ",
|
$r = q("SELECT `user`.* FROM `user` WHERE `user`.`uid` IN ( SELECT `contact`.`uid` FROM `contact` WHERE `contact`.`network` = '%s' AND `contact`.`addr` = '%s' ) AND `account_expired` = 0 ",
|
||||||
dbesc(NETWORK_DIASPORA),
|
dbesc(NETWORK_DIASPORA),
|
||||||
dbesc($msg['author'])
|
dbesc($msg['author'])
|
||||||
);
|
);
|
||||||
|
|
|
@ -86,11 +86,12 @@ function poller_run($argv, $argc){
|
||||||
// and which have a polling address and ignore Diaspora since
|
// and which have a polling address and ignore Diaspora since
|
||||||
// we are unable to match those posts with a Diaspora GUID and prevent duplicates.
|
// we are unable to match those posts with a Diaspora GUID and prevent duplicates.
|
||||||
|
|
||||||
$contacts = q("SELECT `id` FROM `contact`
|
$contacts = q("SELECT `contact`.`id` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||||
WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != ''
|
WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != ''
|
||||||
AND `network` != '%s'
|
AND `network` != '%s'
|
||||||
$sql_extra
|
$sql_extra
|
||||||
AND `self` = 0 AND `blocked` = 0 AND `readonly` = 0 ORDER BY RAND()",
|
AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0
|
||||||
|
AND `user`.`account_expired` = 0 ORDER BY RAND()",
|
||||||
intval(CONTACT_IS_SHARING),
|
intval(CONTACT_IS_SHARING),
|
||||||
intval(CONTACT_IS_FRIEND),
|
intval(CONTACT_IS_FRIEND),
|
||||||
dbesc(NETWORK_DIASPORA)
|
dbesc(NETWORK_DIASPORA)
|
||||||
|
|
|
@ -72,7 +72,7 @@ function dfrn_notify_post(&$a) {
|
||||||
FROM `contact`
|
FROM `contact`
|
||||||
LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||||
WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||||
AND `user`.`nickname` = '%s' $sql_extra LIMIT 1",
|
AND `user`.`nickname` = '%s' AND `user`.`account_expired` = 0 $sql_extra LIMIT 1",
|
||||||
dbesc($a->argv[1])
|
dbesc($a->argv[1])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -829,7 +829,8 @@ function dfrn_notify_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
$r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||||
WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `user`.`nickname` = '%s' $sql_extra LIMIT 1",
|
WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `user`.`nickname` = '%s'
|
||||||
|
AND `user`.`account_expired` = 0 $sql_extra LIMIT 1",
|
||||||
dbesc($a->argv[1])
|
dbesc($a->argv[1])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ function pubsub_init(&$a) {
|
||||||
|
|
||||||
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
|
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
|
||||||
|
|
||||||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 LIMIT 1",
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
if(! count($r))
|
if(! count($r))
|
||||||
|
@ -99,7 +99,7 @@ function pubsub_post(&$a) {
|
||||||
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
||||||
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );
|
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );
|
||||||
|
|
||||||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 LIMIT 1",
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
if(! count($r))
|
if(! count($r))
|
||||||
|
|
|
@ -24,7 +24,7 @@ function receive_post(&$a) {
|
||||||
|
|
||||||
$guid = $a->argv[2];
|
$guid = $a->argv[2];
|
||||||
|
|
||||||
$r = q("SELECT * FROM `user` WHERE `guid` = '%s' LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `guid` = '%s' AND `account_expired` = 0 LIMIT 1",
|
||||||
dbesc($guid)
|
dbesc($guid)
|
||||||
);
|
);
|
||||||
if(! count($r))
|
if(! count($r))
|
||||||
|
|
|
@ -25,12 +25,12 @@ function salmon_post(&$a) {
|
||||||
|
|
||||||
$xml = file_get_contents('php://input');
|
$xml = file_get_contents('php://input');
|
||||||
|
|
||||||
logger('mod-salmon: new salmon ' . $xml);
|
logger('mod-salmon: new salmon ' . $xml, LOGGER_DATA);
|
||||||
|
|
||||||
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
||||||
$mentions = (($a->argc > 2 && $a->argv[2] === 'mention') ? true : false);
|
$mentions = (($a->argc > 2 && $a->argv[2] === 'mention') ? true : false);
|
||||||
|
|
||||||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 LIMIT 1",
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
if(! count($r))
|
if(! count($r))
|
||||||
|
|
Loading…
Reference in a new issue