| | |
| | | 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 |
| | |
| | | |
| | | |
| | | // 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"]; |
| | | |
| | |
| | | $this->dataRecord["homedir"] = $mail_config["homedir_path"]; |
| | | $this->dataRecord["uid"] = $mail_config["mailuser_uid"]; |
| | | $this->dataRecord["gid"] = $mail_config["mailuser_gid"]; |
| | | } |
| | | |
| | | |
| | | parent::onSubmit(); |
| | |
| | | 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); |
| | | |
| | |
| | | $app->db->query($sql); |
| | | } |
| | | } // endif spamfilter policy |
| | | } |
| | | |
| | | } |
| | | |