[Web] Allow multiple sync jobs with same username, fixes #464

master
andryyy 2017-07-17 22:36:34 +02:00
parent 84ad579437
commit f4db3a7a00
1 changed files with 3 additions and 3 deletions

View File

@ -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) {