tbrehm
2008-05-23 b658fe80a25ec780836e36214e21b57cd635eb95
interface/web/mail/mail_user_edit.php
@@ -123,8 +123,10 @@
      global $app, $conf;
      
      // Check if Domain belongs to user
      if(isset($_POST["email_domain"])) {
      $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
      if($domain["domain"] != $_POST["email_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
      }
      
      
      // if its an insert, check that the password is not empty
@@ -166,7 +168,9 @@
      
      // compose the email field
      if(isset($_POST["email_local_part"]) && isset($_POST["email_domain"])) {
      $this->dataRecord["email"] = $_POST["email_local_part"]."@".$_POST["email_domain"];
      // Set the server id of the mailbox = server ID of mail domain.
      $this->dataRecord["server_id"] = $domain["server_id"];
      
@@ -185,6 +189,7 @@
      $this->dataRecord["homedir"] = $mail_config["homedir_path"];
      $this->dataRecord["uid"] = $mail_config["mailuser_uid"];
      $this->dataRecord["gid"] = $mail_config["mailuser_gid"];
      }
      
      parent::onSubmit();
@@ -222,6 +227,7 @@
      global $app, $conf;
      
      // Set the domain owner as mailbox owner
      if(isset($_POST["email_domain"])) {
      $domain = $app->db->queryOneRecord("SELECT sys_groupid, server_id FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
      $app->db->query("UPDATE mail_user SET sys_groupid = ".$domain["sys_groupid"]." WHERE mailuser_id = ".$this->id);
      
@@ -246,6 +252,7 @@
            $app->db->query($sql);
         }
      } // endif spamfilter policy
      }
      
   }