Browse code

Keine Domains => Dann auch keine VMail-Domains

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1542 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on18/12/2009 13:23:33
Showing1 changed files
... ...
@@ -23,7 +23,7 @@ function mailaccounts($uid)
23 23
 
24 24
 function get_mailaccount($id)
25 25
 {
26
-  $uid = (int) $uid;
26
+  $id = (int) $id;
27 27
   $result = db_query("SELECT concat_ws('@',`m`.`local`,if(isnull(`m`.`domain`),'".config('masterdomain')."',`d`.`domainname`)) AS `account`, `m`.`password` AS `cryptpass`,`m`.`maildir` AS `maildir`,aktiv from (`mail`.`mailaccounts` `m` left join `mail`.`v_domains` `d` on((`d`.`id` = `m`.`domain`))) WHERE m.id=$id");
28 28
   DEBUG("Found ".mysql_num_rows($result)." rows!");
29 29
   if (mysql_num_rows($result) != 1)
... ...
@@ -206,7 +206,12 @@ function imap_on_vmail_domain()
206 206
 function user_has_only_vmail_domains()
207 207
 {
208 208
   $uid = (int) $_SESSION['userinfo']['uid'];
209
+  $result = db_query("SELECT id FROM mail.v_vmail_domains WHERE useraccount={$uid}");
210
+  // User hat keine VMail-Domains
211
+  if (mysql_num_rows($result) == 0)
212
+    return false;
209 213
   $result = db_query("SELECT d.id FROM mail.v_domains AS d LEFT JOIN mail.v_vmail_domains AS vd USING (domainname) WHERE vd.id IS NULL AND d.user={$uid}");
214
+  // User hat keine Domains die nicht vmail-Domains sind
210 215
   if (mysql_num_rows($result) == 0)
211 216
     return true;
212 217
   return false;