Hanno Böck To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/ Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code. */ require_once('inc/debug.php'); require_once('inc/security.php'); require_once('inc/icons.php'); require_once('vmail.php'); $section = 'email_vmail'; require_role(array(ROLE_SYSTEMUSER, ROLE_VMAIL_ACCOUNT)); $account = empty_account(); $id = (isset($_GET['id']) ? (int) $_GET['id'] : 0); if ($id != 0) $account = get_account_details($id); $accountlogin = false; if ($_SESSION['role'] == ROLE_VMAIL_ACCOUNT) { $section = 'email_edit'; $id = get_vmail_id_by_emailaddr($_SESSION['mailaccount']); $account = get_account_details($id, false); $accountlogin = true; $accountname = filter_input_general($_SESSION['mailaccount']); } DEBUG($account); if ($id == 0) { title("E-Mail-Adresse anlegen"); } else { if ($accountlogin) { title("Einstellungen für {$accountname}"); } else { title("E-Mail-Adresse bearbeiten"); } } $is_autoresponder = is_array($account['autoresponder']) && $account['autoresponder']['valid_from'] != NULL; $is_forward = (count($account['forwards']) > 0); $is_mailbox = ($account['password'] != NULL || $id == 0); $numforwards = max(count($account['forwards']), 1); output(" "); $form = ''; if ($accountlogin) { $form.= "

Unerwünschte E-Mails (Spam, Viren) in diesem Postfach ".html_select('spamfilter_action', array("none" => 'nicht filtern', "folder" => 'in Unterordner »Spam« ablegen', "tag" => 'markieren und zustellen', "delete" => 'nicht zustellen (löschen)'), $account['spamfilter'])."

"; } else { if ($id != 0) { $domainlist = get_vmail_domains(); $domain = NULL; foreach ($domainlist as $dom) { if ($dom['id'] == $account['domain']) { $domain = $dom['domainname']; } } $form .= "

{$account['local']}@{$domain}

"; } else { $domain = NULL; if (isset($_GET['domain'])) { $domain = (int) $_GET['domain']; } $form .= "

E-Mail-Adresse:  @ ".domainselect($domain)."

"; } $password_message = ''; $password_value = ''; if ($is_mailbox and ($account['password'] != '')) { $password_message = '
Sie haben bereits ein Passwort gesetzt. Wenn Sie dieses Feld nicht ändern, wird das bisherige Passwort beibehalten.
'; $password_value = '**********'; } $form .= "

Passwort für Abruf: {$password_message}

"; $form.= "

Unerwünschte E-Mails (Spam, Viren) in diesem Postfach ".html_select('spamfilter_action', array("none" => 'nicht filtern', "folder" => 'in Unterordner »Spam« ablegen', "tag" => 'markieren und zustellen', "delete" => 'nicht zustellen (löschen)'), $account['spamfilter'])."

"; $quota = config('vmail_basequota'); if ($is_mailbox and $account['quota']) { $quota = $account['quota']; } $form .= "

Größe des Postfachs: MB
Hinweis: Die Differenz zwischen dem hier gesetzten Wert und dem Sockelbetrag von ".config('vmail_basequota')." MB wird vom Speicherplatz Ihres Benutzer-Kontos abgezogen.

"; $quota_notify = ($account['quota_threshold'] >= 0) ? ' checked="checked" ' : ''; $quota_threshold = ($account['quota_threshold'] >= 0) ? $account['quota_threshold'] : ''; $form .= "

MB Speicherplatz zur Verfügung stehen.

"; $form .= "
"; } $form .= "

"; $form .= "
"; $ar = $account['autoresponder']; if (! $ar) { $ar = empty_autoresponder_config(); } if ($ar['valid_until'] != NULL && $ar['valid_until'] < date('Y-m-d')) { // Daten sind Restbestand von einem früheren Einsatz des Autoresponders $ar['valid_from'] = NULL; $ar['valid_until'] = NULL; } $valid_from_now_checked = ($ar['valid_from'] <= date('Y-m-d H:i:s') || $ar['valid_from'] == NULL) ? ' checked="checked"' : ''; $valid_from_future_checked = ($ar['valid_from'] > date('Y-m-d H:i:s')) ? ' checked="checked"' : ''; $startdate = $ar['valid_from']; if (! $startdate || $startdate <= date('Y-m-d')) { $startdate = date('Y-m-d', time() + 1*24*60*60); } $form .= "


". " ". html_datepicker("ar_valid_from", strtotime($startdate))."

"; $valid_until_infinity_checked = ($ar['valid_until'] == NULL) ? ' checked="checked"' : ''; $valid_until_date_checked = ($ar['valid_until'] != NULL) ? ' checked="checked"' : ''; $enddate = $ar['valid_until']; if (! $enddate) { $enddate = date('Y-m-d', time() + 7*24*60*60); } $form .= "

Deaktivierung

"; $form .= "


". " ". html_datepicker("ar_valid_until", strtotime($enddate))."

"; $subject = $ar['subject']; if ($subject == NULL) $subject = ''; $ar_subject_default_checked = ($subject == NULL) ? ' checked="checked"' : ''; $ar_subject_custom_checked = ($subject) ? ' checked="checked"' : ''; $form .= "

Betreffzeile der automatischen Antwort

". "

". "
". " ". "

"; $message = $ar['message']; $form .= "

Inhalt der automatischen Antwort

". "

"; $quote = $ar['quote']; if (! $quote) $quote = 'none'; $form .= "

". html_select('ar_quote', array("none" => 'nicht in Antwort einschließen', "inline" => 'zitieren (max. 50 Zeilen)', "attach" => 'vollständig als Anhang beifügen'), $quote)."

"; $ar_from_default_checked = ($ar['fromname'] == NULL) ? ' checked="checked"' : ''; $ar_from_custom_checked = ($ar['fromname'] != NULL) ? ' checked="checked"' : ''; $fromname = $ar['fromname']; $form .= "

Absender der automatischen Antwort

". "


". " ". "

"; $form .= '
'; $form .= "

"; $form .= "
"; $form .= '
'; if (! isset($account['forwards'][0])) { $account['forwards'][0] = array('destination' => '', 'spamfilter' => 'none'); } for ($i = 0 ; $i < $numforwards ; $i++) { $num = $i+1; $form .= "
".icon_delete("Diese Weiterleitung entfernen")."

Weiterleiten an

Spam-Mails an diese Adresse ".html_select('spamfilter_action_'.$num, array("none" => 'nicht filtern', "tag" => 'markieren und zustellen', "delete" => 'nicht zustellen'), $account['forwards'][$i]['spamfilter'])."

\n"; } $form .= '
'; $form .= '

'.icon_add().' Weiteren Empfänger hinzufügen

'; $form .= '

    '.internal_link('vmail', 'Abbrechen').'

'; output(html_form('vmail_edit_mailbox', 'save', 'action=edit'.($id != 0 ? '&id='.$id : ''), $form)); ?>