|
|
|
@ -181,6 +181,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$status = rcube_utils::get_input_value('vacation_status', rcube_utils::INPUT_POST);
|
|
|
|
|
$from = rcube_utils::get_input_value('vacation_from', rcube_utils::INPUT_POST);
|
|
|
|
|
$subject = rcube_utils::get_input_value('vacation_subject', rcube_utils::INPUT_POST, true);
|
|
|
|
|
$reason = rcube_utils::get_input_value('vacation_reason', rcube_utils::INPUT_POST, true);
|
|
|
|
|
$addresses = rcube_utils::get_input_value('vacation_addresses', rcube_utils::INPUT_POST, true);
|
|
|
|
@ -198,7 +199,8 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
$interval_type = $interval_type == 'seconds' ? 'seconds' : 'days';
|
|
|
|
|
$vacation_action['type'] = 'vacation';
|
|
|
|
|
$vacation_action['reason'] = $this->strip_value(str_replace("\r\n", "\n", $reason));
|
|
|
|
|
$vacation_action['subject'] = $subject;
|
|
|
|
|
$vacation_action['subject'] = trim($subject);
|
|
|
|
|
$vacation_action['from'] = trim($from);
|
|
|
|
|
$vacation_action['addresses'] = $addresses;
|
|
|
|
|
$vacation_action[$interval_type] = $interval;
|
|
|
|
|
$vacation_tests = (array) $this->vacation['tests'];
|
|
|
|
@ -215,6 +217,10 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($vacation_action['from']) && !rcube_utils::check_email($vacation_action['from'])) {
|
|
|
|
|
$error = 'noemailwarning';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($vacation_action['reason'] == '') {
|
|
|
|
|
$error = 'managesieve.emptyvacationbody';
|
|
|
|
|
}
|
|
|
|
@ -335,6 +341,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
$addresses = !$auto_addr || count($this->vacation) > 1 ? (array) $this->vacation['addresses'] : $this->user_emails();
|
|
|
|
|
|
|
|
|
|
// form elements
|
|
|
|
|
$from = new html_inputfield(array('name' => 'vacation_from', 'id' => 'vacation_from', 'size' => 50));
|
|
|
|
|
$subject = new html_inputfield(array('name' => 'vacation_subject', 'id' => 'vacation_subject', 'size' => 50));
|
|
|
|
|
$reason = new html_textarea(array('name' => 'vacation_reason', 'id' => 'vacation_reason', 'cols' => 60, 'rows' => 8));
|
|
|
|
|
$interval = new html_inputfield(array('name' => 'vacation_interval', 'id' => 'vacation_interval', 'size' => 5));
|
|
|
|
@ -471,6 +478,8 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
// Advanced tab
|
|
|
|
|
$table = new html_table(array('cols' => 2));
|
|
|
|
|
|
|
|
|
|
$table->add('title', html::label('vacation_from', $this->plugin->gettext('vacation.from')));
|
|
|
|
|
$table->add(null, $from->show($this->vacation['from']));
|
|
|
|
|
$table->add('title', html::label('vacation_addresses', $this->plugin->gettext('vacation.addresses')));
|
|
|
|
|
$table->add(null, $addresses . $addresses_link->show($this->plugin->gettext('filladdresses')));
|
|
|
|
|
$table->add('title', html::label('vacation_interval', $this->plugin->gettext('vacation.interval')));
|
|
|
|
@ -753,6 +762,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
'action' => $this->vacation['action'],
|
|
|
|
|
'target' => $this->vacation['target'],
|
|
|
|
|
'addresses' => $this->vacation['addresses'],
|
|
|
|
|
'from' => $this->vacation['from'],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return $vacation;
|
|
|
|
@ -781,7 +791,8 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
$vacation['type'] = 'vacation';
|
|
|
|
|
$vacation['reason'] = $this->strip_value(str_replace("\r\n", "\n", $data['message']));
|
|
|
|
|
$vacation['addresses'] = $data['addresses'];
|
|
|
|
|
$vacation['subject'] = $data['subject'];
|
|
|
|
|
$vacation['subject'] = trim($data['subject']);
|
|
|
|
|
$vacation['from'] = trim($data['from']);
|
|
|
|
|
$vacation_tests = (array) $this->vacation['tests'];
|
|
|
|
|
|
|
|
|
|
foreach ((array) $vacation['addresses'] as $aidx => $address) {
|
|
|
|
@ -796,6 +807,11 @@ class rcube_sieve_vacation extends rcube_sieve_engine
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($vacation['from']) && !rcube_utils::check_email($vacation['from'])) {
|
|
|
|
|
$this->error = "Invalid address in 'from': " . $vacation['from'];
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($vacation['reason'] == '') {
|
|
|
|
|
$this->error = "No vacation message specified";
|
|
|
|
|
return false;
|
|
|
|
|