From f4db3a7a00519eeffc91090cf1864dfa85db5ac2 Mon Sep 17 00:00:00 2001 From: andryyy Date: Mon, 17 Jul 2017 22:36:34 +0200 Subject: [PATCH] [Web] Allow multiple sync jobs with same username, fixes #464 --- data/web/inc/functions.mailbox.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index de8bf0ac..c81f3a88 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -135,9 +135,9 @@ function mailbox($_action, $_type, $_data = null) { return false; } try { - $stmt = $pdo->prepare("SELECT `user2`, `user1` FROM `imapsync` - WHERE `user2` = :user2 AND `user1` = :user1"); - $stmt->execute(array(':user1' => $user1, ':user2' => $username)); + $stmt = $pdo->prepare("SELECT '1' FROM `imapsync` + WHERE `user2` = :user2 AND `user1` = :user1 AND `host1` = :host1"); + $stmt->execute(array(':user1' => $user1, ':user2' => $username, ':host1' => $host1)); $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC)); } catch(PDOException $e) {