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 https://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'); require_once('inc/jquery.php'); javascript(); $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 && ($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)."

"; } $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}

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


". " ". "

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

". "
"; 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.)

"; } /* $form .= "


". " ". "
(Automatische Antworten sind nur befristet erlaubt. Benötigen Sie langfristig funktionierende automatische Antworten, sprechen Sie unsere Administratoren bitte an, dann suchen wir eine Lösung.)

"; */ $subject = filter_input_general($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 = filter_input_general($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', "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_input_general($ar['fromname']); $form .= "

Absender der automatischen Antwort

". "


". " ". "

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

"; $form .= "
"; $form .= '
'; if (! isset($account['forwards'][0])) { $account['forwards'][0] = array('destination' => ''); } while (count($account['forwards']) < 10) { // Dummy-Einträge für Leute ohne JavaScript $account['forwards'][] = array('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)."

"); } ?>