$r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey`
FROM `user` WHERE `openid` = '%s' AND `blocked` = 0
- AND `account_expired` = 0 AND `verified` = 1 LIMIT 1",
+ AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 LIMIT 1",
dbesc($authid)
);