0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

see: https://github.com/postfixadmin/postfixadmin/issues/282 - try and ensure local_part contains an @ on creating a mailbox

This commit is contained in:
David Goodwin 2019-06-08 20:05:33 +01:00
parent 78764578db
commit 3322b43bb6

View File

@ -217,6 +217,7 @@ class MailboxHandler extends PFAHandler {
protected function beforestore() {
if (isset($this->values['quota']) && $this->values['quota'] != -1) {
$multiplier = Config::read_string('quota_multiplier');
if ($multiplier == 0) { // or empty string, or null, or false...
@ -268,6 +269,16 @@ class MailboxHandler extends PFAHandler {
return true;
}
public function set($values) {
// See: https://github.com/postfixadmin/postfixadmin/issues/282 - ensure the 'local_part' does not contain an @ sign.
$ok = true;
if(isset($values['local_part']) && strpos($values['local_part'], '@')) {
$this->errormsg['local_part'] = Config::lang('pCreate_mailbox_local_part_error');
$ok = false;
}
return $ok && parent::set($values);
}
protected function storemore() {
if ($this->new) {
if (!$this->mailbox_post_script()) {