mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
MailboxHandler.php:
some bugfixes: - init(): let $domain always base on $this->id (also on $new) - make mergeId dumber (by removing an error check). This can of course result in an invalid mail address, but this is handled more gracefully than an empty $this->id - updateMaxquota(): use Lang::read_f instead of sprintf git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1469 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
parent
b197e148b3
commit
29236ffaa4
@ -51,11 +51,11 @@ class MailboxHandler extends PFAHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
list(/*NULL*/,$domain) = explode('@', $this->id);
|
||||
|
||||
if ($this->new) {
|
||||
$domain = $this->struct['domain']['default'];
|
||||
$currentquota = 0;
|
||||
} else {
|
||||
list(/*NULL*/,$domain) = explode('@', $this->id);
|
||||
$currentquota = $this->return['quotabytes']; # parent::init called ->view()
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ class MailboxHandler extends PFAHandler {
|
||||
# } elseif ($maxquota < 0) {
|
||||
# TODO: show 'disabled' - at the moment, just shows '-1'
|
||||
} else {
|
||||
$this->struct['quota']['desc'] = sprintf(Lang::Read('mb_max'), $maxquota);
|
||||
$this->struct['quota']['desc'] = Lang::read_f('mb_max', $maxquota);
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,9 +166,6 @@ class MailboxHandler extends PFAHandler {
|
||||
*/
|
||||
public function mergeId($values) {
|
||||
if ($this->struct['local_part']['display_in_form'] == 1 && $this->struct['domain']['display_in_form']) { # webform mode - combine to 'address' field
|
||||
if (empty($values['local_part']) || empty($values['domain']) ) { # local_part or domain not set
|
||||
return "";
|
||||
}
|
||||
return $values['local_part'] . '@' . $values['domain'];
|
||||
} else {
|
||||
return $values[$this->id_field];
|
||||
|
Loading…
Reference in New Issue
Block a user