Browse code

do not show manual IMAP account section when mail handling is turned off for some domains

Bernd Wurst authored on10/08/2020 17:42:19
Showing2 changed files
... ...
@@ -28,7 +28,6 @@ $user = $_SESSION['userinfo'];
28 28
 
29 29
 title("E-Mail-Accounts");
30 30
 
31
-
32 31
 if (isset($_GET['action']) && $_GET['action'] == 'save') {
33 32
     if (isset($_GET['id'])) {
34 33
         check_form_token('email_imap_edit');
... ...
@@ -39,7 +39,7 @@ if (! function_exists("user_has_dotcourier_domain")) {
39 39
         }
40 40
         $uid = (int) $_SESSION['userinfo']['uid'];
41 41
         $result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid UNION ".
42
-            "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
42
+            "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.mail != 'none' AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
43 43
         $ret = ($result->rowCount() > 0);
44 44
         if ($ret) {
45 45
             DEBUG("User {$uid} has dotcourier-domains");