1
1
Fork 0

more bugs

This commit is contained in:
Mike Macgirvin 2010-07-19 06:58:03 -07:00
commit 6695b4a203
13 changed files with 25 additions and 25 deletions

View file

@ -119,7 +119,7 @@ function contacts_content(&$a) {
$p['id']);
}
}
if($intval($contact_id))
if(intval($contact_id))
q("DELETE FROM `item` WHERE `contact-id` = %d LIMIT 1",
intval($contact_id)
);
@ -184,7 +184,7 @@ function contacts_content(&$a) {
return $o;
}
dbg(2);
if(($a->argc == 2) && ($a->argv[1] == 'all'))
$sql_extra = '';
else
@ -212,7 +212,7 @@ dbg(2);
break;
}
$r = q("SELECT * FROM `contact` WHERE `uid` = %d $sql_extra $sql_extra2 ",
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `pending` = 0 $sql_extra $sql_extra2 ",
intval($_SESSION['uid']));
if(count($r)) {

View file

@ -136,7 +136,7 @@ function dfrn_confirm_post(&$a) {
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
}
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `blocked` = 0 WHERE `id` = %d LIMIT 1",
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
dbesc($photo),
dbesc($thumb),
intval($dfrn_record)
@ -361,7 +361,7 @@ function dfrn_confirm_post(&$a) {
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
}
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `blocked` = 0 WHERE `id` = %d LIMIT 1",
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
dbesc($photo),
dbesc($thumb),
intval($contact_id)

View file

@ -143,7 +143,7 @@ dbg(3);
$datarray = get_atom_elements($item);
$datarray['parent-uri'] = $item['uri']
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $importer['id'];
$r = post_remote($a,$datarray);
@ -176,7 +176,7 @@ function dfrn_notify_content(&$a) {
intval(time() + 60 )
);
$r = q("SELECT * FROM `contact` WHERE `issued-id` = '%s' AND `blocked` = 0 LIMIT 1",
$r = q("SELECT * FROM `contact` WHERE `issued-id` = '%s' AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
dbesc($_GET['dfrn_id']));
if((! count($r)) || (! strlen($r[0]['prvkey'])))
$status = 1;

View file

@ -165,7 +165,7 @@ function dfrn_poll_content(&$a) {
dbesc($last_update)
);
$r = q("SELECT * FROM `contact` WHERE `issued-id` = '%s' AND `blocked` = 0 LIMIT 1",
$r = q("SELECT * FROM `contact` WHERE `issued-id` = '%s' AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
dbesc($_GET['dfrn_id']));
if((! count($r)) || (! strlen($r[0]['prvkey'])))
$status = 1;

View file

@ -5,7 +5,7 @@ function sanitise_acl(&$item) {
}
function item_post(&$a) {
dbg(3);
if((! local_user()) && (! remote_user()))
return;
@ -170,6 +170,6 @@ dbg(3);
array(),$foo));
}
// goaway($a->get_baseurl() . "/" . $_POST['return'] );
goaway($a->get_baseurl() . "/" . $_POST['return'] );
return; // NOTREACHED
}

View file

@ -40,7 +40,7 @@ function network_content(&$a) {
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra ",
intval($_SESSION['uid'])
);
@ -54,7 +54,7 @@ function network_content(&$a) {
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
ORDER BY `parent` DESC, `created` ASC LIMIT %d ,%d ",
intval($_SESSION['uid']),

View file

@ -155,7 +155,7 @@ function profile_content(&$a) {
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `item`.`type` != 'remote' AND `contact`.`blocked` = 0
AND `item`.`type` != 'remote' AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra ",
intval($a->profile['uid'])
@ -171,7 +171,7 @@ function profile_content(&$a) {
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `item`.`type` != 'remote' AND `contact`.`blocked` = 0
AND `item`.`type` != 'remote' AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
intval($a->profile['uid']),

View file

@ -123,9 +123,9 @@ function register_post(&$a) {
intval($newuid));
return;
}
$r = q("INSERT INTO `contact` ( `uid`, `created`, `self`, `name`, `photo`, `thumb`, `blocked`, `url`,
$r = q("INSERT INTO `contact` ( `uid`, `created`, `self`, `name`, `photo`, `thumb`, `blocked`, `pending`, `url`,
`request`, `notify`, `poll`, `confirm` )
VALUES ( %d, '%s', 1, '%s', '%s', '%s', 0, '%s', '%s', '%s', '%s', '%s' ) ",
VALUES ( %d, '%s', 1, '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', '%s' ) ",
intval($newuid),
datetime_convert(),
dbesc($username),