VacationHandler: re-enable and fix code in validate_new_id()

Note that vacation.php doesn't use this function yet, so it's not
surprising that users didn't notice the broken code.
pull/157/head
Christian Boltz 8 years ago
parent 4f1dd314e7
commit 91c07c9eae
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C

@ -87,8 +87,19 @@ class VacationHandler extends PFAHandler {
protected function validate_new_id() {
# vacation can only be enabled if a mailbox with this name exists
//$handler = new MailboxHandler();
//return $handler->init(); // was: ...init($address); but $address is not defined.
if ($this->is_admin) {
$handler = new MailboxHandler(0, $this->admin_username);
if ($handler->init($this->id)) {
return true;
}
} else {
if ($this->id == $this->username) {
return true;
}
}
# still here? This means the mailbox doesn't exist or the admin/user doesn't have permissions to view it
$this->errormsg[] = Config::Lang('invalid_parameter');
return false;
}

Loading…
Cancel
Save