Hanno Böck This code is published under a 0BSD license. 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'); require_once('inc/javascript.php'); javascript(); $section = 'email_vmail'; require_role([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_output_html($_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"); } } $has_extensions = $account['enableextensions']; $is_autoresponder = is_array($account['autoresponder']) && $account['autoresponder']['valid_from'] != null && ($account['autoresponder']['valid_until'] > date('Y-m-d') || $account['autoresponder']['valid_until'] == null); $is_forward = (count($account['forwards']) > 0); $is_mailbox = ($account['password'] != null || $id == 0); $numforwards = max(count($account['forwards']), 1); $form = ''; if (!$accountlogin) { 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) . "

"; } $form .= '

Passwort für Abruf: {$password_message}

"; $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 .= "


" . " " . "

"; $enddate = $ar['valid_until']; if (!$enddate) { $enddate = date('Y-m-d', time() + 7 * 24 * 60 * 60); } $max_end = date('Y-m-d', time() + 60 * 24 * 60 * 60); if ($ar['valid_from'] > date('Y-m-d')) { $max_end = date_create($ar['valid_from']); $max_end->modify("+60 day"); $max_end = $max_end->format('Y-m-d'); } $form .= "

Deaktivierung

"; $form .= "

" . "
"; if (!$accountlogin && ($id != 0)) { $form .= "(Automatische Antworten sind nur befristet erlaubt. Wenn Sie diese Adresse dauerhaft stilllegen möchten, können Sie dies am Ende dieser Seite tun.)

"; } $subject = filter_output_html($ar['subject']); $ar_subject_default_checked = ($subject == null) ? ' checked="checked"' : ''; $ar_subject_custom_checked = ($subject) ? ' checked="checked"' : ''; $form .= "

Betreffzeile der automatischen Antwort

" . "

" . "
" . " " . "

"; $message = filter_output_html($ar['message']); $form .= "

Inhalt der automatischen Antwort

" . "

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

" . html_select('ar_quote', ["none" => 'nicht in Antwort einschließen', "teaser" => 'anreißen (erste 10 Zeilen)', "inline" => 'zitieren (max. 50 Zeilen)', ], $quote) . "

"; //"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 = filter_output_html($ar['fromname']); $form .= "

Absender der automatischen Antwort

" . "


" . " " . "

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

"; $form .= "
"; $form .= '
'; if (!isset($account['forwards'][0])) { $account['forwards'][0] = ['destination' => '']; } while (count($account['forwards']) < 10) { // Dummy-Einträge für Leute ohne JavaScript $account['forwards'][] = ['destination' => '']; } for ($i = 0 ; $i < max($numforwards, 10) ; $i++) { $num = $i + 1; $form .= "
" . icon_delete("Diese Weiterleitung entfernen") . "

Weiterleiten an

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

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

'; $target = 'vmail'; if ($accountlogin) { $target = '../index/index'; } $form .= '

    ' . internal_link($target, 'Abbrechen') . '

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

" . internal_link('suspend', 'Diese Adresse stilllegen (mit individuellem Fehlertext)', "account=" . $id) . "

"); }