Bernd Wurst commited on 2013-02-25 09:33:28
Zeige 3 geänderte Dateien mit 33 Einfügungen und 19 Löschungen.
| ... | ... |
@@ -147,19 +147,23 @@ $form = ''; |
| 147 | 147 |
if ($accountlogin) {
|
| 148 | 148 |
$form.= "<p class=\"spamfilter_options\">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'])."</p>";
|
| 149 | 149 |
} else {
|
| 150 |
- if ($id != 0 && $is_mailbox) {
|
|
| 150 |
+ if ($id != 0) {
|
|
| 151 | 151 |
$domainlist = get_vmail_domains(); |
| 152 | 152 |
$domain = NULL; |
| 153 | 153 |
foreach ($domainlist as $dom) {
|
| 154 |
- if ($dom->id == $account['domain']) {
|
|
| 155 |
- $domain = $dom->domainname; |
|
| 154 |
+ if ($dom['id'] == $account['domain']) {
|
|
| 155 |
+ $domain = $dom['domainname']; |
|
| 156 | 156 |
} |
| 157 | 157 |
} |
| 158 | 158 |
$form .= " |
| 159 | 159 |
<p><strong style=\"font-size: 1.5em;\">{$account['local']}@{$domain}</strong></p>";
|
| 160 | 160 |
} else {
|
| 161 |
+ $domain = NULL; |
|
| 162 |
+ if (isset($_GET['domain'])) {
|
|
| 163 |
+ $domain = (int) $_GET['domain']; |
|
| 164 |
+ } |
|
| 161 | 165 |
$form .= " |
| 162 |
- <p><strong>E-Mail-Adresse:</strong> <input type=\"text\" name=\"local\" id=\"local\" size=\"10\" value=\"{$account['local']}\" /><strong style=\"font-size: 1.5em;\"> @ </strong>".domainselect($account['domain'])."</p>";
|
|
| 166 |
+ <p><strong>E-Mail-Adresse:</strong> <input type=\"text\" name=\"local\" id=\"local\" size=\"10\" value=\"{$account['local']}\" /><strong style=\"font-size: 1.5em;\"> @ </strong>".domainselect($domain)."</p>";
|
|
| 163 | 167 |
} |
| 164 | 168 |
$password_message = ''; |
| 165 | 169 |
$password_value = ''; |
| ... | ... |
@@ -125,7 +125,7 @@ function get_vmail_domains() |
| 125 | 125 |
if (mysql_num_rows($result) == 0) |
| 126 | 126 |
system_failure('Sie haben keine Domains für virtuelle Mail-Verarbeitung');
|
| 127 | 127 |
$ret = array(); |
| 128 |
- while ($tmp = mysql_fetch_object($result)) |
|
| 128 |
+ while ($tmp = mysql_fetch_assoc($result)) |
|
| 129 | 129 |
array_push($ret, $tmp); |
| 130 | 130 |
return $ret; |
| 131 | 131 |
} |
| ... | ... |
@@ -165,8 +165,8 @@ function domainselect($selected = NULL, $selectattribute = '') |
| 165 | 165 |
$ret = '<select id="domain" name="domain" size="1" '.$selectattribute.' >'; |
| 166 | 166 |
foreach ($domainlist as $dom) |
| 167 | 167 |
{
|
| 168 |
- $s = ($selected == $dom->id) ? ' selected="selected" ': ''; |
|
| 169 |
- $ret .= "<option value=\"{$dom->id}\"{$s}>{$dom->domainname}</option>\n";
|
|
| 168 |
+ $s = ($selected == $dom['id']) ? ' selected="selected" ': ''; |
|
| 169 |
+ $ret .= "<option value=\"{$dom['id']}\"{$s}>{$dom['domainname']}</option>\n";
|
|
| 170 | 170 |
} |
| 171 | 171 |
$ret .= '</select>'; |
| 172 | 172 |
return $ret; |
| ... | ... |
@@ -224,10 +224,10 @@ function save_vmail_account($account) |
| 224 | 224 |
$server = NULL; |
| 225 | 225 |
foreach ($domainlist as $dom) |
| 226 | 226 |
{
|
| 227 |
- if ($dom->id == $account['domain']) |
|
| 227 |
+ if ($dom['id'] == $account['domain']) |
|
| 228 | 228 |
{
|
| 229 |
- $domainname = $dom->domainname; |
|
| 230 |
- $server = $dom->server; |
|
| 229 |
+ $domainname = $dom['domainname']; |
|
| 230 |
+ $server = $dom['server']; |
|
| 231 | 231 |
$valid_domain = true; |
| 232 | 232 |
break; |
| 233 | 233 |
} |
| ... | ... |
@@ -62,14 +62,21 @@ foreach ($all_accounts AS $account) |
| 62 | 62 |
DEBUG($sorted_by_domains); |
| 63 | 63 |
|
| 64 | 64 |
title('E-Mail-Accounts');
|
| 65 |
-if (count($sorted_by_domains) > 0) |
|
| 65 |
+ |
|
| 66 |
+addnew("edit", "Neue E-Mail-Adresse anlegen");
|
|
| 67 |
+ |
|
| 68 |
+if (count($domains) > 0) |
|
| 66 | 69 |
{
|
| 67 | 70 |
output('
|
| 68 |
-<p>Folgende E-Mail-Konten sind eingerichtet:</p> |
|
| 71 |
+<p>Folgende E-Mail-Konten sind aktuell eingerichtet:</p> |
|
| 69 | 72 |
'); |
| 70 |
- foreach ($sorted_by_domains as $accounts_on_domain) |
|
| 73 |
+ foreach ($domains as $dom) |
|
| 71 | 74 |
{
|
| 72 |
- output('<h4>'.$accounts_on_domain[0]['domainname'].' <small>('.other_icon('information.png', 'Zugangsdaten anzeigen').' '.internal_link('logindata', 'Zugangsdaten für E-Mail-Abruf anzeigen', 'server='.get_server_by_id($accounts_on_domain[0]['server']).'&type=vmail').')</small></h4>');
|
|
| 75 |
+ output('
|
|
| 76 |
+ <h4>'.$dom['domainname'].' <small>('.other_icon('information.png', 'Zugangsdaten anzeigen').' '.internal_link('logindata', 'Zugangsdaten für E-Mail-Abruf anzeigen', 'server='.get_server_by_id($dom['server']).'&type=vmail').')</small></h4>
|
|
| 77 |
+ <div style="margin-left: 2em; margin-top: 0.5em; padding: 0.1em 0.5em;">'); |
|
| 78 |
+ if (array_key_exists($dom['id'], $sorted_by_domains)) {
|
|
| 79 |
+ $accounts_on_domain = $sorted_by_domains[$dom['id']]; |
|
| 73 | 80 |
|
| 74 | 81 |
foreach ($accounts_on_domain AS $this_account) |
| 75 | 82 |
{
|
| ... | ... |
@@ -134,18 +141,21 @@ if (count($sorted_by_domains) > 0) |
| 134 | 141 |
$dest .= "<li>{$a}</li>";
|
| 135 | 142 |
$dest .= '</ul>'; |
| 136 | 143 |
} |
| 137 |
- output('
|
|
| 138 |
- <div style="margin-left: 2em; margin-top: 0.5em; padding: 0.1em 0.5em;"><p>'.internal_link('edit', $acc['local'].'@'.$this_account['domainname'], 'id='.$acc['id']).' '.internal_link("save", '<img src="'.$prefix.'images/delete.png" alt="löschen" title="Dieses Konto löschen"/>', "action=delete&id=".$acc['id']).'</p>
|
|
| 139 |
- <p>'.$dest.'</p></div>'); |
|
| 144 |
+ output('<p>'.internal_link('edit', $acc['local'].'@'.$this_account['domainname'], 'id='.$acc['id']).' '.internal_link("save", '<img src="'.$prefix.'images/delete.png" alt="löschen" title="Dieses Konto löschen"/>', "action=delete&id=".$acc['id']).'</p>
|
|
| 145 |
+ <p>'.$dest.'</p>'); |
|
| 146 |
+ } |
|
| 147 |
+ } else {
|
|
| 148 |
+ output('<p><em>Bisher keine E-Mail-Adressen unter dieser Domain.</em></p>');
|
|
| 140 | 149 |
} |
| 150 |
+ addnew("edit", "Neue E-Mail-Adresse anlegen", "domain={$dom['id']}");
|
|
| 151 |
+ output('</div>');
|
|
| 141 | 152 |
} |
| 142 | 153 |
} |
| 143 | 154 |
else |
| 144 | 155 |
{
|
| 145 |
- output('<p><em>Sie haben bisher keine E-Mail-Adressen angelegt</em></p>');
|
|
| 156 |
+ output('<p><em>Es sind bisher keine Ihrer Domains für Mail-Empfang eingerichtet.</em></p>');
|
|
| 146 | 157 |
} |
| 147 | 158 |
|
| 148 |
-addnew("edit", "Neue E-Mail-Adresse anlegen");
|
|
| 149 | 159 |
|
| 150 | 160 |
/* FIXME: Das sollte nur kommen, wenn der IMAP/POP3-Menü-Eintrag nicht da ist */ |
| 151 | 161 |
output('<p style="font-size: 90%;padding-top: 0.5em; border-top: 1px solid black;">Hinweis: '.config('company_name').' bietet für fortgeschrittene Nutzer die manuelle Einrichtung von POP3/IMAP-Accounts.<br/>'.internal_link("imap", "Neuen POP3/IMAP-Account anlegen", "action=create").'</p>');
|
| 152 | 162 |