Allow family members to shop for other family members

This commit is contained in:
Michael Erdely 2024-12-17 10:17:53 -05:00
parent b5716bb14c
commit eeae574cb2
Signed by: mike
SSH key fingerprint: SHA256:ukbnfrRMaRYlBZXENtBTyO2jLnql5AA5m+SzZCfYQe0

View file

@ -142,13 +142,15 @@ if (!empty($_GET["action"])) {
}
}
$stmt = $smarty->dbh()->prepare("SELECT * FROM {$opt["table_prefix"]}shoppers WHERE shopper = ? AND mayshopfor = ? AND pending = 0");
$stmt->bindParam(1, $userid, PDO::PARAM_INT);
$stmt->bindParam(2, $shopfor, PDO::PARAM_INT);
$stmt->execute();
if (!($stmt->fetch())) {
echo "Nice try! (You can't shop for someone who hasn't approved it.)";
exit;
if (!$opt["auto_connect_family_members"]) {
$stmt = $smarty->dbh()->prepare("SELECT * FROM {$opt["table_prefix"]}shoppers WHERE shopper = ? AND mayshopfor = ? AND pending = 0");
$stmt->bindParam(1, $userid, PDO::PARAM_INT);
$stmt->bindParam(2, $shopfor, PDO::PARAM_INT);
$stmt->execute();
if (!($stmt->fetch())) {
echo "Nice try! (You can't shop for someone who hasn't approved it.)";
exit;
}
}
if (!empty($_GET["sortdir"])) {