mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-05 16:29:32 +00:00
[Web] imapsync: change the server of a sync source only with access to all its sync jobs
This commit is contained in:
5 files changed
+45
-1
No files matched your search
@@ -48,6 +48,12 @@ class SourceRepository extends Repository
|
||||
return (bool)$this->query("SELECT 1 FROM `imapsync` WHERE `source_id` = :id LIMIT 1", ['id' => $id])->fetchColumn();
|
||||
}
|
||||
|
||||
/** @return string[] mailboxes whose sync jobs use the source */
|
||||
public function jobMailboxes(int $id): array
|
||||
{
|
||||
return $this->query("SELECT DISTINCT `user2` FROM `imapsync` WHERE `source_id` = :id", ['id' => $id])->fetchAll(PDO::FETCH_COLUMN);
|
||||
}
|
||||
|
||||
public function isSuperAdmin(string $username): bool
|
||||
{
|
||||
return (bool)$this->query("SELECT 1 FROM `admin` WHERE `username` = :username AND `superadmin` = '1'",
|
||||
|
||||
Reference in new issue
Block a user